public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: qcom-geni: Use IRQF_NO_AUTOEN flag in request_irq()
@ 2024-09-12  3:34 Jinjie Ruan
  2024-09-12  4:51 ` Mukesh Kumar Savaliya
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jinjie Ruan @ 2024-09-12  3:34 UTC (permalink / raw)
  To: andi.shyti, swboyd, wsa, sdharia, girishm, dianders,
	linux-arm-msm, linux-i2c
  Cc: ruanjinjie

disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable when request IRQ.

Fixes: 37692de5d523 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/i2c/busses/i2c-qcom-geni.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index 06e836e3e877..4c9050a4d58e 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -818,15 +818,13 @@ static int geni_i2c_probe(struct platform_device *pdev)
 	init_completion(&gi2c->done);
 	spin_lock_init(&gi2c->lock);
 	platform_set_drvdata(pdev, gi2c);
-	ret = devm_request_irq(dev, gi2c->irq, geni_i2c_irq, 0,
+	ret = devm_request_irq(dev, gi2c->irq, geni_i2c_irq, IRQF_NO_AUTOEN,
 			       dev_name(dev), gi2c);
 	if (ret) {
 		dev_err(dev, "Request_irq failed:%d: err:%d\n",
 			gi2c->irq, ret);
 		return ret;
 	}
-	/* Disable the interrupt so that the system can enter low-power mode */
-	disable_irq(gi2c->irq);
 	i2c_set_adapdata(&gi2c->adap, gi2c);
 	gi2c->adap.dev.parent = dev;
 	gi2c->adap.dev.of_node = dev->of_node;
-- 
2.34.1


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

* Re: [PATCH] i2c: qcom-geni: Use IRQF_NO_AUTOEN flag in request_irq()
  2024-09-12  3:34 [PATCH] i2c: qcom-geni: Use IRQF_NO_AUTOEN flag in request_irq() Jinjie Ruan
@ 2024-09-12  4:51 ` Mukesh Kumar Savaliya
  2024-09-12  5:06 ` Vladimir Zapolskiy
  2024-09-12  6:19 ` Andi Shyti
  2 siblings, 0 replies; 4+ messages in thread
From: Mukesh Kumar Savaliya @ 2024-09-12  4:51 UTC (permalink / raw)
  To: Jinjie Ruan, andi.shyti, swboyd, wsa, sdharia, girishm, dianders,
	linux-arm-msm, linux-i2c

Looks good to me.

On 9/12/2024 9:04 AM, Jinjie Ruan wrote:
> disable_irq() after request_irq() still has a time gap in which
> interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
> disable IRQ auto-enable when request IRQ.
> 
> Fixes: 37692de5d523 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Acked-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
> ---
>   drivers/i2c/busses/i2c-qcom-geni.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
> index 06e836e3e877..4c9050a4d58e 100644
> --- a/drivers/i2c/busses/i2c-qcom-geni.c
> +++ b/drivers/i2c/busses/i2c-qcom-geni.c
> @@ -818,15 +818,13 @@ static int geni_i2c_probe(struct platform_device *pdev)
>   	init_completion(&gi2c->done);
>   	spin_lock_init(&gi2c->lock);
>   	platform_set_drvdata(pdev, gi2c);
> -	ret = devm_request_irq(dev, gi2c->irq, geni_i2c_irq, 0,
> +	ret = devm_request_irq(dev, gi2c->irq, geni_i2c_irq, IRQF_NO_AUTOEN,
>   			       dev_name(dev), gi2c);
>   	if (ret) {
>   		dev_err(dev, "Request_irq failed:%d: err:%d\n",
>   			gi2c->irq, ret);
>   		return ret;
>   	}
> -	/* Disable the interrupt so that the system can enter low-power mode */
> -	disable_irq(gi2c->irq);
>   	i2c_set_adapdata(&gi2c->adap, gi2c);
>   	gi2c->adap.dev.parent = dev;
>   	gi2c->adap.dev.of_node = dev->of_node;

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

* Re: [PATCH] i2c: qcom-geni: Use IRQF_NO_AUTOEN flag in request_irq()
  2024-09-12  3:34 [PATCH] i2c: qcom-geni: Use IRQF_NO_AUTOEN flag in request_irq() Jinjie Ruan
  2024-09-12  4:51 ` Mukesh Kumar Savaliya
@ 2024-09-12  5:06 ` Vladimir Zapolskiy
  2024-09-12  6:19 ` Andi Shyti
  2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Zapolskiy @ 2024-09-12  5:06 UTC (permalink / raw)
  To: Jinjie Ruan, andi.shyti, swboyd, wsa, sdharia, girishm, dianders,
	linux-arm-msm, linux-i2c

On 9/12/24 06:34, Jinjie Ruan wrote:
> disable_irq() after request_irq() still has a time gap in which
> interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
> disable IRQ auto-enable when request IRQ.
> 
> Fixes: 37692de5d523 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
>   drivers/i2c/busses/i2c-qcom-geni.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
> index 06e836e3e877..4c9050a4d58e 100644
> --- a/drivers/i2c/busses/i2c-qcom-geni.c
> +++ b/drivers/i2c/busses/i2c-qcom-geni.c
> @@ -818,15 +818,13 @@ static int geni_i2c_probe(struct platform_device *pdev)
>   	init_completion(&gi2c->done);
>   	spin_lock_init(&gi2c->lock);
>   	platform_set_drvdata(pdev, gi2c);
> -	ret = devm_request_irq(dev, gi2c->irq, geni_i2c_irq, 0,
> +	ret = devm_request_irq(dev, gi2c->irq, geni_i2c_irq, IRQF_NO_AUTOEN,
>   			       dev_name(dev), gi2c);
>   	if (ret) {
>   		dev_err(dev, "Request_irq failed:%d: err:%d\n",
>   			gi2c->irq, ret);
>   		return ret;
>   	}
> -	/* Disable the interrupt so that the system can enter low-power mode */
> -	disable_irq(gi2c->irq);
>   	i2c_set_adapdata(&gi2c->adap, gi2c);
>   	gi2c->adap.dev.parent = dev;
>   	gi2c->adap.dev.of_node = dev->of_node;

Thank you for the change.

Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

--
Best wishes,
Vladimir

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

* Re: [PATCH] i2c: qcom-geni: Use IRQF_NO_AUTOEN flag in request_irq()
  2024-09-12  3:34 [PATCH] i2c: qcom-geni: Use IRQF_NO_AUTOEN flag in request_irq() Jinjie Ruan
  2024-09-12  4:51 ` Mukesh Kumar Savaliya
  2024-09-12  5:06 ` Vladimir Zapolskiy
@ 2024-09-12  6:19 ` Andi Shyti
  2 siblings, 0 replies; 4+ messages in thread
From: Andi Shyti @ 2024-09-12  6:19 UTC (permalink / raw)
  To: Jinjie Ruan
  Cc: swboyd, wsa, sdharia, girishm, dianders, linux-arm-msm, linux-i2c

Hi Jinjie,

On Thu, Sep 12, 2024 at 11:34:59AM GMT, Jinjie Ruan wrote:
> disable_irq() after request_irq() still has a time gap in which
> interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
> disable IRQ auto-enable when request IRQ.
> 
> Fixes: 37692de5d523 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>

merged to i2c/i2c-host-fixes.

Thanks,
Andi

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

end of thread, other threads:[~2024-09-12  6:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-12  3:34 [PATCH] i2c: qcom-geni: Use IRQF_NO_AUTOEN flag in request_irq() Jinjie Ruan
2024-09-12  4:51 ` Mukesh Kumar Savaliya
2024-09-12  5:06 ` Vladimir Zapolskiy
2024-09-12  6:19 ` Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox