Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp667015lqb; Wed, 17 Apr 2024 07:36:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXH7yqpNL2lT8hZFYw+qJgUzv9z1O3e2vaLqKmOovltpG43JOGAXxw8g+RnUs03kDdDEKOItIKja3DMqhYHzkGSXjJEGbtizN4y8u8m6A== X-Google-Smtp-Source: AGHT+IFLXvzX8PdheKbxUzKlGVDF0eIvufFIfpSt3RurXlTFbzxWNomdvSdD2MfIJBn1Un2WG5LD X-Received: by 2002:a17:906:7146:b0:a54:c12d:2be8 with SMTP id z6-20020a170906714600b00a54c12d2be8mr5608480ejj.23.1713364575810; Wed, 17 Apr 2024 07:36:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713364575; cv=pass; d=google.com; s=arc-20160816; b=yKv9M59ijg/t0y0CcNR8dMfBNxZKBh/dUAe2++iTqIpMHTEwlpMLsca3WdbdTJ8P+A F0V3NTbAAjLDY3MqhP0YCO1Evg6AFI2qJlx7moJS03lpKJ8GgcnTZHHvGD9dN9Q83gAg zOYzV3vp5akoNRrfMSBz+jtE/WoxwRbVa4Ke+RIOiiUDNneS1zaKZHzLYt3RKvszXWBH sRKV5B3zHxD7TUSveckXf4tiJ0Jjx/BxtAMdJMtZYzOKHoL4oJEiNmmmYRjw/DFmH4c3 QtJ2uoaLkZRvncqkSR70/FizKdUXMpcGYb7ENzOXsaCASJJJMTG1kSYMdGsXiK0KACYa +3pQ== 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=eHrH4yqk+7ELy5qh4VlKDIa25V4TyHmWTxfDlCubDSU=; fh=sUIUDSRLPnoDTcyC+NG/apWxqpmg9gT5rxu7A6nGf6U=; b=Px7n4PUyX058j5nirDuICS8rTKtrw91OPiBmFQcQZ7DAgRaGqdT9JYomPq+8dc8mbF JdtrnrR/Gt9Kjj2TxzT8Ih5EsVtL6zAiQqxZwuC9VIDD6omrJDadTS/Zx3XeLUwXUiXg U0t/qXpj4U2C3KxPFxu6ffkoWVolQERuVi84IgyReajKPbcEKXb11oKRFu5XmFV/ZEpb uRtZ5e82b9ZQWR7TF+7Rt4MgURc9Hdx3iHgSZeD7tPITw92YHayjbodm4HFA9gTI350f HNTcYUv0QfDyeWjROM7apYhMTVng0+GT3/ZfFAzB0+g5BV71apHetIIdsiNWkAR2PWyy S7Yw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=anjArfD6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-148680-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148680-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c19-20020a170906529300b00a51d88cded7si6729651ejm.163.2024.04.17.07.36.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 07:36:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148680-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=anjArfD6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-148680-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148680-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 8C5281F21A3C for ; Wed, 17 Apr 2024 14:36:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF1BF13C664; Wed, 17 Apr 2024 14:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="anjArfD6" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E93CC13A265 for ; Wed, 17 Apr 2024 14:36:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713364569; cv=none; b=azvAtAwBdnt1T1XmyQGvYaOQ+aoGQCJUcisdoNEvkzZAUtcEzHkPhGUn18QN9ZsUXax5Y5eCpYsuZkXxwqtwf6c2rALJmBuumnzg4GDqSCbtbES+xUIERK4XaLsd6xUnVxJoPpCqCciXpquxVST3Z03HZlrcwE6YBA/ENTcP1vs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713364569; c=relaxed/simple; bh=+Y9JzAylpqFu2bRnmflUigQpLiwfuTJ/VegvAB2EcjM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=EXsuBnnRbitWR+/FcfG/YMvjbrni+0qZtprPxCDkebt+HnLQix79ZJViT/hiFU428XCM5e+4GiqYUHS3dDiC/k21tjBdt7CldlEGT1/x7Ph8HcBSG6aoHPDUZBO/tsiqeSEbsoMJdKKCxT60c0lR0HjM0oKn2fderTPyYKGR5rs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=anjArfD6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A6F3C072AA; Wed, 17 Apr 2024 14:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713364568; bh=+Y9JzAylpqFu2bRnmflUigQpLiwfuTJ/VegvAB2EcjM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=anjArfD6oxx6cZ4qCiZG864wcbmxykfLW+BETZ+XMQD+XcgrVnvSeTdx2jB4Apr/n 5ovg3ouCBrr84D1+CtJgiGng2wkoDTQkImulTZB80oJb+3jr86IPypSLiXsm2XewvE +x5bg8vdu2oFCQzyz5p6m8geYsaC7KnX7scs89gjskEKJAcHAwpjrOL5lLB3pB+U+/ QY0AbML6ucdpVAtA6myQ5ciR8rJe/fliiOXbnWVVgQbw4TrpOAVuKr2l9ORtT9RZNq zLYMBC6yeu6F0CBnjwLPmyffVi1Xw07u6QYlCk1Pqbc6NrlSH68tlq0gOYCpdeQC93 zNLfcSX/mubBw== From: Pratyush Yadav To: Michael Walle Cc: Tudor Ambarus , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: Re: [RFC PATCH v1 6/6] mtd: spi-nor: introduce support for displaying deprecation message In-Reply-To: <20240412134405.381832-7-mwalle@kernel.org> (Michael Walle's message of "Fri, 12 Apr 2024 15:44:05 +0200") References: <20240412134405.381832-1-mwalle@kernel.org> <20240412134405.381832-7-mwalle@kernel.org> Date: Wed, 17 Apr 2024 16:36:06 +0200 Message-ID: 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 On Fri, Apr 12 2024, Michael Walle wrote: > SPI-NOR will automatically detect the attached flash device most of the > time. We cannot easily find out if boards are using a given flash. > Therefore, introduce a (temporary) flag to display a message on boot if Why temporary? There will always be a need to deprecate one flash or another. Might as well keep the flag around. Also, this patch/series does not add any users of the deprecated flag. If you have some flashes in mind, it would be good to add them to the patch/series. I like the idea in general. Do you think we should also print a rough date for the deprecation as well? > support for a given flash device is scheduled to be removed in the > future. > > Signed-off-by: Michael Walle > --- > drivers/mtd/spi-nor/core.c | 12 ++++++++++++ > drivers/mtd/spi-nor/core.h | 1 + > 2 files changed, 13 insertions(+) > > diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c > index 58d310427d35..a294eef2e34a 100644 > --- a/drivers/mtd/spi-nor/core.c > +++ b/drivers/mtd/spi-nor/core.c > @@ -3312,6 +3312,7 @@ static const struct flash_info *spi_nor_get_flash_info(struct spi_nor *nor, > const char *name) > { > const struct flash_info *jinfo = NULL, *info = NULL; > + const char *deprecated = NULL; > > if (name) > info = spi_nor_match_name(nor, name); > @@ -3326,6 +3327,17 @@ static const struct flash_info *spi_nor_get_flash_info(struct spi_nor *nor, > return jinfo; > } > > + if (info && (info->flags & SPI_NOR_DEPRECATED)) > + deprecated = info->name; > + else if (jinfo && (jinfo->flags & SPI_NOR_DEPRECATED)) > + deprecated = jinfo->name; > + > + if (deprecated) > + pr_warn("Your board or device tree is using a SPI NOR flash (%s) with\n" > + "deprecated driver support. It will be removed in future kernel\n" Nit: "removed in a future kernel version" > + "version. If you feel this shouldn't be the case, please contact\n" > + "us at linux-mtd@lists.infradead.org\n", deprecated); > + Hmm, this isn't so nice. I'd suggest doing something like: /* * If caller has specified name of flash model that can normally be * ... */ info = jinfo ?: info; if (info->flags & SPI_NOR_DEPRECATED) pr_warn(...); return info; > /* > * If caller has specified name of flash model that can normally be > * detected using JEDEC, let's verify it. > diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h > index 8552e31b1b07..0317d8e253f4 100644 > --- a/drivers/mtd/spi-nor/core.h > +++ b/drivers/mtd/spi-nor/core.h > @@ -524,6 +524,7 @@ struct flash_info { > #define SPI_NOR_NO_ERASE BIT(6) > #define SPI_NOR_QUAD_PP BIT(8) > #define SPI_NOR_RWW BIT(9) > +#define SPI_NOR_DEPRECATED BIT(15) If you do agree with my suggestion of making it permanent, would it make more sense to make it BIT(10) instead. Or BIT(9) once you move up the others because we no longer have BIT(7). > > u8 no_sfdp_flags; > #define SPI_NOR_SKIP_SFDP BIT(0) -- Regards, Pratyush Yadav