Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1317556
| From | Jianqiang Tang <jianqiang.tang@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] usb: dwc2: host: fix the data toggle error in full speed descriptor dma |
| Date | 2016-01-26 07:30 +0100 |
| Message-ID | <qV5ix-7WO-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
From: "Tang, Jianqiang" <jianqiang.tang@intel.com>
There will be data toggle error happen for full speed buld-out transfer.
The data toggle bit is saved in qh for non-control transfers, it is wrong
to check the qtd for that case.
Also fix one static analysis tool issue after fix the data toggle error.
Signed-off-by: Dyson Lee <dyson.lee@intel.com>
Signed-off-by: Tang, Jianqiang <jianqiang.tang@intel.com>
---
drivers/usb/dwc2/hcd_ddma.c | 2 +-
drivers/usb/dwc2/hcd_intr.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/dwc2/hcd_ddma.c b/drivers/usb/dwc2/hcd_ddma.c
index 36606fc..6b18956 100644
--- a/drivers/usb/dwc2/hcd_ddma.c
+++ b/drivers/usb/dwc2/hcd_ddma.c
@@ -1258,7 +1258,7 @@ static void dwc2_complete_non_isoc_xfer_ddma(struct dwc2_hsotg *hsotg,
*/
if (halt_status == DWC2_HC_XFER_STALL)
qh->data_toggle = DWC2_HC_PID_DATA0;
- else if (qtd)
+ else
dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd);
}
diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
index f825380..918773f 100644
--- a/drivers/usb/dwc2/hcd_intr.c
+++ b/drivers/usb/dwc2/hcd_intr.c
@@ -530,6 +530,10 @@ void dwc2_hcd_save_data_toggle(struct dwc2_hsotg *hsotg,
else
chan->qh->data_toggle = DWC2_HC_PID_DATA1;
} else {
+ if (!qtd) {
+ dev_err(hsotg->dev, "qtd is null, return\n");
+ return;
+ }
if (pid == TSIZ_SC_MC_PID_DATA0)
qtd->data_toggle = DWC2_HC_PID_DATA0;
else
--
1.9.1
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] usb: dwc2: host: fix the data toggle error in full speed descriptor dma Jianqiang Tang <jianqiang.tang@intel.com> - 2016-01-26 07:30 +0100
csiph-web