All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: i2c-tegra: replace spin_lock_irqsave with spin_lock in ISR
@ 2018-09-11 14:54 jun qian
  2018-11-27 18:13 ` Dmitry Osipenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jun qian @ 2018-09-11 14:54 UTC (permalink / raw)
  To: Laxman Dewangan, Thierry Reding, Jonathan Hunter
  Cc: linux-i2c, linux-tegra, linux-kernel, jun qian

As you are already in ISR, it is unnecessary to call spin_lock_irqsave.

Signed-off-by: jun qian <hangdianqj@163.com>
---
 drivers/i2c/busses/i2c-tegra.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 60c8561fbe65..59f31d3a508f 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -608,11 +608,10 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id)
 	u32 status;
 	const u32 status_err = I2C_INT_NO_ACK | I2C_INT_ARBITRATION_LOST;
 	struct tegra_i2c_dev *i2c_dev = dev_id;
-	unsigned long flags;
 
 	status = i2c_readl(i2c_dev, I2C_INT_STATUS);
 
-	spin_lock_irqsave(&i2c_dev->xfer_lock, flags);
+	spin_lock(&i2c_dev->xfer_lock);
 	if (status == 0) {
 		dev_warn(i2c_dev->dev, "irq status 0 %08x %08x %08x\n",
 			 i2c_readl(i2c_dev, I2C_PACKET_TRANSFER_STATUS),
@@ -670,7 +669,7 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id)
 
 	complete(&i2c_dev->msg_complete);
 done:
-	spin_unlock_irqrestore(&i2c_dev->xfer_lock, flags);
+	spin_unlock(&i2c_dev->xfer_lock);
 	return IRQ_HANDLED;
 }
 
-- 
2.17.1

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

* Re: [PATCH] i2c: i2c-tegra: replace spin_lock_irqsave with spin_lock in ISR
  2018-09-11 14:54 [PATCH] i2c: i2c-tegra: replace spin_lock_irqsave with spin_lock in ISR jun qian
@ 2018-11-27 18:13 ` Dmitry Osipenko
  2018-11-28  9:13 ` Thierry Reding
  2018-12-11 19:38 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Osipenko @ 2018-11-27 18:13 UTC (permalink / raw)
  To: jun qian, Laxman Dewangan, Thierry Reding, Jonathan Hunter
  Cc: linux-i2c, linux-tegra, linux-kernel

On 11.09.2018 17:54, jun qian wrote:
> As you are already in ISR, it is unnecessary to call spin_lock_irqsave.
> 
> Signed-off-by: jun qian <hangdianqj@163.com>
> ---
>  drivers/i2c/busses/i2c-tegra.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
> index 60c8561fbe65..59f31d3a508f 100644
> --- a/drivers/i2c/busses/i2c-tegra.c
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -608,11 +608,10 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id)
>  	u32 status;
>  	const u32 status_err = I2C_INT_NO_ACK | I2C_INT_ARBITRATION_LOST;
>  	struct tegra_i2c_dev *i2c_dev = dev_id;
> -	unsigned long flags;
>  
>  	status = i2c_readl(i2c_dev, I2C_INT_STATUS);
>  
> -	spin_lock_irqsave(&i2c_dev->xfer_lock, flags);
> +	spin_lock(&i2c_dev->xfer_lock);
>  	if (status == 0) {
>  		dev_warn(i2c_dev->dev, "irq status 0 %08x %08x %08x\n",
>  			 i2c_readl(i2c_dev, I2C_PACKET_TRANSFER_STATUS),
> @@ -670,7 +669,7 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id)
>  
>  	complete(&i2c_dev->msg_complete);
>  done:
> -	spin_unlock_irqrestore(&i2c_dev->xfer_lock, flags);
> +	spin_unlock(&i2c_dev->xfer_lock);
>  	return IRQ_HANDLED;
>  }
>  
> 

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>

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

* Re: [PATCH] i2c: i2c-tegra: replace spin_lock_irqsave with spin_lock in ISR
  2018-09-11 14:54 [PATCH] i2c: i2c-tegra: replace spin_lock_irqsave with spin_lock in ISR jun qian
  2018-11-27 18:13 ` Dmitry Osipenko
@ 2018-11-28  9:13 ` Thierry Reding
  2018-12-11 19:38 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2018-11-28  9:13 UTC (permalink / raw)
  To: jun qian
  Cc: Laxman Dewangan, Jonathan Hunter, linux-i2c, linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 339 bytes --]

On Tue, Sep 11, 2018 at 07:54:46AM -0700, jun qian wrote:
> As you are already in ISR, it is unnecessary to call spin_lock_irqsave.
> 
> Signed-off-by: jun qian <hangdianqj@163.com>
> ---
>  drivers/i2c/busses/i2c-tegra.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] i2c: i2c-tegra: replace spin_lock_irqsave with spin_lock in ISR
  2018-09-11 14:54 [PATCH] i2c: i2c-tegra: replace spin_lock_irqsave with spin_lock in ISR jun qian
  2018-11-27 18:13 ` Dmitry Osipenko
  2018-11-28  9:13 ` Thierry Reding
@ 2018-12-11 19:38 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2018-12-11 19:38 UTC (permalink / raw)
  To: jun qian
  Cc: Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-i2c,
	linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 220 bytes --]

On Tue, Sep 11, 2018 at 07:54:46AM -0700, jun qian wrote:
> As you are already in ISR, it is unnecessary to call spin_lock_irqsave.
> 
> Signed-off-by: jun qian <hangdianqj@163.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2018-12-11 19:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 14:54 [PATCH] i2c: i2c-tegra: replace spin_lock_irqsave with spin_lock in ISR jun qian
2018-11-27 18:13 ` Dmitry Osipenko
2018-11-28  9:13 ` Thierry Reding
2018-12-11 19:38 ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.