From nobody Fri Sep 5 06:20:05 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F41CC001B0 for ; Mon, 7 Aug 2023 13:25:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234146AbjHGNZX (ORCPT ); Mon, 7 Aug 2023 09:25:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234136AbjHGNYp (ORCPT ); Mon, 7 Aug 2023 09:24:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BBD219BA for ; Mon, 7 Aug 2023 06:23:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4086661AE0 for ; Mon, 7 Aug 2023 13:23:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAD69C433CD; Mon, 7 Aug 2023 13:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691414584; bh=v3ofMUp8UBxPgYd5XD7XRHJNeXUWfMpXY/dIXqoAhK8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=es5CoEJce0v1chJ3Ry11vQ0GhdRj6X8gklJ28pDG1Ic/YfKoDOMqil6qcGTgXZiV3 GFYqkdTW2DCOXPH7Lsi+5JvaNt0dqzufqW5lV+SP0m/lRzAOo8Xuo924dqT6Zyi0Ju 0EH6f6kPSYIaSNA+Wnn1bD7WgDWTMpvdu8bpL3wFBBT78sITFDDl1XC/HnvqMvpmaj U2cxKagIH4b0EZJvcxpZ7Lpt1l5euCTRJ4ddJ50Fzu2lXCrAcww+UI65Ede5KTCqVJ JSgEMENfWfaA6/1R8CKdcQkLBGPjaULvftRvZE0cdeq2/1o2Vvt/oU5s7XYetUrBtk Idc5jlGyvcb0A== From: Michael Walle Date: Mon, 07 Aug 2023 15:21:28 +0200 Subject: [PATCH 34/41] mtd: spi-nor: issi: sort flash_info database MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230807-mtd-flash-info-db-rework-v1-34-3d3d5bef4ba4@kernel.org> References: <20230807-mtd-flash-info-db-rework-v1-0-3d3d5bef4ba4@kernel.org> In-Reply-To: <20230807-mtd-flash-info-db-rework-v1-0-3d3d5bef4ba4@kernel.org> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Michael Walle X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle --- drivers/mtd/spi-nor/issi.c | 44 ++++++++++++++++++++++--------------------= -- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/mtd/spi-nor/issi.c b/drivers/mtd/spi-nor/issi.c index 9478f1e61626..18d9a00aa22e 100644 --- a/drivers/mtd/spi-nor/issi.c +++ b/drivers/mtd/spi-nor/issi.c @@ -48,26 +48,43 @@ static const struct spi_nor_fixups pm25lv_nor_fixups = =3D { =20 static const struct flash_info issi_nor_parts[] =3D { { + .name =3D "pm25lv512", + .sector_size =3D SZ_32K, + .size =3D SZ_64K, + .no_sfdp_flags =3D SECT_4K, + .fixups =3D &pm25lv_nor_fixups + }, { + .name =3D "pm25lv010", + .sector_size =3D SZ_32K, + .size =3D SZ_128K, + .no_sfdp_flags =3D SECT_4K, + .fixups =3D &pm25lv_nor_fixups + }, { .id =3D SNOR_ID(0x7f, 0x9d, 0x20), .name =3D "is25cd512", .sector_size =3D SZ_32K, .size =3D SZ_64K, .no_sfdp_flags =3D SECT_4K, + }, { + .id =3D SNOR_ID(0x7f, 0x9d, 0x46), + .name =3D "pm25lq032", + .size =3D SZ_4M, + .no_sfdp_flags =3D SECT_4K, }, { .id =3D SNOR_ID(0x9d, 0x40, 0x13), .name =3D "is25lq040b", .size =3D SZ_512K, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, - }, { - .id =3D SNOR_ID(0x9d, 0x60, 0x15), - .name =3D "is25lp016d", - .size =3D SZ_2M, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { .id =3D SNOR_ID(0x9d, 0x60, 0x14), .name =3D "is25lp080d", .size =3D SZ_1M, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + }, { + .id =3D SNOR_ID(0x9d, 0x60, 0x15), + .name =3D "is25lp016d", + .size =3D SZ_2M, + .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { .id =3D SNOR_ID(0x9d, 0x60, 0x16), .name =3D "is25lp032", @@ -109,23 +126,6 @@ static const struct flash_info issi_nor_parts[] =3D { .flags =3D SPI_NOR_QUAD_PP, .fixups =3D &is25lp256_fixups, .fixup_flags =3D SPI_NOR_4B_OPCODES, - }, { - .name =3D "pm25lv512", - .sector_size =3D SZ_32K, - .size =3D SZ_64K, - .no_sfdp_flags =3D SECT_4K, - .fixups =3D &pm25lv_nor_fixups - }, { - .name =3D "pm25lv010", - .sector_size =3D SZ_32K, - .size =3D SZ_128K, - .no_sfdp_flags =3D SECT_4K, - .fixups =3D &pm25lv_nor_fixups - }, { - .id =3D SNOR_ID(0x7f, 0x9d, 0x46), - .name =3D "pm25lq032", - .size =3D SZ_4M, - .no_sfdp_flags =3D SECT_4K, } }; =20 --=20 2.39.2