From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Roy Luo <royluo@google.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"badhri@google.com" <badhri@google.com>
Subject: Re: [PATCH v1] usb: dwc3: Add error logs for unknown endpoint events
Date: Wed, 3 May 2023 23:00:58 +0000 [thread overview]
Message-ID: <20230503230053.mbhh6p2h4qakfc65@synopsys.com> (raw)
In-Reply-To: <20230503003144.3782774-1-royluo@google.com>
On Wed, May 03, 2023, Roy Luo wrote:
> In cases where the controller somehow fails to write to event buffer
> memory (e.g. due to incorrect MMU config), the driver would receive
> all-zero dwc3 events. However, the abnormal event is silently dropped
> as a regular ep0out event.
When it does happen, will these prints flood the dmesg log?
> Add error logs when an unknown endpoint event is received to highlight
> the anamoly.
anomaly?
>
> Signed-off-by: Roy Luo <royluo@google.com>
> ---
> drivers/usb/dwc3/ep0.c | 2 ++
> drivers/usb/dwc3/gadget.c | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
> index 953b752a5052..8c9560a9999e 100644
> --- a/drivers/usb/dwc3/ep0.c
> +++ b/drivers/usb/dwc3/ep0.c
> @@ -1207,5 +1207,7 @@ void dwc3_ep0_interrupt(struct dwc3 *dwc,
> dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
> }
> break;
> + default:
> + dev_err(dwc->dev, "unknown endpoint event %d\n", event->endpoint_event);
Can we add a break here?
> }
> }
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index c0ca4d12f95d..054f6f297e17 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -3803,6 +3803,8 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
> break;
> case DWC3_DEPEVT_RXTXFIFOEVT:
> break;
> + default:
> + dev_err(dwc->dev, "unknown endpoint event %d\n", event->endpoint_event);
and here too.
> }
> }
>
>
> base-commit: c8c655c34e33544aec9d64b660872ab33c29b5f1
> --
> 2.40.1.495.gc816e09b53d-goog
>
Thanks,
Thinh
next prev parent reply other threads:[~2023-05-03 23:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-03 0:31 Roy Luo
2023-05-03 23:00 ` Thinh Nguyen [this message]
2023-05-03 23:52 ` Roy Luo
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=20230503230053.mbhh6p2h4qakfc65@synopsys.com \
--to=thinh.nguyen@synopsys.com \
--cc=badhri@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=royluo@google.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
all inboxes | Powered by JetHome®