Message ID | 20231124193814.360552-1-miquel.raynal@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp1484117vqx; Fri, 24 Nov 2023 11:38:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFab35xz8ouWvnxWxl7B50MtekgHJnpFIiAGqdsNltYe2rpuibXASj+5hSkEkfR1I+xY+5I X-Received: by 2002:a05:6a21:a591:b0:18c:138e:f268 with SMTP id gd17-20020a056a21a59100b0018c138ef268mr2582997pzc.21.1700854711586; Fri, 24 Nov 2023 11:38:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700854711; cv=none; d=google.com; s=arc-20160816; b=kJXJuqEYYxzGQmzbvdQETmtAzXJDgCkgvzoWCrSeOOFp80TEo9DWBJKw4gJiZOaU8w /njtQjgTD33jAgWJ+wA1KnHB6DxywruQMK3GivGNABpl1SwXg7ANNmqdNJRZdfM3jbJI 6obWWaNnBmNlVH74bceXep1XPrxYHA0apZeWoR3G2fWadZKQu+y9IFVgzuOT6/CBd/SO 3iPszBmJUHUb+13X9hxwpXjD6+ZmLC5nWdcTqKqaD1sZRuEB72WQOcQTnMaZdoaBDCWp UIl4JEV5tBEbj1cGGKDgmTyvWR/04lJsoBItH7jmZMShiqweSB6kT0DzFe2+0UJXA3xZ +SMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=gK80R0M7dvN1cmSQk+8Hk9wbTsrIf4Z+IhzQHo3PHu8=; fh=xsU+Xu/Cf8P8tsyuTWnMIlvjYcnAN69ACSVN8Boh1Mk=; b=Xw668uIgSp1q3cFgDnB+fBnGhcANemLqrtS2q6jtIBZzRC8whwdXvDk9jyb+G1J457 GXXYcMSgYFtIDmdSTb48BDanq5CZQK8T/leRq7+36/9IFMNgstnInW22zMRBxKbeBlaO I3xLqyM+U8kLJOiw9Jw4CVb+Bsy2dAbZ99dLU/7p6WS8rySsRnWzWF6WlmkV5hayxIdk a1ZSf+hTf97TyRp0M7MAwwurX39fFQyyhsBzBytobSRdsATa/5w453jEaDaeP/3VvH9J lXRRsB+6fWzelPoe5UTXFI7kAB3j6z34DzDj3UwFCh7TihPad1At8a4RQUXIF8QjCAn7 lGrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=T1SM1sus; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h33-20020a632121000000b005c1b323da1bsi4301006pgh.695.2023.11.24.11.38.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 11:38:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=T1SM1sus; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 037E080440E4; Fri, 24 Nov 2023 11:38:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345983AbjKXTiN (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Fri, 24 Nov 2023 14:38:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229557AbjKXTiM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 24 Nov 2023 14:38:12 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1546F98; Fri, 24 Nov 2023 11:38:17 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 75138FF809; Fri, 24 Nov 2023 19:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700854696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=gK80R0M7dvN1cmSQk+8Hk9wbTsrIf4Z+IhzQHo3PHu8=; b=T1SM1suskaIuCwd4kbvQdQEiCDN0oAjSleDEKrXTCILUIxzphNI0zhgJybSIQIrmryz7u6 /YnbjIthrPPA0P0XS/XbSETl0b5bvcraz1J7zgh3OpmKFVws61sAhJyKQC4od1wZ0zKV4a gJ7aRuJowhbUd693yO0AMyFGYvQcUqN6wEoB1METfs1byt7wZAvYW//nGnGXluRlC1OZpm YyNG4yJzmcLh6SCr5qTpsO7AhTckcVJLxpx4hV/2kjm4/ZB9eSf909vqMpK03xTx1xJe64 CbpNxyvWlVIqiP/MSqUVwtp8E/CiUzuOmMynCt+i9twpmHLtcvtBLN1n8FDGHg== From: Miquel Raynal <miquel.raynal@bootlin.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: <linux-kernel@vger.kernel.org>, Michael Walle <michael@walle.cc>, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= <rafal@milecki.pl>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Miquel Raynal <miquel.raynal@bootlin.com>, stable@vger.kernel.org, Luca Ceresoli <luca.ceresoli@bootlin.com> Subject: [PATCH] nvmem: Do not expect fixed layouts to grab a layout driver Date: Fri, 24 Nov 2023 20:38:14 +0100 Message-Id: <20231124193814.360552-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 24 Nov 2023 11:38:28 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783475429793489500 X-GMAIL-MSGID: 1783475429793489500 |
Series |
nvmem: Do not expect fixed layouts to grab a layout driver
|
|
Commit Message
Miquel Raynal
Nov. 24, 2023, 7:38 p.m. UTC
Two series lived in parallel for some time, which led to this situation:
- The nvmem-layout container is used for dynamic layouts
- We now expect fixed layouts to also use the nvmem-layout container but
this does not require any additional driver, the support is built-in the
nvmem core.
Ensure we don't refuse to probe for wrong reasons.
Fixes: 27f699e578b1 ("nvmem: core: add support for fixed cells *layout*")
Cc: stable@vger.kernel.org
Reported-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
Please note this is a temporary fix as this piece of code is going to
disappear when the NVMEM layouts 'as devices' series gets in.
drivers/nvmem/core.c | 6 ++++++
1 file changed, 6 insertions(+)
Comments
On 2023-11-24 20:38, Miquel Raynal wrote: > Two series lived in parallel for some time, which led to this > situation: > - The nvmem-layout container is used for dynamic layouts > - We now expect fixed layouts to also use the nvmem-layout container > but > this does not require any additional driver, the support is built-in > the > nvmem core. > > Ensure we don't refuse to probe for wrong reasons. I pushed a pretty much identical patch to OpenWrt (I just forgot of_node_put()): commit 61f674df4f0c ("kernel: nvmem: fix "fixed-layout" & support "mac-base""): https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=61f674df4f0ce2b1c53b0b7f6b0c1d03d99838c0 It's in use since July and seems to do the trick just fine. Thanks for submitting this fix. > Fixes: 27f699e578b1 ("nvmem: core: add support for fixed cells > *layout*") > Cc: stable@vger.kernel.org > Reported-by: Luca Ceresoli <luca.ceresoli@bootlin.com> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Rafał Miłecki <rafal@milecki.pl>
Hi Miquèl, On Fri, 24 Nov 2023 20:38:14 +0100 Miquel Raynal <miquel.raynal@bootlin.com> wrote: > Two series lived in parallel for some time, which led to this situation: > - The nvmem-layout container is used for dynamic layouts > - We now expect fixed layouts to also use the nvmem-layout container but > this does not require any additional driver, the support is built-in the > nvmem core. > > Ensure we don't refuse to probe for wrong reasons. > > Fixes: 27f699e578b1 ("nvmem: core: add support for fixed cells *layout*") > Cc: stable@vger.kernel.org > Reported-by: Luca Ceresoli <luca.ceresoli@bootlin.com> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> [fixes probing I2C EEPROMs using fixed-layout] Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index bf42b7e826db..608b352a7d91 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -796,6 +796,12 @@ static struct nvmem_layout *nvmem_layout_get(struct nvmem_device *nvmem) if (!layout_np) return NULL; + /* Fixed layouts don't have a matching driver */ + if (of_device_is_compatible(layout_np, "fixed-layout")) { + of_node_put(layout_np); + return NULL; + } + /* * In case the nvmem device was built-in while the layout was built as a * module, we shall manually request the layout driver loading otherwise