Re: [PATCH] Fix SMP support on 3c527 net driver

From: Felipe W Damasio (felipewd_at_terra.com.br)
Date: 08/31/03

  • Next message: Jeff Chua: "Re: [BUG] hda:end_request: I/O error, dev 03:00 (hda), sector 0"
    Date:	Sun, 31 Aug 2003 13:50:30 -0300
    To: Manfred Spraul <manfred@colorfullife.com>
    
    

            Hi Manfred,

    Manfred Spraul wrote:
    > Additionally, you must replace the sleep_on calls with wait_event, or an
    > open-coded wait queue: sleep_on is racy, it only works with cli().

            Oh, I didn't no that..

    > IMHO the right way to fix cli() is
    > - add a single spinlock to the driver or the device structure. Do not
    > forget the spin_lock_init().
    > - replace cli/sti with spin_lock_irqsave/spin_unlock_irqsave.

            Yes.

    > - Additionally acquire the spinlock in every interrupt handler (cli()
    > stops all interrupts, spinlocks only stop interrupt on the current cpu).
    > - check if there were recursive cli() calls. Fix them.
    > - replace all sleep_on calls with wait queue calls.
    > - check if there are any kmalloc or schedule calls in the area now under
    > the spinlock, and reorganize the code.

            But doesn't wait_queue call schedule()?

    > And please add a changelog entry that code was converted without testing.

            Ok.

            Thanks for your review, will work on those.

    Felipe

    -- 
    It's most certainly GNU/Linux, not Linux. Read more at
    http://www.gnu.org/gnu/why-gnu-linux.html
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Jeff Chua: "Re: [BUG] hda:end_request: I/O error, dev 03:00 (hda), sector 0"

    Relevant Pages

    • waiting on a condition
      ... disable interrupts ... acquire spinlock ... set task to sleep ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.7-mm6
      ... > serio ports with spinlock held and interrupts off. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: waiting on a condition
      ... > variable in the kernel, i.e. wait for some condition to become true. ... > disable interrupts ... > acquire spinlock ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: [patch] Real-Time Preemption, -RT-2.6.13-rc6-V0.7.53-11
      ... but the main issue isnt with disabling interrupts in general, ... (naked IRQ flags use also happens to be a problem for ... the debug feature will also warn if a spinlock _not_ marked ...
      (Linux-Kernel)
    • Re: waiting on a condition
      ... > preemption while the spinlock was held. ... >>disable interrupts ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)