From b3dc9566a46efa67951ff6ae28e4397da9db92af Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 25 Feb 2016 10:14:01 +0000 Subject: brcm2708: switch to linux 4.4 and update patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As usual these patches were extracted from: https://github.com/raspberrypi/linux/commits/rpi-4.4.y Signed-off-by: Álvaro Fernández Rojas SVN-Revision: 48765 --- ...m-xfer-length-when-buffer-larger-than-all.patch | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 target/linux/brcm2708/patches-4.4/0151-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch (limited to 'target/linux/brcm2708/patches-4.4/0151-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch') diff --git a/target/linux/brcm2708/patches-4.4/0151-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch b/target/linux/brcm2708/patches-4.4/0151-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch new file mode 100644 index 0000000000..62342c23d2 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0151-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch @@ -0,0 +1,37 @@ +From 5c7f4533904206fc11e2073e709598a65da19e10 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 12 Feb 2016 14:50:25 +0000 +Subject: [PATCH 151/156] dcw_otg: trim xfer length when buffer larger than + allocated size is received + +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -737,6 +737,11 @@ static int update_urb_state_xfer_comp(dw + DWC_OTG_HC_XFER_COMPLETE, + &short_read); + ++ if (urb->actual_length + xfer_length > urb->length) { ++ DWC_WARN("%s(): trimming xfer length\n", __func__); ++ xfer_length = urb->length - urb->actual_length; ++ } ++ + /* non DWORD-aligned buffer case handling. */ + if (hc->align_buff && xfer_length && hc->ep_is_in) { + dwc_memcpy(urb->buf + urb->actual_length, hc->qh->dw_align_buf, +@@ -1423,6 +1428,12 @@ static void update_urb_state_xfer_intr(d + { + uint32_t bytes_transferred = get_actual_xfer_length(hc, hc_regs, qtd, + halt_status, NULL); ++ ++ if (urb->actual_length + bytes_transferred > urb->length) { ++ DWC_WARN("%s(): trimming xfer length\n", __func__); ++ bytes_transferred = urb->length - urb->actual_length; ++ } ++ + /* non DWORD-aligned buffer case handling. */ + if (hc->align_buff && bytes_transferred && hc->ep_is_in) { + dwc_memcpy(urb->buf + urb->actual_length, hc->qh->dw_align_buf, -- cgit v1.2.3