From: Peter Chen <peter.chen@kernel.org>
To: Xu Yang <xu.yang_2@nxp.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
imx@lists.linux.dev, jun.li@nxp.com
Subject: Re: [PATCH] usb: chipidea: udc: enable suspend interrupt after usb reset
Date: Mon, 26 Aug 2024 09:11:08 +0800 [thread overview]
Message-ID: <20240826011108.GA807665@nchen-desktop> (raw)
In-Reply-To: <20240823073832.1702135-1-xu.yang_2@nxp.com>
On 24-08-23 15:38:32, Xu Yang wrote:
> Currently, suspend interrupt is enabled before pullup enable operation.
> This will cause a suspend interrupt assert right after pullup DP. This
> suspend interrupt is meaningless, so this will ignore such interrupt
> by enable it after usb reset completed.
>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
> ---
> drivers/usb/chipidea/udc.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
> index 2d7f616270c1..69ef3cd8d4f8 100644
> --- a/drivers/usb/chipidea/udc.c
> +++ b/drivers/usb/chipidea/udc.c
> @@ -86,7 +86,7 @@ static int hw_device_state(struct ci_hdrc *ci, u32 dma)
> hw_write(ci, OP_ENDPTLISTADDR, ~0, dma);
> /* interrupt, error, port change, reset, sleep/suspend */
> hw_write(ci, OP_USBINTR, ~0,
> - USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);
> + USBi_UI|USBi_UEI|USBi_PCI|USBi_URI);
> } else {
> hw_write(ci, OP_USBINTR, ~0, 0);
> }
> @@ -877,6 +877,7 @@ __releases(ci->lock)
> __acquires(ci->lock)
> {
> int retval;
> + u32 intr;
>
> spin_unlock(&ci->lock);
> if (ci->gadget.speed != USB_SPEED_UNKNOWN)
> @@ -890,6 +891,11 @@ __acquires(ci->lock)
> if (retval)
> goto done;
>
> + /* clear SLI */
> + hw_write(ci, OP_USBSTS, USBi_SLI, USBi_SLI);
> + intr = hw_read(ci, OP_USBINTR, ~0);
> + hw_write(ci, OP_USBINTR, ~0, intr | USBi_SLI);
> +
> ci->status = usb_ep_alloc_request(&ci->ep0in->ep, GFP_ATOMIC);
> if (ci->status == NULL)
> retval = -ENOMEM;
> --
> 2.34.1
>
prev parent reply other threads:[~2024-08-26 1:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 7:38 [PATCH] usb: chipidea: udc: enable suspend interrupt after usb reset Xu Yang
2024-08-26 1:11 ` Peter Chen [this message]
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=20240826011108.GA807665@nchen-desktop \
--to=peter.chen@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=imx@lists.linux.dev \
--cc=jun.li@nxp.com \
--cc=linux-usb@vger.kernel.org \
--cc=xu.yang_2@nxp.com \
/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).