aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)AuthorFilesLines
2013-10-24consolidate the reassignments of ->f_op in ->open() instancesAl Viro1-12/+4
Signed-off-by: Al Viro <[email protected]>
2013-10-24Merge tag 'usb-for-v3.13' of ↵Greg Kroah-Hartman43-1162/+2883
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v3.13 Final conversions to configfs for mass storage, acm_ms, and multi gadgets. MUSB should now work out of the box on AM335x-based boards (beagle bone white and black) with DMA thanks to Sebastian's work. We can now enable VERBOSE_DEBUG on builds of drivers/usb/gadget/ by selecting CONFIG_USB_GADGET_VERBOSE. s3c-hsotg got quite a few non-critical fixes but also learned a few new tricks (isochronous transfers, multi count support). The Marvel USB3 Controller driver got a memory leak fix. devm_usb_get_phy() learned not to return NULL, ever. Other than these patches, we have the usual set of cleanups ranging from removal of unnecessary *_set_drvdata() to using SIMPLE_DEV_PM_OPS. Signed-of-by: Felipe Balbi <[email protected]>
2013-10-19USB: wusbcore: fix usb_dev leaksAlexey Khoroshilov1-0/+3
cbaf_probe() does cbaf->usb_dev = usb_get_dev(interface_to_usbdev(iface)), but there is no usb_put_dev() anywhere in cbaf. The patch adds usb_put_dev() to cbaf_disconnect() and to an error path in cbaf_probe(). Also it adds missed usb_put_intf(iface) to the error path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-19USB: UHCI: check for wakeup/suspend raceAlan Stern1-7/+10
hcd-pci.c in usbcore contains a check for wakeup requests racing with controller suspend. This check is going to be moved out of usbcore and into the individual controller drivers, where it can apply to all platforms, not just PCI. This patch adds the check to uhci-hcd. Ironically, none of the non-PCI platform drivers for uhci-hcd implement suspend/resume. Nevertheless, this change is needed to accomodate the upcoming change to usbcore. The patch also removes an outdated check of the root hub state. For one thing, the PM layer has long been quite reliable about suspending root hubs before controllers. For another, virtually the same check is also made in hcd-pci.c; there's no point in repeating it. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-19USB: EHCI: add check for wakeup/suspend raceAlan Stern1-0/+8
hcd-pci.c in usbcore contains a check for wakeup requests racing with controller suspend. This check is going to be moved out of usbcore and into the individual controller drivers, where it can apply to all platforms, not just PCI. This patch adds the check to ehci-hcd. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-19USB: change dev_warn about missing reset-resume to dev_dbgAlan Stern1-2/+2
This patch changes a dev_warn() call in usbcore to dev_dbg(). It's not necessary to warn about drivers missing a reset-resume callback, since the reset-resume method is optional. Signed-off-by: Alan Stern <[email protected]> CC: Clemens Ladisch <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-19USB: OHCI: fix and explain sparse errorsAlan Stern1-4/+5
This patch fixes an endian-related error in ohci-hcd (detected by sparse) and clarifies a comment explaining a peculiar locking arrangement that sparse warns about. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-19USB: EHCI: fix sparse errorsAlan Stern2-5/+7
This patch fixes several sparse errors in ehci-hcd introduced by commit 3d091a6f7039 (USB: EHCI: AMD periodic frame list table quirk). Although the problem fixed by that commit affects only little-endian systems, the source code has to use types appropriate for big-endian too. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-19USB: EHCI: fix type mismatch in check_intr_scheduleAlan Stern1-1/+1
This patch fixes a type mismatch in ehci-hcd caused by commit b35c5009bbf6 (USB: EHCI: create per-TT bandwidth tables). The c_maskp parameter in check_intr_schedule() was changed to point to unsigned int rather than __hc32, but the prototype declaration wasn't adjusted accordingly. Signed-off-by: Alan Stern <[email protected]> Reported-by: kbuild test robot <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-19Merge tag 'for-usb-next-2013-10-17' of ↵Greg Kroah-Hartman9-322/+260
git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-next Sarah writes: xhci: Final patches for 3.13 Hi Greg, Here's my pull request for usb-next and 3.13. My xHCI tree is closed after this point, since I won't be able to run my full tests while I'm in Scotland. After Kernel Summit, I'll be on vacation with access to email from Oct 26th to Nov 6th. Here's what's in this request: - Patches to fix USB 2.0 Link PM issues that cause USB 3.0 devices to not enumerate or misbehave when plugged into a USB 2.0 port. Those are marked for stable. - A msec vs jiffies bug fix by xiao jin, which results in fairly harmless behavior, and thus isn't marked for stable. - Xenia's patches to refactor the xHCI command handling code, which makes it much more readable and consistent. - Misc cleanup patches, one by Sachin Kamat and three from Dan Williams. Here's what's not in this request: - Dan's two patches to allow the xHCI host to use the "Windows" or "new" enumeration scheme. I did not have time to test those, and I want to run them with as many USB devices as I can get a hold of. That will have to wait for 3.14. - Xenia's patches to remove xhci_readl in favor of readl. I'll queue those for 3.14 after I test them. - The xHCI streams update, UAS fixes, and usbfs streams support. I'm not comfortable with changes and fixes to that patchset coming in this late. I would rather wait for 3.14 and be really sure the streams support is stable before we add new userspace API and remove CONFIG_BROKEN from the uas driver. - Julius' patch to clear the port reset bit on hub resume that came in a couple days ago. It looks harmless, but I would rather take the time to test and queue it for usb-linus and the stable trees once 3.13-rc1 is out. Sarah Sharp
2013-10-19Merge 3.12-rc6 into usb-next.Greg Kroah-Hartman16-80/+339
We want those USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-19usb: wusbcore: preserve endianness of cached descriptorsThomas Pugliese2-8/+4
Do not overwrite the multi-byte fields of usb_wa_descriptor with their cpu format values after reading the descriptor. Leave the values as __le16 and swap on use. This is more consistent with other uses of USB descriptors. Signed-off-by: Thomas Pugliese <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-19usb: wusbcore: serialize access to the HWA data out endpointThomas Pugliese3-21/+152
This patch serializes access to the HWA data transfer out (DTO) endpoint. This prevents a situation where two transfer requests being sent concurrently to separate downstream endpoints could interleave their transfer request and transfer data packets causing data corruption. The transfer processing code will now attempt to acquire the DTO resource before sending a transfer to the HWA. If it cannot acquire the resource, the RPIPE that the transfer is assigned to will be placed on a waiting list. When the DTO resource is released, the actor releasing the resource will serivce the RPIPEs that are waiting. Signed-off-by: Thomas Pugliese <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-17usb: phy: twl6030-usb: Include linux/of.h headerSachin Kamat1-0/+1
'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-17usb: musb: cppi41: allow to defer probing if DMA isn't yet availableSebastian Andrzej Siewior2-3/+13
If everything (musb, cppi41, phy) is built-in then musb will start without the dma engine printing only |musb-hdrc musb-hdrc.0.auto: Falied to request rx1. The reason for this is that the musb device structs are created & probed before those of the cppi41 device. So the cppi41 device is probed too late. As a workaround for this allow the musb_cppi41 part to defer the probe if everything is fine except for the missing DMA controller. In case of another error we continue. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-17usb: musb: core: Call dma_controller_destroy() in error path only once.Sebastian Andrzej Siewior1-2/+3
In commit f3ce4d5 ("usb: musb: core: call dma_controller_destroy() in the err path") I erroneously assumed that the dma controller is not removed in the error patch. This was wrong because it happens later via musb_free(). That means the original commit can be reverted because it is wrong or we do this, so it is more obvious. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-17usb: musb: core: properly free host / device structs in err pathSebastian Andrzej Siewior1-0/+3
The patch fixes two issues in the error path cleanup: - in MUSB_PORT_MODE_DUAL_ROLE mode, if musb_gadget_setup() fails we never cleanup the host struct earlier allocated. - if musb_init_debugfs() or sysfs_create_group() fails, then we never free the host part initialization, only device part. Cc: [email protected] # v3.11 Cc: Daniel Mack <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-17usb: gadget: f_mass_storage: style corrections, cleanup & simplificationAndrzej Pietrasiewicz1-19/+18
Fix spacing, improve error code returned, remove unused #define, use strtobool() instead of kstrtou8(). Acked-by: Michal Nazarewicz <[email protected]> Signed-off-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-17usb: musb: dsps: run the timer only on OTG systemsSebastian Andrzej Siewior1-1/+1
I introduced this check here because it looked wrong in HOST only configurions. The timer would remove that session bit and will never come back and so there would not be another session. Now that I played with OTG for a while I belive this workaround is only required for the OTG mode because we have to end the session and then we have to try to start manually. Therefore, this patch limits this timer to the OTG only port mode so we don't need to poll around in device only mode. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-17usb: musb: dsps: redo the otg timerSebastian Andrzej Siewior1-11/+9
According to the comments, we rely on the OTG timer because the core does not expose some important OTG details. So far this is all I know. After playing with OTG I stumbled over a problem: musb is recognized as a B-device without a problem. Whenever a cable is plugged, the VBUS rises, musb recognizes this as a starting session, sets the MUSB_DEVCTL_SESSION bit by itself and a RESET interrupt occurs, the session starts. Good. After a disconnect, the timer is started and re-starts itself because it remains in B_IDLE with the BDEVICE set. I didn't figure the the reason or the need for it. Nothing changes here except for OTG state from B to A device if the BDEVICE bit disappears. This doesn't make much sense to me because nothing happens after this. _IF_ we receive an interrupt before the state change then we may act on wrong condition. Plugging a B-device (and letting MUSB act as host) doesn't work here. The reason seems to be that the MUSB tries to start a session, it fails and then it removes the bit. So we never start as a host. This patch sets the MUSB_DEVCTL_SESSION bit in the IDLE state so musb can try to establish a session as host. After the bit is set, musb tries to start a session and if it fails it clears the bit. Therefore it will try over and over again until a session either as host or as device is established. The readout of the MUSB_DEVCTL register after the removal the MUSB_DEVCTL_SESSION (in A_WAIT_BCON) has been removed because it did not contain the BDEVICE bit set (in the second read) leading to A_IDLE. After plugging a host musb assumed that it is also a host and complained about a missing reset. However a third read of the register has has the BDEVICE bit set so it seems that it is not stable. This mostly what da8xx.c is doing except that we set the timer also after A_WAIT_BCON so the session bit can be triggered. Whit this change I was able to keep am335x-evm in OTG mode and plug in either a HOST or a DEVICE and in a random order and the device was recognized. Cc: [email protected] # v3.11 Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-17usb: musb: dsps: remove declartion for dsps_musb_try_idle()Sebastian Andrzej Siewior1-38/+37
This patch moves dsps_musb_try_idle() before dsps_musb_enable() so the declaration (of dsps_musb_try_idle() can be removed. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-17usb: musb: dsps: move try_idle to start hookSebastian Andrzej Siewior1-0/+5
The timer is initialized right after musb is probed. There is actually no need to have this timer running because _nothing_ will happen until we have the gadget loaded. Also we need this timer only if we run in OTG mode _and_ we need it also after the gadget has been replaced with another one. I've been looking at am35x.c, da8xx.c, omap2430.c, tusb6010.c. da8xx seem to have the same problem as dsps and doing mostly the same thing. tusb6010 seem to do something different and do some actual "idle / power saving" work so I am not too comfortable to remove musb_platform_try_idle() from musb_gadget_setup(). Therefore this patch does not start the timer if there is no gadget active (which is at musb_gadget_setup() at time). In order to have the timer active after the gadget is loaded it will be triggered from dsps_musb_enable(). Cc: [email protected] # v3.11 Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-17usb: musb: call musb_start() only once in OTG modeSebastian Andrzej Siewior1-1/+18
In commit 001dd84 ("usb: musb: start musb on the udc side, too") it was ensured that the state engine is started also in OTG mode after a removal / insertion of the gadget. Unfortunately this change also introduced a bug: If the device is configured as OTG and it connected with a remote host _without_ loading a gadget then we bug() later (because musb->otg->gadget is not initialized). Initially I assumed it might be nice to have the host part of musb in OTG mode working without having a gadget loaded. This bug and fact that it wasn't working like this before the host/gadget split made me realize that this was a silly idea. This patch now introduces back the old behavior where in OTG mode the host mode is only working after the gadget has been loaded. Cc: [email protected] # v3.11 Cc: Daniel Mack <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2013-10-16usb: xhci: remove the unused ->address fieldDan Williams2-10/+2
Only used for debug output, so we don't need to save it. Signed-off-by: Dan Williams <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16usb: xhci: kill a conditional when toggling cycleDan Williams1-1/+1
Perform an unconditional toggle of the cycle bit with 'xor'. Signed-off-by: Dan Williams <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16usb: hub_activate kill an 'else'Dan Williams1-7/+4
Remove a few extra lines and make it clear that all implementations disable the port by sharing the same line of code. Acked-by: Alan Stern <[email protected]> Signed-off-by: Dan Williams <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16usb: misc: usb3503: Fix compile error due to incorrect regmap depedencyMatthew Dawson1-1/+1
The USB3503 driver had an incorrect depedency on REGMAP, instead of REGMAP_I2C. This caused the build to fail since the necessary regmap i2c pieces were not available. Signed-off-by: Matthew Dawson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16usb/chipidea: fix oops on memory allocation failureRussell King - ARM Linux1-2/+4
When CMA fails to initialize in v3.12-rc4, the chipidea driver oopses the kernel while trying to remove and put the HCD which doesn't exist: WARNING: CPU: 0 PID: 6 at /home/rmk/git/linux-rmk/arch/arm/mm/dma-mapping.c:511 __dma_alloc+0x200/0x240() coherent pool not initialised! Modules linked in: CPU: 0 PID: 6 Comm: kworker/u2:0 Tainted: G W 3.12.0-rc4+ #56 Workqueue: deferwq deferred_probe_work_func Backtrace: [<c001218c>] (dump_backtrace+0x0/0x10c) from [<c0012328>] (show_stack+0x18/0x1c) r6:c05fd9cc r5:000001ff r4:00000000 r3:df86ad00 [<c0012310>] (show_stack+0x0/0x1c) from [<c05f3a4c>] (dump_stack+0x70/0x8c) [<c05f39dc>] (dump_stack+0x0/0x8c) from [<c00230a8>] (warn_slowpath_common+0x6c/0x8c) r4:df883a60 r3:df86ad00 [<c002303c>] (warn_slowpath_common+0x0/0x8c) from [<c002316c>] (warn_slowpath_fmt+0x38/0x40) r8:ffffffff r7:00001000 r6:c083b808 r5:00000000 r4:df2efe80 [<c0023134>] (warn_slowpath_fmt+0x0/0x40) from [<c00196bc>] (__dma_alloc+0x200/0x240) r3:00000000 r2:c05fda00 [<c00194bc>] (__dma_alloc+0x0/0x240) from [<c001982c>] (arm_dma_alloc+0x88/0xa0) [<c00197a4>] (arm_dma_alloc+0x0/0xa0) from [<c03e2904>] (ehci_setup+0x1f4/0x438) [<c03e2710>] (ehci_setup+0x0/0x438) from [<c03cbd60>] (usb_add_hcd+0x18c/0x664) [<c03cbbd4>] (usb_add_hcd+0x0/0x664) from [<c03e89f4>] (host_start+0xf0/0x180) [<c03e8904>] (host_start+0x0/0x180) from [<c03e7c34>] (ci_hdrc_probe+0x360/0x670 ) r6:df2ef410 r5:00000000 r4:df2c3010 r3:c03e8904 [<c03e78d4>] (ci_hdrc_probe+0x0/0x670) from [<c0311044>] (platform_drv_probe+0x20/0x24) [<c0311024>] (platform_drv_probe+0x0/0x24) from [<c030fcac>] (driver_probe_device+0x9c/0x234) ... ---[ end trace c88ccaf3969e8422 ]--- Unable to handle kernel NULL pointer dereference at virtual address 00000028 pgd = c0004000 [00000028] *pgd=00000000 Internal error: Oops: 17 [#1] SMP ARM Modules linked in: CPU: 0 PID: 6 Comm: kworker/u2:0 Tainted: G W 3.12.0-rc4+ #56 Workqueue: deferwq deferred_probe_work_func task: df86ad00 ti: df882000 task.ti: df882000 PC is at usb_remove_hcd+0x10/0x150 LR is at host_stop+0x1c/0x3c pc : [<c03cacec>] lr : [<c03e88e4>] psr: 60000013 sp : df883b50 ip : df883b78 fp : df883b74 r10: c11f4c54 r9 : c0836450 r8 : df30c400 r7 : fffffff4 r6 : df2ef410 r5 : 00000000 r4 : df2c3010 r3 : 00000000 r2 : 00000000 r1 : df86b0a0 r0 : 00000000 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c53c7d Table: 2f29404a DAC: 00000015 Process kworker/u2:0 (pid: 6, stack limit = 0xdf882240) Stack: (0xdf883b50 to 0xdf884000) ... Backtrace: [<c03cacdc>] (usb_remove_hcd+0x0/0x150) from [<c03e88e4>] (host_stop+0x1c/0x3c) r6:df2ef410 r5:00000000 r4:df2c3010 [<c03e88c8>] (host_stop+0x0/0x3c) from [<c03e8aa0>] (ci_hdrc_host_destroy+0x1c/0x20) r5:00000000 r4:df2c3010 [<c03e8a84>] (ci_hdrc_host_destroy+0x0/0x20) from [<c03e7c80>] (ci_hdrc_probe+0x3ac/0x670) [<c03e78d4>] (ci_hdrc_probe+0x0/0x670) from [<c0311044>] (platform_drv_probe+0x20/0x24) [<c0311024>] (platform_drv_probe+0x0/0x24) from [<c030fcac>] (driver_probe_device+0x9c/0x234) [<c030fc10>] (driver_probe_device+0x0/0x234) from [<c030ff28>] (__device_attach+0x44/0x48) ... ---[ end trace c88ccaf3969e8423 ]--- Fix this so at least we can continue booting and get to a shell prompt. Signed-off-by: Russell King <[email protected]> Tested-by: Russell King <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16usb: hub: Clear Port Reset Change during init/resumeJulius Werner1-0/+5
This patch adds the Port Reset Change flag to the set of bits that are preemptively cleared on init/resume of a hub. In theory this bit should never be set unexpectedly... in practice it can still happen if BIOS, SMM or ACPI code plays around with USB devices without cleaning up correctly. This is especially dangerous for XHCI root hubs, which don't generate any more Port Status Change Events until all change bits are cleared, so this is a good precaution to have (similar to how it's already done for the Warm Port Reset Change flag). Signed-off-by: Julius Werner <[email protected]> Acked-by: Alan Stern <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16drivers: usb: core: devio.c: Spaces to tabs for proc_control_compat()Matthias Beyer1-10/+10
Replaced spaces by tabs for proc_control_compat() function. Signed-off-by: Matthias Beyer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16drivers: usb: core: devio.c: Spaces to tabs for proc_reapurbnonblock()Matthias Beyer1-6/+6
Replaced spaces by tabs for proc_reapurbnonblock() function. Signed-off-by: Matthias Beyer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16target: Remove TF_CIT_TMPL macroAndy Grover1-9/+9
Remove a lingering macro that just hid a dereference. Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Andy Grover <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2013-10-16usb-storage: add quirk for mandatory READ_CAPACITY_16Oliver Neukum2-1/+11
Some USB drive enclosures do not correctly report an overflow condition if they hold a drive with a capacity over 2TB and are confronted with a READ_CAPACITY_10. They answer with their capacity modulo 2TB. The generic layer cannot cope with that. It must be told to use READ_CAPACITY_16 from the beginning. Signed-off-by: Oliver Neukum <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16usb: serial: option: blacklist Olivetti Olicard200Enrico Mioso1-1/+3
Interface 6 of this device speaks QMI as per tests done by us. Credits go to Antonella for providing the hardware. Signed-off-by: Enrico Mioso <[email protected]> Signed-off-by: Antonella Pellizzari <[email protected]> Tested-by: Dan Williams <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16xhci: replace 'event' with 'cmd_comp_code' in set_deq and reset_ep handlersXenia Ragiadakou1-9/+8
This patch replaces the 'event' argument of xhci_handle_cmd_set_deq() and xhci_handle_cmd_reset_ep(), which is used to retrieve the command completion status code, with the cmd_comp_code directly, since it is available. Signed-off-by: Xenia Ragiadakou <[email protected]> Acked-by: Sarah Sharp <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: add argument 'slot_id' in stop_ep, set_deq and reset_ep cmd handlersXenia Ragiadakou1-13/+12
Since the Slot ID field in the command completion event matches the Slot ID field in the associated command TRB for the Stop Endpoint, Set Dequeue Pointer and Reset Endpoint commands, this patch adds in the handlers of their completion events a 'slot_id' argument and removes the slot id calculation in each of them. Also, a WARN_ON() was added in case the slot ids reported by command TRB and event TRB differ (although according to xhci spec rev1.0 that should not happen) Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: replace 'xhci->cmd_ring->dequeue' with 'trb' in stop_ep cmd handlerXenia Ragiadakou1-4/+2
This patch replaces 'xhci->cmd_ring->dequeue' with 'trb', the address of the command TRB, since it is available to reduce line length. Signed-off-by: Xenia Ragiadakou <[email protected]> Acked-by: Sarah Sharp <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: add variable 'cmd_type' in handle_cmd_completion()Xenia Ragiadakou1-13/+14
This patch adds a new variable 'cmd_type' to hold the command type so that switch cases can be simplified by removing TRB_TYPE() macro improving code readability. Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: add variable 'cmd_trb' in handle_cmd_completion()Xenia Ragiadakou1-8/+9
This patch adds a new variable 'cmd_trb' to hold the address of the command TRB, that is associated with the command completion event, and to replace repetitions of xhci->cmd_ring->dequeue into the code. Signed-off-by: Xenia Ragiadakou <[email protected]> Acked-by: Sarah Sharp <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: add variable 'cmd_comp_code' in handle_cmd_completion()Xenia Ragiadakou1-12/+8
This patch adds a new variable 'cmd_comp_code' to hold the command completion status code aiming to reduce code duplication and to improve code readability. Signed-off-by: Xenia Ragiadakou <[email protected]> Acked-by: Sarah Sharp <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: refactor TRB_CONFIG_EP case into functionXenia Ragiadakou1-52/+62
The function that handles xHCI command completion is much too long and there is need to be broken up into individual functions for each command completion to improve code readablity. This patch refactors the code in TRB_CONFIG_EP switch case, in handle_cmd_completion(), into a fuction named xhci_handle_cmd_config_ep(). There were added two additional variables, 'add_flags' and 'drop_flags', to reduce line length below 80 chars and improve code readability. Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: remove unused 'ep_ring' variable in handle_cmd_completion()Xenia Ragiadakou1-2/+0
This patch removes the variable 'ep_ring' that is assigned in TRB_CONFIG_EP switch case but never used. Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: refactor TRB_EVAL_CONTEXT case into functionXenia Ragiadakou1-5/+14
The function that handles xHCI command completion is much too long and there is need to be broken up into individual functions for each command completion to improve code readablity. This patch refactors the code in TRB_EVAL_CONTEXT switch case in handle_cmd_completion() into a fuction named xhci_handle_cmd_eval_ctx(). Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: refactor TRB_NEC_GET_FW case into functionXenia Ragiadakou1-8/+14
The function that handles xHCI command completion is much too long and there is need to be broken up into individual functions for each command completion to improve code readablity. This patch refactors the code in TRB_NEC_GET_FW switch case in handle_cmd_completion() into a fuction named xhci_handle_cmd_nec_get_fw(). Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: refactor TRB_RESET_DEV case into functionXenia Ragiadakou1-7/+15
The function that handles xHCI command completion is much too long and there is need to be broken up into individual functions for each command completion to improve code readablity. This patch refactors the code in TRB_RESET_DEV switch case in handle_cmd_completion() into a fuction named xhci_handle_cmd_reset_dev(). Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: use completion event's slot id rather than dig it out of commandXenia Ragiadakou1-2/+2
Since the slot id retrieved from the Reset Device TRB matches the slot id in the command completion event, which is available, there is no need to determine it again. This patch removes the uneccessary reassignment to slot id and adds a WARN_ON in case the two Slot ID fields differ (although according xhci spec rev1.0 they should not differ). Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: refactor TRB_ADDR_DEV case into functionXenia Ragiadakou1-2/+9
The function that handles xHCI command completion is much too long and there is need to be broken up into individual functions for each command completion to improve code readablity. This patch refactors the code in TRB_ADDR_DEV switch case in handle_cmd_completion() into a fuction named xhci_handle_cmd_addr_dev(). Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: refactor TRB_DISABLE_SLOT case into functionXenia Ragiadakou1-7/+14
The function that handles xHCI command completion is much too long and there is need to be broken up into individual functions for each command completion to improve code readablity. This patch refactors the code in TRB_DISABLE_SLOT switch case in handle_cmd_completion() into a fuction named xhci_handle_cmd_disable_slot(). Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: refactor TRB_ENABLE_SLOT case into functionXenia Ragiadakou1-5/+12
The function that handles xHCI command completion is much too long and there is need to be broken up into individual functions for each command completion to improve code readablity. This patch refactors the code in TRB_ENABLE_SLOT switch case in handle_cmd_completion() into a fuction named xhci_handle_cmd_enable_slot(). Signed-off-by: Xenia Ragiadakou <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>
2013-10-16xhci: rename existing Command Completion Event handlersXenia Ragiadakou1-10/+8
This patch renames the function handlers of a triggered Command Completion Event that correspond to each command type into 'xhci_handle_cmd_<type>'. That is done to give a consistent naming space to all the functions that handle Command Completion Events and that will permit the code reader to reference to them more easily. Signed-off-by: Xenia Ragiadakou <[email protected]> Acked-by: Sarah Sharp <[email protected]> Signed-off-by: Sarah Sharp <[email protected]>