Re: [question] why does rtc_read() use spin_lock_irq()?

Jeff Garzik (jgarzik@mandrakesoft.com)
Mon, 26 Jun 2000 11:15:56 -0400


Tigran Aivazian wrote:
>
> Hi guys,
>
> It would appear that fop->read() methods assume that interrupts are always
> enabled on the current cpu. For example, drivers/char/rtc:rtc_read() uses
> spin_lock_irq(&rtc_lock) while the interrupt handler uses the plain
> spin_lock(&rtc_lock). It is clear why rtc_interrupt() use spin_lock() but
> is not clear why rtc_read() uses spin_lock_irq() and not the generic
> spin_lock_irqsave().

rtc_read is never called w/ interrupts disabled, so you can use the
cheaper version of the spinlock

Jeff

-- 
Jeff Garzik              |
Building 1024            | Free beer tomorrow.
MandrakeSoft, Inc.       |

- 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/