Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp534580lqt; Thu, 6 Jun 2024 10:24:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUzWEkgkWmlEwRm7FGY9ci+pYPqrgS/73gM+u3HEW8hSwwWOGymWzhgPghmTx5C5s7yGC5QaaBqM+mQ1UyMxnM99Vw0KUWKHDsC6AvSmw== X-Google-Smtp-Source: AGHT+IHJNOVh0nEINRHdlHEc9okTvfZW+AXhIgt1pjyB2hzn7Eezt9HEPy6efegO1j3LYbd+yaqi X-Received: by 2002:a05:6a20:244b:b0:1b2:bcbc:c8c with SMTP id adf61e73a8af0-1b2f9a62074mr243775637.28.1717694657010; Thu, 06 Jun 2024 10:24:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717694657; cv=pass; d=google.com; s=arc-20160816; b=tfK5RunfsMu2cu7dxxPF7ofnXWZTQ9jZCdIjk+o6NvnIJGKP8w+HF+/PQWAASIPmmN Tgizm37XP5BVxdV/zxw01UPu+Njhxk307tKq8pZjpspjK8WjKIJUgTWa7LYVkUyp2SI0 omyE5mk4DkV5IHt54MIBBySwq5Q7uChDSM7o+epPKdIvKkqnuKBMPQgrw+TbSiD9Ub5j aB3U9124lyLPe9LJWHLiDymYOTpFEicHDAHKuQzit3sUY/1HKBy3LcHI+UQmUZn2eMDG JlYhuovxW5Q4QCy7IxEtMjfq+lXn5FisQZOQKx7yvosXMqXL3Rh2QT6K9KwEOsq/MhL7 rOTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=uh6hmNB3/hOoQGCh2kYcY8ljw2iK4guW9QdsRKpcjAk=; fh=IwT7TC8WL3BAnG0Wdcw8Kw6/y3XrBg983XvtYFWG/F4=; b=XdDXjC4bO8mtLlXS73eV2jGd4ln+TJSepA3pWLkdZA91GZsNF/d0U8zYsZTet7hBIQ bs2EgjHMbxQIIAufuw9fUHYZ7gA/MmBrfhVnnHqPx/yDGQs4axVA+pQw9tvCXiDentI7 20VdY9xz+8CgVI6lteOJ3ITPQ1UQwyLGygeVOIYy1EVmoW9AAxEwJVzDABo/s5jE59+H g4WHMunkOEqZ4OtT//SBy9t8dCmdsTxRx2WLurCVQXMxFylJcHNOIFSUO/DDhPZbmMRA 3aDasSOOzIHls0Ms+31hjudhSbomAmJe3LlIKv9GO6xpR+8gY5jTpHLLvGU8i7eBcZRV UdZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@geanix.com header.s=default2211 header.b="G6JZwJS/"; arc=pass (i=1 spf=pass spfdomain=geanix.com dkim=pass dkdomain=geanix.com dmarc=pass fromdomain=geanix.com); spf=pass (google.com: domain of linux-kernel+bounces-204787-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204787-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de261c9ae1si1489304a12.256.2024.06.06.10.24.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 10:24:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204787-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@geanix.com header.s=default2211 header.b="G6JZwJS/"; arc=pass (i=1 spf=pass spfdomain=geanix.com dkim=pass dkdomain=geanix.com dmarc=pass fromdomain=geanix.com); spf=pass (google.com: domain of linux-kernel+bounces-204787-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204787-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C0688286D15 for ; Thu, 6 Jun 2024 17:21:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47FCE1990B5; Thu, 6 Jun 2024 17:20:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=geanix.com header.i=@geanix.com header.b="G6JZwJS/" Received: from www530.your-server.de (www530.your-server.de [188.40.30.78]) (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 B8DCD197A8F for ; Thu, 6 Jun 2024 17:20:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=188.40.30.78 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717694457; cv=none; b=o7+7rg0V27gHOuIIWV3HU9oPZDBu5hHDsoaAhKLBw20E7DFtVDyVCw6HpB6WBReCAyiAHOtiuoWO1wxAHMGbzg8JJuWiBx7HRdj1VLL0YBdcFlCvqcndGDlLm6Od5xx+prAviyPXh62/d8402cBD/755bBWyFr8Q72IeCYC7LKw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717694457; c=relaxed/simple; bh=o6l8Q90eG0SC0p7aKRIvyUpjH+PHEbLFWDBdZ0rdMHI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=fQzcg1MvMiSNQL1sn1fbZzf/6gLP31SuQNPYV6thAuAr3r51zAKi5qlBWlKvxt6W3Y5ev69x3Kq/ommBqBjIDqbyMcP6gMHJ2KJySq+EF7f/bO1sUR95zhv/Dvxs2VXleEoWUEJ77AxSKKSJ4fcjSLpcJP0MAwDzJTto3QVChU8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=geanix.com; spf=pass smtp.mailfrom=geanix.com; dkim=pass (2048-bit key) header.d=geanix.com header.i=@geanix.com header.b=G6JZwJS/; arc=none smtp.client-ip=188.40.30.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=geanix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=geanix.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=uh6hmNB3/hOoQGCh2kYcY8ljw2iK4guW9QdsRKpcjAk=; b=G6JZwJS//bgOQ0onfnj9tl/maL Tjc/+1Q2C/xDcPsW4uHMsBPZF6Gtmf/T8YnmluG1Im5xep2rTE3d0vKQbNp+6V5OAlzgA7r0qMFQB hRMEHyGmMyYaHHMExZ026+t+kmybyRuQcgb+q2pXD2n/5Am7LahPuf6rWAwXXcb93jRPZfM9H8bt3 M8RqCFfK3m/cXS7XnpskiFR8/yz2HQpDUn6YrqbG1RY8uL7IP0d40jcTRKVSbFE/HkQwxjkATd8Yz m+6FxijHUNXJJBUfSHv8Fjmy5rXaO7FmFFXAyyrKdOf2xwrnXHtkkEPIH6sDjHj+pCLWfxW8eikXC +yYH94KQ==; Received: from sslproxy07.your-server.de ([78.47.199.104]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sFGnJ-0002at-BP; Thu, 06 Jun 2024 19:20:53 +0200 Received: from [80.62.117.184] (helo=localhost) by sslproxy07.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sFGnF-000484-1p; Thu, 06 Jun 2024 19:20:53 +0200 From: Esben Haabendal To: Tudor Ambarus Cc: Michael Walle , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Rasmus Villemoes Subject: Re: [PATCH v2 1/2] mtd: spi-nor: core: add flag for doing optional SFDP In-Reply-To: <48719b0f-1a7f-47f9-948a-c981a0a29b41@linaro.org> (Tudor Ambarus's message of "Thu, 6 Jun 2024 15:52:35 +0100") References: <20240603-macronix-mx25l3205d-fixups-v2-0-ff98da26835c@geanix.com> <20240603-macronix-mx25l3205d-fixups-v2-1-ff98da26835c@geanix.com> <48719b0f-1a7f-47f9-948a-c981a0a29b41@linaro.org> Date: Thu, 06 Jun 2024 19:20:52 +0200 Message-ID: <87zfry9edn.fsf@geanix.com> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Sender: esben@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.10/27298/Thu Jun 6 10:30:08 2024) Tudor Ambarus writes: > On 6/6/24 14:59, Michael Walle wrote: >> On Thu Jun 6, 2024 at 3:31 PM CEST, Tudor Ambarus wrote: >>> 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. >> >> I actually had the same concern. But currently there is no >> non-deprecated way to handle this case, right? >> >> Right now we have the following cases: >> (1) pure SFDP parsing >> (2) non-SFDP flashes with static configuration only >> (3) legacy implementation, where the magic flags decide whether we >> use SFDP >> >> Which case is eventually used depends on the ID of the flash - >> assuming there will only be IDs which either fall into (1) *or* (2). >> That assumption is clearly wrong :) >> >> I'd propose a new case in spi_nor_init_params() >> (4) try SFDP with a fallback to the static flags from the >> flash_info db. >> > > that's not that bad, but I would avoid doing it if it's not common. You > also have to update the core a bit, you can't use no_sfdp_flags & > TRY_SFDP, it's misleading. Does it worth it? > > I won't oppose too much, but to me it feels that we're trying to keep > alive a dead man. Which dead man are you referring to? The legacy implementation or the old non-SFDP Macronix part? /Esben