diff mbox series

[1/2] i2c: exynos5: Remove IRQF_ONESHOT

Message ID 20190813115555.10542-2-bigeasy@linutronix.de (mailing list archive)
State Not Applicable
Headers show
Series [1/2] i2c: exynos5: Remove IRQF_ONESHOT | expand

Commit Message

Sebastian Andrzej Siewior Aug. 13, 2019, 11:55 a.m. UTC
The drivers sets IRQF_ONESHOT and passes only a primary handler. The IRQ
is masked while the primary is handler is invoked independently of
IRQF_ONESHOT.
With IRQF_ONESHOT the core code will not force-thread the interrupt and
this is probably not intended. I *assume* that the original author copied
the IRQ registration from another driver which passed a primary and
secondary handler and removed the secondary handler but keeping the
ONESHOT flag.

Remove IRQF_ONESHOT.

Reported-by: Benjamin Rouxel <benjamin.rouxel@uva.nl>
Tested-by: Benjamin Rouxel <benjamin.rouxel@uva.nl>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/i2c/busses/i2c-exynos5.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Wolfram Sang Sept. 3, 2019, 5:54 p.m. UTC | #1
On Tue, Aug 13, 2019 at 01:55:54PM +0200, Sebastian Andrzej Siewior wrote:
> The drivers sets IRQF_ONESHOT and passes only a primary handler. The IRQ
> is masked while the primary is handler is invoked independently of
> IRQF_ONESHOT.
> With IRQF_ONESHOT the core code will not force-thread the interrupt and
> this is probably not intended. I *assume* that the original author copied
> the IRQ registration from another driver which passed a primary and
> secondary handler and removed the secondary handler but keeping the
> ONESHOT flag.
> 
> Remove IRQF_ONESHOT.
> 
> Reported-by: Benjamin Rouxel <benjamin.rouxel@uva.nl>
> Tested-by: Benjamin Rouxel <benjamin.rouxel@uva.nl>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: Krzysztof Kozlowski <krzk@kernel.org>
> Cc: linux-samsung-soc@vger.kernel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Krzysztof, are you okay with this change?

> ---
>  drivers/i2c/busses/i2c-exynos5.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
> index e4e7932f78000..e7514c16b756c 100644
> --- a/drivers/i2c/busses/i2c-exynos5.c
> +++ b/drivers/i2c/busses/i2c-exynos5.c
> @@ -791,9 +791,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
>  	}
>  
>  	ret = devm_request_irq(&pdev->dev, i2c->irq, exynos5_i2c_irq,
> -				IRQF_NO_SUSPEND | IRQF_ONESHOT,
> -				dev_name(&pdev->dev), i2c);
> -
> +			       IRQF_NO_SUSPEND, dev_name(&pdev->dev), i2c);
>  	if (ret != 0) {
>  		dev_err(&pdev->dev, "cannot request HS-I2C IRQ %d\n", i2c->irq);
>  		goto err_clk;
> -- 
> 2.23.0.rc1
>
Krzysztof Kozlowski Sept. 4, 2019, 7:14 a.m. UTC | #2
On Tue, 3 Sep 2019 at 19:54, Wolfram Sang <wsa@the-dreams.de> wrote:
>
> On Tue, Aug 13, 2019 at 01:55:54PM +0200, Sebastian Andrzej Siewior wrote:
> > The drivers sets IRQF_ONESHOT and passes only a primary handler. The IRQ
> > is masked while the primary is handler is invoked independently of
> > IRQF_ONESHOT.
> > With IRQF_ONESHOT the core code will not force-thread the interrupt and
> > this is probably not intended. I *assume* that the original author copied
> > the IRQ registration from another driver which passed a primary and
> > secondary handler and removed the secondary handler but keeping the
> > ONESHOT flag.
> >
> > Remove IRQF_ONESHOT.
> >
> > Reported-by: Benjamin Rouxel <benjamin.rouxel@uva.nl>
> > Tested-by: Benjamin Rouxel <benjamin.rouxel@uva.nl>
> > Cc: Kukjin Kim <kgene@kernel.org>
> > Cc: Krzysztof Kozlowski <krzk@kernel.org>
> > Cc: linux-samsung-soc@vger.kernel.org
> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> Krzysztof, are you okay with this change?

I do not have a clue what the original author back in 2013 had in
mind, but change itself looks reasonable. I also gave it a try and it
seems it works fine:

Tested-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
Wolfram Sang Sept. 4, 2019, 9:13 p.m. UTC | #3
On Tue, Aug 13, 2019 at 01:55:54PM +0200, Sebastian Andrzej Siewior wrote:
> The drivers sets IRQF_ONESHOT and passes only a primary handler. The IRQ
> is masked while the primary is handler is invoked independently of
> IRQF_ONESHOT.
> With IRQF_ONESHOT the core code will not force-thread the interrupt and
> this is probably not intended. I *assume* that the original author copied
> the IRQ registration from another driver which passed a primary and
> secondary handler and removed the secondary handler but keeping the
> ONESHOT flag.
> 
> Remove IRQF_ONESHOT.
> 
> Reported-by: Benjamin Rouxel <benjamin.rouxel@uva.nl>
> Tested-by: Benjamin Rouxel <benjamin.rouxel@uva.nl>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: Krzysztof Kozlowski <krzk@kernel.org>
> Cc: linux-samsung-soc@vger.kernel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Applied to for-next, thanks!
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
index e4e7932f78000..e7514c16b756c 100644
--- a/drivers/i2c/busses/i2c-exynos5.c
+++ b/drivers/i2c/busses/i2c-exynos5.c
@@ -791,9 +791,7 @@  static int exynos5_i2c_probe(struct platform_device *pdev)
 	}
 
 	ret = devm_request_irq(&pdev->dev, i2c->irq, exynos5_i2c_irq,
-				IRQF_NO_SUSPEND | IRQF_ONESHOT,
-				dev_name(&pdev->dev), i2c);
-
+			       IRQF_NO_SUSPEND, dev_name(&pdev->dev), i2c);
 	if (ret != 0) {
 		dev_err(&pdev->dev, "cannot request HS-I2C IRQ %d\n", i2c->irq);
 		goto err_clk;