mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Jon Hunter <jonathanh@nvidia.com>,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Abel Vesa <abel.vesa@oss.qualcomm.com>,
	Sibi Sankar <sibi.sankar@oss.qualcomm.com>
Cc: 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: Fri, 27 Mar 2026 14:05:08 +0100	[thread overview]
Message-ID: <c6318d9b-c706-4d09-b0c9-3bca35278478@oss.qualcomm.com> (raw)
In-Reply-To: <dff3c797-a619-42c0-9696-3e617e13356e@nvidia.com>

On 3/17/26 11:12 AM, Jon Hunter wrote:
> Hi Bartosz,
> 
> On 16/03/2026 13:52, Bartosz Golaszewski wrote:
>> OF-based GPIO controller drivers may provide a translation function that
>> calculates the real chip offset from whatever devicetree sources
>> provide. We need to take this into account in the shared GPIO management
>> and call of_xlate() if it's provided and adjust the entry->offset we
>> initially set when scanning the tree.
>>
>> To that end: modify the shared GPIO API to take the GPIO chip as
>> argument on setup (to avoid having to rcu_dereference() it from the GPIO
>> device) and protect the access to entry->offset with the existing lock.
>>
>> Fixes: a060b8c511ab ("gpiolib: implement low-level, shared GPIO support")
>> Reported-by: Jon Hunter <jonathanh@nvidia.com>
>> Closes: https://lore.kernel.org/all/921ba8ce-b18e-4a99-966d-c763d22081e2@nvidia.com/
>> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
>> ---

[...]

> Thanks for sending this. However, I am seeing a different issue now ...
> 
>  ------------[ cut here ]------------
>  WARNING: drivers/gpio/gpiolib-shared.c:499 at gpio_shared_add_proxy_lookup+0x118/0x1d8, CPU#8: swapper/0/1

Not only this, this breaks suspend on the Qualcomm X1E CRD (probably all
/most QC devices by extension)

+CC Abel, Sibi in case this is what you've been chasing

with the patch:
[rootfs ]# echo mem > /sys/power/state 
[  226.043580] PM: suspend entry (deep)
[  226.047470] Filesystems sync: 0.000 seconds
[  226.058513] Freezing user space processes
[  226.066296] Freezing user space processes completed (elapsed 0.003 seconds)
[  226.073489] OOM killer disabled.
[  226.076843] Freezing remaining freezable tasks
[  226.082353] Freezing remaining freezable tasks completed (elapsed 0.000 seconds)
(give it some time, it dies)

without the patch:
[rootfs ]# echo mem > /sys/power/state [   38.047570] PM: suspend entry (deep)

[   38.053506] Filesystems sync: 0.001 seconds
[   38.082615] Freezing user space processes
[   38.092528] Freezing user space processes completed (elapsed 0.005 seconds)
[   38.099860] OOM killer disabled.
[   38.103222] Freezing remaining freezable tasks
[   38.110329] Freezing remaining freezable tasks completed (elapsed 0.002 seconds)
[   38.469231] dwc3-qcom-legacy a0f8800.usb: port-1 HS-PHY not in L2
[   38.652848] Disabling non-boot CPUs ...
[   38.668957] IRQ205: set affinity failed(-22).
[   38.669018] IRQ206: set affinity failed(-22).
[   38.669029] IRQ207: set affinity failed(-22).
[   38.670351] IRQ274: set affinity failed(-22).
[   38.671257] psci: CPU11 killed (polled 0 ms)
[   38.712308] IRQ205: set affinity failed(-22).
[   38.712323] IRQ206: set affinity failed(-22).
[   38.712333] IRQ207: set affinity failed(-22).
[   38.713634] IRQ274: set affinity failed(-22).
[   38.713821] psci: CPU10 killed (polled 0 ms)
[   38.754187] IRQ205: set affinity failed(-22).
[   38.754202] IRQ206: set affinity failed(-22).
[   38.756479] psci: CPU9 killed (polled 0 ms)
[   38.789962] psci: CPU8 killed (polled 0 ms)
[   38.803178] psci: CPU7 killed (polled 0 ms)
[   38.816286] psci: CPU6 killed (polled 0 ms)
[   38.828479] psci: CPU5 killed (polled 0 ms)
[   38.847479] psci: CPU4 killed (polled 0 ms)
[   38.873528] psci: CPU3 killed (polled 0 ms)
[   38.894399] psci: CPU2 killed (polled 0 ms)
[   38.905818] psci: CPU1 killed (polled 0 ms)
[   38.912658] Enabling non-boot CPUs ...
(resumes just fine)

Konrad

  parent reply	other threads:[~2026-03-27 13:05 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
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 [this message]
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=c6318d9b-c706-4d09-b0c9-3bca35278478@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=abel.vesa@oss.qualcomm.com \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=sibi.sankar@oss.qualcomm.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®