linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipmi_si: replace spin_lock_irqsave by spin_lock in hard IRQ
@ 2020-10-17  1:40 Tian Tao
  2020-10-27 21:03 ` [Openipmi-developer] " Corey Minyard
  0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2020-10-17  1:40 UTC (permalink / raw)
  To: minyard, arnd, gregkh, openipmi-developer, linux-kernel

It is redundant to do irqsave and irqrestore in hardIRQ context.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/char/ipmi/ipmi_si_intf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 45546ac..97452a8 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1116,7 +1116,6 @@ static void smi_timeout(struct timer_list *t)
 irqreturn_t ipmi_si_irq_handler(int irq, void *data)
 {
 	struct smi_info *smi_info = data;
-	unsigned long   flags;
 
 	if (smi_info->io.si_type == SI_BT)
 		/* We need to clear the IRQ flag for the BT interface. */
@@ -1124,14 +1123,14 @@ irqreturn_t ipmi_si_irq_handler(int irq, void *data)
 				     IPMI_BT_INTMASK_CLEAR_IRQ_BIT
 				     | IPMI_BT_INTMASK_ENABLE_IRQ_BIT);
 
-	spin_lock_irqsave(&(smi_info->si_lock), flags);
+	spin_lock(&(smi_info->si_lock));
 
 	smi_inc_stat(smi_info, interrupts);
 
 	debug_timestamp("Interrupt");
 
 	smi_event_handler(smi_info, 0);
-	spin_unlock_irqrestore(&(smi_info->si_lock), flags);
+	spin_unlock(&(smi_info->si_lock));
 	return IRQ_HANDLED;
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Openipmi-developer] [PATCH] ipmi_si: replace spin_lock_irqsave by spin_lock in hard IRQ
  2020-10-17  1:40 [PATCH] ipmi_si: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
@ 2020-10-27 21:03 ` Corey Minyard
  0 siblings, 0 replies; 2+ messages in thread
From: Corey Minyard @ 2020-10-27 21:03 UTC (permalink / raw)
  To: Tian Tao; +Cc: arnd, gregkh, openipmi-developer, linux-kernel

On Sat, Oct 17, 2020 at 09:40:10AM +0800, Tian Tao wrote:
> It is redundant to do irqsave and irqrestore in hardIRQ context.

Are ACPI GPEs run in hardirq context?  I looked around a bit and
couldn't tell.  If not, then I can't take this patch.  Otherwise, it's
ok.

-corey

> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
>  drivers/char/ipmi/ipmi_si_intf.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index 45546ac..97452a8 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -1116,7 +1116,6 @@ static void smi_timeout(struct timer_list *t)
>  irqreturn_t ipmi_si_irq_handler(int irq, void *data)
>  {
>  	struct smi_info *smi_info = data;
> -	unsigned long   flags;
>  
>  	if (smi_info->io.si_type == SI_BT)
>  		/* We need to clear the IRQ flag for the BT interface. */
> @@ -1124,14 +1123,14 @@ irqreturn_t ipmi_si_irq_handler(int irq, void *data)
>  				     IPMI_BT_INTMASK_CLEAR_IRQ_BIT
>  				     | IPMI_BT_INTMASK_ENABLE_IRQ_BIT);
>  
> -	spin_lock_irqsave(&(smi_info->si_lock), flags);
> +	spin_lock(&(smi_info->si_lock));
>  
>  	smi_inc_stat(smi_info, interrupts);
>  
>  	debug_timestamp("Interrupt");
>  
>  	smi_event_handler(smi_info, 0);
> -	spin_unlock_irqrestore(&(smi_info->si_lock), flags);
> +	spin_unlock(&(smi_info->si_lock));
>  	return IRQ_HANDLED;
>  }
>  
> -- 
> 2.7.4
> 
> 
> 
> _______________________________________________
> Openipmi-developer mailing list
> Openipmi-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openipmi-developer

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-27 21:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-17  1:40 [PATCH] ipmi_si: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
2020-10-27 21:03 ` [Openipmi-developer] " Corey Minyard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).