All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: rz-mtu3: Replace raw_spin_lock->spin_lock()
@ 2023-07-19 12:47 Biju Das
  2023-07-28 10:29 ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Biju Das @ 2023-07-19 12:47 UTC (permalink / raw)
  To: Lee Jones
  Cc: Biju Das, Geert Uytterhoeven, Pavel Machek, Prabhakar Mahadev Lad,
	linux-renesas-soc

As per kernel documentation, use raw_spinlock_t only in real critical core
code, low-level interrupt handling, and places where disabling preemption
or interrupts is required. Here the lock is for concurrent register access
from different drivers, hence spin_lock() is sufficient.

Reported-by: Pavel Machek <pavel@denx.de>
Closes: https://patchwork.kernel.org/project/linux-renesas-soc/patch/20230717120333.165219-1-biju.das.jz@bp.renesas.com/
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
This patch depend upon [1]
[1] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20230717120333.165219-1-biju.das.jz@bp.renesas.com/
---
 drivers/mfd/rz-mtu3.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/rz-mtu3.c b/drivers/mfd/rz-mtu3.c
index e5cace963c7c..2400bf5830b9 100644
--- a/drivers/mfd/rz-mtu3.c
+++ b/drivers/mfd/rz-mtu3.c
@@ -21,7 +21,7 @@
 struct rz_mtu3_priv {
 	void __iomem *mmio;
 	struct reset_control *rstc;
-	raw_spinlock_t lock;
+	spinlock_t lock;
 };
 
 /******* MTU3 registers (original offset is +0x1200) *******/
@@ -175,11 +175,11 @@ void rz_mtu3_shared_reg_update_bit(struct rz_mtu3_channel *ch, u16 offset,
 	struct rz_mtu3_priv *priv = mtu->priv_data;
 	unsigned long tmdr, flags;
 
-	raw_spin_lock_irqsave(&priv->lock, flags);
+	spin_lock_irqsave(&priv->lock, flags);
 	tmdr = rz_mtu3_shared_reg_read(ch, offset);
 	__assign_bit(pos, &tmdr, !!val);
 	rz_mtu3_shared_reg_write(ch, offset, tmdr);
-	raw_spin_unlock_irqrestore(&priv->lock, flags);
+	spin_unlock_irqrestore(&priv->lock, flags);
 }
 EXPORT_SYMBOL_GPL(rz_mtu3_shared_reg_update_bit);
 
@@ -255,13 +255,13 @@ static void rz_mtu3_start_stop_ch(struct rz_mtu3_channel *ch, bool start)
 	bitpos = rz_mtu3_get_tstr_bit_pos(ch);
 
 	/* start stop register shared by multiple timer channels */
-	raw_spin_lock_irqsave(&priv->lock, flags);
+	spin_lock_irqsave(&priv->lock, flags);
 
 	tstr = rz_mtu3_shared_reg_read(ch, offset);
 	__assign_bit(bitpos, &tstr, start);
 	rz_mtu3_shared_reg_write(ch, offset, tstr);
 
-	raw_spin_unlock_irqrestore(&priv->lock, flags);
+	spin_unlock_irqrestore(&priv->lock, flags);
 }
 
 bool rz_mtu3_is_enabled(struct rz_mtu3_channel *ch)
@@ -276,9 +276,9 @@ bool rz_mtu3_is_enabled(struct rz_mtu3_channel *ch)
 	bitpos = rz_mtu3_get_tstr_bit_pos(ch);
 
 	/* start stop register shared by multiple timer channels */
-	raw_spin_lock_irqsave(&priv->lock, flags);
+	spin_lock_irqsave(&priv->lock, flags);
 	tstr = rz_mtu3_shared_reg_read(ch, offset);
-	raw_spin_unlock_irqrestore(&priv->lock, flags);
+	spin_unlock_irqrestore(&priv->lock, flags);
 
 	return tstr & BIT(bitpos);
 }
@@ -348,7 +348,7 @@ static int rz_mtu3_probe(struct platform_device *pdev)
 		return PTR_ERR(ddata->clk);
 
 	reset_control_deassert(priv->rstc);
-	raw_spin_lock_init(&priv->lock);
+	spin_lock_init(&priv->lock);
 	platform_set_drvdata(pdev, ddata);
 
 	for (i = 0; i < RZ_MTU_NUM_CHANNELS; i++) {
-- 
2.25.1


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

* Re: [PATCH] mfd: rz-mtu3: Replace raw_spin_lock->spin_lock()
  2023-07-19 12:47 [PATCH] mfd: rz-mtu3: Replace raw_spin_lock->spin_lock() Biju Das
@ 2023-07-28 10:29 ` Lee Jones
  2023-08-01  6:20   ` Biju Das
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2023-07-28 10:29 UTC (permalink / raw)
  To: Biju Das
  Cc: Geert Uytterhoeven, Pavel Machek, Prabhakar Mahadev Lad,
	linux-renesas-soc

On Wed, 19 Jul 2023, Biju Das wrote:

> As per kernel documentation, use raw_spinlock_t only in real critical core
> code, low-level interrupt handling, and places where disabling preemption
> or interrupts is required. Here the lock is for concurrent register access
> from different drivers, hence spin_lock() is sufficient.
> 
> Reported-by: Pavel Machek <pavel@denx.de>
> Closes: https://patchwork.kernel.org/project/linux-renesas-soc/patch/20230717120333.165219-1-biju.das.jz@bp.renesas.com/
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> This patch depend upon [1]
> [1] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20230717120333.165219-1-biju.das.jz@bp.renesas.com/
> ---
>  drivers/mfd/rz-mtu3.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)

Doesn't apply.  Please rebase and resend

-- 
Lee Jones [李琼斯]

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

* RE: [PATCH] mfd: rz-mtu3: Replace raw_spin_lock->spin_lock()
  2023-07-28 10:29 ` Lee Jones
@ 2023-08-01  6:20   ` Biju Das
  0 siblings, 0 replies; 3+ messages in thread
From: Biju Das @ 2023-08-01  6:20 UTC (permalink / raw)
  To: Lee Jones
  Cc: Geert Uytterhoeven, Pavel Machek, Prabhakar Mahadev Lad,
	linux-renesas-soc@vger.kernel.org

Hi Lee Jones,

Thanks for the feedback.

> Subject: Re: [PATCH] mfd: rz-mtu3: Replace raw_spin_lock->spin_lock()
> 
> On Wed, 19 Jul 2023, Biju Das wrote:
> 
> > As per kernel documentation, use raw_spinlock_t only in real critical
> > core code, low-level interrupt handling, and places where disabling
> > preemption or interrupts is required. Here the lock is for concurrent
> > register access from different drivers, hence spin_lock() is
> sufficient.
> >
> > Reported-by: Pavel Machek <pavel@denx.de>
> > Closes:
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > This patch depend upon [1]
> > [1]
> > ---
> >  drivers/mfd/rz-mtu3.c | 16 ++++++++--------
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> Doesn't apply.  Please rebase and resend

Sure. Will rebase and resend.

Cheers,
Biju

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

end of thread, other threads:[~2023-08-01  6:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-19 12:47 [PATCH] mfd: rz-mtu3: Replace raw_spin_lock->spin_lock() Biju Das
2023-07-28 10:29 ` Lee Jones
2023-08-01  6:20   ` Biju Das

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.