All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: rcar: replace spin_lock_irqsave by spin_lock in hard IRQ
@ 2020-10-27  1:06 Tian Tao
  2020-10-27  9:45 ` Daniel Lezcano
  2020-11-24  9:36 ` [thermal: thermal/next] thermal/drivers/rcar: Replace " thermal-bot for Tian Tao
  0 siblings, 2 replies; 3+ messages in thread
From: Tian Tao @ 2020-10-27  1:06 UTC (permalink / raw)
  To: niklas.soderlund, rui.zhang, daniel.lezcano, amitk,
	linux-renesas-soc, linux-pm, linux-kernel

On RT or even on mainline with 'threadirqs' on the command line all
interrupts which are not explicitly requested with IRQF_NO_THREAD
run their handlers in thread context. The same applies to soft interrupts.
That means they are subject to the normal scheduler rules and no other
code is going to acquire that lock from hard interrupt context either,
so the irqsave() here is pointless in all cases.

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

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 5c2a13b..6ae757d 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -409,16 +409,15 @@ static irqreturn_t rcar_thermal_irq(int irq, void *data)
 {
 	struct rcar_thermal_common *common = data;
 	struct rcar_thermal_priv *priv;
-	unsigned long flags;
 	u32 status, mask;
 
-	spin_lock_irqsave(&common->lock, flags);
+	spin_lock(&common->lock);
 
 	mask	= rcar_thermal_common_read(common, INTMSK);
 	status	= rcar_thermal_common_read(common, STR);
 	rcar_thermal_common_write(common, STR, 0x000F0F0F & mask);
 
-	spin_unlock_irqrestore(&common->lock, flags);
+	spin_unlock(&common->lock);
 
 	status = status & ~mask;
 
-- 
2.7.4


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

* Re: [PATCH] thermal: rcar: replace spin_lock_irqsave by spin_lock in hard IRQ
  2020-10-27  1:06 [PATCH] thermal: rcar: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
@ 2020-10-27  9:45 ` Daniel Lezcano
  2020-11-24  9:36 ` [thermal: thermal/next] thermal/drivers/rcar: Replace " thermal-bot for Tian Tao
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Lezcano @ 2020-10-27  9:45 UTC (permalink / raw)
  To: Tian Tao, niklas.soderlund, rui.zhang, amitk, linux-renesas-soc,
	linux-pm, linux-kernel

On 27/10/2020 02:06, Tian Tao wrote:
> On RT or even on mainline with 'threadirqs' on the command line all
> interrupts which are not explicitly requested with IRQF_NO_THREAD
> run their handlers in thread context. The same applies to soft interrupts.
> That means they are subject to the normal scheduler rules and no other
> code is going to acquire that lock from hard interrupt context either,
> so the irqsave() here is pointless in all cases.
> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

Applied, thanks


-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

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

* [thermal: thermal/next] thermal/drivers/rcar: Replace spin_lock_irqsave by spin_lock in hard IRQ
  2020-10-27  1:06 [PATCH] thermal: rcar: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
  2020-10-27  9:45 ` Daniel Lezcano
@ 2020-11-24  9:36 ` thermal-bot for Tian Tao
  1 sibling, 0 replies; 3+ messages in thread
From: thermal-bot for Tian Tao @ 2020-11-24  9:36 UTC (permalink / raw)
  To: linux-pm; +Cc: Tian Tao, Daniel Lezcano, rui.zhang, amitk

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     4eb7d0cd590d99b6010b5b87a88804cda09a85da
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//4eb7d0cd590d99b6010b5b87a88804cda09a85da
Author:        Tian Tao <tiantao6@hisilicon.com>
AuthorDate:    Tue, 27 Oct 2020 09:06:30 +08:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Tue, 27 Oct 2020 10:45:22 +01:00

thermal/drivers/rcar: Replace spin_lock_irqsave by spin_lock in hard IRQ

On RT or even on mainline with 'threadirqs' on the command line all
interrupts which are not explicitly requested with IRQF_NO_THREAD
run their handlers in thread context. The same applies to soft interrupts.
That means they are subject to the normal scheduler rules and no other
code is going to acquire that lock from hard interrupt context either,
so the irqsave() here is pointless in all cases.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/1603760790-37748-1-git-send-email-tiantao6@hisilicon.com
---
 drivers/thermal/rcar_thermal.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 5c2a13b..6ae757d 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -409,16 +409,15 @@ static irqreturn_t rcar_thermal_irq(int irq, void *data)
 {
 	struct rcar_thermal_common *common = data;
 	struct rcar_thermal_priv *priv;
-	unsigned long flags;
 	u32 status, mask;
 
-	spin_lock_irqsave(&common->lock, flags);
+	spin_lock(&common->lock);
 
 	mask	= rcar_thermal_common_read(common, INTMSK);
 	status	= rcar_thermal_common_read(common, STR);
 	rcar_thermal_common_write(common, STR, 0x000F0F0F & mask);
 
-	spin_unlock_irqrestore(&common->lock, flags);
+	spin_unlock(&common->lock);
 
 	status = status & ~mask;
 

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

end of thread, other threads:[~2020-11-24  9:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27  1:06 [PATCH] thermal: rcar: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
2020-10-27  9:45 ` Daniel Lezcano
2020-11-24  9:36 ` [thermal: thermal/next] thermal/drivers/rcar: Replace " thermal-bot for Tian Tao

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.