mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Linus Walleij <linusw@kernel.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH] gpio: shared: call gpio_chip::of_xlate() if set
Date: Tue, 17 Mar 2026 22:46:55 +0000	[thread overview]
Message-ID: <6ea1e467-b0d0-4ec7-90b5-740ca2415460@nvidia.com> (raw)
In-Reply-To: <CAMRc=McMCMuyB7ETefXaWJ6K=-nPcDHo964WZKtPRU9XVVky_w@mail.gmail.com>


On 17/03/2026 15:19, Bartosz Golaszewski wrote:
> On Tue, Mar 17, 2026 at 3:05 PM Bartosz Golaszewski <brgl@kernel.org> wrote:
>>
>> On Tue, Mar 17, 2026 at 2:47 PM Jon Hunter <jonathanh@nvidia.com> wrote:
>>>
>>>
>>>>> I am not sure if this is because these are child nodes of gpio-keys?
>>>>> Obviously this is not a proper example, but something quick and dirty
>>>>> for local testing :-)
>>>>>
>>>>
>>>> Let me create a setup with GPIO keys then.
>>>
>>> Thanks!
>>> Jon
>>>
>>
>> I can reproduce this with a gpio-keys setup. I think you hit an
>> interesting corner-case where the consumer device is the same for two
>> shared pins assigned to its child fwnodes. The setup doesn't make
>> sense really but I guess this shouldn't just fail like that.
>>
> 
> So the problem goes like this: we're using lookup tables for shared
> GPIOs but they are not capable of dealing with two fwnodes that are
> children of the same device that share the same pin but are themselves
> not attached to a device bound to a driver. While we could extend
> lookup tables to take that into account, I think that the setup here
> is so hypothetical, it doesn't really make sense to spend time on it.

Makes sense.

> Does this patch fix the real problem on the tegra board that you
> reported initially? I doubt two separate GPIO keys, share the same pin
> in real life.

Yes it fixes the initial issue. However, now I am seeing a different
error on the actual platform that is having the issue to begin with ...

  ------------[ cut here ]------------
  WARNING: kernel/rcu/srcutree.c:757 at cleanup_srcu_struct+0xc0/0x1e0, CPU#2: kworker/u49:1/114
  Modules linked in:
  CPU: 2 UID: 0 PID: 114 Comm: kworker/u49:1 Not tainted 6.19.0-tegra #1 PREEMPT
  Hardware name: NVIDIA NVIDIA Jetson AGX Orin Developer Kit/Jetson, BIOS buildbrain-gcid-44496888 03/15/2026
  Workqueue: events_unbound deferred_probe_work_func
  pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
  pc : cleanup_srcu_struct+0xc0/0x1e0
  lr : cleanup_srcu_struct+0xb4/0x1e0
  sp : ffff800081cbb930
  x29: ffff800081cbb930 x28: ffffd79ff96d0c40 x27: ffff000086059000
  x26: 00000000fffffff0 x25: ffff000086571200 x24: ffffd79ff94adb10
  x23: ffffd79ff86400c0 x22: ffff000086059390 x21: ffffd79ff94aa040
  x20: 0000000000000000 x19: fffffdffbf669d40 x18: 00000000ffffffff
  x17: 0000000000000000 x16: ffffd79ff62dc8a0 x15: 0081cf5fe0409838
  x14: 0000000000000000 x13: 0000000000000272 x12: 0000000000000000
  x11: 00000000000000c0 x10: f7c5d06d757a4b3a x9 : 15ccf89dfeffb5e1
  x8 : ffff800081cbb8c8 x7 : 0000000000000000 x6 : 000000000151e960
  x5 : 0800000000000000 x4 : 0000000000000000 x3 : 0000000000000000
  x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000004
  Call trace:
   cleanup_srcu_struct+0xc0/0x1e0 (P)
   gpiochip_add_data_with_key+0x3dc/0xf68
   devm_gpiochip_add_data_with_key+0x30/0x84
   tegra186_gpio_probe+0x5e4/0x808
   platform_probe+0x5c/0xb0
   really_probe+0xbc/0x2b4
   __driver_probe_device+0x78/0x134
   driver_probe_device+0x3c/0x164
   __device_attach_driver+0xc8/0x15c
   bus_for_each_drv+0x88/0x100
   __device_attach+0xa0/0x198
   device_initial_probe+0x58/0x5c
   bus_probe_device+0x38/0xbc
   deferred_probe_work_func+0x88/0xc8
   process_one_work+0x16c/0x3fc
   worker_thread+0x2d8/0x3ec
   kthread+0x144/0x22c
   ret_from_fork+0x10/0x20
  ---[ end trace 0000000000000000 ]---
  gpiochip_add_data_with_key: GPIOs 512..675 (tegra234-gpio) failed to register, -16
  tegra186-gpio 2200000.gpio: probe with driver tegra186-gpio failed with error -16

Note this is on top of a Linux v6.19 kernel I was using to track down the
original problem.

Looking at the above there appears to be two other issues; one the warning from
SRCU and the other an -EBUSY failure when registering the GPIO controller. I am
guessing the warning is triggered when gpiochip_add_data_with_key fails. I need
to look at this closer.

Jon

-- 
nvpublic


  reply	other threads:[~2026-03-17 22:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 13:52 Bartosz Golaszewski
2026-03-17  8:47 ` Linus Walleij
2026-03-17 10:12 ` Jon Hunter
2026-03-17 11:44   ` Bartosz Golaszewski
2026-03-17 12:53     ` Jon Hunter
2026-03-17 13:43       ` Bartosz Golaszewski
2026-03-17 13:46         ` Jon Hunter
2026-03-17 14:05           ` Bartosz Golaszewski
2026-03-17 15:19             ` Bartosz Golaszewski
2026-03-17 22:46               ` Jon Hunter [this message]
2026-03-18  8:09                 ` Bartosz Golaszewski
2026-03-18 19:09                   ` Jon Hunter
2026-03-19  9:41                     ` Bartosz Golaszewski
2026-03-20  4:49                       ` Tzung-Bi Shih
2026-03-20 11:46                         ` Jon Hunter
2026-03-27 13:05   ` Konrad Dybcio
2026-03-17 12:53 ` Jon Hunter
2026-03-17 13:44   ` 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=6ea1e467-b0d0-4ec7-90b5-740ca2415460@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    /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®