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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e806046e-fc53-5a77-46ed-4f668ef2e6e7@pengutronix.de>
Date:   Mon, 18 Jan 2021 14:25:16 +0100
From:   Ahmad Fatoum <a.fatoum@...gutronix.de>
To:     Kamel Bouhara <kamel.bouhara@...tlin.com>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:     kernel@...gutronix.de, ceggers@...i.de,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/2] nvmem: core: skip nodes with compatibles other
 than "nvmem-cell"

Hello Kamel,

On 30.12.20 14:43, Kamel Bouhara wrote:
> Hi Ahmad,
> 
> On 4/28/20 1:18 PM, Ahmad Fatoum wrote:
>> The nvmem cell binding used to apply to all objects which match
>> "^.*@[0-9a-f]+$", without taking a compatible into account, which
>> precluded extension of EEPROMs by child nodes other than nvmem.
>>
>> A previous commit changed the binding, so that nvmem cells that
>> feature a compatible property must have "nvmem-cell" as the value,
>> otherwise they are skipped.
>>
>> Adjust the driver to observe the new binding change. This change
>> does not change behavior for any device tree that was already
>> compliant with the nvmem binding.
>>
>> Signed-off-by: Ahmad Fatoum <a.fatoum@...gutronix.de>
> 
> Tested-by: Kamel Bouhara <kamel.bouhara@...tlin.com>

Thanks for testing. Could you share what use case you have for this?

Rob had objections to this approach:
https://lore.kernel.org/linux-devicetree/20200512141834.GA3023@bogus/

But solving it within a partition doesn't address my original problem:
https://lore.kernel.org/lkml/f03ecee7-c4b6-7a59-7ab8-42c5dfcaffc4@pengutronix.de/

I just sent out a v4, which added you in CC.

Cheers,
Ahmad

> 
>> ---
>>   drivers/nvmem/core.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
>> index 05c6ae4b0b97..eb697f5ad07d 100644
>> --- a/drivers/nvmem/core.c
>> +++ b/drivers/nvmem/core.c
>> @@ -547,6 +547,10 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
>>       parent = dev->of_node;
>>         for_each_child_of_node(parent, child) {
>> +        if (of_find_property(child, "compatible", NULL) &&
>> +            !of_device_is_compatible(child, "nvmem-cell"))
>> +            continue;
>> +
>>           addr = of_get_property(child, "reg", &len);
>>           if (!addr || (len < 2 * sizeof(u32))) {
>>               dev_err(dev, "nvmem: invalid reg on %pOF\n", child);
>>
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ