Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad718dac authored by Jack Pham's avatar Jack Pham
Browse files

usb: dwc3: gadget: Rate limit ep_queue() error message



In case of a soft disconnect the controller will be halted
via dwc3_gadget_run_stop(). However, a function driver might
be unaware of this and could still be continuing to call
usb_ep_queue() in a different process. Since pullups_connected
is false, this results in a dev_err() to be printed and could
happen quite frequently before the function's disconnect or
unbind callbacks are finally notified. Rate limit this error
message to avoid flooding the kernel log.

Change-Id: If5299cdfd7eee13bb51a8cf29917d9674d0a7c9b
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 08a70590
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ int dwc3_gadget_ep0_queue(struct usb_ep *ep, struct usb_request *request,
	spin_lock_irqsave(&dwc->lock, flags);
	if (!dep->endpoint.desc || !dwc->pullups_connected ||
		!dwc->vbus_active) {
		dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
		dev_err_ratelimited(dwc->dev, "%s: can't queue to disabled endpoint\n",
				dep->name);
		ret = -ESHUTDOWN;
		goto out;
+1 −1
Original line number Diff line number Diff line
@@ -1554,7 +1554,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
	struct dwc3		*dwc = dep->dwc;

	if (!dep->endpoint.desc || !dwc->pullups_connected) {
		dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
		dev_err_ratelimited(dwc->dev, "%s: can't queue to disabled endpoint\n",
				dep->name);
		return -ESHUTDOWN;
	}