[PATCH] dwc3: gadget: fix for no-resource condition in dwc3 device controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The "no-resource" error occurs when the driver issues DEPSTRTXFER
command to start data transfer on specific endpoint, and dwc3
core throws error "no resource" available to process the request.

This condition is occurs in composite gadget scenario where there
are multiple interfaces selected by host and during simulateneous
data traffic on multiple endpoints on these interfaces, the issue
occur when software/driver issues DEPSTRTXFER command to specific
endpoint in same direction (in/out) and other endpoint in the same
direction (in/out) is busy or executed by dwc3 controller.

example: if dwc3 core is busy in transferring the request on ep1-in
during this scenario, if software/driver queues another request on
ep2-in and issue start transfer (DEPSTRTXFER command), then dwc3
throws error "no-resource". The same applicable to OUT transfer.

The issue is root caused that software issue DEPSTARTCFG
"START NEW CONFIGURATION" command twice during the SET_INTERFACE
request received from host while selecting multiple interface.
In single configuration with two parallel interfaces, say the
interface-1 has two endpoints, ep1-in & ep1-out, and interface-2
has two endpoints ep2-in and ep2-out. The additional DEPSTARTCFG
will make the core too allocate the same resource, say for ep2-in
and ep2-out which were previously assigned to ep1-in and ep1-out.

Therefore during the simulataneous traffic on endpoints on same
direction leads to resource conflict and dwc3 core throws the
"no-resource" error when DEPSTARTCFG command while issuing the
start transfer request.

Hence the DEPSTARTCFG must be issued only once after reset and
during SET_CONFIG request from host to allocate the transfer
resource properly for all endpoints on multiple interfaces in
composite gadget scenario.

The issue is reproducible in composite gadget (ACM + NCM)
enabled through CONFIGFS.

Signed-off-by: Ravi Babu <ravibabu@xxxxxx>
---
 drivers/usb/dwc3/ep0.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 3a9354a..97499a2 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -739,7 +739,6 @@ static int dwc3_ep0_std_request(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
 		break;
 	case USB_REQ_SET_INTERFACE:
 		dwc3_trace(trace_dwc3_ep0, "USB_REQ_SET_INTERFACE");
-		dwc->start_config_issued = false;
 		/* Fall through */
 	default:
 		dwc3_trace(trace_dwc3_ep0, "Forwarding to gadget driver");
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux