summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/fsl_udc_core.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: gadget: Gadget directory cleanup - group UDC driversAndrzej Pietrasiewicz2014-07-161-2682/+0
| | | | | | | | | The drivers/usb/gadget directory contains many files. Files which are related can be distributed into separate directories. This patch moves the UDC drivers into a separate directory. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: fsl_udc_core: should not call gadget driver's .unbindPeter Chen2014-06-301-1/+0
| | | | | | | It has already been covered by udc core Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: fsl_udc_core: delete __init marker for probePeter Chen2014-06-301-3/+3
| | | | | | | | The probe function may be probed deferal and called after .init section has freed. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge tag 'usb-for-v3.16' of ↵Greg Kroah-Hartman2014-05-231-6/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v3.16 merge window Not a lot here during this merge window. Mostly we just have the usual miscellaneous patches (removal of unnecessary prints, proper dependencies being added to Kconfig, build warning fixes, new device ID, etc. Other than those, the only important new features are the new support for OS Strings which should help Linux Gadget Drivers behave better under MS Windows. Also Babble Recovery implementation for MUSB on AM335x. Lastly, we also have ARCH_QCOM PHY support though phy-msm. Signed-of-by: Felipe Balbi <balbi@ti.com> Conflicts: drivers/usb/phy/phy-mv-u3d-usb.c
| * usb: gadget: fsl_udc_core: remove unnecessary OOM messagesJingoo Han2014-05-141-6/+2
| | | | | | | | | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: fsl driver pullup fixSuresh Gupta2014-04-171-0/+4
| | | | | | | | | | | | | | | | This fix the fsl usb gadget driver in a way that the usb device will be only "pulled up" on requests only when vbus is powered Signed-off-by: Suresh Gupta <suresh.gupta@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb : gadget : fsl: fix the fault issue on rmmodSuresh Gupta2014-04-161-1/+1
|/ | | | | | | | | | completion in udc_controller->done should be assign with proper value before complete called. The complete called in fsl_udc_release which intern called from usb_del_gadget_udc, so moving assignment before calling usb_del_gadget_udc Signed-off-by: Suresh Gupta <suresh.gupta@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: add "maxpacket_limit" field to struct usb_epRobert Baldyga2013-12-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds "maxpacket_limit" to struct usb_ep. This field contains maximum value of maxpacket supported by driver, and is set in driver probe. This value should be used by autoconfig() function, because value of field "maxpacket" is set to value from endpoint descriptor when endpoint becomes enabled. So when autoconfig() function will be called again for this endpoint, "maxpacket" value will contain wMaxPacketSize from descriptior instead of maximum packet size for this endpoint. For this reason this patch adds new field "maxpacket_limit" which contains value of maximum packet size (which defines maximum endpoint capabilities). This value is used in ep_matches() function used by autoconfig(). Value of "maxpacket_limit" should be set in UDC driver probe function, using usb_ep_set_maxpacket_limit() function, defined in gadget.h. This function set choosen value to both "maxpacket_limit" and "maxpacket" fields. This patch modifies UDC drivers by adding support for maxpacket_limit. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: remove superfluous name castsGeert Uytterhoeven2013-11-261-1/+1
| | | | | | | | device_driver.name is "const char *" Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: linux-usb@vger.kernel.org Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: use dev_get_platdata()Jingoo Han2013-07-301-3/+3
| | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* gadget: single_open() leaksAl Viro2013-05-051-1/+1
| | | | | Cc: stable@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge branch 'for-linus' of ↵Linus Torvalds2013-05-011-81/+43
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull VFS updates from Al Viro, Misc cleanups all over the place, mainly wrt /proc interfaces (switch create_proc_entry to proc_create(), get rid of the deprecated create_proc_read_entry() in favor of using proc_create_data() and seq_file etc). 7kloc removed. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits) don't bother with deferred freeing of fdtables proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h proc: Make the PROC_I() and PDE() macros internal to procfs proc: Supply a function to remove a proc entry by PDE take cgroup_open() and cpuset_open() to fs/proc/base.c ppc: Clean up scanlog ppc: Clean up rtas_flash driver somewhat hostap: proc: Use remove_proc_subtree() drm: proc: Use remove_proc_subtree() drm: proc: Use minor->index to label things, not PDE->name drm: Constify drm_proc_list[] zoran: Don't print proc_dir_entry data in debug reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show() proc: Supply an accessor for getting the data from a PDE's parent airo: Use remove_proc_subtree() rtl8192u: Don't need to save device proc dir PDE rtl8187se: Use a dir under /proc/net/r8180/ proc: Add proc_mkdir_data() proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h} proc: Move PDE_NET() to fs/proc/proc_net.c ...
| * fsl_udc: Don't use create_proc_read_entry()David Howells2013-04-291-81/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | Don't use create_proc_read_entry() as that is deprecated, but rather use proc_create_data() and seq_file instead. Signed-off-by: David Howells <dhowells@redhat.com> cc: Li Yang <leoli@freescale.com> cc: Felipe Balbi <balbi@ti.com> cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> cc: linux-usb@vger.kernel.org cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | usb: gadget: fsl_udc_core: Use module_platform_driver_probe macroSachin Kamat2013-03-181-15/+1
| | | | | | | | | | | | | | | | | | module_platform_driver_probe() eliminates the boilerplate and simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Li Yang <leoli@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: fsl_udc_core: don't assign gadget.dev.release directlyFelipe Balbi2013-03-181-2/+2
| | | | | | | | | | | | | | udc-core provides a better way to handle release methods, let's use it. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: fsl_udc_core: don't touch gadget.dev.driverFelipe Balbi2013-03-181-3/+0
| | | | | | | | | | | | | | udc-core now handles that for us, which means we can remove it from our driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: fsl_udc_core: remove unnecessary initializationsFelipe Balbi2013-03-181-1/+0
| | | | | | | | | | | | | | udc-core now sets dma-related and parent fields for us, we don't need to do it ourselves. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: fsl_udc_core: switch over to usb_gadget_map/unmap_request()Felipe Balbi2013-03-181-38/+13
| | | | | | | | | | | | | | we have generic implementations for a reason, let's use them Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: drop now unnecessary flagFelipe Balbi2013-03-181-1/+0
| | | | | | | | | | | | | | | | | | | | We don't need the ->register_my_device flag anymore because all UDC drivers have been properly converted. Let's remove every history of it. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: fsl_udc_core: let udc-core manage gadget->devFelipe Balbi2013-03-181-7/+2
|/ | | | | | | By simply setting a flag, we can drop some boilerplate code. Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge 3.8-rc5 into usb-nextGreg Kroah-Hartman2013-01-251-17/+25
|\ | | | | | | | | | | | | This fixes up a conflict with drivers/usb/serial/io_ti.c that came up in linux-next. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * usb: gadget: fsl_mxc_udc: replace MX35_IO_ADDRESS to ioremapPeter Chen2013-01-181-1/+3
| | | | | | | | | | | | | | | | | | As mach/hardware.h is deleted, we can't visit platform code at driver. It has no phy driver to combine with this controller, so it has to use ioremap to map phy address as a workaround. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: fsl-mxc-udc: replace cpu_is_xxx() with platform_device_idPeter Chen2013-01-181-16/+22
| | | | | | | | | | | | | | | | | | | | | | As mach/hardware.h is deleted, we need to use platform_device_id to differentiate SoCs. Besides, one cpu_is_mx35 is useless as it has already used pdata to differentiate runtime Meanwhile we update the platform code accordingly. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: constify all struct usb_gadget_opsFelipe Balbi2013-01-241-1/+1
| | | | | | | | | | | | | | Add the missing 'const' keyword to all struct usb_gadget_ops in the gadget framework. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: fsl_udc_core: convert to udc_start/udc_stopFelipe Balbi2013-01-241-47/+11
|/ | | | | | | | Mechanical change making use of the new (can we still call it new ?) interface for registering UDC drivers. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: fix typo in drivers/usbMasanari Iida2012-11-061-1/+1
| | | | | | | | Correct spelling typo in debug messages within drivers/usb. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: remove global variable composite in composite.cSebastian Andrzej Siewior2012-09-101-3/+3
| | | | | | | | | | | | | This patch removes the global variable composite in composite.c. The private data which was saved there is now passed via an additional argument to the bind() function in struct usb_gadget_driver. Only the "old-style" UDC drivers have to be touched here, new style are doing it right because this change is made in udc-core. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge tag 'xceiv-for-v3.6' of ↵Greg Kroah-Hartman2012-07-051-8/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next usb: phy: patches for v3.6 merge window We are starting to support multiple USB phys as we should thanks for Kishon's work. DeviceTree support for USB PHYs won't come until discussion with DeviceTree maintainer is finished. Together with that series, we have one fix for twl4030 which missed a IRQF_ONESHOT annotation when requesting a threaded IRQ without a top half handler, and removal of an unused variable compilation warning to isp1301_omap.
| * usb: phy: fix return value check of usb_get_phyKishon Vijay Abraham I2012-07-021-7/+8
| | | | | | | | | | | | | | | | | | usb_get_phy will return -ENODEV if it's not able to find the phy. Hence fixed all the callers of usb_get_phy to check for this error condition instead of relying on a non-zero value as success condition. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: otg: support for multiple transceivers by a single controllerKishon Vijay Abraham I2012-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | Add a linked list for keeping multiple PHY instances with different types so that we can have separate USB2 and USB3 PHYs on one single board. _get_phy_ has been changed so that the controller gets the transceiver by type. _remove_phy_ has been added to let the phy be removed from the phy list. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: otg: utils: rename function name in OTG utilsKishon Vijay Abraham I2012-06-251-1/+1
| | | | | | | | | | | | | | | | | | _transceiver() in otg.c is replaced with _phy. usb_set_transceiver is replaced with usb_add_phy to make it similar to other usb standard function names like usb_add_hcd. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | Merge tag 'gadget-for-v3.6' of ↵Greg Kroah-Hartman2012-07-051-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next usb: gadget: patches for v3.6 merge window This is quite a big pull request and contains patches all over the place. omap_udc is now a bit cleaner after removing omap2 support, fixing some checkpatch.pl warnings and errors, switching over to generic map/unmap routines and preventing a NULL pointer de-reference. s3c-hsotg has been switched over to devm_* API, got some locking fixes and improvements and it also got an implementation for the pullup() method. the mass storage gadgets changed default value of the removable parameter, dropped some unused options and made "file" and "ro" module_parameters read-only in some cases. ffs function got support for HID descriptor. Some UDCs have been converted to clk_prepare_enable() and clk_disable_unprepare(). Marvell now got support for its USB3 controller in mainline after introducing its mv_u3d_core.c driver.
| * | usb: gadget: fsl_udc: Propagate devicetree to gadget driversAlexandre Pereira da Silva2012-07-021-0/+1
| |/ | | | | | | | | | | | | Fill dev.of_node of gadget drivers, so they can use devicetree Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: regression fix - usage of usb_epChristoph Fritz2012-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes redundant pointer to struct usb_endpoint_descriptor which were missed in commit 79149b8: usb: gadget: Update fsl_udc_core to use usb_endpoint_descriptor inside the struct usb_ep Due to clock framework regressions, this patch is only compile tested! Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: fsl_udc_core: Remove unneeded conditionIdo Shayevitz2012-06-041-1/+1
|/ | | | | | | | The removed condition is always true, since the endpoint descriptor is set prior to calling the enable endpoint. Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge tag 'gadget-for-v3.5' of ↵Greg Kroah-Hartman2012-05-071-13/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next usb: gadget: patches for v3.5 This pull request is quite big, but mainly because there's a giant rework of the s3c_hsotg.c driver to make it friendlier for other users. Samsung Exynos platforms use the DesignWare Core USB2 IP from Synopsys so it's a bit unfair to have the driver work for Samsung platforms only. In short, the big rework is in preparation to make the driver more reusable. Another big rework in this pull request came from Ido, where he's removing the redundant pointer for the endpoint descriptor from the controller driver's own endpoint representation. The same pointer is available through the generic struct usb_ep structure. Also on this pull request is the conversion of a few extra controller drivers to the new style registration, which allows multiple controllers to be available on the same platform and helps remove global pointers from those drivers. Together with those big changes, there's the usual fixes and cleanups to gadget drivers. Nothing major.
| * usb: gadget: fsl_udc_core: dTD's next dtd pointer need to be updated once ↵Peter Chen2012-05-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | written dTD's next dtd pointer need to be updated once CPU writes it, or this request may not be handled by controller, then host will get NAK from device forever. This problem occurs when there is a request is handling, we need to add a new request to dTD list, if this new request is added before the current one is finished, the new request is intended to added as next dtd pointer at current dTD, but without wmb(), the dTD's next dtd pointer may not be updated when the controller reads it. In that case, the controller will still get Terminate Bit is 1 at dTD's next dtd pointer, that means there is no next request, then this new request is missed by controller. CC: <stable@vger.kernel.org> Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Li Yang <leoli@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: Update fsl_udc_core to use usb_endpoint_descriptor inside the ↵Ido Shayevitz2012-05-041-13/+12
| | | | | | | | | | | | | | | | | | struct usb_ep Remove redundant pointer to struct usb_endpoint_descriptor. Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | Merge 3.4-rc4 into usb-next.Greg Kroah-Hartman2012-04-221-5/+23
|\ \ | |/ |/| | | | | | | | | | | | | This resolves the conflict in: drivers/usb/host/ehci-fsl.c And picks up loads of xhci bugfixes to make it easier for others to test with. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * fsl/usb: Add controller version based ULPI and UTMI phy supportRamneek Mehresh2012-04-181-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for ULPI and UTMI PHYs based on usb controller version info read from device-tree Example of USB Controller versioning info: Version 1.2 and below : MPC8536, MPC8315, etc Version 1.6 : P1020, P1010, P2020, P5020, etc Version 2.2 : PSC9131, PSC9132, P3060, etc No changes for non-DT users Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com> Acked-by: Li Yang <leoli@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | usb: fsl_udc_core: prime status stage once data stage has primedPeter Chen2012-04-101-9/+16
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - For Control Read transfer, the ACK handshake on an IN transaction may be corrupted, so the device may not receive the ACK for data stage, the complete irq will not occur at this situation. Therefore, we need to move prime status stage from complete irq routine to the place where the data stage has just primed, or the host will never get ACK for status stage. The above issue has been described at USB2.0 spec chapter 8.5.3.3. - After adding prime status stage just after prime the data stage, there is a potential problem when the status dTD is added before the data stage has primed by hardware. The reason is the device's dTD descriptor has NO direction bit, if data stage (IN) prime hasn't finished, the status stage(OUT) dTD will be added at data stage dTD's Next dTD Pointer, so when the data stage transfer has finished, the status dTD will be primed as IN by hardware, then the host will never receive ACK from the device side for status stage. - Delete below code at fsl_ep_queue: /* Update ep0 state */ if ((ep_index(ep) == 0)) udc->ep0_state = DATA_STATE_XMIT; the udc->ep0_state will be updated again after udc->driver->setup finishes. It is tested at i.mx51 bbg board with g_mass_storage, g_ether, g_serial. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Remove all #inclusions of asm/system.hDavid Howells2012-03-281-1/+0
| | | | | | | | | Remove all #inclusions of asm/system.h preparatory to splitting and killing it. Performed with the following command: perl -p -i -e 's!^#\s*include\s*<asm/system[.]h>.*\n!!' `grep -Irl '^#\s*include\s*<asm/system[.]h>' *` Signed-off-by: David Howells <dhowells@redhat.com>
* Merge tag 'gadget-for-v3.4' of ↵Greg Kroah-Hartman2012-03-011-10/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next USB: Gadget: changes for 3.4 This merge is rather big. Here's what it contains: For am5536udc we have just simple coding style fixes. Nothing that has any potential to cause any issues going forward. With mv_udc, there's only one single change removing an unneeded NULL check. at91_udc also only saw a single change this merge window, and that's only removing a duplicated header. The Renesas controller has a few more involved changes. Support for SUDMAC was added, there's now a special handling of IRQ resources for when the IRQ line is shared between Renesas controller and SUDMAC, we also had a bug fix where Renesas controller would sleep in atomic context while doing DMA transfers from a tasklet. There were also a set of minor cleanups. The FSL UDC also had a scheduling in atomic context bug fix, but that's all. Thanks to Sebastian, the dummy_hcd now works better than ever with support for scatterlists and streams. Sebastian also added SuperSpeed descriptors to the serial gadgets. The highlight on this merge is the addition of a generic API for mapping and unmapping usb_requests. This will avoid code duplication on all UDC controllers and also kills all the defines for DMA_ADDR_INVALID which UDC controllers sprinkled around. A few of the UDC controllers were already converted to use this new API. Conflicts: drivers/usb/dwc3/gadget.c
| * usb: fsl_udc_core: Fix scheduling while atomic dump messagePeter Chen2012-02-241-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When loading g_ether gadget, there is below message: Backtrace: [<80012248>] (dump_backtrace+0x0/0x10c) from [<803cb42c>] (dump_stack+0x18/0x1c) r7:00000000 r6:80512000 r5:8052bef8 r4:80513f30 [<803cb414>] (dump_stack+0x0/0x1c) from [<8000feb4>] (show_regs+0x44/0x50) [<8000fe70>] (show_regs+0x0/0x50) from [<8004c840>] (__schedule_bug+0x68/0x84) r5:8052bef8 r4:80513f30 [<8004c7d8>] (__schedule_bug+0x0/0x84) from [<803cd0e4>] (__schedule+0x4b0/0x528) r5:8052bef8 r4:809aad00 [<803ccc34>] (__schedule+0x0/0x528) from [<803cd214>] (_cond_resched+0x44/0x58) [<803cd1d0>] (_cond_resched+0x0/0x58) from [<800a9488>] (dma_pool_alloc+0x184/0x250) r5:9f9b4000 r4:9fb4fb80 [<800a9304>] (dma_pool_alloc+0x0/0x250) from [<802a8ad8>] (fsl_req_to_dtd+0xac/0x180) [<802a8a2c>] (fsl_req_to_dtd+0x0/0x180) from [<802a8ce4>] (fsl_ep_queue+0x138/0x274) [<802a8bac>] (fsl_ep_queue+0x0/0x274) from [<7f004328>] (composite_setup+0x2d4/0xfac [g_ether]) [<7f004054>] (composite_setup+0x0/0xfac [g_ether]) from [<802a9bb4>] (fsl_udc_irq+0x8dc/0xd38) [<802a92d8>] (fsl_udc_irq+0x0/0xd38) from [<800704f8>] (handle_irq_event_percpu+0x54/0x188) [<800704a4>] (handle_irq_event_percpu+0x0/0x188) from [<80070674>] (handle_irq_event+0x48/0x68) [<8007062c>] (handle_irq_event+0x0/0x68) from [<800738ec>] (handle_level_irq+0xb4/0x138) r5:80514f94 r4:80514f40 [<80073838>] (handle_level_irq+0x0/0x138) from [<8006ffa4>] (generic_handle_irq+0x38/0x44) r7:00000012 r6:80510b1c r5:80529860 r4:80512000 [<8006ff6c>] (generic_handle_irq+0x0/0x44) from [<8000f4c4>] (handle_IRQ+0x54/0xb4) [<8000f470>] (handle_IRQ+0x0/0xb4) from [<800085b8>] (tzic_handle_irq+0x64/0x94) r9:412fc085 r8:00000000 r7:80513f30 r6:00000001 r5:00000000 r4:00000000 [<80008554>] (tzic_handle_irq+0x0/0x94) from [<8000e680>] (__irq_svc+0x40/0x60) The reason of above dump message is calling dma_poll_alloc with can-schedule mem_flags at atomic context. To fix this problem, below changes are made: - fsl_req_to_dtd doesn't need to be protected by spin_lock_irqsave, as struct usb_request can be access at process context. Move lock to beginning of hardware visit (fsl_queue_td). - Change the memory flag which using to allocate dTD descriptor buffer, the memory flag can be from gadget layer. It is tested at i.mx51 bbg board with g_mass_storage, g_ether, g_serial. Cc: stable@vger.kernel.org Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Li Yang <leoli@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: gadget: Clear usb_endpoint_descriptor inside the struct usb_ep on disableIdo Shayevitz2012-02-241-0/+1
| | | | | | | | | | | | | | | | | | This fix a bug in f_serial, which expect the ep->desc to be NULL after disabling an endpoint. Cc: stable@vger.kernel.org Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: otg: Convert all users to pass struct usb_otg for OTG functionsHeikki Krogerus2012-02-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the otg functions so that they receive struct otg instead of struct usb_phy as parameter and converts all users of these functions to pass the otg member of their usb_phy. Includes fixes to IMX code from Sascha Hauer. [ balbi@ti.com : fixed a compile warning on ehci-mv.c ] Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Igor Grinberg <grinberg@compulab.co.il> Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Acked-by: Li Yang <leoli@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: Convert all users to new usb_phyHeikki Krogerus2012-02-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new usb_phy_* functions with transceiver operations instead of the old otg functions. Includes fixes from Sascha Hauer. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Acked-by: Li Yang <leoli@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: gadget: fsl_udc: fix the usage of udc->max_epPeter Chen2012-01-241-2/+2
|/ | | | | | | | | | | | | | The max_ep is the number of endpoint * 2. But in dtd_complete_irq, it does again * 2, it will deference wrong memory after scanning max_ep - 1. The another similar problem is at USB_REQ_SET_FEATURE (the pipe number should be 0 and max_ep - 1). Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Matthieu castet <matthieu.castet@parrot.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: rename usb_gadget_driver::speed to max_speedMichal Nazarewicz2011-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This commit renames the “speed” field of the usb_gadget_driver structure to “max_speed”. This is so that to make it more apparent that the field represents the maximum speed gadget driver can support. This also make the field look more like fields with the same name in usb_gadget and usb_composite_driver structures. All of those represent the *maximal* speed given entity supports. After this commit, there are the following fields in various structures: * usb_gadget::speed - the current connection speed, * usb_gadget::max_speed - maximal speed UDC supports, * usb_gadget_driver::max_speed - maximal speed gadget driver supports, and * usb_composite_driver::max_speed - maximal speed composite gadget supports. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: replace usb_gadget::is_dualspeed with max_speedMichal Nazarewicz2011-12-121-1/+1
| | | | | | | | | | This commit replaces usb_gadget's is_dualspeed field with a max_speed field. [ balbi@ti.com : Fixed DWC3 driver ] Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
OpenPOWER on IntegriCloud