lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=MdXXNaMVK5q+yNSZcLjjoQLwPmDnMW90gGK+uk77F+3ZQ@mail.gmail.com>
Date: Wed, 26 Nov 2025 15:38:53 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Bjorn Andersson <andersson@...nel.org>
Cc: Linus Walleij <linus.walleij@...aro.org>, Srinivas Kandagatla <srini@...nel.org>, 
	linux-arm-msm@...r.kernel.org, linux-gpio@...r.kernel.org, 
	linux-kernel@...r.kernel.org, 
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>, stable@...r.kernel.org, 
	Val Packett <val@...kett.cool>
Subject: Re: [PATCH] pinctrl: qcom: lpass-lpi: mark the GPIO controller as sleeping

On Wed, Nov 26, 2025 at 3:35 PM Bjorn Andersson <andersson@...nel.org> wrote:
>
> On Wed, Nov 26, 2025 at 01:22:19PM +0100, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> >
> > The gpio_chip settings in this driver say the controller can't sleep
> > but it actually uses a mutex for synchronization. This triggers the
> > following BUG():
> >
> > [    9.233659] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:281
> > [    9.233665] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 554, name: (udev-worker)
> > [    9.233669] preempt_count: 1, expected: 0
> > [    9.233673] RCU nest depth: 0, expected: 0
> > [    9.233688] Tainted: [W]=WARN
> > [    9.233690] Hardware name: Dell Inc. Latitude 7455/0FK7MX, BIOS 2.10.1 05/20/2025
> > [    9.233694] Call trace:
> > [    9.233696]  show_stack+0x24/0x38 (C)
> > [    9.233709]  dump_stack_lvl+0x40/0x88
> > [    9.233716]  dump_stack+0x18/0x24
> > [    9.233722]  __might_resched+0x148/0x160
> > [    9.233731]  __might_sleep+0x38/0x98
> > [    9.233736]  mutex_lock+0x30/0xd8
>
> As far as I can see, this mutex only protects mmio accesses.
>
> Is it preferable to mark the gpio chip can_sleep over replacing the
> mutex with a non-sleep lock?
>

I'd say let's do this as a fix and convert the driver to non-sleeping
with a spinlock next cycle?

Bart

> >
> > Mark the controller as sleeping.
> >
> > Fixes: 6e261d1090d6 ("pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver")
> > Cc: stable@...r.kernel.org
> > Reported-by: Val Packett <val@...kett.cool>
> > Closes: https://lore.kernel.org/all/98c0f185-b0e0-49ea-896c-f3972dd011ca@packett.cool/
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
>
> If we stick to the mutex, the patch LGTM
>
> Reviewed-by: Bjorn Andersson <andersson@...nel.org>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ