summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/core.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: dwc3: core: Fix gadget for system suspend/resumeRoger Quadros2014-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During system resume, if the event buffers are not setup before the gadget controller starts then we start with invalid context and this can lead to bus access errors. This is especially true for platforms that loose the controller context during system suspend. e.g. AM437x. The following backtrace was found when the system is suspended and resumed with g_zero loaded on AM437x-evm (USB cable connected to host all the while). [ 120.981506] WARNING: CPU: 0 PID: 1656 at drivers/bus/omap_l3_noc.c:137 l3_interrupt_handler+0x198/0x28c() [ 120.981514] L3 custom error: MASTER:USB0 WR TARGET:GPMC [ 120.981638] Modules linked in: g_mass_storage usb_f_mass_storage libcomposite configfs bufferclass_ti(O) omaplfb(O) cryptodev(O) dwc3 snd_soc_evm snd_soc_omap snd_pe [ 120.981659] CPU: 0 PID: 1656 Comm: sh Tainted: G O 3.12.10-gc559824 #1 [ 120.981669] Backtrace: [ 120.981705] [<c0017880>] (dump_backtrace+0x0/0x10c) from [<c0017a1c>] (show_stack+0x18/0x1c) [ 120.981730] r6:c02819ac r5:00000009 r4:ec137cb8 r3:00000000 [ 120.981767] [<c0017a04>] (show_stack+0x0/0x1c) from [<c056c0b0>] (dump_stack+0x20/0x28) [ 120.981802] [<c056c090>] (dump_stack+0x0/0x28) from [<c0046d08>] (warn_slowpath_common+0x70/0x90) [ 120.981830] [<c0046c98>] (warn_slowpath_common+0x0/0x90) from [<c0046dcc>] (warn_slowpath_fmt+0x38/0x40) [ 120.981856] r8:c0855eb0 r7:00000002 r6:f1000700 r5:00000007 r4:80080003 [ 120.981886] [<c0046d94>] (warn_slowpath_fmt+0x0/0x40) from [<c02819ac>] (l3_interrupt_handler+0x198/0x28c) [ 120.981900] r3:c0801ab8 r2:c06cb354 [ 120.981936] [<c0281814>] (l3_interrupt_handler+0x0/0x28c) from [<c007162c>] (handle_irq_event_percpu+0x54/0x1b8) [ 120.981962] [<c00715d8>] (handle_irq_event_percpu+0x0/0x1b8) from [<c00717c0>] (handle_irq_event+0x30/0x40) [ 120.981993] [<c0071790>] (handle_irq_event+0x0/0x40) from [<c0074058>] (handle_fasteoi_irq+0x74/0x128) [ 120.982006] r4:ed0056c0 r3:00000000 [ 120.982033] [<c0073fe4>] (handle_fasteoi_irq+0x0/0x128) from [<c0070f34>] (generic_handle_irq+0x28/0x38) [ 120.982046] r4:0000002a r3:c0073fe4 [ 120.982085] [<c0070f0c>] (generic_handle_irq+0x0/0x38) from [<c0015560>] (handle_IRQ+0x38/0x8c) [ 120.982098] r4:c080137c r3:00000182 [ 120.982124] [<c0015528>] (handle_IRQ+0x0/0x8c) from [<c00087e0>] (gic_handle_irq+0x30/0x5c) [ 120.982145] r6:ec137dd0 r5:c07ac480 r4:fa24010c r3:00000100 [ 120.982169] [<c00087b0>] (gic_handle_irq+0x0/0x5c) from [<c056fcc0>] (__irq_svc+0x40/0x54) [ 120.982179] Exception stack(0xec137dd0 to 0xec137e18) [ 120.982195] 7dc0: 00000000 a00001d3 00000000 00000004 [ 120.982216] 7de0: a0000153 ec1d9010 c080de90 ec137e30 c080debc 00000000 ed756e44 ec137e2c [ 120.982232] 7e00: ec137de0 ec137e18 bf1150e4 bf115474 60000153 ffffffff [ 120.982253] r7:ec137e04 r6:ffffffff r5:60000153 r4:bf115474 [ 120.982327] [<bf115438>] (dwc3_complete+0x0/0x40 [dwc3]) from [<c0338f50>] (dpm_complete+0xd4/0x19c) [ 120.982341] r5:ed756e10 r4:ed756e64 [ 120.982370] [<c0338e7c>] (dpm_complete+0x0/0x19c) from [<c0339034>] (dpm_resume_end+0x1c/0x20) [ 120.982400] [<c0339018>] (dpm_resume_end+0x0/0x20) from [<c006d4ec>] (suspend_devices_and_enter+0x118/0x33c) [ 120.982412] r4:c0833da4 r3:00000000 [ 120.982436] [<c006d3d4>] (suspend_devices_and_enter+0x0/0x33c) from [<c006d928>] (pm_suspend+0x218/0x254) [ 120.982458] [<c006d710>] (pm_suspend+0x0/0x254) from [<c006c594>] (state_store+0x70/0xc0) [ 120.982478] r6:c057a6cc r5:c06a8320 r4:00000003 r3:0000006d [ 120.982515] [<c006c524>] (state_store+0x0/0xc0) from [<c0264cc0>] (kobj_attr_store+0x1c/0x28) [ 120.982546] [<c0264ca4>] (kobj_attr_store+0x0/0x28) from [<c012ccb8>] (sysfs_write_file+0x170/0x1a4) [ 120.982583] [<c012cb48>] (sysfs_write_file+0x0/0x1a4) from [<c00d17e4>] (vfs_write+0xb8/0x190) [ 120.982611] [<c00d172c>] (vfs_write+0x0/0x190) from [<c00d1bf8>] (SyS_write+0x44/0x78) [ 120.982641] [<c00d1bb4>] (SyS_write+0x0/0x78) from [<c0014660>] (ret_fast_syscall+0x0/0x30) Signed-off-by: Roger Quadros <rogerq@ti.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: adapt dwc3 core to use Generic PHY FrameworkKishon Vijay Abraham I2014-03-051-3/+77
| | | | | | | | | | | | Adapted dwc3 core to use the Generic PHY Framework. So for init, exit, power_on and power_off the following APIs are used phy_init(), phy_exit(), phy_power_on() and phy_power_off(). However using the old USB phy library wont be removed till the PHYs of all other SoC's using dwc3 core is adapted to the Generic PHY Framework. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: support optional PHYsKishon Vijay Abraham I2014-03-051-20/+14
| | | | | | | | | | | | | | | Since PHYs for dwc3 is optional (not all SoCs having PHYs for DWC3 should be programmed), do not return from probe if the USB PHY library returns -ENODEV as that indicates the platform does not have a programmable PHY. While this can be considered as a temporary fix, a long term solution would be to add 'nop' PHY for platforms that does not have programmable PHY. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Reviewed-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: allocate scratch buffersFelipe Balbi2014-03-051-0/+105
| | | | | | | | | | | We must read HWPARAMS4 register to figure out how many scratch buffers we should allocate. Later patch will use "Set Scratchpad Buffer Array" command to pass the pointer to the IP so it can be used during hibernation. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: workaround: clock gating issuesFelipe Balbi2014-03-051-9/+27
| | | | | | | | | | | | | | | | | Revisions between 2.10a and 2.50a (included) have a known issue which may cause xHCI compliance tests to fail and/or quality issues with Isochronous transactions. Note that this issue only impacts certain configurations of those revisions, namely the ones which have clock gating enabled. The suggested workaround is to disable clock gating in known broken revisions, make sure HW LPM is disabled and set GCTL.SOFITPSYNC to 1. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: power off usb phy in error pathKishon Vijay Abraham I2013-11-251-0/+2
| | | | | | | | usb phy was power'ed on but was never power'ed off in the error path. Fix it. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: invoke phy_resume after phy_initKishon Vijay Abraham I2013-11-251-3/+3
| | | | | | | | usb_phy_set_suspend(phy, 0) is called before usb_phy_init. Fix it. Reported-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: use pm_runtime_put_sync() on removeFelipe Balbi2013-10-111-1/+1
| | | | | | | | We are going to disable runtime_pm and we're removing the driver, we must disable the device now. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: Remove additional delay of 100ms when resumingVivek Gautam2013-10-011-1/+0
| | | | | | | | | | | | | | | | This delay got introduced in: "7415f17 usb: dwc3: core: add power management support" which reflected similar code in dwc3_core_soft_reset() function. However, originally the delay of 100ms in dwc3_core_soft_reset() was meant to assist USB2PHY and USB3PHY reset, not for usb_phy_init() sequence. We should get rid of this delay, since things will still work fine without this. Reviewed-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: Remove duplicate inclusion of otg.hSachin Kamat2013-08-271-1/+0
| | | | | | | otg.h header file was included twice. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: cope with NULL pdataFelipe Balbi2013-08-141-1/+4
| | | | | | | | | | | | if pdata is a NULL pointer we could cause a kernel oops when probing the driver. Make sure to cope with systems which won't pass pdata to the driver. Tested-by: Paul Zimmerman <paulz@synopsys.com> Reported-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: dwc3: use dev_get_platdata()Felipe Balbi2013-07-311-3/+3
| | | | | | | | | | | | Use the wrapper function for retrieving the platform_data instead of accessing dev->platform_data directly. While at that also make change 'node' initialization to use the dev pointer. Inspired-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: modify IO memory resource after deferred probe completesIvan T. Ivanov2013-07-291-15/+16
| | | | | | | | | | | When deferred probe happens driver will try to ioremap multiple times and will fail. Memory resource.start variable is a global variable, modifications in this field will be accumulated on every probe. Fix this by moving the above operations after driver hold all required PHY's. Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: introduce and use macros for Event Size registerFelipe Balbi2013-07-291-2/+3
| | | | | | | | | | | | | That register has more than just the event buffer size; we can also mask and unmask that particular interrupter on bit 31 of that register. In this patch we introduce the necessary macros and make sure to use the new macros while also making sure we mask interrupts during driver removal. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: switch over to devm_ioremap_resource()Felipe Balbi2013-07-291-13/+5
| | | | | | use the new devm_ioremap_resource() on core.c Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: adapt to use dr_mode device tree helperRuchika Kharwar2013-07-291-36/+37
| | | | | | | | | | | | | This patch adapts the dwc3 to use the device tree helper "of_usb_get_dr_mode" for the mode of operation of the dwc3 instance being probed. [ balbi@ti.com : make of_usb_get_dr_mode() conditional on dev->of_node and let pdata pass dr_mode too ] Reviewed-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Ruchika Kharwar <ruchika@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: switch to snps,dwc3Felipe Balbi2013-07-291-0/+3
| | | | | | | | | | | | all other drivers using Synopsys IPs with DT have a compatible of snps,$driver, in order to add consistency, we are switching over to snps,dwc3 but keeping synopsys,dwc3 in the core driver to maintain backwards compatibility. New DTS bindings should NOT use synopsys,dwc3. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: make maximum-speed a per-instance attributeFelipe Balbi2013-07-291-15/+9
| | | | | | | | | | in order to allow different instances of the core work in different maximum speeds, we will move the maximum_speed module_parameter to both DeviceTree (making use the new maximum-speed DT property) and platform_data. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: let non-DT platforms pass tx-fifo-resize flag;Felipe Balbi2013-07-291-2/+6
| | | | | | | | | | | in case we're not in a DT boot, we should still be able to tell the driver how to behave. In order to be able to pass flags to the driver, we introduce platform_data structure which the core driver should use. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: switch to GPL v2 onlyFelipe Balbi2013-07-291-27/+10
| | | | | | | | | | | | | | | | This is a Linux-only driver which makes use of GPL-only symbols. It makes no sense to maintain Dual BSD/GPL licensing for this driver. Considering that the amount of work to use this driver in any different operating system would likely be as large as developing the driver from scratch and considering that we depend on GPL-only symbols, we will switch over to a GPL v2-only license. Cc: Anton Tikhomirov <av.tikhomirov@samsung.com> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: fix the error returned with usb3_phy failureRuchika Kharwar2013-07-151-1/+1
| | | | | | | | | When there is an error with the usb3_phy probe or absence, the error returned is erroneously for usb2_phy. Cc: <stable@vger.kernel.org> Signed-off-by: Ruchika Kharwar <ruchika@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: add CONFIG_PM_SLEEP to suspend/resume functionsJingoo Han2013-04-021-1/+1
| | | | | | | | | | | | | | | | | | Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SET_SYSTEM_SLEEP_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. Unnecessary CONFIG_PM ifdefs are removed. drivers/usb/dwc3/core.c:682:12: warning: 'dwc3_suspend' defined but not used [-Wunused-function] drivers/usb/dwc3/core.c:709:12: warning: 'dwc3_resume' defined but not used [-Wunused-function] drivers/usb/dwc3/dwc3-omap.c:430:12: warning: 'dwc3_omap_suspend' defined but not used [-Wunused-function] drivers/usb/dwc3/dwc3-omap.c:440:12: warning: 'dwc3_omap_resume' defined but not used [-Wunused-function] drivers/usb/dwc3/dwc3-exynos.c:185:12: warning: 'dwc3_exynos_suspend' defined but not used [-Wunused-function] drivers/usb/dwc3/dwc3-exynos.c:194:12: warning: 'dwc3_exynos_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: fix PHY error handlingFelipe Balbi2013-03-181-2/+22
| | | | | | | | | PHY layer no longer returns NULL. It will return -ENXIO when PHY layer isn't enabled and we can use that to bail out instead of request a probe deferral. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: set dma_mask for dwc3_omap deviceKishon Vijay Abraham I2013-03-181-0/+4
| | | | | | | | | *dma_mask* is not set for devices created from dt data. So filled dma_mask for dwc3_omap device here. And dwc3 core will copy the dma_mask from its parent. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: calculate the number of endpointsFelipe Balbi2013-03-181-0/+13
| | | | | | | | hwparams2 holds the number of endpoints which were selected during RTL generation, we can use that on our driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: set 'mode' based on selected Kconfig choicesVivek Gautam2013-03-181-1/+6
| | | | | | | | | | | | | Now that machines may select dwc3's working mode (HOST only, GADGET only or DUAL_ROLE) via Kconfig, let's set dwc3's mode based on that, rather than fixing it to whatever hardware says. This way we can skip initializing Gadget/Host in case we are using Host-only/Gadget-only mode respectively. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: avoid checkpatch.pl warningFelipe Balbi2013-03-181-1/+2
| | | | | | | trivial patch to avoid "over 80-chars" rule break. No functional changes. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: add power management supportFelipe Balbi2013-03-181-0/+118
| | | | | | | | | | | | | Add support for basic power management on the dwc3 driver. While there is still lots to improve for full PM support, this minimal patch will already make sure that we survive suspend-to-ram and suspend-to-disk without major issues. Cc: Vikas C Sajjan <vikas.sajjan@linaro.org> Tested-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: explicitly setup and cleanup event buffersFelipe Balbi2013-03-181-15/+17
| | | | | | | | | Make the call to dwc3_event_buffers_setup() and dwc3_event_buffers_cleanup() explicit, so it's easier to implement PM. Tested-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: don't forget to free coherent memoryFelipe Balbi2013-03-041-0/+1
| | | | | | | | | | | | | | | | | | commit 3921426 (usb: dwc3: core: move event buffer allocation out of dwc3_core_init()) introduced a memory leak of the coherent memory we use as event buffers on dwc3 driver. If the driver is compiled as a dynamically loadable module and use constantly loads and unloads the driver, we will continue to leak the coherent memory allocated during ->probe() because dwc3_free_event_buffers() is never called during ->remove(). Cc: <stable@vger.kernel.org> # v3.7 v3.8 Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge tag 'xceiv-for-v3.9' of ↵Greg Kroah-Hartman2013-01-251-4/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: xceiv: patches for v3.9 merge window Two new PHY drivers coming here: one for Samsung, one for OMAP. Both architectures are adding USB3 support to mainline kernel. The PHY layer now allows us to have mulitple PHYs of the same type, which is necessary for platforms which provide more than one USB peripheral port. There's also a few cleanups here: removal of __dev* annotations, conversion of a cast to to_delayed_work(), and mxs-phy learns about ->set_suspend.
| * usb: dwc3: core: add dt support for dwc3 coreKishon Vijay Abraham I2013-01-251-4/+20
| | | | | | | | | | | | | | | | | | Added dt support for dwc3 core and update the documentation with device tree binding information. Getting a PHY is now done using devm_usb_get_phy_by_phandle() for dt boot. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: core: stray statements are removedKishon Vijay Abraham I2013-01-251-3/+0
| | | | | | | | | | | | | | No functional change. Stray statements where removed from dwc3 core. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: core: enable the USB2 and USB3 phy in probeKishon Vijay Abraham I2013-01-251-0/+6
|/ | | | | | | | | Enabled the USB2 and USB3 PHY in probe by calling usb_phy_set_suspend and disabled the PHYs on driver removal. When PM is implemented this will be optimized to enable the PHYs only when needed. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: remove use of __devexitBill Pemberton2012-11-211-1/+1
| | | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Li Yang <leoli@freescale.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: remove use of __devinitBill Pemberton2012-11-211-6/+5
| | | | | | | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Li Yang <leoli@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Geoff Levand <geoff@infradead.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Olav Kongas <ok@artecdesign.ee> Cc: Lennert Buytenhek <kernel@wantstofly.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: remove use of __devexit_pBill Pemberton2012-11-211-1/+1
| | | | | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Li Yang <leoli@freescale.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: dwc3: core: move dwc3_cache_hwparams before dwc3_alloc_event_buffersKishon Vijay Abraham I2012-11-161-2/+2
| | | | | | | | | | | | commit 392142 moved event buffer allocation out of dwc3_core_init() but event buffer allocation uses the cached copy of hwparams to determine the number of event buffers and the caching is done in dwc3_core_init. So moved dwc3_cache_hwparams function before dwc3_alloc_event_buffers so that dwc3_alloc_event_buffers sees the correct number of event buffers. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'dwc3-for-v3.8' of ↵Greg Kroah-Hartman2012-11-111-61/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next USB dwc3 patches from Felipe: "usb: dwc3: patches for v3.8 We can finaly drop HAVE_CLK dependency from exynos glue layer now that clk API provides no-op stubs when it's not linked into the kernel. We're also switching over event buffer allocation to devm_kzalloc() and moving the allocation out of dwc3_core_init() so that can be re-used when implementing PM support for v3.9. After the introduction of PLATFORM_DEVID_AUTO, we can also drop the homebrew platform device ID handling we had on dwc3 core and let driver core take care of that for us. Exynos glue layer learns about DeviceTree and drops platform_data support completely."
| * usb: dwc3: core: don't kfree() devm_kzalloc()'ed memoryFelipe Balbi2012-11-081-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | commit 380f0d2 (usb: dwc3: core: switch event buffer allocation to devm_kzalloc()) was incomplete leaving a trailing kfree(evt) in an error exit path. Fix this problem by removing the trailing kfree(evt). Cc: Julia Lawall <julia.lawall@lip6.fr> Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: remove custom unique id handlingSebastian Andrzej Siewior2012-10-311-39/+0
| | | | | | | | | | | | | | | | | | | | The lockless implementation of the unique id is quite impressive (:P) but dirver's core can handle it, we can remove it and make our code a little smaller. Cc: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: core: move event buffer allocation out of dwc3_core_init()Felipe Balbi2012-10-151-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch is in preparation for adding PM support dwc3 driver. We want to re-use dwc3_core_init and dwc3_core_exit() functions on resume() and suspend() callbacks respectively. Moving even buffer allocation away from dwc3_core_init() will allow us to reuse the event buffer which was allocated long ago on our probe() routine. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: core: switch event buffer allocation to devm_kzalloc()Felipe Balbi2012-10-151-5/+3
| | | | | | | | | | | | | | | | The rest of the driver is using devm_kzalloc() where possible and this patch is just making event buffer allocation follow the example. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: shutdown usb_phy when removing the deviceVivek Gautam2012-10-151-0/+4
|/ | | | | | | | | | We call usb_phy_init() from dwc3_core_init() during probe, so adding usb_phy_shutdown() to dwc3_core_exit() while removing the device so we don't keep PHYs turned on, consuming power, unnecessarily. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge 3.6-rc6 into usb-nextGreg Kroah-Hartman2012-09-161-2/+7
|\ | | | | | | | | | | | | | | | | This resolves the merge problems with: drivers/usb/dwc3/gadget.c drivers/usb/musb/tusb6010.c that had been seen in linux-next. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * usb: dwc3: core: fix incorrect usage of resource pointerKishon Vijay Abraham I2012-09-061-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Populate the resources for xhci afresh instead of directly using the *struct resource* of core. *resource* structure has parent, sibling, child pointers which should be filled only by resource API's. By directly using the *resource* pointer of core in xhci, these parent, sibling, child pointers are already populated even before *platform_device_add* causing side effects. Cc: stable@vger.kernel.org # v3.4, v3.5 Reported-by: Ruchika Kharwar <ruchika@ti.com> Tested-by: Moiz Sonasath <m-sonasath@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | Merge tag 'dwc3-for-v3.7' of ↵Greg Kroah-Hartman2012-09-111-1/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next usb: dwc3: patches for v3.7 merge window Some much needed changes for our dwc3 driver. First there's a rework on the ep0 handling due to some Silicon issue we uncovered which affects all users of this IP core (there's a missing XferNotReady(DATA) event in some conditions). This issue which show up as a SETUP transfers which wouldn't complete ever and we would fail TD 7.06 of the Link Layer Test from USB-IF and Lecroy's USB3 Exerciser. We also fix a long standing bug regarding EP0 enable sequencing where we weren't setting a particular bit (Ignore Sequence Number). Since we never saw any problems caused by that, it didn't deserve being sent to stable tree. On this pull request we also fix Burst Size initialization which should be done only in SuperSpeed and we were mistakenly setting Burst Size to the maximum value on non-SuperSpeed mode. Again, since we never saw any problems caused by that, we're not sending this patch to stable. There's also a memory ordering fix regarding usage of bitmaps in dwc3 driver. You will also find some sparse warnings fix, a fix for missed isochronous packets when the endpoint is already busy, and a fix for synchronization delay on dwc3_stop_active_transfer().
| * | usb: dwc3: core: memory ordering fix in closeOliver Neukum2012-08-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | As a bitmap is used for free/used. As a device freed all memory operations must be scheduled before the bitmap is manipulated. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | usb: dwc3: core: use devm_iremap_nocache() versionFelipe Balbi2012-08-101-1/+1
| |/ | | | | | | | | | | | | This just guarantees that this piece of memory will be marked uncachable. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: add basic PHY supportFelipe Balbi2012-09-101-0/+15
|/ | | | | | | this will let us control PHYs on platforms which need them. Signed-off-by: Felipe Balbi <balbi@ti.com>
OpenPOWER on IntegriCloud