diff options
| author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2026-07-18 20:23:54 +0200 |
|---|---|---|
| committer | Geert Uytterhoeven <geert+renesas@glider.be> | 2026-08-31 12:03:39 +0200 |
| commit | b7453d3fbb017069466fcd4a0d50ffcfeadaee84 (patch) | |
| tree | 2a5fe65938cda3defb4e6c709c5d52513e403c48 | |
| parent | 8faf58aebca323d679d10876f97f0ab7fb7a48c4 (diff) | |
| download | linux-next-b7453d3fbb017069466fcd4a0d50ffcfeadaee84.tar.gz linux-next-b7453d3fbb017069466fcd4a0d50ffcfeadaee84.zip | |
soc: renesas: rcar-mfis: Convert spinlock to raw_spinlock
With the upcoming hwspinlock support for this driver, mfis_write() can
also be accessed from atomic contexts. Convert the spinlock guarding
the unprotect register to a raw_spinlock, so we will avoid potential
deadlocks with preempt_rt.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260718182355.50045-2-wsa+renesas@sang-engineering.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
| -rw-r--r-- | drivers/soc/renesas/rcar-mfis.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/soc/renesas/rcar-mfis.c b/drivers/soc/renesas/rcar-mfis.c index 3435c3e16198..c327a60789d0 100644 --- a/drivers/soc/renesas/rcar-mfis.c +++ b/drivers/soc/renesas/rcar-mfis.c @@ -50,7 +50,7 @@ struct mfis_chan_priv { }; struct mfis_priv { - spinlock_t unprotect_lock; /* guards access to the unprotection reg */ + raw_spinlock_t unprotect_lock; /* guards access to unprotection reg */ struct device *dev; struct mfis_reg common_reg; struct mfis_reg mbox_reg; @@ -80,10 +80,10 @@ static void mfis_write(struct mfis_reg *mreg, u32 reg, u32 val) unprotect_code = (MFIS_UNPROTECT_KEY & ~unprotect_mask) | ((mreg->start + reg) & unprotect_mask); - spin_lock_irqsave(&priv->unprotect_lock, flags); + raw_spin_lock_irqsave(&priv->unprotect_lock, flags); iowrite32(unprotect_code, priv->common_reg.base + MFISWACNTR); iowrite32(val, mreg->base + reg); - spin_unlock_irqrestore(&priv->unprotect_lock, flags); + raw_spin_unlock_irqrestore(&priv->unprotect_lock, flags); } /******************************************************** @@ -323,7 +323,7 @@ static int mfis_probe(struct platform_device *pdev) if (!priv->info) return -ENOENT; - spin_lock_init(&priv->unprotect_lock); + raw_spin_lock_init(&priv->unprotect_lock); ret = mfis_reg_probe(pdev, priv, &priv->common_reg, "common", true); if (ret) |
