Message ID | 1612696333-50502-1-git-send-email-tiantao6@hisilicon.com |
---|---|
State | New |
Headers | show |
Series | hwmon: (npcm750-pwm-fan): replace spin_lock_irqsave by spin_lock in hard IRQ | expand |
On Sun, Feb 07, 2021 at 07:12:13PM +0800, Tian Tao wrote: > The code has been in a irq-disabled context since it is hard IRQ. There > is no necessity to do it again. > > Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Applied. Thanks, Guenter > --- > drivers/hwmon/npcm750-pwm-fan.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c > index 11a2860..6c27af1 100644 > --- a/drivers/hwmon/npcm750-pwm-fan.c > +++ b/drivers/hwmon/npcm750-pwm-fan.c > @@ -481,12 +481,11 @@ static inline void npcm7xx_check_cmp(struct npcm7xx_pwm_fan_data *data, > static irqreturn_t npcm7xx_fan_isr(int irq, void *dev_id) > { > struct npcm7xx_pwm_fan_data *data = dev_id; > - unsigned long flags; > int module; > u8 flag; > > module = irq - data->fan_irq[0]; > - spin_lock_irqsave(&data->fan_lock[module], flags); > + spin_lock(&data->fan_lock[module]); > > flag = ioread8(NPCM7XX_FAN_REG_TICTRL(data->fan_base, module)); > if (flag > 0) { > @@ -496,7 +495,7 @@ static irqreturn_t npcm7xx_fan_isr(int irq, void *dev_id) > return IRQ_HANDLED; > } > > - spin_unlock_irqrestore(&data->fan_lock[module], flags); > + spin_unlock(&data->fan_lock[module]); > > return IRQ_NONE; > }
On Sun, Feb 07, 2021 at 07:12:13PM +0800, Tian Tao wrote: > The code has been in a irq-disabled context since it is hard IRQ. There > is no necessity to do it again. > > Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Now dropped. Quite obviously you have not even compile tested, much less runtime tested this patch. Guenter > --- > drivers/hwmon/npcm750-pwm-fan.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c > index 11a2860..6c27af1 100644 > --- a/drivers/hwmon/npcm750-pwm-fan.c > +++ b/drivers/hwmon/npcm750-pwm-fan.c > @@ -481,12 +481,11 @@ static inline void npcm7xx_check_cmp(struct npcm7xx_pwm_fan_data *data, > static irqreturn_t npcm7xx_fan_isr(int irq, void *dev_id) > { > struct npcm7xx_pwm_fan_data *data = dev_id; > - unsigned long flags; > int module; > u8 flag; > > module = irq - data->fan_irq[0]; > - spin_lock_irqsave(&data->fan_lock[module], flags); > + spin_lock(&data->fan_lock[module]); > > flag = ioread8(NPCM7XX_FAN_REG_TICTRL(data->fan_base, module)); > if (flag > 0) { > @@ -496,7 +495,7 @@ static irqreturn_t npcm7xx_fan_isr(int irq, void *dev_id) > return IRQ_HANDLED; > } > > - spin_unlock_irqrestore(&data->fan_lock[module], flags); > + spin_unlock(&data->fan_lock[module]); > > return IRQ_NONE; > }
diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c index 11a2860..6c27af1 100644 --- a/drivers/hwmon/npcm750-pwm-fan.c +++ b/drivers/hwmon/npcm750-pwm-fan.c @@ -481,12 +481,11 @@ static inline void npcm7xx_check_cmp(struct npcm7xx_pwm_fan_data *data, static irqreturn_t npcm7xx_fan_isr(int irq, void *dev_id) { struct npcm7xx_pwm_fan_data *data = dev_id; - unsigned long flags; int module; u8 flag; module = irq - data->fan_irq[0]; - spin_lock_irqsave(&data->fan_lock[module], flags); + spin_lock(&data->fan_lock[module]); flag = ioread8(NPCM7XX_FAN_REG_TICTRL(data->fan_base, module)); if (flag > 0) { @@ -496,7 +495,7 @@ static irqreturn_t npcm7xx_fan_isr(int irq, void *dev_id) return IRQ_HANDLED; } - spin_unlock_irqrestore(&data->fan_lock[module], flags); + spin_unlock(&data->fan_lock[module]); return IRQ_NONE; }
The code has been in a irq-disabled context since it is hard IRQ. There is no necessity to do it again. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> --- drivers/hwmon/npcm750-pwm-fan.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)