mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
To: Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Subject: [PATCH 1/2] gpio: don't process hogs on disabled nodes
Date: Tue, 09 Jun 2026 14:17:49 +0200	[thread overview]
Message-ID: <20260609-gpio-hogs-fixes-v1-1-b4064f8070e7@oss.qualcomm.com> (raw)
In-Reply-To: <20260609-gpio-hogs-fixes-v1-0-b4064f8070e7@oss.qualcomm.com>

The core hogging logic uses device_for_each_child_node_scoped(), which
iterates over all child firmware nodes without checking their
availability. Before the code was moved to the GPIO core, it correctly
used for_each_available_child_of_node_scoped() to skip disabled nodes.
Check if the node is available and skip it if not.

Closes: https://sashiko.dev/#/patchset/20260608210108.36248-1-dan%40reactivated.net
Fixes: d1d564ec4992 ("gpio: move hogs into GPIO core")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/gpio/gpiolib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 7bb6f114d64d9ce3eb930f1d79d0224bf7920c37..1fc7ee9e1158d21f7c75e6cb95c33f0af44835c8 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1052,7 +1052,8 @@ static int gpiochip_hog_lines(struct gpio_chip *gc)
 	int ret;
 
 	device_for_each_child_node_scoped(&gc->gpiodev->dev, fwnode) {
-		if (!fwnode_property_present(fwnode, "gpio-hog"))
+		if (!fwnode_device_is_available(fwnode) ||
+		    !fwnode_property_present(fwnode, "gpio-hog"))
 			continue;
 
 		ret = gpiochip_add_hog(gc, fwnode);

-- 
2.47.3


  reply	other threads:[~2026-06-09 12:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 12:17 [PATCH 0/2] gpio: fix regressions in GPIO hogs after the code refactoring Bartosz Golaszewski
2026-06-09 12:17 ` Bartosz Golaszewski [this message]
2026-06-09 14:16   ` [PATCH 1/2] gpio: don't process hogs on disabled nodes Andy Shevchenko
2026-06-09 14:33     ` Bartosz Golaszewski
2026-06-09 12:17 ` [PATCH 2/2] gpio: fix cleanup path on hog failure Bartosz Golaszewski
2026-06-09 14:25   ` Andy Shevchenko
2026-06-09 14:33     ` Bartosz Golaszewski
2026-06-09 14:50       ` Andy Shevchenko
2026-06-09 12:47 ` [PATCH 0/2] gpio: fix regressions in GPIO hogs after the code refactoring Mika Westerberg
2026-06-10  7:30 ` (subset) " Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260609-gpio-hogs-fixes-v1-1-b4064f8070e7@oss.qualcomm.com \
    --to=bartosz.golaszewski@oss.qualcomm.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brgl@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®