Re: IDE spin_lock bug

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Wed May 03 2000 - 19:05:50 EST


Jens Axboe wrote:
>
> Hi,
>
> After browsing through Rusty's locking guide today, it occured to
> me that IDE violates the _irqsave rule of passing flags
> to a different function which does the restoring. The easy solution
> is to inline ide_spin_wait_hwgroup.

Have you checked the asm to make sure the function is inlined?
Typically the rule is you must make it 'static inline' to better ensure
inlining.

Stepping back a bit, is this function ever called with interrupts
disabled and such? If not, you can use spin_lock_irq in certain
[carefully considered] cases. That eliminates worrying about 'flags'
completely and is a bit faster.

        Jeff

-- 
Jeff Garzik              | Nothing cures insomnia like the
Building 1024            | realization that it's time to get up.
MandrakeSoft, Inc.       |        -- random fortune

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:13 EST