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

Commit 842553e6 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: dwc3: Do not call WARN_ON_ONCE from interrupt context



Gadget driver calls WARN_ON_ONCE in some of the APIs which
are called from interrupt context. This may lead to watchdog
bark if repeated WARN_ON_ONCE condition occurs. Hence print
error message and/or log it in debug buffer.

CRs-Fixed: 747698
Change-Id: Ieecd6342135e7d2bad36c82a12958b78054150db
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent f1a9f6d4
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -1002,7 +1002,6 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
	}

	dbg_queue(dep->number, &req->request, ret);
	WARN_ON(ret < 0);
}

static int dwc3_ep0_start_control_status(struct dwc3_ep *dep)
@@ -1053,7 +1052,11 @@ static void dwc3_ep0_end_control_data(struct dwc3 *dwc, struct dwc3_ep *dep)
	cmd |= DWC3_DEPCMD_PARAM(dep->resource_index);
	memset(&params, 0, sizeof(params));
	ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);
	WARN_ON_ONCE(ret);
	if (ret) {
		dev_dbg(dwc->dev, "%s: send ep cmd ENDTRANSFER failed",
			dep->name);
		dbg_event(dep->number, "EENDXFER", ret);
	}
	dep->resource_index = 0;
}

@@ -1098,7 +1101,9 @@ static void dwc3_ep0_xfernotready(struct dwc3 *dwc,
					dwc->ctrl_req_addr, 0,
					DWC3_TRBCTL_CONTROL_DATA);
			dbg_event(epnum, "ZLP", ret);
			WARN_ON(ret < 0);
			if (ret)
				dev_dbg(dwc->dev, "%s: start xfer cmd failed",
					dep->name);
		}

		break;
@@ -1115,7 +1120,8 @@ static void dwc3_ep0_xfernotready(struct dwc3 *dwc,

		if (dwc->delayed_status &&
				list_empty(&dwc->eps[0]->request_list)) {
			WARN_ON_ONCE(event->endpoint_number != 1);
			if (event->endpoint_number != 1)
				dbg_event(epnum, "EEPNUM", event->status);
			dev_vdbg(dwc->dev, "Mass Storage delayed status\n");
			return;
		}
+8 −3
Original line number Diff line number Diff line
@@ -445,7 +445,6 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
			dev_err(dwc->dev, "%s command timeout for %s\n",
				dwc3_gadget_ep_cmd_string(cmd),
				dep->name);
			WARN_ON_ONCE(1);
			ret = -ETIMEDOUT;
			break;
		}
@@ -2488,7 +2487,9 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
		req = next_request(&dep->req_queued);
		if (!req) {
			if (event->status)
				WARN_ON_ONCE(1);
				dev_err(dwc->dev,
					"%s: evt sts %x for no req queued",
					dep->name, event->status);
			return 1;
		}

@@ -2828,7 +2829,11 @@ static void dwc3_clear_stall_all_ep(struct dwc3 *dwc)
		memset(&params, 0, sizeof(params));
		ret = dwc3_send_gadget_ep_cmd(dwc, dep->number,
				DWC3_DEPCMD_CLEARSTALL, &params);
		WARN_ON_ONCE(ret);
		if (ret) {
			dev_dbg(dwc->dev, "%s; send ep cmd CLEARSTALL failed",
				dep->name);
			dbg_event(dep->number, "ECLRSTALL", ret);
		}
	}
}