From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f67.google.com (mail-dl1-f67.google.com [74.125.82.67]) (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 1FA8C2F744C for ; Wed, 18 Feb 2026 17:15:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.67 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771434935; cv=none; b=rGFDcdJ+OyBgOC/eGwwxGNCXk1APZW0PUIatIIAsDSPoRcPQkA3U/vaz9lsrtA85ItZj/vqIym2D8Bco2nr2Zo025o7VwngMefUh7WZVazKxOMwmrQnhoptf8DeaQt9wW4tOIt7dXedCQ0+B5FHjxXmN6oK6+KFt6jdxFdz0zNY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771434935; c=relaxed/simple; bh=Q9ooPQVTGTcVJezfW6R+eFguPYeeOCmuofwhzMEcloE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jjsGkvObX8U/GQG3xqknamc0o3+58TsDf0VopoTC79vaXEZ546hlCC5IU6+0TYLgrmn0OiUA+8mx7oc0lY698eIMPscc3LorcjfcgqPq948r2/m/stofk0LKFmRpNhM4g48pe3YVHdBPNGGdlzt8e8s+iZWDrs2X3owGT0PiHm0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A4g8Qx9R; arc=none smtp.client-ip=74.125.82.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A4g8Qx9R" Received: by mail-dl1-f67.google.com with SMTP id a92af1059eb24-1275750cf9cso1325018c88.0 for ; Wed, 18 Feb 2026 09:15:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771434933; x=1772039733; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=wIZQJcadFJwIiNdmilqedpFYEso+tQwK1rGzbwDAdbY=; b=A4g8Qx9RHBdDCRZPnmspn153wPXv/iwgGb9oWxb/dbrKzEZrt5NcSBFKWtOrdSSX9b 3xefLpNJfZW37VIhvrnwJ19AoDRRnIBwAhLW0jUz3liS2CPTw0p3wMHaSW+plpbENmxT bmImBV0NkWBfV9wSEhXE05Phq9e++/x9AoAbYKIhGXXNcaV/cwjLe5MjKPs0f+3hxDzs lwUccqVlwjAkjlxjyVKU0lGDtiu21K9OlUmU5CD4Z6p0V4IO+xYB8wnuD6w1gSqlAg3h wAqGRtxrmez6c7AG1dbIhG5xnddg3XfYstdc8B2eMlx52Yzl70p5/f9ggkDFz1PTlR8k 0b8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771434933; x=1772039733; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wIZQJcadFJwIiNdmilqedpFYEso+tQwK1rGzbwDAdbY=; b=mUkNwO3DvqBMHNcMBjjQFKHcmBiCuIrsWfqmESYDsMf1b7YPs14wWS0dflFRee7WMm 8rTYTbq2/UaN4QHVIO2JE6VhSUcn/m8erJ4p617xEOstD4/WEaouYNEJXlTpQPeBzJ9n /J+mv3Kf8lnNAg5e1p/ESguh79IYZ9wNeapcNA4iy0BfYOZw2Hho4zLiA9M7PfmPGBnG 4AN/ShtE99KDyUbMghqQzrCo4y5aRf+oMr8CzHw9Lh53z023Asn8/KrKU5/QysrhFqMt uVSnvy6uEzJAZM4oKcAQWnzzdbIn9hXD51E8A1Vf8086TV8KOZWqrlxqMRenMTFU6pc+ ii2Q== X-Forwarded-Encrypted: i=1; AJvYcCVtoFDnfup8RYD+h3uwrFOtB64G5t3Gr5XsrUyyLI4E/twDTDUJRCpwpMi9N4JJSCsuLcr1BVwFUNXU3rY=@vger.kernel.org X-Gm-Message-State: AOJu0YyELJk6anMJjV+qeiKQrjPUT5CbFznpOnJD4BUz4XlF+uKdC7AB I89Oj9YoIwzy5EEIxB1IqJMOwjbKHW8c6nxU8UYYvq7rGXHfCAu+8Dh3 X-Gm-Gg: AZuq6aJjhltQ4VPCM1NnigGfeWiX3RCl1xTA0Hl7BH8080PUr9RxiARTYN2jHtScHJf 9e3D+b/gDd9CO8rwI3u4Q9WlBFpBfgQXfwVCgOZigVYCucNlseWIm8e+QH3jI4VxAqZnZd9knSI IKGteuIfPL+lFe4KWaot4ROK97nGQcvzcbSdmyInIRZr8cdrI7rzIb+ANzet5wrHWnV29d1Z1vI ga0y8Yl2i85E+momQ6BFQW3hT69LeL/y6in2nAqMP5HsqK7Ty/D7Ejkz1G7ghN8nUQ2po9CAEET TTYB7fISLvsNZ8Wd6MnJReG53DpUiPLJC1bkDduxShhwKO5vIoy/h8PDi259OGuajsYgEcDCIHj ocSduUggbWpHPcVxktjM6zMHl+v7445UaMnEPS8sufK1QHtwZbcP95n1EbmXklXQxEZLDds5E3F a6ktiu+d3mjrhQnI6YoxepJx5W4BxLwipc4tfzUvtv/KHpLGr53H5WNb3s/BXTi9HU X-Received: by 2002:a05:7022:60b:b0:11b:9386:a37d with SMTP id a92af1059eb24-127398466d9mr5205084c88.44.1771434932895; Wed, 18 Feb 2026 09:15:32 -0800 (PST) Received: from google.com ([2a00:79e0:2ebe:8:265b:f5ad:9e03:677e]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2bacb5622f2sm22285550eec.10.2026.02.18.09.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Feb 2026 09:15:32 -0800 (PST) Date: Wed, 18 Feb 2026 09:15:29 -0800 From: Dmitry Torokhov To: Bartosz Golaszewski Cc: Bartosz Golaszewski , Linus Walleij , Andy Shevchenko , Greg Kroah-Hartman , Arnd Bergmann , Hans de Goede , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Dan Carpenter , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] gpio: swnode: restore the swnode-name-against-chip-label matching Message-ID: References: <20260211085313.16792-1-bartosz.golaszewski@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Feb 18, 2026 at 09:42:28AM +0100, Bartosz Golaszewski wrote: > On Wed, Feb 18, 2026 at 1:31 AM Dmitry Torokhov > wrote: > > > > On Wed, Feb 11, 2026 at 09:53:13AM +0100, Bartosz Golaszewski wrote: > > > Using the remote firmware node for software node lookup is the right > > > thing to do. The GPIO controller we want to resolve should have the > > > software node we scooped out of the reference attached to it. However, > > > there are existing users who abuse the software node API by creating > > > dummy swnodes whose name is set to the expected label string of the GPIO > > > controller whose pins they want to control and use them in their local > > > swnode references as GPIO properties. > > > > > > This used to work when we compared the software node's name to the > > > chip's label. When we switched to using a real fwnode lookup, these > > > users broke down because the firmware nodes in question were never > > > attached to the controllers they were looking for. > > > > > > Restore the label matching as a fallback to fix the broken users but add > > > a big FIXME urging for a better solution. > > > > > > Cc: stable@vger.kernel.org # v6.18, v6.19 > > > Fixes: 216c12047571 ("gpio: swnode: allow referencing GPIO chips by firmware nodes") > > > Link: https://lore.kernel.org/all/aYkdKfP5fg6iywgr@jekhomev/ > > > Acked-by: Andy Shevchenko > > > Signed-off-by: Bartosz Golaszewski > > > --- > > > Changes in v2: > > > - check if gdev_node and gdev_node->name are not NULL before trying to > > > match the label (Hans & Dan) > > > - use the right link > > > - collect tags > > > > > > drivers/gpio/gpiolib-swnode.c | 19 +++++++++++++++++++ > > > 1 file changed, 19 insertions(+) > > > > > > diff --git a/drivers/gpio/gpiolib-swnode.c b/drivers/gpio/gpiolib-swnode.c > > > index 21478b45c127d..0d7f3f09a0b4b 100644 > > > --- a/drivers/gpio/gpiolib-swnode.c > > > +++ b/drivers/gpio/gpiolib-swnode.c > > > @@ -42,6 +42,25 @@ static struct gpio_device *swnode_get_gpio_device(struct fwnode_handle *fwnode) > > > > > > fwnode_lookup: > > > gdev = gpio_device_find_by_fwnode(fwnode); > > > > By the way, should we extend gpio_device_find_by_fwnode() to use both > > primary and secondary nodes? > > > > That's already done on a higher lever for all fwnodes in gpiod_fwnode_lookup(). How exactly? I am not talking about checking secondary node for the fwnode that is used in the reference, I am talking about secondary fwnode that might be assigned to the gpio chip and you need to check both primary and secondary if they match with the fwnode that you call gpio_device_find_by_fwnode() with. Thanks. -- Dmitry