On Tue, Aug 23, 2005 at 10:07:02AM -0400, Bryan Althouse wrote: > I have added a compact flash disk onto the local bus of an rm9224 mips > processor. We are using an FPGA as an IDE host adaptor. Our driver works > great when the kernel is compiled for a single processor. But if SMP > support is enabled, the kernel dies with: > . > Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 > Ide: Assuming 50MHz system bus speed for PIO modes; override with > idebuss=xx > Badness in smp_call_function at arch/mips/kernel/smp.c:149 That's just a rather drastically looking warning, btw. > Call Trace: > [<ffffffff8010aff8>] smp_call_function+0x1f8/0x200 > [<ffffffff8032adb0>] schedule+0x950/0xa08 > [<ffffffff8010b9f8>] local_rm9k_perfcounter_irq_startup+0x0/0x68 > [<ffffffff8010baa8>] rm9k_perfcounter_irq_startup+0x48/0x68 > [<ffffffff801658b8>] probe_irq_on+0x2b8/0x2e8 > [<ffffffff80146c00>] del_singleshot_timer_sync+0x38/0x50 > [<ffffffff8028e510>] try_to_identify+0x180/0x190 > [<ffffffff80147d88>] process_timeout+0x0/0x8 > [<ffffffff8028e66c>] do_probe+0x14c/0x338 > [<ffffffff8028e57c>] do_probe+0x5c/0x338 > [<ffffffff8028ec40>] wait_hwif_ready+0x178/0x180 > [<ffffffff8028f230>] probe_hwif+0x508/0x6e8 > [<ffffffff8028eec8>] probe_hwif+0x1a0/0x6e8 > [<ffffffff8028f42c>] probe_hwif_init_with_fixup+0x1c/0xe8 > [<ffffffff8029435c>] ide_3P_init+0xb4/0x118 > [<ffffffff80294324>] ide_3P_init+0x7c/0x118 > [<ffffffff8023d100>] idr_get_new+0x18/0x50 > etc. > > Does anyone know what sort of bug could cause problems with SMP, but would > work fine otherwise? I could supply my driver code if anyone is interested. > Thanks! Your driver is probably fine. The problem is that doing PIO may result in cache aliases and that requires a cache flush. Normally that's not terribly hard to do - but in your case an SMP cacheflush is needed which in turn requires smp_call_function to be used and that one again may deadlock if called with interrupts disabled. See also include/asm-mips/mach-generic/ide.h. So until we have a better implementation I suggest try to avoid the use of ide_inb() etc. with interrupts disabled. Ralf