summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* USB: UHCI: Add support for GRLIB GRUSBHC controllerJan Andersson2011-05-073-7/+234
| | | | | | | | | | | | | | | | This patch adds support for the UHCI part of the GRLIB GRUSBHC controller found on some LEON/GRLIB SoCs. The UHCI HCD previously only supported controllers connected over PCI. This patch adds support for the first non-PCI UHCI HC. I have tried to replicate the solution used in ehci-hcd.c. Tested on GR-LEON4-ITX board (LEON4/GRLIB with GRUSBHC) and x86 with Intel UHCI HC. Signed-off-by: Jan Andersson <jan@gaisler.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: UHCI: Support non-PCI host controllersJan Andersson2011-05-073-0/+142
| | | | | | | | | | | | | | | | | | | | | This patch is part of a series that extend the UHCI HCD to support non-PCI host controllers. This patch also extends the uhci_{read,write}* functions to allow accesses to registers not mapped into PCI I/O space. This extension also includes the addition of a void __iomem pointer to the uhci structure. A new Kconfig option is added to signal that the system has a non-PCI HC. If this Kconfig option is set, uhci-hcd.c will include generic reset functions for systems that do not make use of keyboard and mouse legacy support. PCI controllers will still always use the reset functions from pci-quirks This patch is followed by a patch that adds bus glue for the first non-PCI UHCI HC. Signed-off-by: Jan Andersson <jan@gaisler.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: UHCI: Wrap I/O register accessesJan Andersson2011-05-074-47/+77
| | | | | | | | | | | | | This patch is part of a series that extend the UHCI HCD to support non-PCI controllers. This patch replaces in{b,w,l} and out{b,wl} with calls to local inline functions. This is done so that the register access functions can be extended to support register areas not mapped in PCI I/O space. Signed-off-by: Jan Andersson <jan@gaisler.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: UHCI: Move PCI specific functions to uhci-pci.cJan Andersson2011-05-072-294/+333
| | | | | | | | | | | | | | | | This patch is part of a series that extend the UHCI HCD to support non-PCI controllers. This patch moves PCI specific functions to uhci-pci.c and includes this file in uhci-hcd.c. It also renames the function uhci_init to uhci_pci_init. uhci_init/uhci_pci_init is modified so that the port-detection logic is kept in a new separate function uhci_count_ports() in uhci-hcd.c. Signed-off-by: Jan Andersson <jan@gaisler.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: UHCI: Codingstyle fixesJan Andersson2011-05-071-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | This patch is part of a series that extend the UHCI HCD to support non-PCI host controllers. This patch fixes the following warnings from checkpatch: ERROR: switch and case should be at the same indent + switch (to_pci_dev(uhci_dev(uhci))->vendor) { + default: [...] + case PCI_VENDOR_ID_GENESYS: [...] + case PCI_VENDOR_ID_INTEL: WARNING: static char array declaration should probably be static const char + static char bad_Asus_board[] = "A7V8X"; WARNING: Use DEFINE_PCI_DEVICE_TABLE for struct pci_device_id +static const struct pci_device_id uhci_pci_ids[] = { { Signed-off-by: Jan Andersson <jan@gaisler.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: UHCI: Allow dynamic assignment of bus specific functionsJan Andersson2011-05-072-19/+78
| | | | | | | | | | | | | | | This patch is part of a series that extend the UHCI HCD to support non-PCI controllers. This patch changes calls to uhci_reset_hc, uhci_check_and_reset_hc, configure_hc, resume_detect_interrupts_are_broken and global_suspend_mode_is_broken so that they are made through pointers in the uhci hcd struct. This will allow these functions to be replaced with bus/arch specific functions. Signed-off-by: Jan Andersson <jan@gaisler.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: UHCI: Remove PCI dependencies from uhci-hubJan Andersson2011-05-073-4/+17
| | | | | | | | | | | | | | | | This patch is part of a series that extend the UHCI HCD to support non-PCI host controllers. uhci-hub.c contained two PCI vendor checks for silicon quirks. Move these checks into uhci-hcd.c and use bits in uhci_hcd structure to mark that we need to use the quirks. This patch is followed by other patches that will remove PCI dependencies from uhci-hcd.c as well. Signed-off-by: Jan Andersson <jan@gaisler.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* fsl/usb: Unused endpoint failure for USB gadgetRamneek Mehresh2011-05-071-6/+21
| | | | | | | | | | | | | | | Though USB controller works without this most of the time, an issue was faced where USB was configured as printer device and it was dropping first packet(64 bytes) in full speed mode due to DATA PID mismatch. The problem gets resolved once unused endpoints are configured as bulk. As per P1020 RM (Table17-31, bits 19-18, bits 3-2) "When only one endpoint (RX or TX, but not both) of an endpoint pair is used, the unused endpoint should be configured as a bulk type endpoint." So according to the RM, this patch is initializing TX and RX endpoints as bulk type Signed-off-by: Suchit Lepcha <Suchit.Lepcha@freescale.com> Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ohci-s3c2410: return proper error if clk_get failsJingoo Han2011-05-071-2/+2
| | | | | | | Return PTR_ERR(clk) instead of -ENOENT if clk_get fails Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ohci-s3c2410: fix checkpatch errors and warningsJingoo Han2011-05-071-23/+23
| | | | | | | | | | | | This patch fixes the checkpatch errors ans warnings listed below: ERROR: do not use assignment in if condition WARNING: line over 80 characters WARNING: braces {} are not necessary for single statement blocks WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ehci-au1xxx: fix suspend callbackManuel Lauss2011-05-071-6/+3Star
| | | | | | | | | Remove a stray 'return 0' at the top of the suspend callback, and move au1xxx_stop_ehc() out of the ehci spinlock since it takes some time to complete. Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: fix building musb driversAnatolij Gustschin2011-05-0712-73/+74
| | | | | | | | | | | | | Commit 3dacdf11 "usb: factor out state_string() on otg drivers" broke building musb drivers since there is already another otg_state_string() function in musb drivers, but with different prototype. Fix musb drivers to use common otg_state_string(), too. Also provide a nop for otg_state_string() if CONFIG_USB_OTG_UTILS is not defined. Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: Add bus glue for GRLIB GRUSBHC controllerJan Andersson2011-05-035-2/+253
| | | | | | | | | | | | | This patch adds support for the GRLIB GRUSBHC EHCI controller from Aeroflex Gaisler. The controller is typically found on LEON/GRLIB SoCs. Tested on GR-LEON4-ITX with with little endian interface and on LEON3 system on GR-PCI-XC5V development board for big endian controller. Signed-off-by: Jan Andersson <jan@gaisler.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: Support controllers with big endian capability regsJan Andersson2011-05-0327-30/+48
| | | | | | | | | | | | | | | | The two first HC capability registers (CAPLENGTH and HCIVERSION) are defined as one 8-bit and one 16-bit register. Most HC implementations have selected to treat these registers as part of a 32-bit register, giving the same layout for both big and small endian systems. This patch adds a new quirk, big_endian_capbase, to support controllers with big endian register interfaces that treat HCIVERSION and CAPLENGTH as individual registers. Signed-off-by: Jan Andersson <jan@gaisler.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: OTG: msm: Clear in_lpm flag before enabling the IRQ in resumePavankumar Kondeti2011-05-031-2/+2
| | | | | | | | | | The current code is clearing in_lpm flag after enabling the IRQ. If IRQ comes immediately before in_lpm flag is set, it thinks that hardware is in low power mode and disables the IRQ. Fix this by clearing in_lpm flag before enabling the IRQ. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Initialize ep0 once while registering gadget in ci13xxx_udcAnji jonnala2011-05-031-14/+17
| | | | | | | | | | | | | | | | Some of the simulators may cache the ep0 maxpacket size to zero if the ep0 dQh is not setup before enabling the pullup. Hence Setup ep0 and initialize the dQh fields once while registering the gadget(before enabling the pullup). HSUSB Chipidea link controller spec says ep0 is enabled always in the HW. Hence disabling and enabling the ep0 as a part of reset interrupt is unneccesary. Remove the disable/enable ep0 logic from reset interrupt handling. Signed-off-by: Anji jonnala <anjir@codeaurora.org> Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Use ep0out for control OUT data phase in ci13xxx_udcPavankumar Kondeti2011-05-031-6/+14
| | | | | | | | The current code queue the control OUT data request to ep0in instead of ep0out. Check ep0_dir and use the correct control endpoint. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Fix bug in endpoint feature request processing in ci13xxx_udcPavankumar Kondeti2011-05-031-1/+7
| | | | | | | | | The OUT endpoints are stored in 0 - hw_ep_max/2 and IN endpoints are stored from hw_ep_max/2 - hw_ep_max in ci13xxx_ep array. Retrieve the IN endpoint correctly while processing endpoint feature requests. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Fix unused variable warning in ci13xxx_udcPavankumar Kondeti2011-05-031-1/+1
| | | | | Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Use bitwise AND operator to test flags in ci13xxx_udcPavankumar Kondeti2011-05-031-1/+1
| | | | | Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Fix typo (s/EBUSY/-EBUSY) in ci13xxx_udcPavankumar Kondeti2011-05-031-1/+1
| | | | | Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gpio-vbus: ask for vbus_draw regulator before registering xceivDmitry Eremin-Solenikov2011-05-031-7/+7
| | | | | | | | | Ask for vbus_draw regulator before registering tranceiver to disallow possible race between registration and set_power/etc. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ldusb: add several new devicesMichael Hund2011-05-033-12/+81
| | | | | | | Added several new devices to ldusb and excluded them from the HID driver. Signed-off-by: Michael Hund <mhund@ld-didactic.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ehci: remove structure packing from ehci_defRabin Vincent2011-05-031-3/+3
| | | | | | | | | | | | | | | | As pointed out by Arnd Bergmann, in include/linux/usb/ehci_def.h, struct ehci_caps is defined with __attribute__((packed)) for no good reason, and this triggers undefined behaviour when using ARM's readl() on pointers to elements of this structure: http://lkml.kernel.org/r/201102021700.20683.arnd@arndb.de The same problem exists with the other two structures in ehci_def.h too, so remove the __attribute__((packed)) from all of them. Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: Configure octeon2 glue logic for proper uSOF cycle period.David Daney2011-05-031-0/+3
| | | | | | | | | The reset value of the uSOF cycle period is incorrect. Set it to 60,000 bits. Without this, several commercial USB flash memory devices and hubs fail to work properly. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: octeon2-common.c: Configure ports for proper electrical characteristics.David Daney2011-05-031-1/+3
| | | | | | | | Additional PHY tuning is needed to obtain compliant 'eye' diagram electrical characteristics. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: octeon2-common: Don't reinitialize the clocks.David Daney2011-05-031-14/+24
| | | | | | | | | | | | | | The UCTL clock initialization will cause the ehci and ohci blocks to become inoperable if the clocks are reinitialized. Check to see if the clocks have already been initialized. Also use a mutex to protect the clock initialization code so that there can be no attempt to use the clocks before they are fully configured. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Merge branch 'for-usb-next' of ↵Greg Kroah-Hartman2011-05-039-449/+763
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git+ssh://master.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-next * 'for-usb-next' of git+ssh://master.kernel.org/pub/scm/linux/kernel/git/sarah/xhci: xhci 1.0: Set transfer burst last packet count field. xhci 1.0: Set transfer burst count field. xhci 1.0: Update TD size field format. xhci 1.0: Only interrupt on short packet for IN EPs. xhci: Remove sparse warning about cmd_status. usbcore: warm reset USB3 port in SS.Inactive state usbcore: Refine USB3.0 device suspend and resume xHCI: report USB3.0 portstatus comply with USB3.0 specification xHCI: Set link state support xHCI: Clear link state change support xHCI: warm reset support usb/ch9: use proper endianess for wBytesPerInterval xhci: Remove recursive call to xhci_handle_event xhci: Add an assertion to check for virt_dev=0 bug. xhci: Add rmb() between reading event validity & event data access. xhci: Make xHCI driver endian-safe
| * xhci 1.0: Set transfer burst last packet count field.Sarah Sharp2011-05-032-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The xHCI 1.0 specification defines a new isochronous TRB field, called transfer burst last packet count (TBLPC). This field defines the number of packets in the last "burst" of packets in a TD. Only SuperSpeed endpoints can handle more than one burst, so this is set to the number for packets in a TD for all non-SuperSpeed devices (minus one, since the field is zero based). This patch should have no effect on host controllers that don't advertise the xHCI 1.0 (0x100) version number in their hci_version field. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xhci 1.0: Set transfer burst count field.Sarah Sharp2011-05-032-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The xHCI 1.0 specification adds a new field to the fourth dword in an isochronous TRB: the transfer burst count (TBC). This field is only non-zero for SuperSpeed devices. Each SS endpoint sets the bMaxBurst field in the SuperSpeed endpoint companion descriptor, which indicates how many max-packet-sized "bursts" it can handle in one service interval. The device driver may choose to burst less max packet sized chunks each service interval (which is defined by one TD). The xHCI driver indicates to the host controller how many bursts it needs to schedule through the transfer burst count field. This patch will only effect xHCI hosts that advertise 1.0 support (0x100) in the HCI version field of their capabilities register. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xhci 1.0: Update TD size field format.Sarah Sharp2011-05-031-6/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The xHCI 1.0 specification changes the format of the TD size field in Normal and Isochronous TRBs. The field in control TRBs is still set to reserved zero. Instead of representing the number of bytes left to transfer in the TD (including the current TRB's buffer), it now represents the number of packets left to transfer (*not* including this TRB). See section 4.11.2.4 of the xHCI 1.0 specification for details. The math is basically copied straight from there. Create a new function, xhci_v1_0_td_remainder(), that should be called for all xHCI 1.0 host controllers. The field location and maximum value is still the same, so reuse the old function, xhci_td_remainder(), to handle the bit shifting. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xhci 1.0: Only interrupt on short packet for IN EPs.Sarah Sharp2011-05-031-21/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't make sense to set the interrupt on short packet (TRB_ISP) flag for TRBs queued to endpoints that only receive packets from the host controller (i.e. OUT endpoints). Packets can only be short when they are sent from a USB device. Plus, the xHCI 1.0 specification forbids setting the flag for anything but IN endpoints. While we're at it, remove some of my snide remarks about the inefficiency of event data TRBs. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xhci: Remove sparse warning about cmd_status.Sarah Sharp2011-05-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sparse complains about the arguments to xhci_evaluate_context_result() and xhci_configure_endpoint_result(): CHECK drivers/usb/host/xhci.c drivers/usb/host/xhci.c:1647:53: warning: incorrect type in argument 3 (different signedness) drivers/usb/host/xhci.c:1647:53: expected int *cmd_status drivers/usb/host/xhci.c:1647:53: got unsigned int [usertype] *[assigned] cmd_status drivers/usb/host/xhci.c:1648:50: warning: incorrect type in argument 3 (different signedness) drivers/usb/host/xhci.c:1648:50: expected int *cmd_status drivers/usb/host/xhci.c:1648:50: got unsigned int [usertype] *[assigned] cmd_status The command status is taken from the command completion event TRB, and will always be a positive number. Change the signature of xhci_evaluate_context_result() and xhci_configure_endpoint_result() to take a u32 for cmd_status. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * usbcore: warm reset USB3 port in SS.Inactive stateAndiry Xu2011-05-031-0/+46
| | | | | | | | | | | | | | | | | | | | | | Some USB3.0 devices go to SS.Inactive state when hot plug to USB3 ports. Warm reset the port to transition it to U0 state. This patch fixes the issue that Kingston USB3.0 flash drive can not be recognized when hot plug to USB3 port. Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * usbcore: Refine USB3.0 device suspend and resumeAndiry Xu2011-05-032-41/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | In the past, we use USB2.0 request to suspend and resume a USB3.0 device. Actually, USB3.0 hub does not support Set/Clear PORT_SUSPEND request, instead, it uses Set PORT_LINK_STATE request. This patch makes USB3.0 device suspend/resume comply with USB3.0 specification. This patch fixes the issue that USB3.0 device can not be suspended when connected to a USB3.0 external hub. Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xHCI: report USB3.0 portstatus comply with USB3.0 specificationAndiry Xu2011-05-032-27/+66
| | | | | | | | | | | | | | | | | | | | | | USB3.0 specification has different wPortStatus and wPortChange definitions from USB2.0 specification. Since USB3 root hub and USB2 root hub are split now and USB3 hub only has USB3 protocol ports, we should modify the portstatus and portchange report of USB3 ports to comply with USB3.0 specification. Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xHCI: Set link state supportAndiry Xu2011-05-031-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Set Port Feature(PORT_LINK_STATE) request. The most significant byte (bits 15..8) of the wIndex field specifies the U state the host software wants to put the link connected to the port into. This request is only valid when the PORT_ENABLE bit is set and the PORT_LINK_STATE should not be above value '5' (Rx.Detect). This request will be later used to replace the set/clear suspend USB3 protocol ports in hub driver. Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xHCI: Clear link state change supportAndiry Xu2011-05-031-0/+5
| | | | | | | | | | | | | | | | This patch adds support for Clear Port Feature(C_PORT_LINK_STATE) request from usbcore. Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xHCI: warm reset supportAndiry Xu2011-05-031-0/+11
| | | | | | | | | | | | | | | | | | | | This patch adds warm reset support to xhci hub control. It handles Set Port Feature(BH_PORT_RESET) and Clear Port Feature (C_BH_PORT_RESET) request from usbcore. Note warm reset is called BH reset some places in USB3.0 specification. Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * usb/ch9: use proper endianess for wBytesPerIntervalSebastian Andrzej Siewior2011-05-033-3/+3
| | | | | | | | | | | | | | | | while going through Tatyana's changes for the gadget framework I noticed that this type is not defined as __le16. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xhci: Remove recursive call to xhci_handle_eventMatt Evans2011-05-031-7/+11
| | | | | | | | | | | | | | Make the caller loop while there are events to handle, instead. Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xhci: Add an assertion to check for virt_dev=0 bug.Matt Evans2011-05-031-0/+11
| | | | | | | | | | | | | | | | | | | | During a "plug-unplug" stress test on an NEC xHCI card, a null pointer dereference was observed. xhci_address_device() dereferenced a null virt_dev (possibly an erroneous udev->slot_id?); this patch adds a WARN_ON & message to aid debug if it can be recreated. Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xhci: Add rmb() between reading event validity & event data access.Matt Evans2011-05-031-0/+5
| | | | | | | | | | | | | | | | On weakly-ordered systems, the reading of an event's content must occur after reading the event's validity. Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
| * xhci: Make xHCI driver endian-safeMatt Evans2011-05-036-341/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the struct members defining access to xHCI device-visible memory to use __le32/__le64 where appropriate, and then adds swaps where required. Checked with sparse that all accesses are correct. MMIO accesses use readl/writel so already are performed LE, but prototypes now reflect this with __le*. There were a couple of (debug) instances of DMA pointers being truncated to 32bits which have been fixed too. Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
* | usb/isp1760: Improve urb queueing, get rid of BUG():s in normal code pathsArvid Brodin2011-05-032-699/+679Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the code that handles qtds. Intead of directly allocating chip mem and chip slot, enqueue the transfer in a list of queue heads. Use a centralized function enqueue_qtds() to prioritize and enqueue transfers. This removes all of the interrupt context BUG() calls when out of chip mem or transfer slots. It also makes it possible to efficiently use the dual-port mem on the chip for double-buffered transfers, which improve transfer times to/from/between usb sticks by about 40 % on my HW. With this patch it should also be possible to handle qtd scheduling outside of the interrupt handler, for significantly improved kernel latency. I have not implemented this since there are some locking issues which I haven't had time to look at. Signed-off-by: Arvid Brodin <arvid.brodin@enea.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | usb/isp1760: Report correct urb status after unlinkArvid Brodin2011-05-031-0/+1
| | | | | | | | | | | | | | | | This fixes a bug in my previous (2.6.38) patch series which caused urb->status value to be wrong after unlink (broke usbtest 11, 12). Signed-off-by: Arvid Brodin <arvid.brodin@enea.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | usb/isp1760: Remove unneeded OR map and HcBufferStatus codeArvid Brodin2011-05-032-62/+13Star
| | | | | | | | | | | | | | | | | | Since we always set the OR flag for each transfer, we can just as well set all these bits to 1 at init and be done with it. Also, HcBufferStatus can be set at init as per the ISP1761 datasheet page 47 with no loss of performance. Signed-off-by: Arvid Brodin <arvid.brodin@enea.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | usb/isp1760: Clean up urb enqueueingArvid Brodin2011-05-031-198/+129Star
| | | | | | | | | | | | | | | | This collects urb enqueue code that was spread out all over the place into a couple of more readable functions. Signed-off-by: Arvid Brodin <arvid.brodin@enea.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | usb/isp1760: Remove false error printoutArvid Brodin2011-05-031-6/+5Star
| | | | | | | | | | | | | | | | This removes the "qh is 0" printout. qh == NULL if the urb has been unlinked, so this condition is normal. Signed-off-by: Arvid Brodin <arvid.brodin@enea.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: s3c-hsotg: Add copyright stringAnton Tikhomirov2011-05-031-0/+3
| | | | | | | | | | | | | | Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>