Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp379168lqt; Thu, 6 Jun 2024 06:31:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUgzhzlvbVN6e/DRfnQO3pIwWVwPUimaPevT+f3U1Ix/QMFU849FoJLf1qHJyFoDjwglg5sgQbNaHRpyfuoEuAf6Mn6kAEHeiyWXiJIkQ== X-Google-Smtp-Source: AGHT+IFSk0tRRzwd10tolttck1CdBbLqfhUCJ8MZntzLlowU/mKf2jBGm9tm2OTwr2oaoJiY0p5h X-Received: by 2002:a17:906:ff4f:b0:a68:be21:8dca with SMTP id a640c23a62f3a-a699fab8bf6mr370409366b.10.1717680699351; Thu, 06 Jun 2024 06:31:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717680699; cv=pass; d=google.com; s=arc-20160816; b=pmDvjivkaeYG27T0YZia5Af6QHGHhLQxT5/KBTppRG9pGp5ACdiLMbu0yuxaIO4YHl 0Z1ddu9uKaZkMvB1/PBf48oxSn1mexo0y+hM5EKRbDtE2k4nswXICM/8Lahdx95o7MPs dyTfULs9p+vg9AWacLf0WWpFY9Ipa6XhrSBcq8f2NVacbv+YxVFXeBOo/5BNaQsP/RTD z6iMbb+SOrgGJMCu0Zs5cMYOY7yoym3njiT04JE+blJrK1chFi8trgCmwEFyO3flx7Lb mgUt65WhMJJwaFf1hyGfICTYD6TIh32Bcj68doLnUpUgM5BXnZAgXaTnNZjyl4R/sgfv ISew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=/zmsP1MNZwY5lN3l4HikogMd/Cj+hwxphgWW3D3oRNE=; fh=Ni9Ir2nQQFPCq7iGh1qlkhC3mQoW+DNrrpLjf3b6QSE=; b=lb20NuiQZobjoA7iuJwaI4bZVF/nO5S7U6xD4OU9O6naNKbwyyIqiVe8eh7cE/pNpg vDHV25Anevyta6dvNjabYY1OCtW9EoEqhuRSzJ2Ph5xvR5ChWqYVgnCenTF0DuwKLUgO hVa3uMtr7H+cAHTMSliUgBbDN+EkQ++A23dLErzRvDZlYQoqnpSexrafdBZVdriq6CFR tPQIspbY1PG/KOzKMHo5s2rK4X7DnOtnYttRa3gZk8LKGf8QOl2VpM7bDZ+WIhWCNAnX 0I6SzsgXkgXfjb8Uu1nA3o+WwB6PCCteMlCNxI1KOZ24mQ9dSeL9gCWyvhmB/Qif7wx5 OwYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LXDE0bAu; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c807281fbsi67395766b.816.2024.06.06.06.31.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:31:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LXDE0bAu; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DF7391F2584E for ; Thu, 6 Jun 2024 13:31:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0077195FD7; Thu, 6 Jun 2024 13:31:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LXDE0bAu" Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58CC2195993 for ; Thu, 6 Jun 2024 13:31:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717680687; cv=none; b=BwT/k+v0k9oF1R1xWo5APm+9sh1XhmQ5tXStmkb77ZPqlOosn3BuxwfscfGfAa/jFWxubT3VI1TsO0cCciUjJ+Dqsh/fjRALJCZHEqrSobCc1V8t52OBWiBdxOs5oZk/jTkOGfJGx5E+LdOx+M3dLieMbjVyekGsZg4+u3+3LP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717680687; c=relaxed/simple; bh=/MpEarDTdmsHsly2govIHxY4tMGV9P2aqiICWrHuL2s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oEl9tcaZyQvI/jkMYvBNlxOhlp65I3APZuoHVGZCTiJD2xePXPKmkJcGq/Bz5fJAmwlaISmgJyKNQfnQiATz/+4GE/IJcyAAKJ5Xo4uMMxIOaUZsCQpuOFgYr1C4rpHjSACygogkZ3VOynDr4vi915ulzWcjQwXPFotdVjSOcMk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=LXDE0bAu; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-52b88335dd7so1206845e87.1 for ; Thu, 06 Jun 2024 06:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717680684; x=1718285484; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/zmsP1MNZwY5lN3l4HikogMd/Cj+hwxphgWW3D3oRNE=; b=LXDE0bAu52au3h/Uhkhkg54ryABffnLfDkzE/RqHv+tITyhRQLVUQwuyi3aIi5XuFe LR3Mdsuhz3vWb9NDodaDbQ0QgioI43p1wu+YOjIyMPoWAj62d0AZ+ePCTd322lDn8MCP 2xTUBmJkS2OuMIQ/3n4iGo+nbhL4bfv3JVwsUgrGJXm+YsZbuMqb/ImFqa6NGupPgg5t VcnAF+ysqgBesqohBdJc5oSzY9hRkLFBDKTm5mKokuaU3gwKcw305a3cj4aZERjzBrtp if1KX0B5QG9duqMeHQPfKHnDK8B6faYLM197ruDE+9H9hWZE9JvFZjuLtK9fnGWKkxFP jYbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717680684; x=1718285484; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/zmsP1MNZwY5lN3l4HikogMd/Cj+hwxphgWW3D3oRNE=; b=T8J9/35gpivsS2K9RrpogoTjXZcSOngf9stxkqercL61CCm/UU/kct+cgZHKapGL2s IUeLbs0fuVGGMoF6vS35D9O6UqhqHCm0miurmlY3FzKyJkxub9CW1e8AQ7RPFhpyUXll CZj7cbcad9+r4XMz/JJW7096uPOHK6eYWWJE7YYxSQULkx5Q7MPJQNhYhxqckG3I51hD nfKyuSRgYl2yUeyTVAzGILrErpWBKDtlbYdLmle1h8f0CWRJHqS+4xcjWV9Hh78dn/lc T8OSXxHM9eby3kFOcD8rn7XIqf/Vl3fBnS5H/jn4JHRTr5YPAp5FYPPEksSQTEVMV9ej znig== X-Forwarded-Encrypted: i=1; AJvYcCVZtGHAnQKZlXj4PPCtQHXvilMgcVHBYRMMHc0408wgORX0x6gTRxYHx/vR6azpmmZVlL7LWDLbK4drf0ceSLJvh7iBXHO+ugnqvRme X-Gm-Message-State: AOJu0YzGwNLBXI242BNaDPWMRIvGMBLZk/UL4AVrJqDIK0kKSAPkIBj+ 8EHEuH9wqNJTbmf4dJjTJiYPbkbKnO1x9gd7BcQ8b5y9+5x3qsw3+Cn7doz8N+E= X-Received: by 2002:a05:6512:3189:b0:52b:885b:aacd with SMTP id 2adb3069b0e04-52bab4b808dmr3849492e87.14.1717680684478; Thu, 06 Jun 2024 06:31:24 -0700 (PDT) Received: from [192.168.2.107] ([79.115.63.17]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c805c421esm98277666b.48.2024.06.06.06.31.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Jun 2024 06:31:23 -0700 (PDT) Message-ID: Date: Thu, 6 Jun 2024 14:31:22 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] mtd: spi-nor: core: add flag for doing optional SFDP To: Esben Haabendal , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Rasmus Villemoes References: <20240603-macronix-mx25l3205d-fixups-v2-0-ff98da26835c@geanix.com> <20240603-macronix-mx25l3205d-fixups-v2-1-ff98da26835c@geanix.com> Content-Language: en-US From: Tudor Ambarus In-Reply-To: <20240603-macronix-mx25l3205d-fixups-v2-1-ff98da26835c@geanix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 6/3/24 14:09, Esben Haabendal wrote: > A dedicated flag for triggering call to > spi_nor_sfdp_init_params_deprecated() allows enabling optional SFDP read > and parse, with fallback to legacy flash parameters, without having dual, > quad or octal parameters set in the legacy flash parameters. > > With this, spi-nor flash parts without SFDP that is replaced with a > different flash NOR flash part that does have SFDP, but shares the same > manufacturer and device ID is easily handled. > > Signed-off-by: Esben Haabendal > --- > drivers/mtd/spi-nor/core.c | 3 ++- > drivers/mtd/spi-nor/core.h | 1 + > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c > index 3e1f1913536b..1c4d66fc993b 100644 > --- a/drivers/mtd/spi-nor/core.c > +++ b/drivers/mtd/spi-nor/core.c > @@ -2933,7 +2933,8 @@ static void spi_nor_init_params_deprecated(struct spi_nor *nor) > > spi_nor_manufacturer_init_params(nor); > > - if (nor->info->no_sfdp_flags & (SPI_NOR_DUAL_READ | > + if (nor->info->no_sfdp_flags & (SPI_NOR_TRY_SFDP | I don't like that we update deprecated methods. The solution though is elegant. > + SPI_NOR_DUAL_READ | > SPI_NOR_QUAD_READ | > SPI_NOR_OCTAL_READ | > SPI_NOR_OCTAL_DTR_READ)) > diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h > index 442786685515..77f61a984cb3 100644 > --- a/drivers/mtd/spi-nor/core.h > +++ b/drivers/mtd/spi-nor/core.h > @@ -535,6 +535,7 @@ struct flash_info { > u8 no_sfdp_flags; > #define SPI_NOR_SKIP_SFDP BIT(0) > #define SECT_4K BIT(1) > +#define SPI_NOR_TRY_SFDP BIT(2) > #define SPI_NOR_DUAL_READ BIT(3) > #define SPI_NOR_QUAD_READ BIT(4) > #define SPI_NOR_OCTAL_READ BIT(5) >