From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.246.85.4 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796289743; b=O3Os+ug6tfavNpHIjq2Sf6qbVkcOGTGNtG8b31ivufQ5AGXraXL/ilSsdC2rgYsq1Dez 5y4Jz1HstbGjGzHG8QFjWNh9YEfQa2/nTGUzEjt/RBvyym+VZOiKkYAU9SSgxpi+8LeuT iuyUIF4skuFuczyuDFr4X2YliDmZX8F51DfvJqO6UDZkCW4irOHyBi2Ug7KW/v88PDD1B ewIWO7woRo4yy00oLODOBECQ0/I38TgKZgBXNN0Ph4krm2oX6GnkMiQqPNkPctmmgrRPS xnv2AxrIpxe3qQD2nM9ALPbY5X5qcgnBVc7lAJNllFxoH7IDEvasO+kjSWCIMLM27ZA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796289743; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:To:Cc: Subject:In-Reply-To:References:User-Agent:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding: X-Last-TLS-Session-Version; bh=QtMuDfPEhD/WPy0rVJlwUYsygj+uquQuqjT6ir+s8aI=; b=M+ce/BGGQ4LGaMFSUrGGtmB5LUtOSK0GITl9XXkh63LhV4s4hVdC/ynN0vCw1ben/TG/ dpCE0X+PLbenBIymRr+2nn6wyjuh//SmPS7j5mwKTdeztVE8U+RSDCOY+pN3wGHw+RTog kfp3X6u9OkNif4GrLcRyg5nngdZ2kKKJnwOM6+ogj7rY/fYoUoXTHe8zLcrqXzdOIfsPz lvXNP9s82Nw+yGCcRUjcYuzR+8gEGhwe1pMblzg2szTZHCeYLpQwCgJaamNr3Hyvv6tqc aSbXoEBJVVtlbMQP63sOiNbHSnoapkSHS4/eOj3a+jCK60DLIap0AOXXfTLQNr0nN7Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b="Z/OHSF8M"; arc=none smtp.remote-ip=185.246.85.4 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46E10606A322 for ; Thu, 3 Dec 2026 09:22:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 46E10606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=Z/OHSF8M Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 9D4164E4185B; Thu, 3 Dec 2026 09:22:21 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 70F3D604ED; Thu, 3 Dec 2026 09:22:21 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1249011EA1F3B; Thu, 03 Dec 2026 10:22:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796289740; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=QtMuDfPEhD/WPy0rVJlwUYsygj+uquQuqjT6ir+s8aI=; b=Z/OHSF8MfWTlqUs6GNE99ISDdgO9+M8uZ85NxhHWVTajIV5UJ40utL3kNjdNgziWn4Ymj8 EMejrlazw0y8SlDQ3kdeXPJC2T1vhYMQ+HTJ118WzClQMRnjd64fl49kgHn9snVSodwBia 2gromJ77p6vCqTEPF+6SlyY3hHsr3wHTsQuhz7qbBpiD69kd/Cld6VfY/t3giEe6CXtW4D Z6p2DiTy4rlbbQYed2rpSa/oCz7eJOspahPSKsMvrKkDpUSMP0p0Q3/OxchzxZ/+rbepd4 e1nRu9Rv8ClwnjGf7sWaUyTm8YyllTfmE3bbn218VuTVpUfCMuXV/MPdrBm9UA== From: Miquel Raynal To: Cc: , , , , , , Subject: Re: [PATCH] mtd: spi-nor: spansion: add SPI_NOR_HAS_LOCK to s25fl064k In-Reply-To: (Takahiro Kuwano's message of "Thu, 3 Dec 2026 06:40:40 +0000") References: <20261201071521.216993-1-naresh.solanki.2011@gmail.com> User-Agent: mu4e 1.12.12; emacs 30.2 Date: Thu, 03 Dec 2026 10:22:16 +0100 Message-ID: <874iculnw7.fsf@bootlin.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 On 03/12/2026 at 06:40:40 GMT, wrote: > Hi, > >> The s25fl064k entry also matches the Winbond W25Q64, which has the same >> ID. Both protect blocks with the BP0-2 and TB bits of the status >> register. Commit 3b1fba74306b ("mtd: spi-nor: winbond: W25Q64JV-Q/N: >> Fill locking information") set SPI_NOR_HAS_LOCK and SPI_NOR_HAS_TB on >> the winbond w25q64 entry, but that entry is never used for this ID, as >> the spansion table is searched first. Set both flags on the s25fl064k >> entry too. > > Why don't we remove the redundant entry? > We need to keep "s25fl064k" name as it is in spi_nor_dev_ids[]. > >>=20 >> Without SPI_NOR_HAS_LOCK the block protection is never cleared, so on a >> W25Q64 that ships fully protected, erases and writes silently fail. >>=20 >> Signed-off-by: Naresh Solanki Yes, that is true and I documented it in my previous series. I actually commented out the Spansion part for the tests I conducted otherwise that entry was indeed picked-up instead. I found no time to cover this problem yet. >> @@ -1065,6 +1065,7 @@ static const struct flash_info spansion_nor_parts[= ] =3D { >> .id =3D SNOR_ID(0xef, 0x40, 0x17), >> .name =3D "s25fl064k", >> .size =3D SZ_8M, >> + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, > > Do we also need to add HAS_CMP and QUAD_PP? I don't think the Spansion entry supports CMP. For Quad PP, it does not matter much since the extra gain is small. Thanks, Miqu=C3=A8l