Hi,

On 28-06-15 21:09, [email protected] wrote:
Hello all,
I'm trying to have a minimally functional mainline RT_PREEMPT_FULL on a 
olinuxino-A10-lime. Unfortunately there is an issue with the mmc driver. (The 
crash dump is at bottom). The driver seems to work in the RT_PREEMPT_BASE mode. 
I've very little knowledge of kernel internals, but after some search and tests 
I've understood that the problem arises because the mmc_request_done call 
(which eventually ends up with a re-schedule) is made from interrupt context, 
instead of from a threaded context. In the linux-sunxi kernel, in fact, a 
tasklet is used. In the mainline, on top of the sunxi_mmc_finalize_request 
there's a comment:
* Called in interrupt context! */
that makes me think of some issues related to interrupt/non interrupt context.
What is the relation between mainline driver and linux-sunxi one? Who is the 
person who wrote the mainline driver? Even without the RT_PREEMPT_FULL, 
shouln't be the bottom-half run on a threaded context, to avoid latencies?
Any idea on how to solve the problem, even in un unclean manner?
Thank you!

AFAIK it should be legal to call wake_up from any context,
and this is what the mainline sunxi-mmc driver assumes.

Apparently this is not the case with RT_PREEMPT_FULL ?

Can you please contact the rt patchset maintainers and ask
them for some guidance here? I'm fine with fixing this, but first
it needs to be clear what exactly needs to be fixed.

Regards,

Hans







Kernel with default sunxi configuration and RT Patch patch-4.0.5-rt4.patch

4.191698] BUG: scheduling while atomic: mountkernfs.sh/94/0x00010001
[    4.191710] CPU: 0 PID: 94 Comm: mountkernfs.sh Not tainted 4.0.5-rt4 #2
[    4.191713] Hardware name: Allwinner A1X (Device Tree)
[    4.191751] [<c0013630>] (unwind_backtrace) from [<c00110a4>] 
(show_stack+0x10/0x14)
[    4.191765] [<c00110a4>] (show_stack) from [<c039ecd4>] 
(dump_stack+0x80/0xd8)
[    4.191775] [<c039ecd4>] (dump_stack) from [<c039c778>] 
(__schedule_bug+0x44/0x5c)
[    4.191785] [<c039c778>] (__schedule_bug) from [<c039f9e8>] 
(__schedule+0x388/0x424)
[    4.191793] [<c039f9e8>] (__schedule) from [<c039fb1c>] (schedule+0x40/0xdc)
[    4.191803] [<c039fb1c>] (schedule) from [<c03a0f30>] 
(rt_spin_lock_slowlock+0x178/0x2cc)
[    4.191814] [<c03a0f30>] (rt_spin_lock_slowlock) from [<c004e620>] 
(__wake_up+0x24/0x50)
[    4.191829] [<c004e620>] (__wake_up) from [<c02bb62c>] 
(mmc_request_done+0x44/0x88)
[    4.191846] [<c02bb62c>] (mmc_request_done) from [<c02cd45c>] 
(sunxi_mmc_irq+0x4e4/0x520)
[    4.191863] [<c02cd45c>] (sunxi_mmc_irq) from [<c0055d8c>] 
(handle_irq_event_percpu+0x60/0x14c)
[    4.191875] [<c0055d8c>] (handle_irq_event_percpu) from [<c0055ef0>] 
(handle_irq_event+0x78/0xac)
[    4.191885] [<c0055ef0>] (handle_irq_event) from [<c0058dec>] 
(handle_fasteoi_irq+0xa8/0x224)
[    4.191895] [<c0058dec>] (handle_fasteoi_irq) from [<c00556d4>] 
(generic_handle_irq+0x20/0x30)
[    4.191906] [<c00556d4>] (generic_handle_irq) from [<c0055738>] 
(__handle_domain_irq+0x54/0xb4)
[    4.191915] [<c0055738>] (__handle_domain_irq) from [<c0008620>] 
(sun4i_handle_irq+0x44/0x60)
[    4.191925] [<c0008620>] (sun4i_handle_irq) from [<c0011c00>] 
(__irq_svc+0x40/0x88)
[    4.191930] Exception stack(0xde81bda8 to 0xde81bdf0)
[    4.191938] bda0:                   df8c8b40 df89cb50 00000009 ffffffff 
00000000 df8c8000
[    4.191946] bdc0: b6fd1000 dffeb900 de828744 c04d02c4 0005f89c c0522180 
b6fcfef8 de81bdf0
[    4.191951] bde0: 00000000 c01dbbfc 20000113 ffffffff
[    4.191965] [<c0011c00>] (__irq_svc) from [<c01dbbfc>] (copy_page+0x3c/0x80)
[    4.192809] ------------[ cut here ]------------
[    4.192831] WARNING: CPU: 0 PID: 94 at kernel/irq/handle.c:149 
handle_irq_event_percpu+0x128/0x14c()
[    4.192841] irq 19 handler sunxi_mmc_irq+0x0/0x520 enabled interrupts
[    4.192851] CPU: 0 PID: 94 Comm: mountkernfs.sh Tainted: G        W       
4.0.5-rt4 #2
[    4.192853] Hardware name: Allwinner A1X (Device Tree)
[    4.192869] [<c0013630>] (unwind_backtrace) from [<c00110a4>] 
(show_stack+0x10/0x14)
[    4.192879] [<c00110a4>] (show_stack) from [<c039ecd4>] 
(dump_stack+0x80/0xd8)
[    4.192894] [<c039ecd4>] (dump_stack) from [<c00201e4>] 
(warn_slowpath_common+0x70/0xac)
[    4.192904] [<c00201e4>] (warn_slowpath_common) from [<c002027c>] 
(warn_slowpath_fmt+0x30/0x40)
[    4.192915] [<c002027c>] (warn_slowpath_fmt) from [<c0055e54>] 
(handle_irq_event_percpu+0x128/0x14c)
[    4.192926] [<c0055e54>] (handle_irq_event_percpu) from [<c0055ef0>] 
(handle_irq_event+0x78/0xac)
[    4.192937] [<c0055ef0>] (handle_irq_event) from [<c0058dec>] 
(handle_fasteoi_irq+0xa8/0x224)
[    4.192946] [<c0058dec>] (handle_fasteoi_irq) from [<c00556d4>] 
(generic_handle_irq+0x20/0x30)
[    4.192957] [<c00556d4>] (generic_handle_irq) from [<c0055738>] 
(__handle_domain_irq+0x54/0xb4)
[    4.192966] [<c0055738>] (__handle_domain_irq) from [<c0008620>] 
(sun4i_handle_irq+0x44/0x60)
[    4.192976] [<c0008620>] (sun4i_handle_irq) from [<c0011c00>] 
(__irq_svc+0x40/0x88)
[    4.192980] Exception stack(0xde81bda8 to 0xde81bdf0)
[    4.192987] bda0:                   df8c8b40 df89cb50 00000009 ffffffff 
00000000 df8c8000
[    4.192995] bdc0: b6fd1000 dffeb900 de828744 c04d02c4 0005f89c c0522180 
b6fcfef8 de81bdf0
[    4.193000] bde0: 00000000 c01dbbfc 20000113 ffffffff
[    4.193011] [<c0011c00>] (__irq_svc) from [<c01dbbfc>] (copy_page+0x3c/0x80)
[    4.193015] ---[ end trace 0000000000000002 ]---
[    4.224639] ------------[ cut here ]------------


--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to