Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Bryan Althouse <bryan.althouse@3phoenix.com>
Cc: linux-mips@linux-mips.org
Subject: Re: custom ide driver causes "Badness in smp_call_function"
Date: Wed, 24 Aug 2005 16:24:44 +0100	[thread overview]
Message-ID: <20050824152444.GE2783@linux-mips.org> (raw)
In-Reply-To: <20050823140159Z8225393-3678+7283@linux-mips.org>

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

  parent reply	other threads:[~2005-08-24 15:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-23 14:07 custom ide driver causes "Badness in smp_call_function" Bryan Althouse
2005-08-23 14:07 ` Bryan Althouse
2005-08-24 15:24 ` Ralf Baechle [this message]
2005-08-25 15:26   ` Bryan Althouse
2005-08-25 15:26     ` Bryan Althouse
2005-08-25 15:42     ` Ralf Baechle
2005-08-25 21:17       ` Bryan Althouse
2005-08-25 21:17         ` Bryan Althouse
2005-08-26 14:10         ` Ralf Baechle
2005-08-26 14:58           ` Bryan Althouse
2005-08-26 14:58             ` Bryan Althouse
2005-08-26 15:47             ` Alan Cox
2005-08-26 18:05               ` Bryan Althouse
2005-08-26 18:05                 ` Bryan Althouse
2005-08-26 18:16               ` Bryan Althouse
2005-08-26 18:16                 ` Bryan Althouse
2005-08-26 16:28             ` Ralf Baechle
2005-08-26 16:36               ` Bryan Althouse
2005-08-26 16:36                 ` Bryan Althouse
2005-08-26 16:41                 ` Ralf Baechle
2005-09-01 16:15           ` Bryan Althouse
2005-09-01 16:15             ` Bryan Althouse
2005-09-01 16:52             ` Ralf Baechle DL5RB
2005-09-02 12:48           ` Atsushi Nemoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050824152444.GE2783@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=bryan.althouse@3phoenix.com \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox