2008-07-01 17:48:18

by Jürgen Mell

[permalink] [raw]
Subject: BUG messages with real-time kernel 2.6.25.8-rt7

I am getting this bug message from a real-time kernel 2.6.25.8-rt7:

Jul 1 07:58:30 cwc-003 kernel: BUG: sleeping function called from invalid
context IRQ-15(416) at arch/x86/mm/highmem_32.c:8
Jul 1 07:58:30 cwc-003 kernel: in_atomic():0 [00000000], irqs_disabled():1
Jul 1 07:58:30 cwc-003 kernel: Pid: 416, comm: IRQ-15 Not tainted
2.6.25.8-rt7-hws #2
Jul 1 07:58:30 cwc-003 kernel: [<c01125f5>] kmap+0x44/0x54
Jul 1 07:58:30 cwc-003 kernel: [<f88507fd>] ata_hsm_move+0x3d5/0x666
[libata]
Jul 1 07:58:30 cwc-003 kernel: [<f8854d8f>] ata_interrupt+0x14c/0x1cf
[libata]
Jul 1 07:58:30 cwc-003 kernel: [<c01418a6>] handle_IRQ_event+0x3f/0xad
Jul 1 07:58:30 cwc-003 kernel: [<c0141fad>] do_irqd+0x0/0x280
Jul 1 07:58:30 cwc-003 kernel: [<c0141c92>] thread_simple_irq+0x56/0x8f
Jul 1 07:58:30 cwc-003 kernel: [<c0141fad>] do_irqd+0x0/0x280
Jul 1 07:58:30 cwc-003 kernel: [<c014205b>] do_irqd+0xae/0x280
Jul 1 07:58:30 cwc-003 kernel: [<c0141fad>] do_irqd+0x0/0x280
Jul 1 07:58:30 cwc-003 kernel: [<c01283a6>] kthread+0x36/0x5c
Jul 1 07:58:30 cwc-003 kernel: [<c0128370>] kthread+0x0/0x5c
Jul 1 07:58:30 cwc-003 kernel: [<c010443f>] kernel_thread_helper+0x7/0x10
Jul 1 07:58:30 cwc-003 kernel: =======================

This message comes always up once after the system is started.

If a DVD is in the drive, the same message will be repeated over and over
several times per second.

The system is an openSUSE 10.3 with the modifed kernel, KDE3 and all the
fancy auto-mounting stuff. The kernel is not compiled for SMP (that gave
other errors which were already discussed on LKML).

Hardware is a Pentium M processor on an industrial PC board with Intel
chipset and integrated graphics.

Any ideas how to fix this? If you need any more information or if I can
test something, please let me know.

Bye,
J?rgen


2008-07-01 19:40:56

by Steven Rostedt

[permalink] [raw]
Subject: Re: BUG messages with real-time kernel 2.6.25.8-rt7


On Tue, 1 Jul 2008, J?rgen Mell wrote:

>
> I am getting this bug message from a real-time kernel 2.6.25.8-rt7:
>
> Jul 1 07:58:30 cwc-003 kernel: BUG: sleeping function called from invalid
> context IRQ-15(416) at arch/x86/mm/highmem_32.c:8
> Jul 1 07:58:30 cwc-003 kernel: in_atomic():0 [00000000], irqs_disabled():1
> Jul 1 07:58:30 cwc-003 kernel: Pid: 416, comm: IRQ-15 Not tainted
> 2.6.25.8-rt7-hws #2
> Jul 1 07:58:30 cwc-003 kernel: [<c01125f5>] kmap+0x44/0x54
> Jul 1 07:58:30 cwc-003 kernel: [<f88507fd>] ata_hsm_move+0x3d5/0x666

[...]

>
> Any ideas how to fix this? If you need any more information or if I can
> test something, please let me know.

I found the problem. In PREEMPT_RT we define kmap_atomic to kmap since we
don't disable interrutps with spin_lock_irqsave nor do we disable
preemption.

In drivers/ata/libata-core.c we have:


/* FIXME: use bounce buffer */
local_irq_save(flags);
buf = kmap_atomic(page, KM_IRQ0);


But PREEMPT_RT even kmap_atomic will call "might_sleep". So the fix here
is for us to get rid of the local_irq_save. Perhaps simply add a
spin_lock_irqsave(local_lock) here.

Thanks for the report.

-- Steve