Skip to content

Commit

Permalink
rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ
Browse files Browse the repository at this point in the history
It is redundant to do irqsave and irqrestore in hardIRQ context, where
it has been in a irq-disabled context.

Signed-off-by: Xiaofei Tan <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
Xiaofei Tan authored and alexandrebelloni committed Feb 5, 2021
1 parent ddd0521 commit 6950d04
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/rtc/rtc-cmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,11 +643,10 @@ static struct cmos_rtc cmos_rtc;

static irqreturn_t cmos_interrupt(int irq, void *p)
{
unsigned long flags;
u8 irqstat;
u8 rtc_control;

spin_lock_irqsave(&rtc_lock, flags);
spin_lock(&rtc_lock);

/* When the HPET interrupt handler calls us, the interrupt
* status is passed as arg1 instead of the irq number. But
Expand Down Expand Up @@ -681,7 +680,7 @@ static irqreturn_t cmos_interrupt(int irq, void *p)
hpet_mask_rtc_irq_bit(RTC_AIE);
CMOS_READ(RTC_INTR_FLAGS);
}
spin_unlock_irqrestore(&rtc_lock, flags);
spin_unlock(&rtc_lock);

if (is_intr(irqstat)) {
rtc_update_irq(p, 1, irqstat);
Expand Down

0 comments on commit 6950d04

Please sign in to comment.