i2c: imx: add irqf_no_suspend
PATCH 1/1 i2c: imx: add irqf_no_suspend
From: gaopan <[email protected]>
The i2c irq is masked when pcie starts a i2c transfer process during noirq suspend stage. As a result, i2c transfer fails. To solve the problem, IRQF_NO_SUSPEND is added to i2c bus.
--- drivers/i2c/busses/i2c-imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-imx.c +2 -1
@@ -1478,7 +1478,8 @@ static int i2c_imx_probe(struct platform_device *pdev) goto rpm_disable;/* Request IRQ */ - ret =request_threaded_irq (irq, i2c_imx_isr,NULL ,IRQF_SHARED , + ret =request_threaded_irq (irq, i2c_imx_isr,NULL , +IRQF_SHARED |IRQF_NO_SUSPEND , pdev->name, i2c_imx);if (ret) {dev_err (&pdev->dev,"can't claim irq %d\n" , irq);
Signature · 1 line
2.25.1
Quoted 9 lines · Alifer Moraes
From: gaopan <[email protected]>
The i2c irq is masked when pcie starts a i2c transfer process during noirq suspend stage. As a result, i2c transfer fails. To solve the problem,
IRQF_NO_SUSPENDis added to i2c bus.Signed-off-by Gao Pan <[email protected]>Signed-off-by Fugang Duan <[email protected]>Signed-off-by Vipul Kumar <[email protected]>
Thank you!
Quoted 23 lines
--- drivers/i2c/busses/i2c-imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/i2c/busses/i2c-imx.c +2
-1@@ -1478,7 +1478,8 @@ static int i2c_imx_probe(struct platform_device *pdev) goto rpm_disable;/* Request IRQ */ - ret =request_threaded_irq (irq, i2c_imx_isr,NULL ,IRQF_SHARED , + ret =request_threaded_irq (irq, i2c_imx_isr,NULL , +IRQF_SHARED |IRQF_NO_SUSPEND , pdev->name, i2c_imx);if (ret) {dev_err (&pdev->dev,"can't claim irq %d\n" , irq);Signature · 1 line
2.25.1
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Re: (EXT) [PATCH] i2c: imx: add irqf_no_suspend
In reply to Alifer MoraesHallo,
Am Montag, 7. März 2022, 15:36:30 CET schrieb Alifer Moraes:
Quoted 18 lines
From: gaopan <[email protected]>
The i2c irq is masked when pcie starts a i2c transfer process during noirq suspend stage. As a result, i2c transfer fails. To solve the problem,
IRQF_NO_SUSPENDis added to i2c bus.Signed-off-by Gao Pan <[email protected]>Signed-off-by Fugang Duan <[email protected]>Signed-off-by Vipul Kumar <[email protected]>--- drivers/i2c/busses/i2c-imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/i2c/busses/i2c-imx.c +0
-0
drivers/i2c/busses/i2c-imx.c static int i2c_imx_probe(struct platform_device *pdev) · line 1485
Quoted 9 lines
drivers/i2c/busses/i2c-imx.c +2
-1@@ -1478,7 +1478,8 @@ static int i2c_imx_probe(struct platform_device *pdev) goto rpm_disable;/* Request IRQ */ - ret =request_threaded_irq (irq, i2c_imx_isr,NULL ,IRQF_SHARED , + ret =request_threaded_irq (irq, i2c_imx_isr,NULL , +IRQF_SHARED |IRQF_NO_SUSPEND , pdev->name, i2c_imx);if (ret) {dev_err (&pdev->dev,"can't claim irq %d\n" , irq);
I stumbled across Documentation/power/suspend-and-interrupts.rst which states:
Quoted 2 lines
For this reason, using
IRQF_NO_SUSPENDandIRQF_SHAREDat the same time should be avoided.
Given this IMHO at least a comment should be inserted why this is fine. I dont have a full picture about the situation, but to me it seems there is a reference missing, or why/how does some PCIe start some I2C transfer when the controller is suspended already? Do I miss something?
Best regards,
Alexander
Re: (EXT) [PATCH] i2c: imx: add irqf_no_suspend
Hi everyone,
Quoted 7 lines
Quoted 7 lines
The i2c irq is masked when pcie starts a i2c transfer process during noirq suspend stage. As a result, i2c transfer fails. To solve the problem,
IRQF_NO_SUSPENDis added to i2c bus.Signed-off-by Gao Pan <[email protected]>Signed-off-by Fugang Duan <[email protected]>Signed-off-by Vipul Kumar <[email protected]>
The SoB from Alifer Moraes is missing, too.
Quoted 12 lines
drivers/i2c/busses/i2c-imx.c static int i2c_imx_probe(struct platform_device *pdev) · line 1485
Quoted 9 lines
goto
rpm_disable;drivers/i2c/busses/i2c-imx.c +2
-1/* Request IRQ */ - ret =request_threaded_irq (irq, i2c_imx_isr,NULL ,IRQF_SHARED , + ret =request_threaded_irq (irq, i2c_imx_isr,NULL , +IRQF_SHARED |IRQF_NO_SUSPEND , pdev->name, i2c_imx);if (ret) {dev_err (&pdev->dev,"can't claim irq %d\n" , irq);I stumbled across
Documentation/power/suspend-and-interrupts.rstwhich states:
Quoted 6 lines
Quoted 2 lines
For this reason, using
IRQF_NO_SUSPENDandIRQF_SHAREDat the same time should be avoided.Given this IMHO at least a comment should be inserted why this is fine. I dont have a full picture about the situation, but to me it seems there is a reference missing, or why/how does some PCIe start some I2C transfer when the controller is suspended already? Do I miss something?
Thank you for this comment, Alexander. I second you, this needs explanation.
Happy hacking,
Wolfram