diff mbox series

[v9,4/5] usb: dwc3: qcom: Change the IRQ flag for DP/DM hs phy irq

Message ID 1635753224-23975-5-git-send-email-quic_c_sanm@quicinc.com (mailing list archive)
State Superseded
Headers show
Series USB DWC3 host wake up support from system suspend | expand

Commit Message

Sandeep Maheswaram Nov. 1, 2021, 7:53 a.m. UTC
Change the IRQ flags for DP/DM hs phy irq to avoid interrupt
triggering during system suspend.

Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
---
 drivers/usb/dwc3/dwc3-qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Bjorn Andersson Nov. 1, 2021, 4:31 p.m. UTC | #1
On Mon 01 Nov 00:53 PDT 2021, Sandeep Maheswaram wrote:

> Change the IRQ flags for DP/DM hs phy irq to avoid interrupt
> triggering during system suspend.
> 

Why does replacing HIGH with RISING change this behavior, or do you get
a RISING interrupt just before hitting suspend which you ignore?

I think it would be nice to have the commit message for this (or per
below request the DTS change) include some details about what's really
happening on the irq line.

> Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
> ---
>  drivers/usb/dwc3/dwc3-qcom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index 54461f1..356f4f8 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -473,7 +473,7 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev)
>  		irq_set_status_flags(irq, IRQ_NOAUTOEN);
>  		ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
>  					qcom_dwc3_resume_irq,
> -					IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
> +					IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,

IRQF_TRIGGER_* should be omitted from the driver and supplied by the DT.

The dtbs out there should all have IRQ_TYPE_LEVEL_HIGH at this time, so
simply dropping that from this list and updating the dts would be the
right thing to do.

Regards,
Bjorn

>  					"qcom_dwc3 DP_HS", qcom);
>  		if (ret) {
>  			dev_err(qcom->dev, "dp_hs_phy_irq failed: %d\n", ret);
> @@ -488,7 +488,7 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev)
>  		irq_set_status_flags(irq, IRQ_NOAUTOEN);
>  		ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
>  					qcom_dwc3_resume_irq,
> -					IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
> +					IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
>  					"qcom_dwc3 DM_HS", qcom);
>  		if (ret) {
>  			dev_err(qcom->dev, "dm_hs_phy_irq failed: %d\n", ret);
> -- 
> 2.7.4
>
Sandeep Maheswaram Nov. 18, 2021, 11:45 a.m. UTC | #2
On 11/1/2021 10:01 PM, Bjorn Andersson wrote:
> On Mon 01 Nov 00:53 PDT 2021, Sandeep Maheswaram wrote:
>
>> Change the IRQ flags for DP/DM hs phy irq to avoid interrupt
>> triggering during system suspend.
>>
> Why does replacing HIGH with RISING change this behavior, or do you get
> a RISING interrupt just before hitting suspend which you ignore?
>
> I think it would be nice to have the commit message for this (or per
> below request the DTS change) include some details about what's really
> happening on the irq line.

When we use IRQF_TRIGGER_HIGH we get interrupt during PM suspend and 
causes resume.

[  119.743083] Resume caused by IRQ 101, qcom_dwc3 DP_HS

>> Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
>> ---
>>   drivers/usb/dwc3/dwc3-qcom.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
>> index 54461f1..356f4f8 100644
>> --- a/drivers/usb/dwc3/dwc3-qcom.c
>> +++ b/drivers/usb/dwc3/dwc3-qcom.c
>> @@ -473,7 +473,7 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev)
>>   		irq_set_status_flags(irq, IRQ_NOAUTOEN);
>>   		ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
>>   					qcom_dwc3_resume_irq,
>> -					IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
>> +					IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> IRQF_TRIGGER_* should be omitted from the driver and supplied by the DT.
>
> The dtbs out there should all have IRQ_TYPE_LEVEL_HIGH at this time, so
> simply dropping that from this list and updating the dts would be the
> right thing to do.
>
> Regards,
> Bjorn
Ok. Dropping IRQF_TRIGGER_*  solved the resume issue during PM suspend.
>>   					"qcom_dwc3 DP_HS", qcom);
>>   		if (ret) {
>>   			dev_err(qcom->dev, "dp_hs_phy_irq failed: %d\n", ret);
>> @@ -488,7 +488,7 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev)
>>   		irq_set_status_flags(irq, IRQ_NOAUTOEN);
>>   		ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
>>   					qcom_dwc3_resume_irq,
>> -					IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
>> +					IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
>>   					"qcom_dwc3 DM_HS", qcom);
>>   		if (ret) {
>>   			dev_err(qcom->dev, "dm_hs_phy_irq failed: %d\n", ret);
>> -- 
>> 2.7.4
>>
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 54461f1..356f4f8 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -473,7 +473,7 @@  static int dwc3_qcom_setup_irq(struct platform_device *pdev)
 		irq_set_status_flags(irq, IRQ_NOAUTOEN);
 		ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
 					qcom_dwc3_resume_irq,
-					IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
+					IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
 					"qcom_dwc3 DP_HS", qcom);
 		if (ret) {
 			dev_err(qcom->dev, "dp_hs_phy_irq failed: %d\n", ret);
@@ -488,7 +488,7 @@  static int dwc3_qcom_setup_irq(struct platform_device *pdev)
 		irq_set_status_flags(irq, IRQ_NOAUTOEN);
 		ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
 					qcom_dwc3_resume_irq,
-					IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
+					IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
 					"qcom_dwc3 DM_HS", qcom);
 		if (ret) {
 			dev_err(qcom->dev, "dm_hs_phy_irq failed: %d\n", ret);