From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gw2.atmark-techno.com (gw2.atmark-techno.com [35.74.137.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E6D23246E8 for ; Mon, 17 Aug 2026 05:21:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.74.137.57 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786944087; cv=none; b=r2Nj8WKYjYPQQHjq1Z4TG0FG6WyOCc4ORRXUv1PgaMaZDyE5Hfnid8m3FEx/RyKzLABZX4BM73zrFARrNyl/lM+jiUBFTzQ0dkHIXi3748Yf0swjz86XtHMjCmD0BB2k2DjA8EgiGW36FSqcQtr5m30Bt9D8oGUAQsjPPJubuGc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786944087; c=relaxed/simple; bh=JFcy3Wc1ev9TJYPaW9onVUV6Qu7dhyqkvUY4s2GO6o0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aSdlN7D2RlB+C+adGOn6XQyLBR/tJth2kGpv9P9k5yhv9exWob+ENbeUDSQKvLmD9tXJRishty1Far8gITHPvGkPyq77XXtOjPWix8/d9DCZJdmeM5jn47UzzYaXPt8iRJ4ken4KAdjSYk34cNyDwRB/dJYPa4B+9+KXffPPE0s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=atmark-techno.com; spf=pass smtp.mailfrom=atmark-techno.com; dkim=pass (2048-bit key) header.d=atmark-techno.com header.i=@atmark-techno.com header.b=T/NDXDQB; dkim=pass (2048-bit key) header.d=atmark-techno.com header.i=@atmark-techno.com header.b=Uj0yWpYx; arc=none smtp.client-ip=35.74.137.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=atmark-techno.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=atmark-techno.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=atmark-techno.com header.i=@atmark-techno.com header.b="T/NDXDQB"; dkim=pass (2048-bit key) header.d=atmark-techno.com header.i=@atmark-techno.com header.b="Uj0yWpYx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=atmark-techno.com; s=gw2_bookworm; t=1786944079; bh=JFcy3Wc1ev9TJYPaW9onVUV6Qu7dhyqkvUY4s2GO6o0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T/NDXDQBk8xdLesas1T/zRY/VYE1wlWIWQZTz0blybxIivycAxjEc3Aqwp59YAC5i TclqutlvT0ESoq5DGZb8EgofrO8nz40df2vMpnhBaKOL1wECB+6ZbWpJv2R2gjCOqU RzH70OZoavyCeIdaRPM6HNI9bbA2X8pF/xRdg0LzyjBCkEoTp5kS+luEUxXPa+ie3W LumnoA8T25PbTspDzNYmlQc5gp3uOPVSE3H97b4mwCA3xHeCqirOXTvgABz1WK//DZ hNRQROuHv33+vfPgbmVfgnEX68NGNXicTjPOu3gVFOJGSVokuN8I6JeDHlX1DZt22W NB3tgYvT3k94A== Received: from gw2.atmark-techno.com (localhost [127.0.0.1]) by gw2.atmark-techno.com (Postfix) with ESMTP id 06D0C3B4 for ; Mon, 17 Aug 2026 14:21:19 +0900 (JST) Authentication-Results: gw2.atmark-techno.com; dkim=pass (2048-bit key; unprotected) header.d=atmark-techno.com header.i=@atmark-techno.com header.a=rsa-sha256 header.s=google header.b=Uj0yWpYx; dkim-atps=neutral Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by gw2.atmark-techno.com (Postfix) with ESMTPS id 612ED36C for ; Mon, 17 Aug 2026 14:21:18 +0900 (JST) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38e54b6556aso3440893a91.2 for ; Sun, 16 Aug 2026 22:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atmark-techno.com; s=google; t=1786944077; x=1787548877; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=VoQVukNFHORcEJRS2cqOoqlMj+TxEPbZPN8vtZ9zCec=; b=Uj0yWpYxc2kG8cnZ2j0wCHlKhxqMHRn38tfZRjNNetxLS8CZcA1+2C/kQzrrNtfc+N 3bqZcP7B8KjsheZ3hXhGD4nywPGqyqbA1fueLmGp+39Q0yvCG4eQlg/lO4g7s7O+5Wn+ xMC4ePbefyjxA4bbeqy1s2SoZiSkkuccwWH8B36ICnbG5k+sfNF3lVAq8zKCF8Ho1WNm rSC9aOiCOnR9rE4RvhbHOs0wkfnNG8yIvffQbptwO1p86Tcp6rEfYmLqRBQz0oYmvtw7 STN6bFZvbPON3PedLIboU7yIVCxFiDA483W0fEUqpml6kgj4A3LIxGs/+J6hei6/or2R 1MbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786944077; x=1787548877; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=VoQVukNFHORcEJRS2cqOoqlMj+TxEPbZPN8vtZ9zCec=; b=lzqsyayj3iYgGiJ/6UetMzjBdITIA4/rklWkyhBq3hKY7O5AFyGMphXti87LUQz5pB V2Du+ialH3/JzfVnOQS7f6myxsprtPREV2dU9le+9xhciWskttSQZFYG7Pk81I4stvh1 K0iwl+xR57V2JmoHfAUpX0kkaz9y1mPIo4e49hY6Uh8M+hQBGf8XhaEQTZLcMktGKZKI MRafKSyde+tLPMTEwz7026siye1hNiVrbLFdMqfT7VBMW77L5gqVpYKW0Zel8AIk49LC P1nskDEv2gucRuzfljoOOVr25iQzWHLKpyxEldwm5UtZ+wcyAF+zfRV7LHLa2ofHTx0d wCRw== X-Forwarded-Encrypted: i=1; AHgh+RqqWwUvlcS3tYACAwnVOsfNXbWMyGdUlYyjZqhAAvhoeMcg2OYrEI2+JtdVWFHiv533Y80RM1OXmg0FgXU=@vger.kernel.org X-Gm-Message-State: AOJu0Yw62myuEiaAIBY0mvDGG8CB1IzxoyEnDDk+jB1K/5Aiqdr8EdAn BOh5nj6JcpI45r2JEUfsDvwJF34jIDjn7gNWykrLMHuXPx778sY6JNyJLCw7ulklvHxh35AHgNm vGWAlJwmnBBkKOIcfBdqZ2JumBh6/7VUtxm3tnnlKubEx6RqVEnNlS/eRHXRrliNlyGFfoAzqiw I= X-Gm-Gg: AR+sD13B/CXlNSTYD2CsucoYE61+Jb3h4WOVshk7FFuHMun2ancxLi6Cmdcgeq2lZH/ kQw328QuXqQEw8P358FA7AoyckEy1Gl3S3uwSC/BT3CcbgMswnAEOnI/1xqi39BjLtCU8uVrqdT pBN+9M52nmuGZrqmc2DPBMtrHBNJ/upJj5V3QbQU0Et2im1qUrjg3SdsPdA48qFdJ0NHZACQnQ8 gGjq6XEco+QQXuovqkKqKrmuMfyqykwJqxp5nJfmlqkqisLY8cCAbCl8iMXixddaQzVW/3ob8Ke 3HkF1ySSu3Uzlj7SMOcG5Sjbk/X3jzUEkB2mqI2LhtOz6QEn09mRTwM5AxKns06nboUYtQ2BPZF 1kjMmlwix6Yjbx6IyKVphaumXGJMPcuGjlfx11Kwo4ld0Sp1A X-Received: by 2002:a17:90b:2f10:b0:38e:f6eb:2b38 with SMTP id 98e67ed59e1d1-3933e63ba0bmr22671483a91.17.1786944077249; Sun, 16 Aug 2026 22:21:17 -0700 (PDT) X-Received: by 2002:a17:90b:2f10:b0:38e:f6eb:2b38 with SMTP id 98e67ed59e1d1-3933e63ba0bmr22671457a91.17.1786944076793; Sun, 16 Aug 2026 22:21:16 -0700 (PDT) Received: from localhost (sodcd-04p2-40.ppp11.odn.ad.jp. [203.139.65.40]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-39531e31b8fsm3352349a91.3.2026.08.16.22.21.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Aug 2026 22:21:16 -0700 (PDT) Date: Mon, 17 Aug 2026 14:21:04 +0900 From: Dominique Martinet To: Miquel Raynal , Richard Weinberger , Md Sadre Alam , Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Daisuke Mizobuchi Subject: Re: [PATCH v3] mtd: spinand: winbond: add support for W25N04LW Message-ID: References: <20260814-w25n04lw-v3-1-c6a7423ac7d0@atmark-techno.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260814-w25n04lw-v3-1-c6a7423ac7d0@atmark-techno.com> Dominique Martinet wrote on Fri, Aug 14, 2026 at 08:12:11AM +0000: > - I still need to check about the high number of ecc errors next week, > but I don't think it's likely to be related to this patch so sending > ahead... Feel free to wait a bit (there's no hurry on my end for this to > get into 7.3; it's fine to skip a cycle as you see fit) That looks like to have been hardware related, I've tried two other identical boards and these worked fine (one had zero ECC error, the other had a handful but nothing like what I was seeing) That was the last item left on my list of things to verify, so I thought this patch was now OK, but sashiko's comment is spot on... > diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c > index 9b78c1e6cbc9..171f4c264220 100644 > --- a/drivers/mtd/nand/spi/winbond.c > +++ b/drivers/mtd/nand/spi/winbond.c > @@ -326,9 +327,16 @@ static int w25n02kv_ooblayout_ecc(struct mtd_info *mtd, int section, > static int w25n02kv_ooblayout_free(struct mtd_info *mtd, int section, > struct mtd_oob_region *region) > { > - if (section > 3) > + if (section >= mtd->oobsize / 32) > return -ERANGE; >From sashiko: > Does this change cause a regression for the W25N01KV device? > The W25N01KV chip uses this shared w25n02kv_ooblayout_free() function > and has an oobsize of 96 bytes. > With mtd->oobsize = 96, 96 / 32 evaluates to 3. The new check > (section >= mtd->oobsize / 32) will return -ERANGE for section 3, whereas > the original code (section > 3) allowed it. This drops the 4th free > OOB region for W25N01KV devices. I could find the W25N01KV datasheet online and it's correctly 96 bytes with 4x 16 bytes user data and 4x 8 bytes ECC, so this patch is incorrect (I had only checked w25n02kv_ooblayout was only used with oobsize = 128, but w25n01kv_ooblayout also uses w25n02kv_ooblayout_free...) I'll send a v4 with fixed functions, even if it's less elegant. -- Dominique