From: Weihang Li <liweihang@huawei.com>
To: <wsa@kernel.org>, <linux-i2c@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mips@vger.kernel.org>
Cc: <linuxarm@openeuler.org>, Weihang Li <liweihang@huawei.com>,
Baruch Siach <baruch@tkos.co.il>,
Paul Cercueil <paul@crapouillou.net>
Subject: [PATCH] i2c: busses: Replace spin_lock_irqsave with spin_lock in hard IRQ
Date: Mon, 8 Feb 2021 18:48:37 +0800 [thread overview]
Message-ID: <1612781317-51815-1-git-send-email-liweihang@huawei.com> (raw)
There is no need to do irqsave and irqrestore in context of hard IRQ.
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Weihang Li <liweihang@huawei.com>
---
drivers/i2c/busses/i2c-digicolor.c | 5 ++---
drivers/i2c/busses/i2c-jz4780.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-digicolor.c b/drivers/i2c/busses/i2c-digicolor.c
index f67639d..60c838c 100644
--- a/drivers/i2c/busses/i2c-digicolor.c
+++ b/drivers/i2c/busses/i2c-digicolor.c
@@ -160,12 +160,11 @@ static irqreturn_t dc_i2c_irq(int irq, void *dev_id)
{
struct dc_i2c *i2c = dev_id;
int cmd_status = dc_i2c_cmd_status(i2c);
- unsigned long flags;
u8 addr_cmd;
writeb_relaxed(1, i2c->regs + II_INTFLAG_CLEAR);
- spin_lock_irqsave(&i2c->lock, flags);
+ spin_lock(&i2c->lock);
if (cmd_status == II_CMD_STATUS_ACK_BAD
|| cmd_status == II_CMD_STATUS_ABORT) {
@@ -207,7 +206,7 @@ static irqreturn_t dc_i2c_irq(int irq, void *dev_id)
}
out:
- spin_unlock_irqrestore(&i2c->lock, flags);
+ spin_unlock(&i2c->lock);
return IRQ_HANDLED;
}
diff --git a/drivers/i2c/busses/i2c-jz4780.c b/drivers/i2c/busses/i2c-jz4780.c
index cb4a25e..8509c5f 100644
--- a/drivers/i2c/busses/i2c-jz4780.c
+++ b/drivers/i2c/busses/i2c-jz4780.c
@@ -437,9 +437,8 @@ static irqreturn_t jz4780_i2c_irq(int irqno, void *dev_id)
unsigned short intst;
unsigned short intmsk;
struct jz4780_i2c *i2c = dev_id;
- unsigned long flags;
- spin_lock_irqsave(&i2c->lock, flags);
+ spin_lock(&i2c->lock);
intmsk = jz4780_i2c_readw(i2c, JZ4780_I2C_INTM);
intst = jz4780_i2c_readw(i2c, JZ4780_I2C_INTST);
@@ -551,7 +550,7 @@ static irqreturn_t jz4780_i2c_irq(int irqno, void *dev_id)
}
done:
- spin_unlock_irqrestore(&i2c->lock, flags);
+ spin_unlock(&i2c->lock);
return IRQ_HANDLED;
}
--
2.8.1
next reply other threads:[~2021-02-08 10:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 10:48 Weihang Li [this message]
2021-02-12 7:42 ` [PATCH] i2c: busses: Replace spin_lock_irqsave with spin_lock in hard IRQ Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1612781317-51815-1-git-send-email-liweihang@huawei.com \
--to=liweihang@huawei.com \
--cc=baruch@tkos.co.il \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linuxarm@openeuler.org \
--cc=paul@crapouillou.net \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox