linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: owl-mmc: replace spin_lock_irqsave by spin_lock in hard IRQ
@ 2020-11-02  0:52 Tian Tao
  2020-11-02 15:54 ` Manivannan Sadhasivam
  2020-11-05 12:59 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Tian Tao @ 2020-11-02  0:52 UTC (permalink / raw)
  To: ulf.hansson, afaerber, manivannan.sadhasivam, p.zabel, linux-mmc,
	linux-arm-kernel, linux-kernel

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/mmc/host/owl-mmc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/owl-mmc.c b/drivers/mmc/host/owl-mmc.c
index ccf214a..82d2bad 100644
--- a/drivers/mmc/host/owl-mmc.c
+++ b/drivers/mmc/host/owl-mmc.c
@@ -134,10 +134,9 @@ static void owl_mmc_update_reg(void __iomem *reg, unsigned int val, bool state)
 static irqreturn_t owl_irq_handler(int irq, void *devid)
 {
 	struct owl_mmc_host *owl_host = devid;
-	unsigned long flags;
 	u32 state;
 
-	spin_lock_irqsave(&owl_host->lock, flags);
+	spin_lock(&owl_host->lock);
 
 	state = readl(owl_host->base + OWL_REG_SD_STATE);
 	if (state & OWL_SD_STATE_TEI) {
@@ -147,7 +146,7 @@ static irqreturn_t owl_irq_handler(int irq, void *devid)
 		complete(&owl_host->sdc_complete);
 	}
 
-	spin_unlock_irqrestore(&owl_host->lock, flags);
+	spin_unlock(&owl_host->lock);
 
 	return IRQ_HANDLED;
 }
-- 
2.7.4


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

* Re: [PATCH] mmc: owl-mmc: replace spin_lock_irqsave by spin_lock in hard IRQ
  2020-11-02  0:52 [PATCH] mmc: owl-mmc: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
@ 2020-11-02 15:54 ` Manivannan Sadhasivam
  2020-11-05 12:59 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2020-11-02 15:54 UTC (permalink / raw)
  To: Tian Tao
  Cc: ulf.hansson, afaerber, p.zabel, linux-mmc, linux-arm-kernel,
	linux-kernel

On Mon, Nov 02, 2020 at 08:52:17AM +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.
> 

Ah, yes. This should save few cycles!

> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> ---
>  drivers/mmc/host/owl-mmc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/owl-mmc.c b/drivers/mmc/host/owl-mmc.c
> index ccf214a..82d2bad 100644
> --- a/drivers/mmc/host/owl-mmc.c
> +++ b/drivers/mmc/host/owl-mmc.c
> @@ -134,10 +134,9 @@ static void owl_mmc_update_reg(void __iomem *reg, unsigned int val, bool state)
>  static irqreturn_t owl_irq_handler(int irq, void *devid)
>  {
>  	struct owl_mmc_host *owl_host = devid;
> -	unsigned long flags;
>  	u32 state;
>  
> -	spin_lock_irqsave(&owl_host->lock, flags);
> +	spin_lock(&owl_host->lock);
>  
>  	state = readl(owl_host->base + OWL_REG_SD_STATE);
>  	if (state & OWL_SD_STATE_TEI) {
> @@ -147,7 +146,7 @@ static irqreturn_t owl_irq_handler(int irq, void *devid)
>  		complete(&owl_host->sdc_complete);
>  	}
>  
> -	spin_unlock_irqrestore(&owl_host->lock, flags);
> +	spin_unlock(&owl_host->lock);
>  
>  	return IRQ_HANDLED;
>  }
> -- 
> 2.7.4
> 

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

* Re: [PATCH] mmc: owl-mmc: replace spin_lock_irqsave by spin_lock in hard IRQ
  2020-11-02  0:52 [PATCH] mmc: owl-mmc: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
  2020-11-02 15:54 ` Manivannan Sadhasivam
@ 2020-11-05 12:59 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2020-11-05 12:59 UTC (permalink / raw)
  To: Tian Tao
  Cc: Andreas Färber, Manivannan Sadhasivam, Philipp Zabel,
	linux-mmc, Linux ARM, Linux Kernel Mailing List

On Mon, 2 Nov 2020 at 01:51, Tian Tao <tiantao6@hisilicon.com> 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 for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/owl-mmc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/owl-mmc.c b/drivers/mmc/host/owl-mmc.c
> index ccf214a..82d2bad 100644
> --- a/drivers/mmc/host/owl-mmc.c
> +++ b/drivers/mmc/host/owl-mmc.c
> @@ -134,10 +134,9 @@ static void owl_mmc_update_reg(void __iomem *reg, unsigned int val, bool state)
>  static irqreturn_t owl_irq_handler(int irq, void *devid)
>  {
>         struct owl_mmc_host *owl_host = devid;
> -       unsigned long flags;
>         u32 state;
>
> -       spin_lock_irqsave(&owl_host->lock, flags);
> +       spin_lock(&owl_host->lock);
>
>         state = readl(owl_host->base + OWL_REG_SD_STATE);
>         if (state & OWL_SD_STATE_TEI) {
> @@ -147,7 +146,7 @@ static irqreturn_t owl_irq_handler(int irq, void *devid)
>                 complete(&owl_host->sdc_complete);
>         }
>
> -       spin_unlock_irqrestore(&owl_host->lock, flags);
> +       spin_unlock(&owl_host->lock);
>
>         return IRQ_HANDLED;
>  }
> --
> 2.7.4
>

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

end of thread, other threads:[~2020-11-05 12:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02  0:52 [PATCH] mmc: owl-mmc: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
2020-11-02 15:54 ` Manivannan Sadhasivam
2020-11-05 12:59 ` Ulf Hansson

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).