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] [day] [month] [year] [list]
Message-ID: <87wmdsml77.fsf@bootlin.com>
Date: Fri, 14 Feb 2025 19:32:12 +0100
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Santhosh Kumar K <s-k6@...com>
Cc: <richard@....at>,  <vigneshr@...com>,  <quic_sridsn@...cinc.com>,
  <quic_mdalam@...cinc.com>,  <linux-mtd@...ts.infradead.org>,
  <linux-kernel@...r.kernel.org>,  <p-mantena@...com>,
  <stable@...r.kernel.org>
Subject: Re: [PATCH v2] mtd: spinand: winbond: Fix oob_layout for W25N01JW

On 13/02/2025 at 11:30:18 +0530, Santhosh Kumar K <s-k6@...com> wrote:

> Fix the W25N01JW's oob_layout according to the datasheet. [1]
>
> [1] https://www.winbond.com/hq/product/code-storage-flash-memory/qspinand-flash/?__locale=en&partNo=W25N01JW
>
> Fixes: 6a804fb72de5 ("mtd: spinand: winbond: add support for serial NAND flash")
> Cc: Sridharan S N <quic_sridsn@...cinc.com>
> Cc: stable@...r.kernel.org
> Signed-off-by: Santhosh Kumar K <s-k6@...com>
> ---
>
> Changes in v2:
>  - Detach patch 3/3 from v1
>  - Rebase on next
>  - Link to v1: https://lore.kernel.org/linux-mtd/20250102115110.1402440-1-s-k6@ti.com/
>  
> Repo: https://github.com/santhosh21/linux/tree/uL_next
> Test results: https://gist.github.com/santhosh21/71ab6646dccc238a0b3c47c0382f219a
>
> ---
>  drivers/mtd/nand/spi/winbond.c | 31 ++++++++++++++++++++++++++++++-
>  1 file changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
> index ea11ae12423f..41cd0a51e450 100644
> --- a/drivers/mtd/nand/spi/winbond.c
> +++ b/drivers/mtd/nand/spi/winbond.c
> @@ -134,6 +134,30 @@ static int w25n02kv_ooblayout_free(struct mtd_info *mtd, int section,
>  	return 0;
>  }
>  
> +static int w25n01jw_ooblayout_ecc(struct mtd_info *mtd, int section,
> +				  struct mtd_oob_region *region)
> +{
> +	if (section > 3)
> +		return -ERANGE;
> +
> +	region->offset = (16 * section) + 12;
> +	region->length = 4;
> +
> +	return 0;
> +}
> +
> +static int w25n01jw_ooblayout_free(struct mtd_info *mtd, int section,
> +				   struct mtd_oob_region *region)
> +{
> +	if (section > 3)
> +		return -ERANGE;
> +
> +	region->offset = (16 * section) + 2;

This is actually wrong i believe. Only the first section needs + 2.

You can probably have the following condition:

if (section > 3) {
     offset += 2;
     length -= 2;
}

Thanks,
Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ