usb: dwc3: avoid setting ClearPendIn for Intel Cherry Trail devices
Subsystems (3)
PATCH 1/1 usb: dwc3: avoid setting ClearPendIn for Intel Cherry Trail devices
Commit 50c763f8c1bac ("usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command") causes Clear Stall EP command failure on Intel Cherry Trail devices. This patch add a quirk to avoid setting this bit for those Intel devices.
--- drivers/usb/dwc3/core.c | 3 +++ drivers/usb/dwc3/core.h | 3 +++ drivers/usb/dwc3/dwc3-pci.c | 11 +++++++++++ drivers/usb/dwc3/gadget.c | 3 ++- 4 files changed, 19 insertions(+), 1 deletion(-)
drivers/usb/dwc3/core.c +3 -0
@@ -934,6 +934,9 @@ static int dwc3_probe(struct platform_device *pdev)device_property_read_u32 (dev,"snps,quirk-frame-length-adjustment" , &dwc->fladj); + dwc->avoid_clearpendin_quirk =device_property_read_bool (dev, +"snps,avoid_clearpendin_quirk" ); + dwc->lpm_nyet_threshold = lpm_nyet_threshold; dwc->tx_de_emphasis = tx_de_emphasis;
drivers/usb/dwc3/core.h +3 -0
@@ -805,6 +805,8 @@ struct dwc3_scratchpad_array {* 1 - -3.5dB de-emphasis * 2 - No de-emphasis * 3 - Reserved +* @avoid_clearpendin_quirk: set if we avoid setting ClearPendIn bit +* on Clear Stall EP command */ struct dwc3 {struct usb_ctrlrequest *ctrl_req;
@@ -945,6 +947,7 @@ struct dwc3 { unsigned tx_de_emphasis_quirk:1; unsigned tx_de_emphasis:2; + unsigned avoid_clearpendin_quirk:1; };/* -------------------------------------------------------------------------- */
drivers/usb/dwc3/dwc3-pci.c +11 -0
@@ -117,6 +117,17 @@ static int dwc3_pci_quirks(struct pci_dev *pdev, struct platform_device *dwc3)usleep_range (10000 ,11000 ); } } + +if (pdev->device ==PCI_DEVICE_ID_INTEL_BSW ) { +struct property_entry bsw_properties[] = { +PROPERTY_ENTRY_BOOL ( +"snps,avoid_clearpendin_quirk" ), + { } + }; + +return platform_device_add_properties (dwc3, + bsw_properties); + } } if (pdev->vendor == PCI_VENDOR_ID_SYNOPSYS &&
drivers/usb/dwc3/gadget.c +2 -1
@@ -348,7 +348,8 @@ static int dwc3_send_clear_stall_ep_cmd(struct dwc3_ep *dep)* IN transfers due to a mishandled error condition. Synopsys * STAR 9000614252. */ -if (dep->direction && (dwc->revision >=DWC3_REVISION_260A )) +if (dep->direction && (dwc->revision >=DWC3_REVISION_260A ) && + !dwc->avoid_clearpendin_quirk) cmd |=DWC3_DEPCMD_CLEARPENDIN ;memset (¶ms,0 ,sizeof (params));
Signature · 1 line
2.1.4
Hi Felipe,
Quoted 7 lines · Lu Baolu
Commit
50c763f8c1bac("usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command") causes Clear Stall EP command failure on Intel Cherry Trail devices. This patch add a quirk to avoid setting this bit for those Intel devices.Cc [email protected] # 4.7+Signed-off-by Lu Baolu <[email protected]>
Please ignore this patch. It's not a quirk, but a bug. I will send you a fix soon. Sorry for disturbing.
Best regards,
Lu Baolu
Hi Baolu,
Quoted 8 lines · Lu Baolu
Hi Felipe,
Quoted 5 lines · Lu Baolu
Commit
50c763f8c1bac("usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command") causes Clear Stall EP command failure on Intel Cherry Trail devices. This patch add a quirk to avoid setting this bit for those Intel devices.
Quoted 5 lines
Quoted 2 lines
Cc [email protected] # 4.7+Signed-off-by Lu Baolu <[email protected]>Please ignore this patch. It's not a quirk, but a bug. I will send you a fix soon. Sorry for disturbing.
that's okay, thanks for letting me know.
Signature · 1 line
balbi