[Letux-kernel] as5013 is crying

H. Nikolaus Schaller hns at goldelico.com
Mon Dec 10 20:57:43 CET 2018


Hi,

> Am 10.12.2018 um 20:21 schrieb Andreas Kemnade <andreas at kemnade.info>:
> 
> Hi,
> 
> On Fri, 30 Nov 2018 21:13:34 +0100
> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> 
> 
>> The real error seems to be:
>> 
>>> BUG: sleeping function called from invalid context at /home/andi/gta04/pyra-kernel/kernel/locking/mutex.c:908
>>> in_atomic(): 1, irqs_disabled(): 0, pid: 1318, name: udevd
>>> #0: (ptrval) (&dev->mutex){....}, at: __driver_attach+0x7c/0xd0
>> 
>> 
>> No idea why this happens... IMHO it is safe to use mutex during probe. Isn't it?
>> 
> You just have forgotten the real interesting line.
> 
>> [    9.208456] Preemption disabled at:
>> [    9.208468] [<c084e824>] __radix_tree_preload.constprop.7+0x10/0xe8

Ah, yes. I thought it is a follow-up.

> So the reason is the radix tree here. We are only allowed to handle the
> mutex outside/around of the radix tree operations not between them. So
> probably before the idr_preload() the mutex would be fine.

Well, I have no idea what idr_preload() is doing :)

But mutex and radix tree reminds me of missing mutex around radix tree we
did have recently. In the pinmux framework...

So we should fix it - even if it is not easy to reproduce this bug.

Is it sufficient to place idr_preload() and idr_preload_end() inside
the mutex? Or do we need the mutex even earlier?

Do you provide a patch that I can include in letux-4.20-rc6?
Or should I do that?

BR,
Nikolaus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20181210/0da36720/attachment.asc>


More information about the Letux-kernel mailing list