linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: replace spin_lock_irqsave by spin_lock in hard IRQ
@ 2020-11-06  1:56 ` Tian Tao
  2020-11-06  3:26   ` Jaehoon Chung
  2020-11-10 12:26   ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Tian Tao @ 2020-11-06  1:56 UTC (permalink / raw)
  To: jh80.chung, ulf.hansson, p.zabel, linux-mmc, 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/dw_mmc.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 43c5795..a524443 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2617,7 +2617,6 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
 	struct dw_mci *host = dev_id;
 	u32 pending;
 	struct dw_mci_slot *slot = host->slot;
-	unsigned long irqflags;
 
 	pending = mci_readl(host, MINTSTS); /* read-only mask reg */
 
@@ -2632,15 +2631,15 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
 			 * Hold the lock; we know cmd11_timer can't be kicked
 			 * off after the lock is released, so safe to delete.
 			 */
-			spin_lock_irqsave(&host->irq_lock, irqflags);
+			spin_lock(&host->irq_lock);
 			dw_mci_cmd_interrupt(host, pending);
-			spin_unlock_irqrestore(&host->irq_lock, irqflags);
+			spin_unlock(&host->irq_lock);
 
 			del_timer(&host->cmd11_timer);
 		}
 
 		if (pending & DW_MCI_CMD_ERROR_FLAGS) {
-			spin_lock_irqsave(&host->irq_lock, irqflags);
+			spin_lock(&host->irq_lock);
 
 			del_timer(&host->cto_timer);
 			mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);
@@ -2648,7 +2647,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
 			smp_wmb(); /* drain writebuffer */
 			set_bit(EVENT_CMD_COMPLETE, &host->pending_events);
 
-			spin_unlock_irqrestore(&host->irq_lock, irqflags);
+			spin_unlock(&host->irq_lock);
 		}
 
 		if (pending & DW_MCI_DATA_ERROR_FLAGS) {
@@ -2661,7 +2660,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
 		}
 
 		if (pending & SDMMC_INT_DATA_OVER) {
-			spin_lock_irqsave(&host->irq_lock, irqflags);
+			spin_lock(&host->irq_lock);
 
 			del_timer(&host->dto_timer);
 
@@ -2676,7 +2675,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
 			set_bit(EVENT_DATA_COMPLETE, &host->pending_events);
 			tasklet_schedule(&host->tasklet);
 
-			spin_unlock_irqrestore(&host->irq_lock, irqflags);
+			spin_unlock(&host->irq_lock);
 		}
 
 		if (pending & SDMMC_INT_RXDR) {
@@ -2692,12 +2691,12 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
 		}
 
 		if (pending & SDMMC_INT_CMD_DONE) {
-			spin_lock_irqsave(&host->irq_lock, irqflags);
+			spin_lock(&host->irq_lock);
 
 			mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE);
 			dw_mci_cmd_interrupt(host, pending);
 
-			spin_unlock_irqrestore(&host->irq_lock, irqflags);
+			spin_unlock(&host->irq_lock);
 		}
 
 		if (pending & SDMMC_INT_CD) {
-- 
2.7.4


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

* Re: [PATCH] mmc: dw_mmc: replace spin_lock_irqsave by spin_lock in hard IRQ
  2020-11-06  1:56 ` [PATCH] mmc: dw_mmc: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
@ 2020-11-06  3:26   ` Jaehoon Chung
  2020-11-10 12:26   ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2020-11-06  3:26 UTC (permalink / raw)
  To: Tian Tao, ulf.hansson, p.zabel, linux-mmc, linux-kernel

Dear Tian,

On 11/6/20 10:56 AM, Tian Tao wrote:
> The code has been in a irq-disabled context since it is hard IRQ. There
> is no necessity to do it 
Even though I don't remember, there is a reason to use spin_lock_irqsave()..
I will check it. If there is no reason, i will reply.

Best Regards,
Jaehoon Chung

> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
>  drivers/mmc/host/dw_mmc.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 43c5795..a524443 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2617,7 +2617,6 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>  	struct dw_mci *host = dev_id;
>  	u32 pending;
>  	struct dw_mci_slot *slot = host->slot;
> -	unsigned long irqflags;
>  
>  	pending = mci_readl(host, MINTSTS); /* read-only mask reg */
>  
> @@ -2632,15 +2631,15 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>  			 * Hold the lock; we know cmd11_timer can't be kicked
>  			 * off after the lock is released, so safe to delete.
>  			 */
> -			spin_lock_irqsave(&host->irq_lock, irqflags);
> +			spin_lock(&host->irq_lock);
>  			dw_mci_cmd_interrupt(host, pending);
> -			spin_unlock_irqrestore(&host->irq_lock, irqflags);
> +			spin_unlock(&host->irq_lock);
>  
>  			del_timer(&host->cmd11_timer);
>  		}
>  
>  		if (pending & DW_MCI_CMD_ERROR_FLAGS) {
> -			spin_lock_irqsave(&host->irq_lock, irqflags);
> +			spin_lock(&host->irq_lock);
>  
>  			del_timer(&host->cto_timer);
>  			mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);
> @@ -2648,7 +2647,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>  			smp_wmb(); /* drain writebuffer */
>  			set_bit(EVENT_CMD_COMPLETE, &host->pending_events);
>  
> -			spin_unlock_irqrestore(&host->irq_lock, irqflags);
> +			spin_unlock(&host->irq_lock);
>  		}
>  
>  		if (pending & DW_MCI_DATA_ERROR_FLAGS) {
> @@ -2661,7 +2660,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>  		}
>  
>  		if (pending & SDMMC_INT_DATA_OVER) {
> -			spin_lock_irqsave(&host->irq_lock, irqflags);
> +			spin_lock(&host->irq_lock);
>  
>  			del_timer(&host->dto_timer);
>  
> @@ -2676,7 +2675,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>  			set_bit(EVENT_DATA_COMPLETE, &host->pending_events);
>  			tasklet_schedule(&host->tasklet);
>  
> -			spin_unlock_irqrestore(&host->irq_lock, irqflags);
> +			spin_unlock(&host->irq_lock);
>  		}
>  
>  		if (pending & SDMMC_INT_RXDR) {
> @@ -2692,12 +2691,12 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>  		}
>  
>  		if (pending & SDMMC_INT_CMD_DONE) {
> -			spin_lock_irqsave(&host->irq_lock, irqflags);
> +			spin_lock(&host->irq_lock);
>  
>  			mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE);
>  			dw_mci_cmd_interrupt(host, pending);
>  
> -			spin_unlock_irqrestore(&host->irq_lock, irqflags);
> +			spin_unlock(&host->irq_lock);
>  		}
>  
>  		if (pending & SDMMC_INT_CD) {
> 


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

* Re: [PATCH] mmc: dw_mmc: replace spin_lock_irqsave by spin_lock in hard IRQ
  2020-11-06  1:56 ` [PATCH] mmc: dw_mmc: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
  2020-11-06  3:26   ` Jaehoon Chung
@ 2020-11-10 12:26   ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2020-11-10 12:26 UTC (permalink / raw)
  To: Tian Tao
  Cc: Jaehoon Chung, Philipp Zabel, linux-mmc, Linux Kernel Mailing List

On Fri, 6 Nov 2020 at 02:56, 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/dw_mmc.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 43c5795..a524443 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2617,7 +2617,6 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>         struct dw_mci *host = dev_id;
>         u32 pending;
>         struct dw_mci_slot *slot = host->slot;
> -       unsigned long irqflags;
>
>         pending = mci_readl(host, MINTSTS); /* read-only mask reg */
>
> @@ -2632,15 +2631,15 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>                          * Hold the lock; we know cmd11_timer can't be kicked
>                          * off after the lock is released, so safe to delete.
>                          */
> -                       spin_lock_irqsave(&host->irq_lock, irqflags);
> +                       spin_lock(&host->irq_lock);
>                         dw_mci_cmd_interrupt(host, pending);
> -                       spin_unlock_irqrestore(&host->irq_lock, irqflags);
> +                       spin_unlock(&host->irq_lock);
>
>                         del_timer(&host->cmd11_timer);
>                 }
>
>                 if (pending & DW_MCI_CMD_ERROR_FLAGS) {
> -                       spin_lock_irqsave(&host->irq_lock, irqflags);
> +                       spin_lock(&host->irq_lock);
>
>                         del_timer(&host->cto_timer);
>                         mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);
> @@ -2648,7 +2647,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>                         smp_wmb(); /* drain writebuffer */
>                         set_bit(EVENT_CMD_COMPLETE, &host->pending_events);
>
> -                       spin_unlock_irqrestore(&host->irq_lock, irqflags);
> +                       spin_unlock(&host->irq_lock);
>                 }
>
>                 if (pending & DW_MCI_DATA_ERROR_FLAGS) {
> @@ -2661,7 +2660,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>                 }
>
>                 if (pending & SDMMC_INT_DATA_OVER) {
> -                       spin_lock_irqsave(&host->irq_lock, irqflags);
> +                       spin_lock(&host->irq_lock);
>
>                         del_timer(&host->dto_timer);
>
> @@ -2676,7 +2675,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>                         set_bit(EVENT_DATA_COMPLETE, &host->pending_events);
>                         tasklet_schedule(&host->tasklet);
>
> -                       spin_unlock_irqrestore(&host->irq_lock, irqflags);
> +                       spin_unlock(&host->irq_lock);
>                 }
>
>                 if (pending & SDMMC_INT_RXDR) {
> @@ -2692,12 +2691,12 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
>                 }
>
>                 if (pending & SDMMC_INT_CMD_DONE) {
> -                       spin_lock_irqsave(&host->irq_lock, irqflags);
> +                       spin_lock(&host->irq_lock);
>
>                         mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE);
>                         dw_mci_cmd_interrupt(host, pending);
>
> -                       spin_unlock_irqrestore(&host->irq_lock, irqflags);
> +                       spin_unlock(&host->irq_lock);
>                 }
>
>                 if (pending & SDMMC_INT_CD) {
> --
> 2.7.4
>

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20201106015629epcas1p1e017132d77d8b20e7aa6706a6d471adf@epcas1p1.samsung.com>
2020-11-06  1:56 ` [PATCH] mmc: dw_mmc: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
2020-11-06  3:26   ` Jaehoon Chung
2020-11-10 12:26   ` 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).