aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/s3c-hsotg.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: udc: Fix gadget driver's speed check in various UDC driversMichal Nazarewicz2011-11-291-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several UDC drivers had a gadget driver's speed sanity check of the form of: driver->speed != USB_SPEED_HIGH or: driver->speed != USB_SPEED_HIGH && driver->speed != USB_SPEED_FULL As more and more gadget drivers support USB SuperSpeed, driver->speed may be set to USB_SPEED_SUPER and UDC driver should handle such gadget correctly. The above checks however fail to recognise USB_SPEED_SUPER as a valid speed. This commit changes the two checks to: driver->speed < USB_SPEED_HIGH or: driver->speed < USB_SPEED_FULL respectively. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Reported-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: Provide usb_speed_string() functionMichal Nazarewicz2011-09-181-6/+2
| | | | | | | | | | | | | | | | | | | In a few places in the kernel, the code prints a human-readable USB device speed (eg. "high speed"). This involves a switch statement sometimes wrapped around in ({ ... }) block leading to code repetition. To mitigate this issue, this commit introduces usb_speed_string() function, which returns a human-readable name of provided speed. It also changes a few places switch was used to use this new function. This changes a bit the way the speed is printed in few instances at the same time standardising it. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: use usb_endpoint_maxp() instead of le16_to_cpu()Kuninori Morimoto2011-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size instead of le16_to_cpu(desc->wMaxPacketSize). This patch fix it up Cc: Armin Fuerst <fuerst@in.tum.de> Cc: Pavel Machek <pavel@ucw.cz> Cc: Johannes Erdfelt <johannes@erdfelt.com> Cc: Vojtech Pavlik <vojtech@suse.cz> Cc: Oliver Neukum <oliver@neukum.name> Cc: David Kubicek <dave@awk.cz> Cc: Johan Hovold <jhovold@gmail.com> Cc: Brad Hards <bhards@bigpond.net.au> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de> Cc: David Brownell <david-b@pacbell.net> Cc: David Lopo <dlopo@chipidea.mips.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Michal Nazarewicz <m.nazarewicz@samsung.com> Cc: Xie Xiaobo <X.Xie@freescale.com> Cc: Li Yang <leoli@freescale.com> Cc: Jiang Bo <tanya.jiang@freescale.com> Cc: Yuan-hsin Chen <yhchen@faraday-tech.com> Cc: Darius Augulis <augulis.darius@gmail.com> Cc: Xiaochen Shen <xiaochen.shen@intel.com> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Cc: OKI SEMICONDUCTOR, <toshiharu-linux@dsn.okisemi.com> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Ben Dooks <ben@simtec.co.uk> Cc: Thomas Abraham <thomas.ab@samsung.com> Cc: Herbert Pötzl <herbert@13thfloor.at> Cc: Arnaud Patard <arnaud.patard@rtp-net.org> Cc: Roman Weissgaerber <weissg@vienna.at> Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Tony Olech <tony.olech@elandigitalsystems.com> Cc: Florian Floe Echtler <echtler@fs.tum.de> Cc: Christian Lucht <lucht@codemercs.com> Cc: Juergen Stuber <starblue@sourceforge.net> Cc: Georges Toth <g.toth@e-biz.lu> Cc: Bill Ryder <bryder@sgi.com> Cc: Kuba Ober <kuba@mareimbrium.org> Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: gadget: convert all users to the new udc infrastructureSebastian Andrzej Siewior2011-06-281-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | peripheral drivers are using usb_add_gadget()/usb_del_gadget() to register/unregister to the udc-core. The udc-core will take the first available gadget driver and attach function driver which is calling usb_gadget_register_driver(). This is the same behaviour we have right now. Only dummy_hcd was tested, the others were compiled tested. Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Anton Tikhomirov <av.tikhomirov@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Dan Carpenter <error27@gmail.com> Cc: Darius Augulis <augulis.darius@gmail.com> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Jingoo Han <jg1.han@samsung.com> Cc: Kukjin Kim <kgene.kim@samsung.com> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Cc: Li Yang <leoli@freescale.com> Cc: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Pavankumar Kondeti <pkondeti@codeaurora.org> Cc: Roy Huang <roy.huang@analog.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com> Cc: Xiaochen Shen <xiaochen.shen@intel.com> Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Cc: Yuan-Hsin Chen <yhchen@faraday-tech.com> Cc: cxie4 <cxie4@marvell.com> Cc: linux-geode@lists.infradead.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Tone down debuggingMark Brown2011-06-061-10/+12
| | | | | | | | | Currently the s3c-hsotg driver is extremely chatty, producing voluminous with large register dumps even in default operation. Tone this down so we're not chatty unless DEBUG is defined. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: return proper error if clk_get failsJingoo Han2011-05-131-1/+1
| | | | | | | Return PTR_ERR(hsotg->clk) instead of -EINVAL if clk_get fails Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: fix checkpatch warningsJingoo Han2011-05-131-4/+3
| | | | | | | | | | This patch fixes the checkpatch warnings listed below: WARNING: braces {} are not necessary for any arm of this statement WARNING: please, no space before tabs Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Add copyright stringAnton Tikhomirov2011-05-021-0/+3
| | | | | | | Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Fix hang up after resetAnton Tikhomirov2011-05-021-5/+0
| | | | | | | | | | | | | When File Storage gadget receives SET CONFIGURATION request it tries to cancel all pending transfers. If some request is in progress, gadget waits for its completion. This commit allows gadget to dequeue invalid requests in progress left after reset. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Reviewed-by: Kyoungil Kim<ki0351.kim@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Fix stall condition processingAnton Tikhomirov2011-05-021-31/+111
| | | | | | | | | | | | | | | | | | The following should be done for requests after endpoint stall condition is cleared: 1) 'in progress' request (if any) should be completed since Tx FIFO was flushed; 2) next request from queue (if any) should be started. This commit does that. Additionally set/clear stall condition code is fixed. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Reviewed-by: Kyoungil Kim<ki0351.kim@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Fix control request processingAnton Tikhomirov2011-05-021-8/+9
| | | | | | | | | | | | UDC driver does not need to generate reply to host if request is delivered to gadget. This is gadget's responsibility. This commit fixes that. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Reviewed-by: Kyoungil Kim<ki0351.kim@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Fix interrupt cleaning codeAnton Tikhomirov2011-05-021-38/+20
| | | | | | | | | | | | | | This commit does the following: 1) clears all pending interrupts before unmasking; 2) clears interrupts as soon as possible to avoid missing next coming that may occur during handling; 3) removes ineffective interrupt cleaning code. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Reviewed-by: Kyoungil Kim<ki0351.kim@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Fix core resetAnton Tikhomirov2011-05-021-5/+2
| | | | | | | | | | This patch fixes code responsible for core reset. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Reviewed-by: Kyoungil Kim<ki0351.kim@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Fix common misspellingsLucas De Marchi2011-03-311-9/+9
| | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* usb gadget: don't save bind callback in struct usb_gadget_driverUwe Kleine-König2010-10-221-4/+5
| | | | | | | | | | | | | | | | | | | | | | To accomplish this the function to register a gadget driver takes the bind function as a second argument. To make things clearer rename the function to resemble platform_driver_probe. This fixes many section mismatches like WARNING: drivers/usb/gadget/g_printer.o(.data+0xc): Section mismatch in reference from the variable printer_driver to the function .init.text:printer_bind() The variable printer_driver references the function __init printer_bind() All callers are fixed. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [m.nazarewicz@samsung.com: added dbgp] Signed-off-by: Michał Nazarewicz <m.nazarewicz@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Remove DEBUG defineMaurus Cuelenaere2010-09-031-2/+0
| | | | | | | | DEBUG is defined unconditionally, remove it as this clutters the message log. Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: add support for clock gatingMarek Szyprowski2010-08-101-3/+17
| | | | | | | | | | | This patch adds support for clock gating of the HS/OTG block. On S5PV210 otg gating clock is initally disabled so the driver needs to get and enable it before it can access its registers. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: modify only selected bits in S3C_PHYPWR registerMarek Szyprowski2010-08-101-2/+4
| | | | | | | | | | | S5PV210 SoCs has 2 USB PHY interfaces, both enabled by writing zero to S3C_PHYPWR register. HS/OTG driver uses only PHY0, so do not touch bits related to PHY1. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: fix compilation problemMarek Szyprowski2010-08-101-0/+1
| | | | | | | | | | | | drivers/usb/gadget/s3c-hsotg.c: In function ‘s3c_hsotg_otgreset’: drivers/usb/gadget/s3c-hsotg.c:2816: error: ‘MHZ’ undeclared (first use in this function) drivers/usb/gadget/s3c-hsotg.c:2816: error: (Each undeclared identifier is reported only once drivers/usb/gadget/s3c-hsotg.c:2816: error: for each function it appears in.) Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Add support for external USB clockMaurus Cuelenaere2010-08-101-0/+19
| | | | | | | | | | | | | | The PLL that drives the USB clock supports 3 input clocks: 12, 24 and 48Mhz. This patch adds support to the USB driver for setting the correct register bit according to the given clock. This depends on the following patch: [PATCH] ARM: S3C64XX: Add USB external clock definition Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Fix OUT packet request retryBen Dooks2010-08-101-7/+11
| | | | | | | | | | | | | | | If there is more data in the request than we could fit into a single hardware request, then check when the OutDone event is received if we have more data, and if so, schedule the new data instead of trying to complete the request (and in the case of EP0, sending a 0 packet in the middle of a transfer). Also, move the debug message about the current transfer state before the warning about a bad transfer. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Fix the OUT EP0 limitBen Dooks2010-08-101-2/+1
| | | | | | | | The EP0 out limit is the same as the IN limit, so make them the same. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Fix max EP0 IN request lengthBen Dooks2010-08-101-2/+1
| | | | | | | | | The maximum length for any EP0 IN request on EP0 is 127 bytes, not 128 as the driver currently has it. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Check for new request before enqueing new setupBen Dooks2010-08-101-1/+1
| | | | | | | | | | | | | | Before trying a new setup transaction after getting an EP0 in complete interrupt, check that the driver did not try and send more EP0 IN data before enqueing a new setup transaction. This fixes a bug where we cannot send all of the IN data in one go so split the transfer, but then fail to send all the data as we start waiting for a new OUT transaction Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Only load packet per fifo writeBen Dooks2010-08-101-0/+11
| | | | | | | | | | Limit the IN FIFO write to a single packet per attempt at writing, as per the specifications and ensure that we don't return fifo-full so that we can continue writing packets if we have the space. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Add initial detection and setup for dedicated FIFO modeBen Dooks2010-08-101-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the dedicated FIFO mode on newer SoCs such as the S5PV210 partly to improve support and to fix the bug where any non-EP0 IN endpoint requires its own FIFO allocation. To fix this, we ensure that any non-zero IN endpoint is given a TXFIFO using the same allocation method as the periodic case (all our current hardware has enough FIFOs and FIFO memory for a 1:1 mapping) and ensure that the necessary transmission done interrupt is enabled. The default settings from reset for the core point all EPs at FIFO0, used for the control endpoint. However, the controller documentation states that all IN endpoints _must_ have a unique FIFO to avoid any contention during transmission. Note, this leaves us with a large IN FIFO for EP0 (which re-uses the old NPTXFIFO) for an endpoint which cannot shift more than a pair of packets at a time... this is a waste, but it looks like we cannot re-allocate space to the individual IN FIFOs as they are already maxed out (to be confirmed). Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Re-initialise all FIFOs on USB bus resetBen Dooks2010-08-101-9/+4
| | | | | | | | | | | The USB documentation suggest that the FIFOs should be reset when a bus reset event happens. Use the s3c_hsotg_init_fifo() to ensure that the FIFO layout is correct and that the FIFOs are flushed before acknowledging the reset. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Avoid overwriting contents of perodic in 'fifo'Ben Dooks2010-08-101-1/+11
| | | | | | | | | | | | | | In shared fifo mode (used on older SoCs) the periodic in fifo beahves much more like a packet buffer, discarding old data when writing new data. Avoid this by ensuring that we do not load new transactions in when there is data sitting already in the FIFO. Note, this may not be an observed bug, we are fixing the case that this may happen. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: The NPTX/PTX FIFO sizes are in words, not bytesBen Dooks2010-08-101-1/+2
| | | | | | | | | | | | | | | Fix a problem where we have been underestimating the space available in the IN PTX/NPTX FIFOs by assuming that they where simply word aligned instead of in number-of-words. This means all length calculations need to be multiplied-by-4. Note, we do not change the information about fifo size or start addresses available to userspace as we assume the user can multiply by four easily and is already knows these values are in words. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Increase TX fifo limitBen Dooks2010-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | Up the FIFO size for the TX to 1024 entries, as this now seems to work with all the cores. This fixes a problem when using large packets on a core with MPS set to 512 can hang due to insufficient space for the writes. The hang arises due to getting the non-periodic FIFO empty IRQ but not being able to satisfy any requests since there is never enough space to write 512 bytes into the buffer. This means we end up with a stream of interrupt requests. It is easier to up the TX FIFO to fill the space we left for it than to try and fix the positions in the code where we should have limited the max-packet size to < TXFIFOSIZE, since the TXFIFOSIZE depends on how the TX FIFOs have been setup. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Ensure FIFOs are fully flushed after layoutBen Dooks2010-06-041-0/+26
| | | | | | | | | According to the design guide, if the FIFO layout is changed, then the FIFOs must be flushed to ensure all FIFO pointers are correct. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: SoftDisconnect minimum 3msBen Dooks2010-06-041-0/+3
| | | | | | | | | | The shortest period SoftDisconnect can be asserted for is 3 milliseconds according to the V210 datasheet, so ensure that we add an msleep() to the registration code to enforce this. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c-hsotg: Ensure TX FIFO addresses setup when initialising FIFOsBen Dooks2010-06-041-0/+25
| | | | | | | | | | | | | Some versions of the S3C HS OtG block startup with overlapping TX FIFO information, so change the fifo_init code to ensure that known values are set into the FIFO registers at initialisation/reset time. This also ensures that the FIFO RAM pointers are in a known state before use. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: s3c: Enable soft disconnect during initializationThomas Abraham2010-06-041-0/+3
| | | | | | | | | | | | | Enable soft disconnect bit the OTG core during initialization. Without this, the host sees that a gadget is connected and tries to enumerate. The soft disconnect should be enabled until the USB gadget driver is registered with this otg driver. Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: s3c-hsotg: Add missing unlockJulia Lawall2010-04-301-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | In an error handling case the lock is not unlocked. The return is converted to a goto, to share the unlock at the end of the function. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r exists@ expression E1; identifier f; @@ f (...) { <+... * spin_lock_irqsave (E1,...); ... when != E1 * return ...; ...+> } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
* Merge branch 'origin' into devel-stableRussell King2010-03-081-5/+6
|\ | | | | | | | | | | | | Conflicts: arch/arm/mach-mx2/devices.c arch/arm/mach-mx2/devices.h sound/soc/pxa/pxa-ssp.c
| * USB: s3c-hsotg: replace deprecated dma_sync_single()FUJITA Tomonori2010-03-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces deprecated dma_sync_single() with dma_sync_single_for_cpu(). There is no functional change because dma_sync_single() simply calls dma_sync_single_for_cpu(): static inline void __deprecated dma_sync_single(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) { dma_sync_single_for_cpu(dev, addr, size, dir); } This fixes the following compile warnings: drivers/usb/gadget/s3c-hsotg.c: In function 's3c_hsotg_unmap_dma': drivers/usb/gadget/s3c-hsotg.c:376: warning: 'dma_sync_single' is deprecated (declared at /home/fujita/git/linux-2.6/include/linux/dma-mapping.h:109) drivers/usb/gadget/s3c-hsotg.c: In function 's3c_hsotg_map_dma': drivers/usb/gadget/s3c-hsotg.c:758: warning: 'dma_sync_single' is deprecated (declared at /home/fujita/git/linux-2.6/include/linux/dma-mapping.h:109) Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Ben Dooks <ben@simtec.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * USB: s3c-hsotg: Staticise non-exported functionsMark Brown2010-03-021-3/+4
| | | | | | | | | | | | | | | | Keeps sparse happy if nothing else. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | Merge branch 'for-rmk/samsung6' of git://git.fluff.org/bjdooks/linux into ↵Russell King2010-03-081-1/+1
|\ \ | |/ |/| | | devel-stable
| * USB: Fix s3c-hsotg build following Samsung platform header movesMark Brown2010-03-071-1/+1
| | | | | | | | | | | | | | | | | | Fix a reference to regs-sys.h got missed in the reorganisation of the Samsung platform headers targetted for 2.6.34. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
* | USB: s3c-hsotg: Export usb_gadget_register_driver()Mark Brown2010-02-161-0/+1
|/ | | | | | | | | | USB gadget controller drivers normally export their driver registration function, allowing modular builds of the individual gadget drivers so do so for s3c-hsotg, fixing builds. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: s3c-hsotg: missing parenthesesRoel Kluin2009-09-231-3/+3
| | | | | | | | | | | Add missing parentheses Signed-off-by: Roel Kluin <roel.kluin@gmail.com> CC: Ben Dooks <ben@simtec.co.uk> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Gadget driver for Samsung HS/OtG blockBen Dooks2009-06-151-0/+3269
Driver support for the new high-speed/OtG block that is in the newer line of Samsung SoC devices such as the S3C64XX series. This driver does not currntly have DMA support enabled due to issues with buffer alignment which need to be sorted out. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>