Re: gpiod_set_value(): BUG: sleeping function called from invalid context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Dec 5, 2021 at 11:45 AM Hans Verkuil <hverkuil@xxxxxxxxx> wrote:

> Any idea why this hasn't been seen/reported before? According to git blame
> that mutex_lock has been there since 2013. Does nobody test with
> CONFIG_DEBUG_ATOMIC_SLEEP? Am I really the first to encounter this?
>
> Before spending time on this I'd like to be sure that, yes, I'm really the
> first in 8 years to see this, and this wasn't introduced by something else.

Probably because people don't CONFIG_DEBUG_ATOMIC_SLEEP
so much and then it will also work fine unless they have a GPIO
that is backed by a pin control driver, because it's only then that
you have to go and dereference ranges.

There are lots of GPIO drivers not backed by pin control drivers.

Already at two variables the test matrix is big enough that people
don't really get there to test it...

> > If it still need to be sleepable (mutex-ish) you need to convert it to
> > use RCU I think? (Which would be pretty cool anyway.)
>
> RCU seems like a reasonable alternative, but I will have to read up on it
> since it's the first time I'll be using this. All those quizzes in the RCU
> docs (1) scare the hell out of me :-)

Don't say this to Paul McKenney he is very invested in the quizzes,
haha. I think this comes from authors such as Donald Knuth who use
them as educational tools.

Yours,
Linus Walleij



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux