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]
Date:   Mon, 4 Dec 2017 18:44:36 +0100
From:   Bartosz Golaszewski <brgl@...ev.pl>
To:     David Lechner <david@...hnology.com>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:     linux-i2c <linux-i2c@...r.kernel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] eeprom: at24: Change nvmem stride to 1

2017-12-04 2:54 GMT+01:00 David Lechner <david@...hnology.com>:
> This changes the nvmem stride to 1.
>
> I am trying to use the nvram consumer apis to read a MAC address from an
> eeprom that has an offset that is not a multiple of 4, which causes an
> error currently.
>
> Signed-off-by: David Lechner <david@...hnology.com>
> ---
>  drivers/misc/eeprom/at24.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
> index 305a7a4..f70d14c 100644
> --- a/drivers/misc/eeprom/at24.c
> +++ b/drivers/misc/eeprom/at24.c
> @@ -880,7 +880,7 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
>         at24->nvmem_config.reg_read = at24_read;
>         at24->nvmem_config.reg_write = at24_write;
>         at24->nvmem_config.priv = at24;
> -       at24->nvmem_config.stride = 4;
> +       at24->nvmem_config.stride = 1;
>         at24->nvmem_config.word_size = 1;
>         at24->nvmem_config.size = chip.byte_len;
>
> --
> 2.7.4
>

I can't find any documentation on what the stride config option does
in nvmem, but looking at the code it's only used for alignment checks
in nvmem core, so this patch should be ok. Still: I'm wondering if it
shouldn't depend on the size of the eeprom or if we shouldn't make the
chip you're using a special case.

@David: what is the chip you're using? Is it an at24mac402 by any
chance? Were you affected by the read problem we fixed recently[1][2]
in at24?

@Srinivas: any comments on that?

Thanks,
Bartosz

[1] http://patchwork.ozlabs.org/patch/841852/
[2] http://patchwork.ozlabs.org/patch/841876/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ