* [PATCH] i2c: imx: add irqf_no_suspend
@ 2022-03-07 14:36 Alifer Moraes
2022-03-11 9:01 ` Oleksij Rempel
2022-03-11 10:57 ` (EXT) " Alexander Stein
0 siblings, 2 replies; 5+ messages in thread
From: Alifer Moraes @ 2022-03-07 14:36 UTC (permalink / raw)
To: linux-kernel
Cc: eran.m, festevam, kernel, linux-arm-kernel, linux-imx, linux-i2c,
linux, pierluigi.p, s.hauer, shawnguo, gaopan, Fugang Duan,
Vipul Kumar
From: gaopan <b54642@freescale.com>
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.
Signed-off-by: Gao Pan <b54642@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
---
drivers/i2c/busses/i2c-imx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 27f969b3dc07..fcc09a1e7f44 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -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);
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: imx: add irqf_no_suspend
2022-03-07 14:36 [PATCH] i2c: imx: add irqf_no_suspend Alifer Moraes
@ 2022-03-11 9:01 ` Oleksij Rempel
2022-03-11 10:57 ` (EXT) " Alexander Stein
1 sibling, 0 replies; 5+ messages in thread
From: Oleksij Rempel @ 2022-03-11 9:01 UTC (permalink / raw)
To: Alifer Moraes
Cc: linux-kernel, pierluigi.p, Fugang Duan, shawnguo, s.hauer,
gaopan, linux, eran.m, linux-i2c, kernel, Vipul Kumar, festevam,
linux-arm-kernel, linux-imx
On Mon, Mar 07, 2022 at 11:36:30AM -0300, Alifer Moraes wrote:
> From: gaopan <b54642@freescale.com>
>
> 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.
>
> Signed-off-by: Gao Pan <b54642@freescale.com>
> Signed-off-by: Fugang Duan <B38611@freescale.com>
> Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Thank you!
> ---
> drivers/i2c/busses/i2c-imx.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index 27f969b3dc07..fcc09a1e7f44 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -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);
> --
> 2.25.1
>
>
>
--
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 |
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: (EXT) [PATCH] i2c: imx: add irqf_no_suspend
2022-03-07 14:36 [PATCH] i2c: imx: add irqf_no_suspend Alifer Moraes
2022-03-11 9:01 ` Oleksij Rempel
@ 2022-03-11 10:57 ` Alexander Stein
2022-05-21 10:24 ` Wolfram Sang
1 sibling, 1 reply; 5+ messages in thread
From: Alexander Stein @ 2022-03-11 10:57 UTC (permalink / raw)
To: Alifer Moraes
Cc: linux-kernel, linux-arm-kernel, eran.m, festevam, kernel,
linux-arm-kernel, linux-imx, linux-i2c, linux, pierluigi.p,
s.hauer, shawnguo, gaopan, Fugang Duan, Vipul Kumar
Hallo,
Am Montag, 7. März 2022, 15:36:30 CET schrieb Alifer Moraes:
> From: gaopan <b54642@freescale.com>
>
> 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.
>
> Signed-off-by: Gao Pan <b54642@freescale.com>
> Signed-off-by: Fugang Duan <B38611@freescale.com>
> Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
> ---
> drivers/i2c/busses/i2c-imx.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index 27f969b3dc07..fcc09a1e7f44 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -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:
> For this reason, using IRQF_NO_SUSPEND and IRQF_SHARED at 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: (EXT) [PATCH] i2c: imx: add irqf_no_suspend
2022-03-11 10:57 ` (EXT) " Alexander Stein
@ 2022-05-21 10:24 ` Wolfram Sang
0 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2022-05-21 10:24 UTC (permalink / raw)
To: Alexander Stein
Cc: Alifer Moraes, linux-kernel, linux-arm-kernel, eran.m, festevam,
kernel, linux-imx, linux-i2c, linux, pierluigi.p, s.hauer,
shawnguo, gaopan, Fugang Duan, Vipul Kumar
[-- Attachment #1: Type: text/plain, Size: 1371 bytes --]
Hi everyone,
> > 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.
> >
> > Signed-off-by: Gao Pan <b54642@freescale.com>
> > Signed-off-by: Fugang Duan <B38611@freescale.com>
> > Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
The SoB from Alifer Moraes is missing, too.
> > 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:
> > For this reason, using IRQF_NO_SUSPEND and IRQF_SHARED at 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: imx: add irqf_no_suspend
@ 2022-06-20 13:29 Pierluigi Passaro
0 siblings, 0 replies; 5+ messages in thread
From: Pierluigi Passaro @ 2022-06-20 13:29 UTC (permalink / raw)
To: Wolfram Sang, Alexander Stein
Cc: Alifer Willians de Moraes, linux-kernel, linux-arm-kernel,
Eran Matityahu, festevam, kernel, linux-imx, linux-i2c, linux,
s.hauer, shawnguo, gaopan, Fugang Duan, Vipul Kumar
Hi All,
> Hi everyone,
> > > 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.
> > >
> > > Signed-off-by: Gao Pan <b54642@freescale.com>
> > > Signed-off-by: Fugang Duan <B38611@freescale.com>
> > > Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
> The SoB from Alifer Moraes is missing, too.
> > > 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:
> > > For this reason, using IRQF_NO_SUSPEND and IRQF_SHARED at 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?
This patch has been introduced to fix the following behavior.
HW conditions
- Variscite DART-MX8M on DT8MCustomBoard v2.x or higher.
- The PCIe connector uses a reset pin coming from a GPIO expander connected to the I2C bus.
SW behavior
- Upon wake-up, the PCIe try toggling the reset pins, but the GPIO expander / I2C bus are still suspended, leading to a PCIe wake-up failure.
From our investigation, we can't identify a way to postpone PCIe wake-up after I2C wake-up.
This patch is still present in latest NXP kernel 5.15, but please let me know if you think this should be approached / fixed in a different way.
Thanks
Regards
Pier
> Thank you for this comment, Alexander. I second you, this needs
> explanation.
> Happy hacking,
> Wolfram
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-06-20 14:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07 14:36 [PATCH] i2c: imx: add irqf_no_suspend Alifer Moraes
2022-03-11 9:01 ` Oleksij Rempel
2022-03-11 10:57 ` (EXT) " Alexander Stein
2022-05-21 10:24 ` Wolfram Sang
2022-06-20 13:29 Pierluigi Passaro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).