From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Johan Hovold <johan@kernel.org>
Cc: andersson@kernel.org, Thinh.Nguyen@synopsys.com,
gregkh@linuxfoundation.org, mathias.nyman@intel.com,
konrad.dybcio@linaro.org, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 4/5] usb: dwc3: qcom: Clear pending interrupt before enabling wake interrupt
Date: Tue, 28 Mar 2023 15:20:09 +0530 [thread overview]
Message-ID: <20230328095009.GC5695@thinkpad> (raw)
In-Reply-To: <ZCKzQA1YhXQ/6n3L@hovoldconsulting.com>
On Tue, Mar 28, 2023 at 11:28:32AM +0200, Johan Hovold wrote:
> On Sat, Mar 25, 2023 at 10:22:16PM +0530, Manivannan Sadhasivam wrote:
> > It is possible that there may be a pending interrupt logged into the dwc IP
> > while the interrupts were disabled in the driver. And when the wakeup
> > interrupt is enabled, the pending interrupt might fire which is not
> > required to be serviced by the driver.
> >
> > So always clear the pending interrupt before enabling wake interrupt.
> >
> > Cc: stable@vger.kernel.org # 5.20
> > Fixes: 360e8230516d ("usb: dwc3: qcom: Add helper functions to enable,disable wake irqs")
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> > drivers/usb/dwc3/dwc3-qcom.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> > index bbf67f705d0d..f1059dfcb0e8 100644
> > --- a/drivers/usb/dwc3/dwc3-qcom.c
> > +++ b/drivers/usb/dwc3/dwc3-qcom.c
> > @@ -346,6 +346,8 @@ static void dwc3_qcom_enable_wakeup_irq(int irq, unsigned int polarity)
> > if (!irq)
> > return;
> >
> > + irq_set_irqchip_state(irq, IRQCHIP_STATE_PENDING, 0);
> > +
>
> This looks like a hack (and a layering violation). Note that there are
> no other non-irqchip drivers calling this function.
>
I can check if this can be achieved by clearing some dwc specific registers.
- Mani
> > if (polarity)
> > irq_set_irq_type(irq, polarity);
>
> Johan
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2023-03-28 9:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-25 16:52 [PATCH 0/5] usb: dwc3: qcom: Allow runtime PM Manivannan Sadhasivam
2023-03-25 16:52 ` [PATCH 1/5] arm64: dts: qcom: sc8280xp: Add missing dwc3 quirks Manivannan Sadhasivam
2023-03-28 8:54 ` Johan Hovold
2023-03-28 9:38 ` Manivannan Sadhasivam
2023-03-29 5:26 ` Manivannan Sadhasivam
2023-03-29 8:34 ` Johan Hovold
2023-03-29 11:24 ` Konrad Dybcio
2023-03-29 12:15 ` Johan Hovold
2023-03-29 13:23 ` Manivannan Sadhasivam
2023-04-04 11:25 ` Johan Hovold
2023-03-25 16:52 ` [PATCH 2/5] xhci: host: Use 200ms autosuspend delay for runtime suspend Manivannan Sadhasivam
2023-03-25 16:52 ` [PATCH 3/5] usb: dwc3: qcom: Fix null ptr access during runtime_suspend() Manivannan Sadhasivam
2023-03-28 9:23 ` Johan Hovold
2023-03-28 9:47 ` Manivannan Sadhasivam
2023-03-28 9:51 ` Johan Hovold
2023-03-28 10:08 ` Manivannan Sadhasivam
2023-03-25 16:52 ` [PATCH 4/5] usb: dwc3: qcom: Clear pending interrupt before enabling wake interrupt Manivannan Sadhasivam
2023-03-28 9:28 ` Johan Hovold
2023-03-28 9:50 ` Manivannan Sadhasivam [this message]
2023-03-25 16:52 ` [PATCH 5/5] usb: dwc3: qcom: Allow runtime PM Manivannan Sadhasivam
2023-03-28 9:46 ` Johan Hovold
2023-03-28 10:05 ` Manivannan Sadhasivam
2023-03-28 12:18 ` Johan Hovold
2023-03-28 12:57 ` Manivannan Sadhasivam
2023-03-28 13:35 ` Johan Hovold
2023-03-27 9:01 ` [PATCH 0/5] " Konrad Dybcio
2023-03-27 9:17 ` Manivannan Sadhasivam
2023-03-27 9:24 ` Konrad Dybcio
2023-03-27 10:10 ` Manivannan Sadhasivam
2023-03-27 10:33 ` Konrad Dybcio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230328095009.GC5695@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=Thinh.Nguyen@synopsys.com \
--cc=andersson@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=robh+dt@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).