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: <51451f89-9193-2be6-e724-e9ca44a25f52@redhat.com>
Date:   Tue, 6 Aug 2019 19:12:21 +0200
From:   Javier Martinez Canillas <javierm@...hat.com>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     Wolfram Sang <wsa@...-dreams.de>,
        Kieran Bingham <kieran.bingham+renesas@...asonboard.com>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Michal Marek <michal.lkml@...kovi.net>,
        linux-kbuild <linux-kbuild@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        Lee Jones <lee.jones@...aro.org>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH RFC] modpost: Support I2C Aliases from OF tables

Hello Geert,

On 8/6/19 9:22 AM, Geert Uytterhoeven wrote:
> Hi Javier,
> 
> On Tue, Aug 6, 2019 at 12:25 AM Javier Martinez Canillas
> <javierm@...hat.com> wrote:
>> On 7/31/19 9:44 PM, Wolfram Sang wrote:
>>> Hi Javier,
>>>> The other option is to remove i2c_of_match_device() and don't make OF match
>>>> to fallback to i2c_of_match_device_sysfs(). This is what happens in the ACPI
>>>> case, since i2c_device_match() just calls acpi_driver_match_device() directly
>>>> and doesn't have a wrapper function that fallbacks to sysfs matching.
>>>>
>>>> In this case an I2C device ID table would be required if the devices have to
>>>> be instantiated through sysfs. That way the I2C table would be used both for
>>>> auto-loading and also to match the device when it doesn't have an of_node.
>>>
>>> That would probably mean that only a minority of drivers will not add an I2C
>>> device ID table because it is easy to add an you get the sysfs feature?
>>>
>>
>> I believe so yes.
> 
>> As Masahiro-san mentioned, this approach will still require to add a new macro
>> MODULE_DEVICE_TABLE(i2c_of, bar_of_match) so the OF device table is used twice.
>>
>> One to expose the "of:N*T*Cfoo,bar" and another one to expose it as "i2c:bar".
>>
>> I expect that many developers would miss adding this macro for new drivers that
>> are DT-only and so sysfs instantiation would not work there. So whatever is the
>> approach taken we should clearly document all this so drivers authors are aware.
> 
> You could add a new I2C_MODULE_DEVICE_TABLE() that adds both, right?
> Makes it a little bit easier to check/enforce this.
>

Right, we could add a macro for that. Although it should probably be called
I2C_OF_MODULE_DEVICE_TABLE() or something like that since is specific to OF.

> Gr{oetje,eeting}s,
> 
>                         Geert
> 

Best regards,
-- 
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ