lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <525052F5.5080204@pengutronix.de>
Date:	Sat, 05 Oct 2013 19:57:09 +0200
From:	Marc Kleine-Budde <mkl@...gutronix.de>
To:	Fabio Estevam <festevam@...il.com>
CC:	LKML <linux-kernel@...r.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <rob.herring@...xeda.com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"kernel@...gutronix.de" <kernel@...gutronix.de>
Subject: Re: [PATCH|RFC] of: let of_match_device() always return best match

On 10/05/2013 07:46 PM, Fabio Estevam wrote:
> Hi Marc,
> 
> On Thu, Oct 3, 2013 at 3:51 PM, Marc Kleine-Budde <mkl@...gutronix.de> wrote:
> 
>> For example:
>>
>> The imx28.dtsi gives this compatible string for its CAN core:
>>
>>>       compatible = "fsl,imx28-flexcan", "fsl,p1010-flexcan";
>>
>> The flexcan driver defines:
>>
>>> static const struct of_device_id flexcan_of_match[] = {
>>>       { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, },
>>>       { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, },
>>>       { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, },
>>>       { /* sentinel */ },
>>> };
>>
>> The "p1010" was the first Freescale SoC with the flexcan core. But this SoC has
>> a bug, so a workaround has to be enabled in the driver. The mx28 has this bug
>> fixed, so we don't need this quite costly workaround.
> 
> What about defining in imx28.dtsi:
> compatible = "fsl,imx28-flexcan".

It already works with changing only the driver.

> and the in the flexcan driver we could do the same as in the fec_main driver:
> 
> static struct platform_device_id fec_devtype[] = {

For DT based probing I need to modify the struct of_device_id, but I got
the idea :)

>     {
>         /* keep it for coldfire */
>         .name = DRIVER_NAME,
>         .driver_data = 0,
>     }, {
>         .name = "imx25-fec",
>         .driver_data = FEC_QUIRK_USE_GASKET,
>     }, {
>         .name = "imx27-fec",
>         .driver_data = 0,
>     }, {
>         .name = "imx28-fec",
>         .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME,
>     }, {
>         .name = "imx6q-fec",
>         .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
>                 FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
>                 FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR006358,
>     }, {
>         .name = "mvf600-fec",
>         .driver_data = FEC_QUIRK_ENET_MAC,
>     }, {
>         /* sentinel */
>     }
> };
> 
> So that we know which SoC needs to have the workaround applied or not.

I've already created a patch that rearranges the struct of_device_id in
the driver, works for me. I posted it (with another fix) for review on
linux-can[1].

Thanks,
Marc

[1] http://comments.gmane.org/gmane.linux.can/4050
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


Download attachment "signature.asc" of type "application/pgp-signature" (260 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ