History log of /linux-master/drivers/usb/musb/ux500_dma.c
Revision Date Author Comments
# b7962fb4 15-Jan-2020 Peter Ujfalusi <peter.ujfalusi@ti.com>

usb: musb/ux500: Use dma_request_chan() instead dma_request_slave_channel()

dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Link: https://lore.kernel.org/r/20200115132547.364-19-b-liu@ti.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 21b650c2 06-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: musb: Remove redundant license text

Now that the SPDX tag is in all USB files, that identifies the license
in a specific and legally-defined manner. So the extra GPL text wording
can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text. And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Acked-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5fd54ace 03-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: add SPDX identifiers to all remaining files in drivers/usb/

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/usb/ and include/linux/usb* files with the correct
SPDX license identifier based on the license text in the file itself.
The SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 62a6abdd 28-Jan-2016 Arnd Bergmann <arnd@arndb.de>

usb: musb/ux500: remove duplicate check for dma_is_compatible

When dma_addr_t is 64-bit, we get a warning about an invalid cast
in the call to ux500_dma_is_compatible() from ux500_dma_channel_program():

drivers/usb/musb/ux500_dma.c: In function 'ux500_dma_channel_program':
drivers/usb/musb/ux500_dma.c:210:51: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
if (!ux500_dma_is_compatible(channel, packet_sz, (void *)dma_addr, len))

The problem is that ux500_dma_is_compatible() is called from the
main musb driver on the virtual address, but here we pass in a
DMA address, so the types are fundamentally different but it works
because the function only checks the alignment of the buffer and
that is the same.

We could work around this by adding another cast, but I have checked
that the buffer we get passed here is already checked before it
gets mapped, so the second check seems completely unnecessary
and removing it must be the cleanest solution.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Felipe Balbi <balbi@kernel.org>


# 7f6283ed 01-May-2015 Tony Lindgren <tony@atomide.com>

usb: musb: Set up function pointers for DMA

Set up function pointers for DMA so get closer to
being able to build in all the DMA engines.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 1b40fc57 24-Nov-2014 Tony Lindgren <tony@atomide.com>

usb: musb: Change to use new IO access

Change to use new IO access. This allows us to build in multiple
MUSB glue layers.

[ balbi@ti.com : switch to EXPORT_SYMBOL_GPL()
fix long lines ]

Cc: Fabio Baltieri <fabio.baltieri@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 3da6702f 11-Oct-2014 Vinod Koul <vkoul@kernel.org>

usb: musb: ux500_dma: use dmaengine_xxx() APIs

The drivers should use dmaengine_terminate_all() or dmaengine_slave_config()
API instead of accessing the device_control which will be deprecated soon

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 50f9f798 05-Aug-2014 Hans Wennborg <hans@hanshq.net>

usb: musb: ux500: fix decimal printf format specifiers prefixed with 0x

The prefix suggests the number should be printed in hex, so use
the %x specifier to do that.

Found by using regex suggested by Joe Perches.

Signed-off-by: Hans Wennborg <hans@hanshq.net>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 086ed9a0 13-Dec-2013 Lee Jones <lee.jones@linaro.org>

usb: musb: ux500_dma: fix potential NULL dereference error

static checker warning: "drivers/usb/musb/ux500_dma.c:335
ux500_dma_controller_start()
error: potential NULL dereference 'param_array'."

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 0f2aa8ca 20-Aug-2013 Lee Jones <lee.jones@linaro.org>

usb: musb: ux500: Add check for NULL board data

Dan Carpenter's automatic Smatch checker found an anomaly in the ux500
MUSB driver, whereby board data was checked before use in all but one
occasion. It is believed that it needs to be checked every time.

Smatch complaint:
drivers/usb/musb/ux500_dma.c:335 ux500_dma_controller_start()
error: we previously assumed 'data' could be null (see line 313)

Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# c1a7d67c 30-Jul-2013 Jingoo Han <jg1.han@samsung.com>

usb: musb: use dev_get_platdata()

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>


# 66c01883 19-Jun-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

usb: musb: dma: merge ->start/stop into create/destroy

The core code creates a controller and immediately after that it calls
the ->start() callback. This one might drop an error but nobody cares.
The same thing happens in the destroy corner: First ->stop() called
followed by destroy callback. So why not merge those two into the same
function since there is no difference.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 2968da0b 15-May-2013 Lee Jones <lee.jones@linaro.org>

usb: musb: ux500: attempt to find channels by name before using pdata

If we can ever get to a state where we can solely search for DMA channels
by name, this will almost completely alleviate the requirement to pass
copious amounts of information though platform data. Here we take the
first step towards this. The next step will be to enable Device Tree
complete with name<->event_line mapping.

Cc: linux-usb@vger.kernel.org
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# 5f6091a0 15-May-2013 Lee Jones <lee.jones@linaro.org>

usb: musb: ux500: harden checks for platform data

In its current state, the ux500-musb driver uses platform data pointers
blindly with no prior checking. If no platform data pointer is passed
this will Oops the kernel. In this patch we ensure platform data and
board data are present prior to using them.

Cc: linux-usb@vger.kernel.org
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# be2dbb09 15-May-2013 Lee Jones <lee.jones@linaro.org>

usb: musb: ux500: move channel number knowledge into the driver

For all ux500 based platforms the maximum number of end-points are used.
Move this knowledge into the driver so we can relinquish the burden from
platform data. This also removes quite a bit of complexity from the driver
and will aid us when we come to enable the driver for Device Tree.

Cc: linux-usb@vger.kernel.org
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


# 3147dad6 15-May-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: musb: various cosmetic fixes on ux500 files

Various non functional coding style fixes on ux500_dma.c and
phy-ab8500-usb.c drivers.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 3ee1f2e6 03-Apr-2013 Fabio Baltieri <fabio.baltieri@linaro.org>

usb: musb: ux500_dma: drop references to U5500

Drop references to deprecated U5500 platform in driver comments.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 6b0cfc65 22-Mar-2013 Felipe Balbi <balbi@ti.com>

usb: musb: ux500_dma: fix sparse warning

fix the following sparse warning:

drivers/usb/musb/ux500_dma.c:60:6: warning: symbol 'ux500_dma_callback' was not declared. Should it be static?

Signed-off-by: Felipe Balbi <balbi@ti.com>


# 399e0f4f 07-Mar-2013 Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>

usb: musb: ux500_dma: add missing MEM resource check

Fix dma_controller_create() fail path in case memory resource is
missing.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 6a3b0036 06-Feb-2013 Felipe Balbi <balbi@ti.com>

usb: musb: ux500_dma: kill compile warnings

Fix the following compile warnings:

drivers/usb/musb/ux500_dma.c: In function ‘ux500_configure_channel’:
drivers/usb/musb/ux500_dma.c:96:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
drivers/usb/musb/ux500_dma.c: In function ‘ux500_dma_is_compatible’:
drivers/usb/musb/ux500_dma.c:195:4: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Signed-off-by: Felipe Balbi <balbi@ti.com>


# 0f53e481 06-Feb-2013 Felipe Balbi <balbi@ti.com>

usb: musb: dsps: add missing include

<linux/sizes.h> is the header defining SZ_4
and SZ_16M, we shouldn't depend on indirect
inclusion so let's explicitly include it.

Signed-off-by: Felipe Balbi <balbi@ti.com>


# 41ac7b3a 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu>

usb: remove use of __devinit

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>


# db298da2 24-Aug-2012 Arnd Bergmann <arnd@arndb.de>

ARM: nomadik: move platform_data definitions

Platform data for device drivers should be defined in
include/linux/platform_data/*.h, not in the architecture
and platform specific directories.

This moves such data out of the nomadik include directories

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Alessandro Rubini <rubini@unipv.it>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: STEricsson <STEricsson_nomadik_linux@list.st.com>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Andreas Westin <andreas.westin@stericsson.com>


# 07a67bbb 09-Aug-2012 Shubhrajyoti D <shubhrajyoti@ti.com>

usb: musb: Make dma_controller_create __devinit

dma_controller_create is called only from musb_init_controller
which is __devint so annotate dma_controller_create also with
__devint.

fixes the warn

WARNING: vmlinux.o(.devinit.text+0x6fa8): Section mismatch in reference from the function musb_init_controller() to the function .init.text:dma_controller_create()
The function __devinit musb_init_controller() references
a function __init dma_controller_create().
If dma_controller_create is only used by musb_init_controller then
annotate dma_controller_create with a matching annotation.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 16052827 08-Mar-2012 Alexandre Bounine <alexandre.bounine@idt.com>

dmaengine/dma_slave: introduce inline wrappers

Add inline wrappers for device_prep_slave_sg() and device_prep_dma_cyclic()
interfaces to hide new parameter from current users of affected interfaces.
Convert current users to use new wrappers instead of direct calls.
Suggested by Russell King [https://lkml.org/lkml/2012/2/3/269].

Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>


# 258aea76 01-Feb-2012 Viresh Kumar <vireshk@kernel.org>

dmaengine: Pass dma_slave_config .device_fc = NULL for all existing users

.device_fc is added in struct dma_slave_config recently. All user drivers, which
want DMA to be the flow controller must pass this field as false. As earlier
driver don't look to use this feature, mark it false for now.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>


# be18a251 17-Aug-2011 Per Forlin <per.forlin@linaro.org>

usb: musb: ux500: optimize DMA callback routine

Skip the use of work queue and call musb_dma_completion() directly from
DMA callback context.

Here follows measurements on a Snowball board with ondemand governor active.

Performance using work queue:
(105 MB) copied, 6.23758 s, 16.8 MB/s
(105 MB) copied, 5.7151 s, 18.3 MB/s
(105 MB) copied, 5.83583 s, 18.0 MB/s
(105 MB) copied, 5.93611 s, 17.7 MB/s

Performance without work queue
(105 MB) copied, 5.62173 s, 18.7 MB/s
(105 MB) copied, 5.61811 s, 18.7 MB/s
(105 MB) copied, 5.57817 s, 18.8 MB/s
(105 MB) copied, 5.58549 s, 18.8 MB/s

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 8341544c 14-Oct-2011 Vinod Koul <vkoul@kernel.org>

USB-musb: move to dma_transfer_direction

fixup usage of dma direction by introducing dma_transfer_direction,
this patch moves usb/musb driver to use new enum

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>


# afbd0749 03-Aug-2011 Per Forlin <per.forlin@linaro.org>

usb: musb: ux500: replace missing DBG with dev_dbg

ux500_dma.c fail to compile becase DBG has been removed from musb_debug.
Use dev_dbg for all prints.

Cc: stable@vger.kernel.org
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Mian Yousaf Kaukab<mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# d366d39b 02-Aug-2011 Per Forlin <per.forlin@linaro.org>

usb: musb: ux500: set dma config for both src and dst

The dma driver requires both src and dst to be set.
This fix is needed in order to run gadget mass storage.
Patch is verified on snowball.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>


# 8dcc8f72 22-Mar-2011 Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>

usb: musb: ux500: add dma glue layer for ux500

Unaligned sizes and buffers are not supported and they will be filtered
out by is_compatible().

Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>