From 8d516d9cf918ec83e764ccbe6f54bef09fa4dd9b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 24 May 2013 12:50:35 -0700 Subject: [PATCH] 3.9-stable patches added patches: avr32-fix-relocation-check-for-signed-18-bit-offset.patch usb-fix-latency-in-uhci-hcd-and-ohci-hcd.patch usb-ohci-fix-logic-for-scheduling-isochronous-urbs.patch --- ...ation-check-for-signed-18-bit-offset.patch | 30 ++++++++ queue-3.9/series | 3 + ...fix-latency-in-uhci-hcd-and-ohci-hcd.patch | 54 +++++++++++++ ...ogic-for-scheduling-isochronous-urbs.patch | 77 +++++++++++++++++++ 4 files changed, 164 insertions(+) create mode 100644 queue-3.9/avr32-fix-relocation-check-for-signed-18-bit-offset.patch create mode 100644 queue-3.9/series create mode 100644 queue-3.9/usb-fix-latency-in-uhci-hcd-and-ohci-hcd.patch create mode 100644 queue-3.9/usb-ohci-fix-logic-for-scheduling-isochronous-urbs.patch diff --git a/queue-3.9/avr32-fix-relocation-check-for-signed-18-bit-offset.patch b/queue-3.9/avr32-fix-relocation-check-for-signed-18-bit-offset.patch new file mode 100644 index 00000000000..e92da74aec7 --- /dev/null +++ b/queue-3.9/avr32-fix-relocation-check-for-signed-18-bit-offset.patch @@ -0,0 +1,30 @@ +From e68c636d88db3fda74e664ecb1a213ae0d50a7d8 Mon Sep 17 00:00:00 2001 +From: Hans-Christian Egtvedt +Date: Mon, 13 May 2013 22:22:10 +0200 +Subject: avr32: fix relocation check for signed 18-bit offset + +From: Hans-Christian Egtvedt + +commit e68c636d88db3fda74e664ecb1a213ae0d50a7d8 upstream. + +Caught by static code analysis by David. + +Reported-by: David Binderman +Signed-off-by: Hans-Christian Egtvedt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/avr32/kernel/module.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/avr32/kernel/module.c ++++ b/arch/avr32/kernel/module.c +@@ -264,7 +264,7 @@ int apply_relocate_add(Elf32_Shdr *sechd + break; + case R_AVR32_GOT18SW: + if ((relocation & 0xfffe0003) != 0 +- && (relocation & 0xfffc0003) != 0xffff0000) ++ && (relocation & 0xfffc0000) != 0xfffc0000) + return reloc_overflow(module, "R_AVR32_GOT18SW", + relocation); + relocation >>= 2; diff --git a/queue-3.9/series b/queue-3.9/series new file mode 100644 index 00000000000..9260728078f --- /dev/null +++ b/queue-3.9/series @@ -0,0 +1,3 @@ +avr32-fix-relocation-check-for-signed-18-bit-offset.patch +usb-ohci-fix-logic-for-scheduling-isochronous-urbs.patch +usb-fix-latency-in-uhci-hcd-and-ohci-hcd.patch diff --git a/queue-3.9/usb-fix-latency-in-uhci-hcd-and-ohci-hcd.patch b/queue-3.9/usb-fix-latency-in-uhci-hcd-and-ohci-hcd.patch new file mode 100644 index 00000000000..c34ea97c4cb --- /dev/null +++ b/queue-3.9/usb-fix-latency-in-uhci-hcd-and-ohci-hcd.patch @@ -0,0 +1,54 @@ +From e1944017839d7dfbf7329fac4bdec8b4050edf5e Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Tue, 14 May 2013 13:57:19 -0400 +Subject: USB: fix latency in uhci-hcd and ohci-hcd + +From: Alan Stern + +commit e1944017839d7dfbf7329fac4bdec8b4050edf5e upstream. + +Commits c44b225077bb1fb25ed5cd5c4f226897b91bedd4 (UHCI: implement new +semantics for URB_ISO_ASAP) and +6a41b4d3fe8cd4cc95181516fc6fba7b1747a27c (OHCI: implement new +semantics for URB_ISO_ASAP) increased the latency for isochronous URBs +in uhci-hcd and ohci-hcd respectively to 2 milliseconds, in an +attempt to avoid underruns. It turns out that not only was this +unnecessary -- 1-ms latency works okay -- it also causes problems with +certain application loads such as real-time audio. + +This patch changes the latency for both drivers back to 1 ms. + +This should be applied to -stable kernels going back to 3.8. + +Signed-off-by: Alan Stern +Reported-and-tested-by: Joe Rayhawk +CC: Clemens Ladisch +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ohci-hcd.c | 2 +- + drivers/usb/host/uhci-q.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/usb/host/ohci-hcd.c ++++ b/drivers/usb/host/ohci-hcd.c +@@ -233,7 +233,7 @@ static int ohci_urb_enqueue ( + urb->start_frame = frame; + } + } else if (ed->type == PIPE_ISOCHRONOUS) { +- u16 next = ohci_frame_no(ohci) + 2; ++ u16 next = ohci_frame_no(ohci) + 1; + u16 frame = ed->last_iso + ed->interval; + + /* Behind the scheduling threshold? */ +--- a/drivers/usb/host/uhci-q.c ++++ b/drivers/usb/host/uhci-q.c +@@ -1287,7 +1287,7 @@ static int uhci_submit_isochronous(struc + return -EINVAL; /* Can't change the period */ + + } else { +- next = uhci->frame_number + 2; ++ next = uhci->frame_number + 1; + + /* Find the next unused frame */ + if (list_empty(&qh->queue)) { diff --git a/queue-3.9/usb-ohci-fix-logic-for-scheduling-isochronous-urbs.patch b/queue-3.9/usb-ohci-fix-logic-for-scheduling-isochronous-urbs.patch new file mode 100644 index 00000000000..5f1e7379863 --- /dev/null +++ b/queue-3.9/usb-ohci-fix-logic-for-scheduling-isochronous-urbs.patch @@ -0,0 +1,77 @@ +From 815fa7b917614261748d1ecd9600ff27f99508e5 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Tue, 14 May 2013 13:57:51 -0400 +Subject: USB: OHCI: fix logic for scheduling isochronous URBs + +From: Alan Stern + +commit 815fa7b917614261748d1ecd9600ff27f99508e5 upstream. + +The isochronous scheduling logic in ohci-hcd has a bug. The +calculation for skipping TDs that are too late should be carried out +only in the !URB_ISO_ASAP case. When URB_ISO_ASAP is set, the URB is +pushed back so that none of the TDs are too late, which would cause +the calculation to overflow. + +The patch also fixes the calculation to avoid overflow in the case +where the frame value wraps around. + +This should be applied to -stable kernels going back to 3.8. + +Signed-off-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ohci-hcd.c | 32 ++++++++++++++++++-------------- + 1 file changed, 18 insertions(+), 14 deletions(-) + +--- a/drivers/usb/host/ohci-hcd.c ++++ b/drivers/usb/host/ohci-hcd.c +@@ -240,7 +240,7 @@ static int ohci_urb_enqueue ( + if (unlikely(tick_before(frame, next))) { + + /* USB_ISO_ASAP: Round up to the first available slot */ +- if (urb->transfer_flags & URB_ISO_ASAP) ++ if (urb->transfer_flags & URB_ISO_ASAP) { + frame += (next - frame + ed->interval - 1) & + -ed->interval; + +@@ -248,21 +248,25 @@ static int ohci_urb_enqueue ( + * Not ASAP: Use the next slot in the stream. If + * the entire URB falls before the threshold, fail. + */ +- else if (tick_before(frame + ed->interval * ++ } else { ++ if (tick_before(frame + ed->interval * + (urb->number_of_packets - 1), next)) { +- retval = -EXDEV; +- usb_hcd_unlink_urb_from_ep(hcd, urb); +- goto fail; +- } ++ retval = -EXDEV; ++ usb_hcd_unlink_urb_from_ep(hcd, urb); ++ goto fail; ++ } + +- /* +- * Some OHCI hardware doesn't handle late TDs +- * correctly. After retiring them it proceeds to +- * the next ED instead of the next TD. Therefore +- * we have to omit the late TDs entirely. +- */ +- urb_priv->td_cnt = DIV_ROUND_UP(next - frame, +- ed->interval); ++ /* ++ * Some OHCI hardware doesn't handle late TDs ++ * correctly. After retiring them it proceeds ++ * to the next ED instead of the next TD. ++ * Therefore we have to omit the late TDs ++ * entirely. ++ */ ++ urb_priv->td_cnt = DIV_ROUND_UP( ++ (u16) (next - frame), ++ ed->interval); ++ } + } + urb->start_frame = frame; + } -- 2.47.3