summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* usb: hub: rename usb_kick_khubd() to usb_kick_hub_wq()Petr Mladek2014-09-233-4/+4
| | | | | | | | | USB hub started to use a workqueue instead of kthread. Let's make it clear from the function names. Signed-off-by: Petr Mladek <pmladek@suse.cz> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: hub: convert khubd into workqueuePetr Mladek2014-09-232-84/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to have separate kthread for handling USB hub events. It is more elegant to use the workqueue framework. The workqueue is allocated as freezable because the original thread was freezable as well. Also it is allocated as ordered because the code is not ready for parallel processing of hub events, see choose_devnum(). struct usb_hub is passed via the work item. Therefore we do not need hub_event_list. Also hub_thread() is not longer needed. It would call only hub_event(). The rest of the code did manipulate the kthread and it is handled by the workqueue framework now. kick_khubd is renamed to kick_hub_wq() to make the function clear. And the protection against races is done another way, see below. hub_event_lock has been removed. It cannot longer be used to protect struct usb_hub between hub_event() and hub_disconnect(). Instead we need to get hub->kref already in kick_hub_wq(). The lock is not really needed for the other scenarios as well. queue_work() returns whether it succeeded. We could revert the needed operations accordingly. This is enough to avoid duplicity and inconsistencies. Yes, the removed lock causes that there is not longer such a strong synchronization between scheduling the work and manipulating hub->disconnected. But kick_hub_wq() must never be called together with hub_disconnect() otherwise even the original code would have failed. Any callers are responsible for this. Therefore the only problem is that hub_disconnect() could be called in parallel with hub_event(). But this was possible even in the past. struct usb_hub is still guarded by hub->kref and released in hub_events() when needed. Note that the source file is still full of the obsolete "khubd" strings. Let's remove them in a follow up patch. This patch already is complex enough. Thanks a lot Alan Stern <stern@rowland.harvard.edu> for code review, many useful tips and guidance. Also thanks to Tejun Heo <tj@kernel.org> for hints how to allocate the workqueue. Signed-off-by: Petr Mladek <pmladek@suse.cz> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: hub: rename hub_events() to hub_event() and handle only one event therePetr Mladek2014-09-231-125/+111
| | | | | | | | | | | | | | | | | | We would like to convert khubd kthread to a workqueue. As a result hub_events() will handle only one event per call. In fact, we could do this already now because there is another cycle in hub_thread(). It calls hub_events() until hub_event_list is empty. This patch renames the function to hub_event(), removes the while cycle, and renames the goto targets from loop* to out*. When touching the code, it fixes also formatting of dev_err() and dev_dbg() calls to make checkpatch.pl happy :-) Signed-off-by: Petr Mladek <pmladek@suse.cz> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: hub: keep hub->dev reference all the time when struct usb_hub livesPetr Mladek2014-09-231-3/+3
| | | | | | | | | | | | | | | | | This is just a small optimization of the fix from the commit c605f3cdff53a743f6 ("usb: hub: take hub->hdev reference when processing from eventlist). We do not need to take the reference for each event. Instead we could get it when struct usb_hub is allocated and put it when it is released. By other words, we could handle it the same way as the reference for hub->intfdev. The motivation is that it will make the life easier when switching from khubd kthread to a workqueue. Suggested-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Petr Mladek <pmladek@suse.cz> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* storage: Add quirk for another SCM-based USB-SCSI converterMark Knibbs2014-09-231-2/+8
| | | | | | | | | | | | | There is apparently another SCM USB-SCSI converter with ID 04E6:000F. It is listed along with 04E6:000B in the Windows INF file for the Startech ICUSBSCSI2 as "eUSB SCSI Adapter (Bus Powered)". The quirk allows devices with SCSI ID other than 0 to be accessed. Also make a couple of existing SCM product IDs lower case to be consistent with other entries. Signed-off-by: Mark Knibbs <markk@clara.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* storage: Add quirks for Castlewood and Double-H USB-SCSI convertersMark Knibbs2014-09-231-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Castlewood Systems supplied various models of USB-SCSI converter with their ORB external removable-media drive. The ORB Windows and Macintosh drivers support six USB IDs: 084B:A001 [VID 084B is Castlewood Systems] 04E6:0002 (*) ORB USB Smart Cable P/N 88205-001 (generic SCM ID) 2027:A001 Double-H Technology DH-2000SC 1822:0001 (*) Ariston iConnect/iSCSI 07AF:0004 (*) Microtech XpressSCSI (25-pin) 07AF:0005 (*) Microtech XpressSCSI (50-pin) *: quirk already in unusual-devs.h [Apparently the official VID for Double-H Technology is 0x07EB = 2027 decimal. That's another hex/decimal mix-up with these SCM-based products (in addition to the Ariston and Entrega ones). Perhaps the USB-IF informed companies of their allocated VID in decimal, but they assumed it was hex? It seems all Entrega products used VID 0x1645, not just the USB-SCSI converter.] Double-H Technology Co., Ltd. produced a USB-SCSI converter, model DH-2000SC, which is probably the one supported by the ORB drivers. Perhaps the Castlewood-bundled product had a different label or PID though? Castlewood mentioned Conmate as being one type of USB-SCSI converter. Conmate and Double-H seem related somehow; both company addresses in the same road, and at one point the Conmate web site mentioned DH-2000H4, DH-200D4/DH-2000C4 as models of USB hub (DH short for Double-H presumably). Conmate did show a USB-SCSI converter model CM-660 on their web site at one point. My guess is that was identical to the DH-2000SC. Mention of the Double-H product: http://web.archive.org/web/20010221010141/http://www.doubleh.com.tw/dh-2000sc.htm The only picture I could find is at http://jp.acesuppliers.com/catalog/j64/component/page03.html The casing design looks the same as my ORB USB Smart Cable which has ID 04E6:0002. Anyway, that's enough rambling. Here's the patch. storage: Add quirks for Castlewood and Double-H USB-SCSI converters Add quirks for two SCM-based USB-SCSI converters which were bundled with some Castlewood ORB removable drives. Without the quirk only the (single) drive with SCSI ID 0 can be accessed. Signed-off-by: Mark Knibbs <markk@clara.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* storage: Replace magic number with define in usb_stor_euscsi_init()Mark Knibbs2014-09-231-1/+1
| | | | | | | | | usb_stor_euscsi_init() calls usb_stor_control_msg() with timeout argument 5000. USB_CTRL_SET_TIMEOUT is defined to be 5000 in usb.h, so would it make sense to use that instead? Patch below if it would. Signed-off-by: Mark Knibbs <markk@clara.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: quirks.h: use BIT()Greg Kroah-Hartman2014-09-231-10/+10
| | | | | | | Use the BIT macro instead of "open coding" bit fields. This makes it easier to actually see that the bits are not conflicting/overlapping. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: Add device quirk for ASUS T100 Base Station keyboardLu Baolu2014-09-233-2/+11
| | | | | | | | | | | | | | | | | | This full-speed USB device generates spurious remote wakeup event as soon as USB_DEVICE_REMOTE_WAKEUP feature is set. As the result, Linux can't enter system suspend and S0ix power saving modes once this keyboard is used. This patch tries to introduce USB_QUIRK_IGNORE_REMOTE_WAKEUP quirk. With this quirk set, wakeup capability will be ignored during device configure. This patch could be back-ported to kernels as old as 2.6.39. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb3503: clarify what the registers 'PDS' and 'CFG1' really doTobias Jakobi2014-09-231-2/+2
| | | | | | | | | The current comment sounds like you have to disable some of the ports to be able to use self-powered mode. This is misleading, so change the wording to reflect this. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb3503: fix typos in devicetree binding documentationTobias Jakobi2014-09-231-2/+2
| | | | | | | | 'availe' to 'available' 'desribed' to 'described' Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb3503: correct error message in probe ('connect' to 'interrupt')Tobias Jakobi2014-09-231-1/+1
| | | | | | | intn is obviously the interrupt pin. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: Fixed a few typosMickael Maison2014-09-235-6/+6
| | | | | | | | Fixed typos in comments of various drivers/usb files Signed-off-by: Mickael Maison <mickael.maison@gmail.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* USB: storage: use %*ph specifier to dump small buffersAndy Shevchenko2014-09-232-9/+5
| | | | | | | | Instead of dereference each byte let's use %*ph specifier in the printk() calls. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers/usb/host/ehci-xilinx-of.c: Include "linux/of_irq.h" to avoid ↵Chen Gang2014-09-231-0/+1
| | | | | | | | | | | | | | | | compiling error Need include it for irq_of_parse_and_map(), the related error with allmodconfig under microblaze: drivers/usb/host/ehci-xilinx-of.c: In function ‘ehci_hcd_xilinx_of_probe’: drivers/usb/host/ehci-xilinx-of.c:156:2: error: implicit declaration of function ‘irq_of_parse_and_map’ [-Werror=implicit-function-declaration] irq = irq_of_parse_and_map(dn, 0); ^ Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Acked-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: wusbcore: fix device disconnect on rekey timeoutThomas Pugliese2014-09-232-1/+19
| | | | | | | | | | | | | | | | | | | | | If three or more wireless devices are connected and two of them disconnect between 1-3 seconds apart, it can cause the HWA to disconnect the remaining devices due to failing to see a DN_Alive message from them. This happens because when the HWA detects that the first device is gone, it will attempt to rekey the remaining devices. If one of the devices is not responding because it has also been disconnected but not yet timed out, the synchronous rekey operation running on the wusbd workqueue can block for up to 5 seconds. This will prevent the KEEPALIVE timer from running and DN_Alive messages from being processed because they are processed by the same workqueue. This patch moves the rekey operation to a separate workqueue since it is the only wusb work item that needs to communicate directly with wireless devices. The rest of the WUSB work items either perform no device IO or communicate directly with the host controller and should not be blocked out by a non-responding wireless device. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: wusbcore: skip done segs before completing aborted transferThomas Pugliese2014-09-231-3/+14
| | | | | | | | | When completing an aborted transfer, skip done segs before calling wa_complete_remaining_xfer_segs to avoid a runtime warning. The warning is harmless in this case but avoiding it prevents false error reports. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: wusbcore: USB_WUSB_CBAF depends on USBThomas Pugliese2014-09-231-0/+1
| | | | | | | Add USB build dependency for USB_WUSB_CBAF. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: wusbcore: remove USB_WUSB build dependency on PCIThomas Pugliese2014-09-231-1/+0
| | | | | | | | Wireless USB does not require PCI so remove USB_WUSB build dependency on PCI. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: hwa: add USB build dependency for USB_HWA_HCDThomas Pugliese2014-09-231-1/+1
| | | | | | | An HWA is a USB device so it depends on USB. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uwb: doc: add documentation for ASIE sysfs attributeThomas Pugliese2014-09-231-0/+13
| | | | | | | Document the /sys/class/uwb_rc/uwbN/ASIE sysfs attribute Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uwb: add an ASIE sysfs attribute to uwb_rc devicesThomas Pugliese2014-09-231-0/+99
| | | | | | | | Allow user mode to add and remove application specific information elements (ASIEs) to the beacon of a uwb_rc device. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uwb: doc: bring uwb documentation up to dateThomas Pugliese2014-09-231-13/+4
| | | | | | | | | | | | | | | | | The existing UWB documentation states that UWB devices show up in /sys/class/uwb and /sys/bus/uwb/devices. Up until the most recent changes to add uwb devices to their own bus, neither of these statements were actually true. Now, UWB devices do show up in /sys/bus/uwb/devices so the documentation has been updated to reflect that and removed references to /sys/class/uwb. The existing documentation also states that local UWB radio controller (RC) devices also show up as UWB devices along with their wireless peer UWB devices under /sys/class/uwb. This is not true so that statement has been removed. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uwb: create a uwb bus type and add in-range peer devices to itThomas Pugliese2014-09-233-4/+19
| | | | | | | | | | | | Documentation/usb/WUSB-Design-overview.txt states that UWB devices seen by a UWB radio controller are added to /sys/bus/uwb/devices, but this was not actually being done. This functionality is needed in order for UWB peer devices to be enumerated by user mode tools. This patch creates a uwb bus type and adds UWB peer devices to it as they are discovered by the radio controller. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uwb: remove UWB build dependency on PCIThomas Pugliese2014-09-231-1/+0
| | | | | | | UWB does not require PCI to be enabled so remove build dependency. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uwb: update uwb device prints to be more usefulThomas Pugliese2014-09-231-4/+4
| | | | | | | | Print info about the radio controller device instead of the its parent when UWB devices connect and disconnect. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uwb: line length cleanupThomas Pugliese2014-09-231-1/+2
| | | | | | | Fix line length in uwb-internal.h Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* wusb: delete double assignmentJulia Lawall2014-09-231-2/+0
| | | | | | | | | | | | | | | | | | | Delete successive assignments to the same location. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression i; @@ *i = ...; i = ...; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: renesas_usbhs: fix driver dependenciesBartlomiej Zolnierkiewicz2014-09-231-0/+1
| | | | | | | | | | | | | Renesas USBHS controller support should be available only on Renesas ARM SoCs and SuperH architecture. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Magnus Damm <magnus.damm@gmail.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Simon Horman <horms+renesas@verge.net.au> Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: host: ohci-exynos: Remove unnecessary usb-phy supportVivek Gautam2014-09-231-61/+20
| | | | | | | | | | | | | | | Now that we have completely moved from older USB-PHY drivers to newer GENERIC-PHY drivers for PHYs available with USB controllers on Exynos series of SoCs, we can remove the support for the same in our host drivers too. We also defer the probe for our host in case we end up getting EPROBE_DEFER error when getting PHYs. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: misc: yurex: remove useless casting of private_dataArjun Sreedharan2014-09-231-4/+4
| | | | | Signed-off-by: Arjun Sreedharan <arjun024@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* xhci: Log extra info on "ERROR Transfer event TRB DMA ptr not part of ↵Hans de Goede2014-09-233-9/+27
| | | | | | | | | | | | | current TD" Lately (with the use of uas / bulk-streams) we have been seeing several cases where this error triggers (which should never happen). Add some extra logging to make debugging these errors easier. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* xhci: Remove "FIXME - check all the stream rings for pending cancellations"Hans de Goede2014-09-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | Even though a Set TR deq ptr command operates on a ring, and an endpoint can have multiple rings, we can have only one Set TR deq ptr command pending. When an endpoint with streams halts or is stopped to unlink urbs, there will only be at most one ring active / one td being executed (the td stopped_td points to). So when we reset the endpoint (for a halt), or the stop command completes, we will queue one Set TR deq ptr command at most, cancelled urbs on other stream rings then the one being executed will have there trbs turned to nops, and once the hcd gets around to execute that stream ring they will be simply skipped. So the SET_DEQ_PENDING flag in the endpoint is sufficient protection against starting the endpoing before all stream rings are cleaned up. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* xhci: Always ring the doorbell for active eps when a Set TR deq ptr cmd ↵Hans de Goede2014-09-231-2/+2
| | | | | | | | | | | | completes Even if the stream for which the command was intended has been freed in the mean time. This ensures that things start rolling again after an unlink / halt. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* xhci: Fold queue_set_tr_deq into xhci_queue_new_dequeue_stateHans de Goede2014-09-231-51/+32
| | | | | | | | | | | | xhci_queue_new_dequeue_state is the only caller of queue_set_tr_deq and queue_set_tr_deq checks for SET_DEQ_PENDING, where as xhci_queue_new_dequeue_state sets it which is inconsistent. Simply fold the 2 into one is a nice cleanup and fixes the inconsistency. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* xhci: xhci_ring_device: Ring stream ring bells for endpoints with streamsHans de Goede2014-09-231-4/+11
| | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: xhci_suspend is not stopping the root hub timer for the shared HCDAl Cooper2014-09-231-0/+4
| | | | | | | | | | | | | V2 - Restart polling (which will restart the timer) for the shared HCD in xhci_resume(). xhci_suspend() will stop the primary HCD's root hub timer, but leaves the shared HCD's timer running. This change adds stopping of the shared HCD timer. Signed-off-by: Al Cooper <alcooperx@gmail.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* xhci: Move allocating of command for new_dequeue_state to queue_set_tr_deq()Hans de Goede2014-09-233-20/+23
| | | | | | | | | | | | | | | | | | There are multiple reasons for this: 1) This fixes a missing check for xhci_alloc_command failing in xhci_handle_cmd_stop_ep() 2) This adds a warning when we cannot set the new dequeue state because of xhci_alloc_command failing 3) It puts the allocation of the command after the sanity checks in queue_set_tr_deq(), avoiding leaking the command if those fail 4) Since queue_set_tr_deq now owns the command it can free it if queue_command fails 5) It reduces code duplication Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: Add response iu handlingHans de Goede2014-09-231-0/+10
| | | | | | | | | If something goes wrong in our communication with an uas device we may get a response iu in reaction to a cmnd, rather then a status iu. In this case propagate an error upwards, rather then logging a bogus iu message. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: Log error codes when logging errorsHans de Goede2014-09-231-5/+12
| | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: Cleanup uas_log_cmd_state usageHans de Goede2014-09-231-33/+19
| | | | | | | | | | | | | | | | | | | Instead of doing: uas_log_cmd_state(cmnd, __func__) scmd_printk(KERN_ERR, cmnd, "error doing foo %d\n", err) On error, resulting in 2 log calls for a single error, make uas_log_cmd_state take a status code, and change calls like the above to: uas_log_cmd_state(cmnd, "error doing foo", err) Also change various sanity checks (which should never trigger) from: "scmd_printk(KERN_ERR, cmnd, "sanity foo failed\n")" to calling the new uas_log_cmd_state(), so that when they do trigger we get more info. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: Remove protype hardware usb interface infoHans de Goede2014-09-231-2/+0
| | | | | | | We've removed all hack from the driver for pre-production hardware. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: Remove support for old sense ui as used in pre-production hardwareHans de Goede2014-09-231-46/+1
| | | | | | | | | | | | I've access to a number of different uas devices now, and none of them use old style sense urbs. The only case where these code-paths trigger is with the asm1051 and there they do the wrong thing, as the asm1051 sends 8 bytes status iu-s when it does not have any sense data, but uses new style sense iu-s regardless, as can be seen for scsi cmnds where there is sense data. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: Drop COMMAND_COMPLETED flagHans de Goede2014-09-231-7/+3
| | | | | | | | | It was only used to sanity check against completing the same cmnd twice, but that is the case we're likely operating on free-ed memory, and doing sanity checks on free-ed memory is not really helpful. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: Use scsi_print_commandHans de Goede2014-09-231-2/+3
| | | | | | | | Use scsi_print_command to print commands during errors, rather then printing the rather meaningless pointer to the command. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: Do not log urb status error on cancellationHans de Goede2014-09-231-5/+2
| | | | | | | Check for both type of cancellation codes for sense and data urbs. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: Use streams on upcoming 10Gbps / 3.1 USBHans de Goede2014-09-231-1/+1
| | | | | | | Limit the no-streams case to speeds less then USB_SPEED_SUPER. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: pre_reset and suspend: Fix a few racesHans de Goede2014-09-231-6/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of uas_pre_reset is to: 1) Stop any new commands from being submitted while an externally triggered usb-device-reset is running 2) Wait for any pending commands to finish before allowing the usb-device-reset to continue The purpose of uas_suspend is to: 2) Wait for any pending commands to finish before suspending This commit fixes races in both paths: 1) For 1) we use scsi_block_requests, but the scsi midlayer calls queuecommand without holding any locks, so a queuecommand may already past the midlayer scsi_block_requests checks when we call it, add a check to uas_queuecommand to fix this 2) For 2) we were waiting for all sense-urbs to complete, there are 2 problems with this approach: a) data-urbs may complete after the sense urb, so we need to check for those too b) if a sense-urb completes with a iu id of READ/WRITE_READY a command is not yet done. We submit a new sense-urb immediately in this case, but that submit may fail (in which case it will get retried by uas_do_work), if this happens the sense_urbs anchor may become empty while the cmnd is not yet done Also unblock requests on timeout, to avoid things getting stuck in that case. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: Fix memleak of non-submitted urbsHans de Goede2014-09-231-0/+22
| | | | | | | | | | | | | | | Not all urbs we've allocated are necessarily also submitted, non-submitted urbs will not be free-ed by their completion handler. So we need to free them manually. There are 2 scenarios where this can happen: 1) We have failed to submit some urbs at abort / disconnect 2) When running over usb-2 we may have never tried to submit the data urbs when completing the scsi cmnd, because we never got a READ/WRITE_READY iu Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* uas: Drop all references to a scsi_cmnd once it has been abortedHans de Goede2014-09-231-3/+44
| | | | | | | Do not keep references around to a cmnd which is under error handling. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud