diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-10-12 15:27:22 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-10-12 15:27:22 -0700 |
| commit | b028410f2696cd155f5a7fe9b7f016089a0299b0 (patch) | |
| tree | efc999f34bddc71e44dc6d80a210b54edb7573fd /usb.current | |
| parent | 06f2db291dfede5b3cb07f7634bed7fa10363c5f (diff) | |
| download | patches-b028410f2696cd155f5a7fe9b7f016089a0299b0.tar.gz | |
build fixes
Diffstat (limited to 'usb.current')
7 files changed, 466 insertions, 0 deletions
diff --git a/usb.current/usb-ehci-fix-ist-boundary-checking-interval-math.patch b/usb.current/usb-ehci-fix-ist-boundary-checking-interval-math.patch new file mode 100644 index 00000000000000..76b82cef1fb1ee --- /dev/null +++ b/usb.current/usb-ehci-fix-ist-boundary-checking-interval-math.patch @@ -0,0 +1,62 @@ +From sarah.a.sharp@linux.intel.com Mon Oct 12 15:13:10 2009 +From: Sarah Sharp <sarah.a.sharp@linux.intel.com> +Date: Fri, 9 Oct 2009 12:28:41 -0700 +Subject: USB: ehci: Fix IST boundary checking interval math. +To: Greg KH <gregkh@suse.de> +Cc: linux-usb@vger.kernel.org, Alan Stern <stern@rowland.harvard.edu>, David Brownell <david-b@pacbell.net> +Message-ID: <20091009192841.GA5279@gamba.jf.intel.com> +Content-Disposition: inline + + +When the EHCI driver falls behind in its scheduling, the active stream's +first empty microframe may be in the past with respect to the current +microframe. The code attempts to move the starting microframe ("start") N +number of microframes forward, where N is the interval of endpoint. +However, stream->interval is a copy of the endpoint's bInterval, which is +designated in frames for FS devices, and microframes for HS devices. +Convert stream->interval to microframes before using it to move the +starting microframe forward. + +Acked-by: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/ehci-sched.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/usb/host/ehci-sched.c ++++ b/drivers/usb/host/ehci-sched.c +@@ -1400,6 +1400,10 @@ iso_stream_schedule ( + goto fail; + } + ++ period = urb->interval; ++ if (!stream->highspeed) ++ period <<= 3; ++ + now = ehci_readl(ehci, &ehci->regs->frame_index) % mod; + + /* when's the last uframe this urb could start? */ +@@ -1417,8 +1421,8 @@ iso_stream_schedule ( + + /* Fell behind (by up to twice the slop amount)? */ + if (start >= max - 2 * 8 * SCHEDULE_SLOP) +- start += stream->interval * DIV_ROUND_UP( +- max - start, stream->interval) - mod; ++ start += period * DIV_ROUND_UP( ++ max - start, period) - mod; + + /* Tried to schedule too far into the future? */ + if (unlikely((start + sched->span) >= max)) { +@@ -1441,10 +1445,6 @@ iso_stream_schedule ( + + /* NOTE: assumes URB_ISO_ASAP, to limit complexity/bugs */ + +- period = urb->interval; +- if (!stream->highspeed) +- period <<= 3; +- + /* find a uframe slot with enough bandwidth */ + for (; start < (stream->next_uframe + period); start++) { + int enough_space; diff --git a/usb.current/usb-musb-invert-arch-depend-string.patch b/usb.current/usb-musb-invert-arch-depend-string.patch new file mode 100644 index 00000000000000..c2c5ec13e8fd73 --- /dev/null +++ b/usb.current/usb-musb-invert-arch-depend-string.patch @@ -0,0 +1,34 @@ +From vapier@gentoo.org Mon Oct 12 15:01:06 2009 +From: Mike Frysinger <vapier@gentoo.org> +Date: Mon, 12 Oct 2009 09:49:56 -0400 +Subject: USB: musb: invert arch depend string +To: Ingo Molnar <mingo@redhat.com>, Linus Torvalds <torvalds@linux-foundation.org>, Greg Kroah-Hartman <gregkh@suse.de> +Cc: Felipe Balbi <felipe.balbi@nokia.com> +Message-ID: <1255355396-20533-1-git-send-email-vapier@gentoo.org> + + +The MUSB code relies on platform implementations that currently only +exists for Arm and Blackfin processors, so have the MUSB Kconfig depend +upon those arches. + +This should prevent other arches from building MUSB via randconfig. + +Reported-by: Ingo Molnar <mingo@elte.hu> +Signed-off-by: Mike Frysinger <vapier@gentoo.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/musb/Kconfig ++++ b/drivers/usb/musb/Kconfig +@@ -9,7 +9,7 @@ comment "Enable Host or Gadget support t + # (M)HDRC = (Multipoint) Highspeed Dual-Role Controller + config USB_MUSB_HDRC + depends on (USB || USB_GADGET) +- depends on !SUPERH ++ depends on (ARM || BLACKFIN) + select NOP_USB_XCEIV if ARCH_DAVINCI + select TWL4030_USB if MACH_OMAP_3430SDP + select NOP_USB_XCEIV if MACH_OMAP3EVM diff --git a/usb.current/usb-option-support-for-airplus-mcd650-datacard.patch b/usb.current/usb-option-support-for-airplus-mcd650-datacard.patch new file mode 100644 index 00000000000000..6648d6bee3449a --- /dev/null +++ b/usb.current/usb-option-support-for-airplus-mcd650-datacard.patch @@ -0,0 +1,41 @@ +From sidhpurwala.huzaifa@gmail.com Mon Oct 12 15:08:28 2009 +From: Huzaifa Sidhpurwala <sidhpurwala.huzaifa@gmail.com> +Date: Mon, 12 Oct 2009 14:34:45 +0530 +Subject: USB: option: Support for AIRPLUS MCD650 Datacard +To: greg@kroah.org +Cc: linux-usb@vger.kernel.org +Message-ID: <4AD2F12D.1010800@gmail.com> + + +Here is a patch for Airplus MCD 650 card + +Note: This device is with Victor V Kudlak, and he confirmed that this +device works with the patch. + +Signed-off-by: Huzaifa Sidhpurwala <sidhpurwala.huzaifa@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/option.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -328,6 +328,9 @@ static int option_resume(struct usb_ser + #define ALCATEL_VENDOR_ID 0x1bbb + #define ALCATEL_PRODUCT_X060S 0x0000 + ++/* Airplus products */ ++#define AIRPLUS_VENDOR_ID 0x1011 ++#define AIRPLUS_PRODUCT_MCD650 0x3198 + + static struct usb_device_id option_ids[] = { + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, +@@ -589,6 +592,7 @@ static struct usb_device_id option_ids[] + { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) }, + { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, + { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, ++ { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, + { } /* Terminating entry */ + }; + MODULE_DEVICE_TABLE(usb, option_ids); diff --git a/usb.current/usb-rename-documentation-abi-...-sysfs-class-usb_host.patch b/usb.current/usb-rename-documentation-abi-...-sysfs-class-usb_host.patch new file mode 100644 index 00000000000000..9c6c765950a30b --- /dev/null +++ b/usb.current/usb-rename-documentation-abi-...-sysfs-class-usb_host.patch @@ -0,0 +1,76 @@ +From david.vrabel@csr.com Mon Oct 12 15:06:53 2009 +From: David Vrabel <david.vrabel@csr.com> +Date: Mon, 12 Oct 2009 15:45:13 +0000 +Subject: USB: rename Documentation/ABI/.../sysfs-class-usb_host +To: Greg KH <gregkh@suse.de> +Cc: linux-usb@vger.kernel.org, David Vrabel <david.vrabel@csr.com> +Message-ID: <1255362318-10226-2-git-send-email-david.vrabel@csr.com> + + +The usb_host class is no more. Rename its documentation file (which +only contained WUSB specific files) to .../sysfs-class-uwb_rc-wusbhc. + +Signed-off-by: David Vrabel <david.vrabel@csr.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + Documentation/ABI/testing/sysfs-class-usb_host | 25 -------------------- + Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc | 25 ++++++++++++++++++++ + 2 files changed, 25 insertions(+), 25 deletions(-) + +--- a/Documentation/ABI/testing/sysfs-class-usb_host ++++ /dev/null +@@ -1,25 +0,0 @@ +-What: /sys/class/usb_host/usb_hostN/wusb_chid +-Date: July 2008 +-KernelVersion: 2.6.27 +-Contact: David Vrabel <david.vrabel@csr.com> +-Description: +- Write the CHID (16 space-separated hex octets) for this host controller. +- This starts the host controller, allowing it to accept connection from +- WUSB devices. +- +- Set an all zero CHID to stop the host controller. +- +-What: /sys/class/usb_host/usb_hostN/wusb_trust_timeout +-Date: July 2008 +-KernelVersion: 2.6.27 +-Contact: David Vrabel <david.vrabel@csr.com> +-Description: +- Devices that haven't sent a WUSB packet to the host +- within 'wusb_trust_timeout' ms are considered to have +- disconnected and are removed. The default value of +- 4000 ms is the value required by the WUSB +- specification. +- +- Since this relates to security (specifically, the +- lifetime of PTKs and GTKs) it should not be changed +- from the default. +--- /dev/null ++++ b/Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc +@@ -0,0 +1,25 @@ ++What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_chid ++Date: July 2008 ++KernelVersion: 2.6.27 ++Contact: David Vrabel <david.vrabel@csr.com> ++Description: ++ Write the CHID (16 space-separated hex octets) for this host controller. ++ This starts the host controller, allowing it to accept connection from ++ WUSB devices. ++ ++ Set an all zero CHID to stop the host controller. ++ ++What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_trust_timeout ++Date: July 2008 ++KernelVersion: 2.6.27 ++Contact: David Vrabel <david.vrabel@csr.com> ++Description: ++ Devices that haven't sent a WUSB packet to the host ++ within 'wusb_trust_timeout' ms are considered to have ++ disconnected and are removed. The default value of ++ 4000 ms is the value required by the WUSB ++ specification. ++ ++ Since this relates to security (specifically, the ++ lifetime of PTKs and GTKs) it should not be changed ++ from the default. diff --git a/usb.current/usb-whci-hcd-always-do-an-update-after-processing-a-halted-qtd.patch b/usb.current/usb-whci-hcd-always-do-an-update-after-processing-a-halted-qtd.patch new file mode 100644 index 00000000000000..6dcc31e7de095c --- /dev/null +++ b/usb.current/usb-whci-hcd-always-do-an-update-after-processing-a-halted-qtd.patch @@ -0,0 +1,46 @@ +From david.vrabel@csr.com Mon Oct 12 15:07:50 2009 +From: David Vrabel <david.vrabel@csr.com> +Date: Mon, 12 Oct 2009 15:45:16 +0000 +Subject: USB: whci-hcd: always do an update after processing a halted qTD +To: Greg KH <gregkh@suse.de> +Cc: linux-usb@vger.kernel.org, David Vrabel <david.vrabel@csr.com> +Message-ID: <1255362318-10226-5-git-send-email-david.vrabel@csr.com> + + +A halted qTD always triggers a hardware list update because the qset was +either removed or reactivated. + +Signed-off-by: David Vrabel <david.vrabel@csr.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/whci/asl.c | 4 ++++ + drivers/usb/host/whci/pzl.c | 4 ++++ + 2 files changed, 8 insertions(+) + +--- a/drivers/usb/host/whci/asl.c ++++ b/drivers/usb/host/whci/asl.c +@@ -115,6 +115,10 @@ static uint32_t process_qset(struct whc + if (status & QTD_STS_HALTED) { + /* Ug, an error. */ + process_halted_qtd(whc, qset, td); ++ /* A halted qTD always triggers an update ++ because the qset was either removed or ++ reactivated. */ ++ update |= WHC_UPDATE_UPDATED; + goto done; + } + +--- a/drivers/usb/host/whci/pzl.c ++++ b/drivers/usb/host/whci/pzl.c +@@ -121,6 +121,10 @@ static enum whc_update pzl_process_qset( + if (status & QTD_STS_HALTED) { + /* Ug, an error. */ + process_halted_qtd(whc, qset, td); ++ /* A halted qTD always triggers an update ++ because the qset was either removed or ++ reactivated. */ ++ update |= WHC_UPDATE_UPDATED; + goto done; + } + diff --git a/usb.current/usb-whci-hcd-handle-early-deletion-of-endpoints.patch b/usb.current/usb-whci-hcd-handle-early-deletion-of-endpoints.patch new file mode 100644 index 00000000000000..fe592724a4e813 --- /dev/null +++ b/usb.current/usb-whci-hcd-handle-early-deletion-of-endpoints.patch @@ -0,0 +1,104 @@ +From david.vrabel@csr.com Mon Oct 12 15:07:32 2009 +From: David Vrabel <david.vrabel@csr.com> +Date: Mon, 12 Oct 2009 15:45:15 +0000 +Subject: USB: whci-hcd: handle early deletion of endpoints +To: Greg KH <gregkh@suse.de> +Cc: linux-usb@vger.kernel.org, David Vrabel <david.vrabel@csr.com> +Message-ID: <1255362318-10226-4-git-send-email-david.vrabel@csr.com> + + +If an endpoint is deleted before it's been fully added to the hardware +list, the associated qset will not be fully initialized and an oops will +occur when complete(&qset->remove_complete) is called. This can happen +if a queued URB is cancelled. + +Fix this by only removing the qset from the hardware list if the +cancelled URB had qTDs. + +Signed-off-by: David Vrabel <david.vrabel@csr.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/whci/asl.c | 19 ++++++++++++------- + drivers/usb/host/whci/pzl.c | 20 +++++++++++++------- + 2 files changed, 25 insertions(+), 14 deletions(-) + +--- a/drivers/usb/host/whci/asl.c ++++ b/drivers/usb/host/whci/asl.c +@@ -305,6 +305,7 @@ int asl_urb_dequeue(struct whc *whc, str + struct whc_urb *wurb = urb->hcpriv; + struct whc_qset *qset = wurb->qset; + struct whc_std *std, *t; ++ bool has_qtd = false; + int ret; + unsigned long flags; + +@@ -315,17 +316,21 @@ int asl_urb_dequeue(struct whc *whc, str + goto out; + + list_for_each_entry_safe(std, t, &qset->stds, list_node) { +- if (std->urb == urb) ++ if (std->urb == urb) { ++ if (std->qtd) ++ has_qtd = true; + qset_free_std(whc, std); +- else ++ } else + std->qtd = NULL; /* so this std is re-added when the qset is */ + } + +- asl_qset_remove(whc, qset); +- wurb->status = status; +- wurb->is_async = true; +- queue_work(whc->workqueue, &wurb->dequeue_work); +- ++ if (has_qtd) { ++ asl_qset_remove(whc, qset); ++ wurb->status = status; ++ wurb->is_async = true; ++ queue_work(whc->workqueue, &wurb->dequeue_work); ++ } else ++ qset_remove_urb(whc, qset, urb, status); + out: + spin_unlock_irqrestore(&whc->lock, flags); + +--- a/drivers/usb/host/whci/pzl.c ++++ b/drivers/usb/host/whci/pzl.c +@@ -333,6 +333,7 @@ int pzl_urb_dequeue(struct whc *whc, str + struct whc_urb *wurb = urb->hcpriv; + struct whc_qset *qset = wurb->qset; + struct whc_std *std, *t; ++ bool has_qtd = false; + int ret; + unsigned long flags; + +@@ -343,17 +344,22 @@ int pzl_urb_dequeue(struct whc *whc, str + goto out; + + list_for_each_entry_safe(std, t, &qset->stds, list_node) { +- if (std->urb == urb) ++ if (std->urb == urb) { ++ if (std->qtd) ++ has_qtd = true; + qset_free_std(whc, std); +- else ++ } else + std->qtd = NULL; /* so this std is re-added when the qset is */ + } + +- pzl_qset_remove(whc, qset); +- wurb->status = status; +- wurb->is_async = false; +- queue_work(whc->workqueue, &wurb->dequeue_work); +- ++ if (has_qtd) { ++ pzl_qset_remove(whc, qset); ++ update_pzl_hw_view(whc); ++ wurb->status = status; ++ wurb->is_async = false; ++ queue_work(whc->workqueue, &wurb->dequeue_work); ++ } else ++ qset_remove_urb(whc, qset, urb, status); + out: + spin_unlock_irqrestore(&whc->lock, flags); + diff --git a/usb.current/usb-wusb-don-t-use-the-stack-to-read-security-descriptor.patch b/usb.current/usb-wusb-don-t-use-the-stack-to-read-security-descriptor.patch new file mode 100644 index 00000000000000..16b4b5446ac69e --- /dev/null +++ b/usb.current/usb-wusb-don-t-use-the-stack-to-read-security-descriptor.patch @@ -0,0 +1,103 @@ +From david.vrabel@csr.com Mon Oct 12 15:07:12 2009 +From: David Vrabel <david.vrabel@csr.com> +Date: Mon, 12 Oct 2009 15:45:14 +0000 +Subject: USB: wusb: don't use the stack to read security descriptor +To: Greg KH <gregkh@suse.de> +Cc: linux-usb@vger.kernel.org, David Vrabel <david.vrabel@csr.com> +Message-ID: <1255362318-10226-3-git-send-email-david.vrabel@csr.com> + + +From: Stefano Panella <stefano.panella@csr.com> + +An urb's transfer buffer must be kmalloc'd memory and not point to the +stack or a DMA API warning results. + +Signed-off-by: David Vrabel <david.vrabel@csr.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/wusbcore/security.c | 41 ++++++++++++++++++---------------------- + 1 file changed, 19 insertions(+), 22 deletions(-) + +--- a/drivers/usb/wusbcore/security.c ++++ b/drivers/usb/wusbcore/security.c +@@ -200,35 +200,40 @@ int wusb_dev_sec_add(struct wusbhc *wusb + { + int result, bytes, secd_size; + struct device *dev = &usb_dev->dev; +- struct usb_security_descriptor secd; ++ struct usb_security_descriptor *secd; + const struct usb_encryption_descriptor *etd, *ccm1_etd = NULL; +- void *secd_buf; + const void *itr, *top; + char buf[64]; + ++ secd = kmalloc(sizeof(struct usb_security_descriptor), GFP_KERNEL); ++ if (secd == NULL) { ++ result = -ENOMEM; ++ goto out; ++ } ++ + result = usb_get_descriptor(usb_dev, USB_DT_SECURITY, +- 0, &secd, sizeof(secd)); ++ 0, secd, sizeof(struct usb_security_descriptor)); + if (result < sizeof(secd)) { + dev_err(dev, "Can't read security descriptor or " + "not enough data: %d\n", result); +- goto error_secd; ++ goto out; + } +- secd_size = le16_to_cpu(secd.wTotalLength); +- secd_buf = kmalloc(secd_size, GFP_KERNEL); +- if (secd_buf == NULL) { ++ secd_size = le16_to_cpu(secd->wTotalLength); ++ secd = krealloc(secd, secd_size, GFP_KERNEL); ++ if (secd == NULL) { + dev_err(dev, "Can't allocate space for security descriptors\n"); +- goto error_secd_alloc; ++ goto out; + } + result = usb_get_descriptor(usb_dev, USB_DT_SECURITY, +- 0, secd_buf, secd_size); ++ 0, secd, secd_size); + if (result < secd_size) { + dev_err(dev, "Can't read security descriptor or " + "not enough data: %d\n", result); +- goto error_secd_all; ++ goto out; + } + bytes = 0; +- itr = secd_buf + sizeof(secd); +- top = secd_buf + result; ++ itr = &secd[1]; ++ top = (void *)secd + result; + while (itr < top) { + etd = itr; + if (top - itr < sizeof(*etd)) { +@@ -259,24 +264,16 @@ int wusb_dev_sec_add(struct wusbhc *wusb + dev_err(dev, "WUSB device doesn't support CCM1 encryption, " + "can't use!\n"); + result = -EINVAL; +- goto error_no_ccm1; ++ goto out; + } + wusb_dev->ccm1_etd = *ccm1_etd; + dev_dbg(dev, "supported encryption: %s; using %s (0x%02x/%02x)\n", + buf, wusb_et_name(ccm1_etd->bEncryptionType), + ccm1_etd->bEncryptionValue, ccm1_etd->bAuthKeyIndex); + result = 0; +- kfree(secd_buf); + out: ++ kfree(secd); + return result; +- +- +-error_no_ccm1: +-error_secd_all: +- kfree(secd_buf); +-error_secd_alloc: +-error_secd: +- goto out; + } + + void wusb_dev_sec_rm(struct wusb_dev *wusb_dev) |
