Commit Graph

192 Commits (5c52cbeb7f27e1242e88f99f7f6486a16d5733c7)

Author SHA1 Message Date
Linus Torvalds ebdea46fec Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (130 commits)
  [ARM] 3856/1: Add clocksource for Intel IXP4xx platforms
  [ARM] 3855/1: Add generic time support
  [ARM] 3873/1: S3C24XX: Add irq_chip names
  [ARM] 3872/1: S3C24XX: Apply consistant tabbing to irq_chips
  [ARM] 3871/1: S3C24XX: Fix ordering of EINT4..23
  [ARM] nommu: confirms the CR_V bit in nommu mode
  [ARM] nommu: abort handler fixup for !CPU_CP15_MMU cores.
  [ARM] 3870/1: AT91: Start removing static memory mappings
  [ARM] 3869/1: AT91: NAND support for DK and KB9202 boards
  [ARM] 3868/1: AT91 hardware header update
  [ARM] 3867/1: AT91 GPIO update
  [ARM] 3866/1: AT91 clock update
  [ARM] 3865/1: AT91RM9200 header updates
  [ARM] 3862/2: S3C2410 - add basic power management support for AML M5900 series
  [ARM] kthread: switch arch/arm/kernel/apm.c
  [ARM] Off-by-one in arch/arm/common/icst*
  [ARM] 3864/1: Refactore sharpsl_pm
  [ARM] 3863/1: Add Locomo SPI Device
  [ARM] 3847/2:  Convert LOMOMO to use struct device for GPIOs
  [ARM] Use CPU_CACHE_* where possible in asm/cacheflush.h
  ...
2006-09-28 14:40:39 -07:00
Andrew Victor 72729910c3 [ARM] 3865/1: AT91RM9200 header updates
This is more preparation for adding support for the new Atmel AT91SAM9
processors.

Changes include:
- Replace AT91_BASE_* with AT91RM9200_BASE_*
- Replace AT91_ID_* with AT91RM9200_ID_*
- ROM, SRAM and UHP address definitions moved to at91rm9200.h.
- The raw AT91_P[ABCD]_* definitions are now depreciated in favour of
the GPIO API.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-09-28 11:52:05 +01:00
David Brownell 901b3d75e7 USB: net2280: update dma buffer allocation
This updates the code handling dma-coherent buffer allocations, basically
reusing code from the musb_hdrc driver.  Instead of trying to work around two
significant limitations of the dma framework (memory wastage for buffers
smaller than a page, and inconsistency between calling context requirements
for allocation and free) this just works around one of them (the latter).

So count this as two steps forward (bugfixes:  the latter issue could cause
errors on some platforms, and some MIPS changes broke code for the former), 
and one step back (increasing cross-platform memory wastage).

Plus linelength and whitespace fixes; and minor data segment shrinkage.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:57 -07:00
Eugeny S. Mints 80f8af0c59 USB: usb serial gadget smp related bug
Adjust dev->dev_lock spinlock lock/unlock calls to be safe for SMP case.
Otherwise the following sequence may lead to a deadlock in SMP case:

gs_send()->usb_ep_queue()
	->(in case a request is satisfied immediatly) gs_write_complete()

for ex for pxa2xx_udc.c: 
usb_ep_queue()->pxa2xx_ep_queue()->write_fifo()->done()->gs_write_complete() 
(through req.complete pointer)

Signed-off-by: Eugeny S. Mints <emints@ru.mvista.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:56 -07:00
Skip Hansen 997694defd gadgetfs patch for ep0out
For ep0out transfers (rare), be sure to copy the right data to userspace.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:56 -07:00
David Brownell 729ed6d502 USB: ethernet gadget avoids zlps for musb_hdrc
For systems using the Mentor HDRC controllers we get better TX DMA throughput
if we can avoid falling back to PIO to write zero length packets ... so tell
the driver to avoid ZLPs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:56 -07:00
Alan Stern 1720058343 usbcore: trim down usb_bus structure
As part of the ongoing program to flatten out the HCD bus-glue layer,
this patch (as771b) eliminates the hcpriv, release, and kref fields
from struct usb_bus.  hcpriv and release were not being used for
anything worthwhile, and kref has been moved into the enclosing
usb_hcd structure.

Along with those changes, the patch gets rid of usb_bus_get and
usb_bus_put, replacing them with usb_get_hcd and usb_put_hcd.

The one interesting aspect is that the dev_set_drvdata call was
removed from usb_put_hcd, where it clearly doesn't belong.  This means
the driver private data won't get reset to NULL.  It shouldn't cause
any problems, since the private data is undefined when no driver is
bound.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:56 -07:00
Jules Villard e113f29c90 USB: fix typo in drivers/usb/gadget/Kconfig
This tiny patch fixes a typo in drivers/usb/gadget/Kconfig. The typo
is present in 2.6.18-rc4 and in the corresponding -mm tree (and AFAIK,
FYI and FWIW was present in previous kernel versions as well).

From: Jules Villard <jvillard@ens-lyon.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:55 -07:00
Eric Sesterhenn 55359021b9 USB: fix signedness issue in drivers/usb/gadget/ether.c
another gcc 4.1 signdness warning:

drivers/usb/gadget/ether.c:2028: warning: comparison of unsigned expression < 0 is always false

length is assigned the value of usb_ep_queue() which returns an int.
Directly after this it is checked for < 0, which can never be true.  Making
length an int makes the error check work again.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:55 -07:00
Milan Svoboda a94da8971e USB gadget: gadgetfs dont try to lock before free
I spotted this during my tests with -rt on arm. The -rt patch contains
some better tools
to diagnose problems with locks and some other things...

Original code tries to take semaphore in BUG_ON and then free the memory
with this semaphore.


Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:54 -07:00
Milan Svoboda e22fc27c87 USB: add poll to gadgetfs's endpoint zero
Add poll() support to gadgetfs ep0

Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:54 -07:00
Luiz Fernando N. Capitulino 066202dd48 USB: Make file operations structs in drivers/usb const.
Making structs const prevents accidental bugs and with the proper debug
options they're protected against corruption.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:52 -07:00
Ben Williamson f2ebf92c9e USB: gmidi: New USB MIDI Gadget class driver.
This driver is glue between the USB gadget interface
and the ALSA MIDI interface. It allows us to appear
as a MIDI Streaming device to a host system on the
other end of a USB cable.

This includes linux/usb/audio.h and linux/usb/midi.h
containing definitions from the relevant USB specifications
for USB audio and USB MIDI devices.

The following changes have been made since the first RFC
posting:

* Bug fixes to endpoint handling.
* Workaround for USB_REQ_SET_CONFIGURATION handling,
  not understood yet.
* Added SND and SND_RAWMIDI dependencies in Kconfig.
* Moved usb_audio.h and usb_midi.h to usb/*.h
* Added module parameters for ALSA card index and id.
* Added module parameters for USB descriptor IDs and strings.
* Removed some unneeded stuff inherited from zero.c, more to go.
* Provide DECLARE_* macros for the variable-length structs.
* Use kmalloc instead of usb_ep_alloc_buffer.
* Limit source to 80 columns.
* Return actual error code instead of -ENOMEM in a few places.

Signed-off-by: Ben Williamson <ben.williamson@greyinnovation.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:52 -07:00
Milan Svoboda ba307f5828 USB: gadgetfs: protect ep_release with lock
This patch adds mutex protection to ep_release.

Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:52 -07:00
Milan Svoboda 8a7471aba1 USB: fix ep_config to return correct value
This patch fixes ep_config to return correct value. Without patch
ep_config returns submitted lenght minus 4 on succes. With this
patch applied, whole submitted lenght is returned.

ep_config parses submitted data and if buffer starts with (int) 1
it is parsed, otherwise error is reported. Problem is that ep_config
returns size of buffer minus 4 on success. I think that size of buffer
should be returned instead, because there were no problems and
all data were processed.

Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:52 -07:00
Milan Svoboda 07cb7f23d0 USB: correct locking in gadgetfs_disconnect
This patch moves spin_lock (&dev->lock) before first use of dev.
I think that test to the state of device should be protected with
this spin_lock...

Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:52 -07:00
Tony Lindgren bfb2c965d6 USB: Allow compile in g_ether, fix typo
Allows compiling g_ether in and fixes a typo with MUSB_HDRC

Signed-off-by: Tony Lindgren <tony@atomide.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:48 -07:00
David Brownell b2bbb20b37 USB: pxa2xx_udc understands GPIO based VBUS sensing
This updates the PXA 25x UDC board-independent infrastructure for VBUS sensing
and the D+ pullup.  The original code evolved from rather bizarre support on
Intel's "Lubbock" reference hardware, so that on more sensible hardware it
doesn't work as well as it could/should.

The change is just to teach the UDC driver how to use built-in PXA GPIO pins
directly.  This reduces the amount of board-specfic object code needed, and
enables the use of a VBUS sensing IRQ on boards (like Gumstix) that have one.
With VBUS sensing, the UDC is unclocked until a host is actually connected.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:48 -07:00
David Brownell 3a16f7b4a7 USB: move <linux/usb_otg.h> to <linux/usb/otg.h>
Move <linux/usb_otg.h> to <linux/usb/otg.h>.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:48 -07:00
Theodore Ts'o ba52de123d [PATCH] inode-diet: Eliminate i_blksize from the inode structure
This eliminates the i_blksize field from struct inode.  Filesystems that want
to provide a per-inode st_blksize can do so by providing their own getattr
routine instead of using the generic_fillattr() function.

Note that some filesystems were providing pretty much random (and incorrect)
values for i_blksize.

[bunk@stusta.de: cleanup]
[akpm@osdl.org: generic_fillattr() fix]
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 08:26:18 -07:00
Theodore Ts'o 8e18e2941c [PATCH] inode_diet: Replace inode.u.generic_ip with inode.i_private
The following patches reduce the size of the VFS inode structure by 28 bytes
on a UP x86.  (It would be more on an x86_64 system).  This is a 10% reduction
in the inode size on a UP kernel that is configured in a production mode
(i.e., with no spinlock or other debugging functions enabled; if you want to
save memory taken up by in-core inodes, the first thing you should do is
disable the debugging options; they are responsible for a huge amount of bloat
in the VFS inode structure).

This patch:

The filesystem or device-specific pointer in the inode is inside a union,
which is pretty pointless given that all 30+ users of this field have been
using the void pointer.  Get rid of the union and rename it to i_private, with
a comment to explain who is allowed to use the void pointer.  This is just a
cleanup, but it allows us to reuse the union 'u' for something something where
the union will actually be used.

[judith@osdl.org: powerpc build fix]
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Judith Lebzelter <judith@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 08:26:17 -07:00
David Brownell 789851cf00 usb gadget: g_ether spinlock recursion fix
The new spinlock debug code turned up a spinlock recursion bug in the
Ethernet gadget driver on a disconnect path; it would show up with any
UDC driver where the cancellation of active requests was synchronous,
rather than e.g. delayed until a controller's completion IRQ.

That recursion is fixed here by creating and using a new spinlock to
protect the relevant lists.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-08-31 18:04:30 -07:00
Alan Stern b4dbda1a22 USB: dummy-hcd: disable interrupts during req->complete
This patch (as756) fixes a bug in dummy-hcd found by the lockdep
checker.  In one of the code paths, the driver did not disable
interrupts before calling a request completion routine.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-08-02 16:41:42 -07:00
Adrian Bunk be0c8015a2 USB: fix the USB_GADGET_DUMMY_HCD dependencies
If USB=m, USB_GADGET=y, the option USB_GADGET_DUMMY_HCD mustn't be 
offered since selecting it results in a compile error.

This patch fixes kernel Bugzilla #6534 reported by Toralf Förster.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-08-02 16:41:42 -07:00
David Brownell 8b2e76687b USB: AT91 UDC updates, mostly power management
UDC updates for AT91 series processors:

 - Get ready for at91sam926x processors (ARMv5tej not ARMv4t)

 - Suspend/resume support now behaves properly

 - In "standby" mode, UDC can be a source of system wakeup events
   (host resume, device connect/disconnect, etc)

 - Fix IRQ storming issues, seemingly related to clock disabling
   changes that went in a while back

And minor cleanups, especially whitespace.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Victor  <andrew@sanpeople.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-08-02 16:41:41 -07:00
David Brownell a353678d31 [PATCH] USB: gadget section fixups
Recent section changes broke gadget builds on some platforms.  This patch
is the best fix that's available until better section markings exist:

 - There's a lot of cleanup code that gets used in both init and exit paths;
   stop marking it as "__exit".

   (Best fix for this would be an "__init_or_exit" section marking, putting
   the cleanup in __init when __exit sections get discarded else in __exit.)

 - Stop marking the use-once probe routines as "__init" since references
   to those routines are not allowed from driver structures.  They're now
   marked "__devinit", which in practice is a net lose.

   (Best fix for this is likely to separate such use-once probe routines
   from the driver structure ... but in general, all busses that aren't
   hotpluggable will be forced to waste memory for all probe-only code.)

In general these broken section rules waste an average of two to four kBytes
per driver of code bloat ... because none of the relevant code can ever be
reused after module initialization.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-07-12 16:03:24 -07:00
Russell King 0f1482fdd7 [ARM] Fix lh7a40x_udc.c
In 3ae5eaec1d, I broke this driver
by missing a comma.  Replace the missing comma.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-07-03 15:32:47 +01:00
Linus Torvalds a8c4c20dfa Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (44 commits)
  [ARM] 3541/2: workaround for PXA27x erratum E7
  [ARM] nommu: provide a way for correct control register value selection
  [ARM] 3705/1: add supersection support to ioremap()
  [ARM] 3707/1: iwmmxt: use the generic thread notifier infrastructure
  [ARM] 3706/2: ep93xx: add cirrus logic edb9315a support
  [ARM] 3704/1: format IOP Kconfig with tabs, create more consistency
  [ARM] 3703/1: Add help description for ARCH_EP80219
  [ARM] 3678/1: MMC: Make OMAP MMC work
  [ARM] 3677/1: OMAP: Update H2 defconfig
  [ARM] 3676/1: ARM: OMAP: Fix dmtimers and timer32k to compile on OMAP1
  [ARM] Add section support to ioremap
  [ARM] Fix sa11x0 SDRAM selection
  [ARM] Set bit 4 on section mappings correctly depending on CPU
  [ARM] 3666/1: TRIZEPS4 [1/5] core
  ARM: OMAP: Multiplexing for 24xx GPMC wait pin monitoring
  ARM: OMAP: Fix SRAM to use MT_MEMORY instead of MT_DEVICE
  ARM: OMAP: Update dmtimers
  ARM: OMAP: Make clock variables static
  ARM: OMAP: Fix GPMC compilation when DEBUG is defined
  ARM: OMAP: Mux updates for external DMA and GPIO
  ...
2006-07-02 15:04:12 -07:00
Thomas Gleixner d54b5caa83 [PATCH] irq-flags: usb: Use the new IRQF_ constants
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-02 13:58:53 -07:00
Jörn Engel 6ab3d5624e Remove obsolete #include <linux/config.h>
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-06-30 19:25:36 +02:00
Milan Svoboda bf7e851108 [PATCH] usb gadget: fixup pxa2xx_udc to include asm/arch/udc.h again
This fixes pxa2xx_udc.c to include asm/arch/udc.h again to fix current
build breakage.

Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com>
[ forwarded by David Brownell <david-b@pacbell.net> ]
[ fixed to apply properly by Linus ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-29 14:27:22 -07:00
Tony Lindgren 7ff879dbcd ARM: OMAP: Fix DMA channel irq handling for omap24xx
- DMA CSR register is cleared by reading on omap1, but on
  omap2 it is cleard by writing to it.

- DMA TOUT interrupt does not exist on omap24xx, rename it

- Add SECURE and MISALIGNED errors by default for omap24xx

- Add defines for external DMA request lines

Signed-off-by: Tony Lindgren <tony@atomide.com>
2006-06-26 16:16:15 -07:00
Greg Kroah-Hartman 331b831983 [PATCH] devfs: Rename TTY_DRIVER_NO_DEVFS to TTY_DRIVER_DYNAMIC_DEV
I've always found this flag confusing.  Now that devfs is no longer around, it
has been renamed, and the documentation for when this flag should be used has
been updated.

Also fixes all drivers that use this flag.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-26 12:25:09 -07:00
Greg Kroah-Hartman f4eaa37017 [PATCH] devfs: Remove the tty_driver devfs_name field as it's no longer needed
Also fixes all drivers that set this field.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-26 12:25:09 -07:00
Jens Axboe b31dc66a54 [PATCH] Kill PF_SYNCWRITE flag
A process flag to indicate whether we are doing sync io is incredibly
ugly. It also causes performance problems when one does a lot of async
io and then proceeds to sync it. Part of the io will go out as async,
and the other part as sync. This causes a disconnect between the
previously submitted io and the synced io. For io schedulers such as CFQ,
this will cause us lost merges and suboptimal behaviour in scheduling.

Remove PF_SYNCWRITE completely from the fsync/msync paths, and let
the O_DIRECT path just directly indicate that the writes are sync
by using WRITE_SYNC instead.

Signed-off-by: Jens Axboe <axboe@suse.de>
2006-06-23 17:10:39 +02:00
David Howells 454e2398be [PATCH] VFS: Permit filesystem to override root dentry on mount
Extend the get_sb() filesystem operation to take an extra argument that
permits the VFS to pass in the target vfsmount that defines the mountpoint.

The filesystem is then required to manually set the superblock and root dentry
pointers.  For most filesystems, this should be done with simple_set_mnt()
which will set the superblock pointer and then set the root dentry to the
superblock's s_root (as per the old default behaviour).

The get_sb() op now returns an integer as there's now no need to return the
superblock pointer.

This patch permits a superblock to be implicitly shared amongst several mount
points, such as can be done with NFS to avoid potential inode aliasing.  In
such a case, simple_set_mnt() would not be called, and instead the mnt_root
and mnt_sb would be set directly.

The patch also makes the following changes:

 (*) the get_sb_*() convenience functions in the core kernel now take a vfsmount
     pointer argument and return an integer, so most filesystems have to change
     very little.

 (*) If one of the convenience function is not used, then get_sb() should
     normally call simple_set_mnt() to instantiate the vfsmount. This will
     always return 0, and so can be tail-called from get_sb().

 (*) generic_shutdown_super() now calls shrink_dcache_sb() to clean up the
     dcache upon superblock destruction rather than shrink_dcache_anon().

     This is required because the superblock may now have multiple trees that
     aren't actually bound to s_root, but that still need to be cleaned up. The
     currently called functions assume that the whole tree is rooted at s_root,
     and that anonymous dentries are not the roots of trees which results in
     dentries being left unculled.

     However, with the way NFS superblock sharing are currently set to be
     implemented, these assumptions are violated: the root of the filesystem is
     simply a dummy dentry and inode (the real inode for '/' may well be
     inaccessible), and all the vfsmounts are rooted on anonymous[*] dentries
     with child trees.

     [*] Anonymous until discovered from another tree.

 (*) The documentation has been adjusted, including the additional bit of
     changing ext2_* into foo_* in the documentation.

[akpm@osdl.org: convert ipath_fs, do other stuff]
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Nathan Scott <nathans@sgi.com>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-23 07:42:45 -07:00
David Brownell a8c28f2389 [PATCH] USB: move <linux/usb_cdc.h> to <linux/usb/cdc.h>
This moves <linux/usb_cdc.h> to <linux/usb/cdc.h> to reduce some of the
clutter of usb header files.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-21 15:04:18 -07:00
David Brownell 7e27f18c8a [PATCH] USB: whitespace removal from usb/gadget/ether
This removes extraneous whitespace from the Ethernet/RNDIS gadget driver.
It's all space-at-EOL, spaces-before-tabs, or tabs-then-spaces.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-21 15:04:18 -07:00
Milan Svoboda 043ea18b2e [PATCH] usb gadget: update pxa2xx_udc.c driver to fully support IXP4xx platform
This patch adds IXP465 into the list of known devices and
adds IXP425 and IXP465 to the list of devices that have cfr. This
is not described in the hardware documentation, but without
it driver won't work.

Workaround (#if 1) that seemed to get rid of lost
status irqs is disabled for IXP4XX as it caused freezes
during testing of control messages. No lost irqs are
visible on IXP4XX.

Driver survived tests running over night without any
visible problems.

Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-21 15:04:18 -07:00
Milan Svoboda 44df45a09c [PATCH] usb gadget: fix compile errors
This patch fixes compile errors when pxa2xx_udc is to be compiled
for ixp4xx platform.

Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-21 15:04:18 -07:00
Milan Svoboda 7c0642c196 [PATCH] usb gadget: allow drivers support speeds higher than full speed
This patch removes limitation which prevents use of drivers that support
speeds different that full speed.

Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-21 15:04:17 -07:00
Franck Bui-Huu ca094f1186 [PATCH] USB: gadget-serial: do not save/restore IRQ flags in gs_close()
As pointed out by David Brownell, we know that IRQs are never
blocked when calling gs_close function. So the save/restore
IRQ flags are pointless.

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-21 15:04:17 -07:00
Franck Bui-Huu 943e1b4d60 [PATCH] USB: gadget-serial: fix a deadlock when closing the serial device
When closing the device, the driver acquires/release twice the
port lock before/after waiting for the data to be completely
sent. Therefore it will dead lock.

This patch fixes it and also uses the generic scheduler services
for waiting for an event.

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-21 15:04:17 -07:00
Matt Reimer 4186c29ca1 [PATCH] USB: trivial DEBUG message correction in gadget ether driver
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-21 15:04:17 -07:00
Alan Stern 0ae4ea8092 [PATCH] gadgetfs: fix memory leaks
This patch (as692) fixes a few memory leaks in some unimportant error
pathways of the gadgetfs driver.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-21 15:04:13 -07:00
Alan Stern 83196b5205 [PATCH] gadgetfs: fix AIO interface bugs
This patch (as691) fixes a few errors in the AIO interface for the
gadgetfs driver.  Now requests will complete properly instead of hanging.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-21 15:04:12 -07:00
Alan Stern 2d61bde7a0 [PATCH] USB: net2280: add a shutdown routine
The net2280 board has an annoying habit of surviving soft reboots with
interrupts enabled.  This patch (as674) adds a shutdown routine to the
driver so that the board can be put in a quiescent state.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-21 15:04:10 -07:00
David S. Miller c6387a48cf [SPARC]: Kill __irq_itoa().
This ugly hack was long overdue to die.

It was a way to print out Sparc interrupts in a more freindly format,
since IRQ numbers were arbitrary opaque 32-bit integers which vectored
into PIL levels.  These 32-bit integers were not necessarily in the
0-->NR_IRQS range, but the PILs they vectored to were.

The idea now is that we will increase NR_IRQS a little bit and use a
virtual<-->real IRQ number mapping scheme similar to PowerPC.

That makes this IRQ printing hack irrelevant, and furthermore only a
handful of drivers actually used __irq_itoa() making it even less
useful.

Signed-off-by: David S. Miller <davem@davemloft.net>
2006-06-20 01:21:29 -07:00
Alan Stern 9fb81ce636 [PATCH] USB: net2280: set driver data before it is used
This patch (as671) fixes a bug in the error pathway for the net2280
probe routine.  A failure during probe will cause the driver to call
pci_get_drvdata before the corresponding pci_set_drvdata has been set.
The patch also does a kzalloc conversion.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-27 10:28:58 -07:00
Alan Stern 658ad5e001 [PATCH] USB: net2280: check for shared IRQs
This patch (as670) adds a check for whether a shared IRQ was actually
generated by the net2280 device.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-27 10:28:58 -07:00
Alan Stern 317e83b842 [PATCH] USB: net2280: send 0-length packets for ep0
This patch (as669) fixes a bug in the net2280 driver.  Now it will
properly send zero-length packets on ep0 until the control status stage
occurs.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-27 10:28:58 -07:00
Alan Stern a29fccd799 [PATCH] USB: net2280: Handle STALLs for 0-length control-IN requests
This patch (as668) fixes a typo in net2280.  The handler for 0-length
control-IN requests should check that the endpoint _isn't_ halted before
sending a 0-length packet.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-27 10:28:58 -07:00
Al Viro c82ffb07cd [PATCH] fix leak in activate_ep_files()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-04-26 07:52:21 -07:00
Pete Zaitcev 9fc4831cc3 [PATCH] USB: linux/usb/net2280.h common definitions
Move common definitions for NET2280 to <linux/usb/net2280.h>, so that I can
use them in prism54usb (it is not merged yet, but I plan to do it soon).

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:12:25 -07:00
David Brownell e1394b49ee [PATCH] USB: g_ether, highspeed conformance fix
Be sure to record the peripheral's ep0 maxpacket size BEFORE using
that to initialize the (high speed) device qualifier; that helps a
lot with USBCV testing.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:12:25 -07:00
David Brownell 68ba61b89c [PATCH] USB: at91 usb driver supend/resume fixes
AT91: the two USB drivers (OHCI, UDC) got out of sync with various
usbcore and driver model PM updates; fix.

Also minor fixes to ohci:  whitespace/style, MODULE_ALIAS so coldplug works
using /sys/.../modalias, and turn off _both_ clocks during suspend.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:12:25 -07:00
David Brownell 35fcca442a [PATCH] USB: gadget zero poisons OUT buffers
Fill OUT buffers with 0x55 before RX, so that controller driver
bugs that mangle data can be more readily detected during testing.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:12:24 -07:00
David Brownell 984163338a [PATCH] USB: gadgetfs highspeed bugfix
This catches up to a change in the Kconfig support for highspeed modes;
the change predated 2.6.10, and anyone using gadgetfs on a highspeed
device would see the kernel wrongly reject the alternate descriptors.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:12:24 -07:00
David Brownell 68dcc688d1 [PATCH] USB: net2280 short rx status fix
Some patch broke short-OUT packet handling for net2280, making it report
illegal status values.  This updates the status code so it's correct.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:12:24 -07:00
David Brownell 42795410c3 [PATCH] USB: fix gadget_is_musbhdrc()
I submitted the wrong version of the patch teaching about the driver
for Mentor's Highspeed Dual Role Controller (HDRC), whoops!  This
uses the right name for that driver.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:12:24 -07:00
Alan Stern aafe5bd6ec [PATCH] USB: g_file_storage: use module_param_array_named macro
Randy Dunlap pointed out that there now is a module_param_array_named
macro available.  This patch (as666) updates g_file_storage to make use of
it.  It also adds a comment listing the specifications documents used in
the design of the driver's SCSI operation (at Pat LaVarre's request).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:12:21 -07:00
Alan Stern 14cd5f8e85 [PATCH] USB: g_file_storage: add comment about buffer allocation
This patch (as664) adds a comment to file_storage.c, noting that the
driver is slightly non-portable because it assumes that a buffer
allocated for a bulk-in endpoint will also be useable for a bulk-out
endpoint.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:12:20 -07:00
Alan Stern 70ffe6e14d [PATCH] USB: g_file_storage: Set short_not_ok for bulk-out transfers
I'm told that some UDC hardware may work better if it knows that
receiving a short packet should always cause an error.  Accordingly,
this patch (as663) sets the short_not_ok flag for bulk-out transfers in
g_file_storage.  Oddly enough, there are no circumstances where that
driver can legally receive a shorter-than-expected bulk-out packet.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-04-14 11:12:20 -07:00
Guennadi Liakhovetski 950ee4c8f0 [PATCH] USB: net2282 and net2280 software compatibility
Below is a patch to gadgets/net2280.[ch] which adds support for the
net2282 controller. The original code was kindly provided by PLX
Technology, I just merged it with the current net2280 driver in the
kernel. Tested on 2.6.15.6, but only with 2282. I did the merge, so
that the behaviour for the 2280 is unaffected (except for short delays
for extra checks).

Signed-off-by: G. Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Support for net2282 in net2280 driver.
2006-04-14 11:12:19 -07:00
Arjan van de Ven 99ac48f54a [PATCH] mark f_ops const in the inode
Mark the f_ops members of inodes as const, as well as fix the
ripple-through this causes by places that copy this f_ops and then "do
stuff" with it.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-28 09:16:05 -08:00
Eric Sesterhenn 7039f4224d [PATCH] USB: kzalloc() conversion in drivers/usb/gadget
this patch converts drivers/usb to kzalloc usage.
Compile tested with allyes config.

I think there was a bug in drivers/usb/gadget/inode.c because
it used sizeof(*data) for the kmalloc() and sizeof(data) for
the memset(), since sizeof(data) just returns the size for a pointer.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20 14:49:59 -08:00
Aras Vaichas 1afc64a3d6 [PATCH] USB: ethernet gadget driver section fixups
This patch allows you to set the iSerialNumber field in the
usb_device_descriptor structure for your USB ethernet gadget.

It also changes the parameters shown through sysfs so they're
no longer declared as __initdata, preventing potential oopses.

That's most useful for the Ethernet addresses, which may in
some cases be random "locally administered" addresses.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20 14:49:58 -08:00
David Brownell 329af28b14 [PATCH] USB: gadget driver section fixups
This adds __init section annotations to gadget driver bind() routines to
remove calls from .text into .init sections (for endpoint autoconfig).
Likewise it adds __exit section annotations to their unbind() routines.

The specification of the gadget driver register/unregister functions is
updated to explicitly allow use of those sections.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20 14:49:58 -08:00
Franck Bui-Huu 0eb8c7cafe [PATCH] USB: Zero driver: Removed duplicated code
Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20 14:49:57 -08:00
David Brownell 1c05ad4447 [PATCH] recognize three more usb peripheral controllers
This adds declarations for three USB peripheral controllers:

  - Two high speed USB cores that can be licensed from Mentor Graphics
    to be integrated into silicon:

      * "musbhsfc" is for peripherals only, as found in for example the
        IBM/AMCC 44EP processors.

      * "musbhdrc" is OTG-capable (dual role), and is found in various
        products including OMAP 2430 and the new DaVinci SOCs.

    The "musbh" standing for "Mentor USB Highspeed", the rest standing
    for "Function Controller" or "Dual Role Controller" (OTG-capable).

  - The full speed controller on the FreeScale MPC8272.

Adding these definitions just allows gadget driver code to handle any
controller-specific logic; controller drivers are quite separate.

Signed-off-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20 14:49:56 -08:00
David Brownell 7802ac5c29 [PATCH] USB: minor gadget/rndis tweak
Resove a minor FIXME:  don't change MTU while RNDIS link is active,
the other end won't expect such things...

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20 14:49:56 -08:00
David Brownell bae4bd848d [PATCH] USB: add support for AT91 gadget
This adds support for the USB peripheral controller on AT91
(rm9200, eventually also sam9261 or uClinux) platforms.

More SOC support for Linux-USB ... an uncomplicated pure PIO driver.
It'd be worth using this as a model, if you're starting a driver
for some other peripheral controller.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-03-20 14:49:56 -08:00
Shaun Tancheff 8763716bfe [PATCH] USB: Gadget RNDIS fix alloc bug. (buffer overflow)
Remote NDIS response to OID_GEN_SUPPORTED_LIST only allocated space
for the data attached to the reply, and not the reply structure
itself. This caused other kmalloc'd memory to be corrupted.

Signed-off-by: Shaun Tancheff <shaun@tancheff.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-02-28 12:42:06 -08:00
Franck Bui-Huu d5ec33490c [PATCH] USB: lh7a40x gadget driver: Fixed a dead lock
There is a dead lock in lh7a40x udc driver. When the driver receive a
SET_FEATURE HALT request, the dev lock is taken by the interrupt
handler lh7a40x_udc_irq then the handler will call lh7a40x_set_halt
function which in its turn will try to acquire the dev lock.

Signed-off-by: Franck Bui-Huu <franck.bui-huu@innova-card.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-02-28 12:42:06 -08:00
David Brownell 69396dcfa3 [PATCH] USB: gadget zero and dma-coherent buffers
This makes sure that the correct length is reported when freeing
a dma-coherent buffer; some platforms complain if that's wrong.
It also makes two parameters readonly in sysfs, as they're not
safe to change while tests are running.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-31 17:23:44 -08:00
Alan Stern 9790636927 [PATCH] USB: gadgetfs: set "zero" flag for short control-IN response
This patch (as622) makes gadgetfs set the "zero" flag for control-IN
responses, when the length of the response is shorter than the length of
the request.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-31 17:23:42 -08:00
David Brownell 682d4c803f [PATCH] USB: net2280 warning fix
For some reason alpha doesn't include <linux/dma-mapping.h> where other
architectures do; this makes net2280 include it explicitly.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-31 17:23:42 -08:00
Russell King d78967fb03 [PATCH] Remove usb gadget generic driver methods
USB gadget drivers make no use of these, remove the pointless
comments.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-13 11:26:11 -08:00
Alan Cox 33f0f88f1c [PATCH] TTY layer buffering revamp
The API and code have been through various bits of initial review by
serial driver people but they definitely need to live somewhere for a
while so the unconverted drivers can get knocked into shape, existing
drivers that have been updated can be better tuned and bugs whacked out.

This replaces the tty flip buffers with kmalloc objects in rings. In the
normal situation for an IRQ driven serial port at typical speeds the
behaviour is pretty much the same, two buffers end up allocated and the
kernel cycles between them as before.

When there are delays or at high speed we now behave far better as the
buffer pool can grow a bit rather than lose characters. This also means
that we can operate at higher speeds reliably.

For drivers that receive characters in blocks (DMA based, USB and
especially virtualisation) the layer allows a lot of driver specific
code that works around the tty layer with private secondary queues to be
removed. The IBM folks need this sort of layer, the smart serial port
people do, the virtualisers do (because a virtualised tty typically
operates at infinite speed rather than emulating 9600 baud).

Finally many drivers had invalid and unsafe attempts to avoid buffer
overflows by directly invoking tty methods extracted out of the innards
of work queue structs. These are no longer needed and all go away. That
fixes various random hangs with serial ports on overflow.

The other change in here is to optimise the receive_room path that is
used by some callers. It turns out that only one ldisc uses receive room
except asa constant and it updates it far far less than the value is
read. We thus make it a variable not a function call.

I expect the code to contain bugs due to the size alone but I'll be
watching and squashing them and feeding out new patches as it goes.

Because the buffers now dynamically expand you should only run out of
buffering when the kernel runs out of memory for real.  That means a lot of
the horrible hacks high performance drivers used to do just aren't needed any
more.

Description:

tty_insert_flip_char is an old API and continues to work as before, as does
tty_flip_buffer_push() [this is why many drivers dont need modification].  It
does now also return the number of chars inserted

There are also

tty_buffer_request_room(tty, len)

which asks for a buffer block of the length requested and returns the space
found.  This improves efficiency with hardware that knows how much to
transfer.

and tty_insert_flip_string_flags(tty, str, flags, len)

to insert a string of characters and flags

For a smart interface the usual code is

    len = tty_request_buffer_room(tty, amount_hardware_says);
    tty_insert_flip_string(tty, buffer_from_card, len);

More description!

At the moment tty buffers are attached directly to the tty.  This is causing a
lot of the problems related to tty layer locking, also problems at high speed
and also with bursty data (such as occurs in virtualised environments)

I'm working on ripping out the flip buffers and replacing them with a pool of
dynamically allocated buffers.  This allows both for old style "byte I/O"
devices and also helps virtualisation and smart devices where large blocks of
data suddenely materialise and need storing.

So far so good.  Lots of drivers reference tty->flip.*.  Several of them also
call directly and unsafely into function pointers it provides.  This will all
break.  Most drivers can use tty_insert_flip_char which can be kept as an API
but others need more.

At the moment I've added the following interfaces, if people think more will
be needed now is a good time to say

 int tty_buffer_request_room(tty, size)

Try and ensure at least size bytes are available, returns actual room (may be
zero).  At the moment it just uses the flipbuf space but that will change.
Repeated calls without characters being added are not cumulative.  (ie if you
call it with 1, 1, 1, and then 4 you'll have four characters of space.  The
other functions will also try and grow buffers in future but this will be a
more efficient way when you know block sizes.

 int tty_insert_flip_char(tty, ch, flag)

As before insert a character if there is room.  Now returns 1 for success, 0
for failure.

 int tty_insert_flip_string(tty, str, len)

Insert a block of non error characters.  Returns the number inserted.

 int tty_prepare_flip_string(tty, strptr, len)

Adjust the buffer to allow len characters to be added.  Returns a buffer
pointer in strptr and the length available.  This allows for hardware that
needs to use functions like insl or mencpy_fromio.

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: John Hawkes <hawkes@sgi.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-10 08:01:59 -08:00
Jes Sorensen 1b1dcc1b57 [PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
This patch converts the inode semaphore to a mutex. I have tested it on
XFS and compiled as much as one can consider on an ia64. Anyway your
luck with it might be different.

Modified-by: Ingo Molnar <mingo@elte.hu>

(finished the conversion)

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2006-01-09 15:59:24 -08:00
Tobias Klauser 52950ed40d [PATCH] USB: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove
duplicates of ARRAY_SIZE. Some trailing whitespaces are also removed.

Patch is compile-tested on i386.

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 13:51:43 -08:00
Alan Stern 3cf0a22e8b [PATCH] USB Gadget: dummy_hcd: updates to hcd->state
This patch (as613) moves the updates to hcd->state in the dummy_hcd
driver to where they now belong.  It also uses the new
HC_FLAG_HW_ACCESSIBLE flag in a way that simulates a real PCI
controller, and it adds checks for attempts to resume the bus while the
controller is suspended or to suspend the controller while the bus is
active.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 13:51:40 -08:00
Alan Stern a21d4fed4b [PATCH] USB Gadget: file_storage: remove "volatile" declarations
This patch (as612) removes the "volatile" declarations from the
file-storage gadget.  It turns out that they aren't needed for anything
much; adding a few memory barriers does a sufficient job.

The patch also removes a wait_queue.  Not much point having a queue when
only one task is ever going to be on it!

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 13:51:40 -08:00
Pavel Machek 3aea4a76a3 [PATCH] USB: Cleanups for usb gadget mass-storage
Remove useless initalizers.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
2006-01-04 13:48:35 -08:00
Fengwei Yin 949bf64311 [PATCH] USB: One potential problem in gadget/serial.c
It looks like that the gs_serial module maybe sleep with spinlock in gs_close.
Sometimes, system hang when I remove the gs_serial module.

From: Fengwei Yin <xaityyy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 13:48:34 -08:00
Alan Stern 8364d6b0be [PATCH] USB: dummy_hcd: rename variables
The recent platform_device update has reintroduced into dummy_hcd.c the
dreaded dev->dev syndrome.  This harkens back to when an earlier version
of that driver included the unforgettable line:

	dev->dev.dev.driver_data = dev;

This patch (as602) renames the platform_device variables to "pdev", in
the hope of reducing confusion.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 13:48:31 -08:00
Alan Stern 87c4252a35 [PATCH] USB: file-storage gadget: Add reference count for children
This patch (as601) adds a proper reference count to the file-storage
gadget's main data structure, to keep track of references held by child
devices (LUNs in this case).  Before this, the driver would wait for
each child to be released before unbinding.

While there's nothing really wrong with that (you can't create a hang by
doing "rmmod g_file_storage </sys/.../lun0/ro" since the open file will
prevent rmmod from running), the code might as well follow the standard
procedures.  Besides, this shrinks the size of the structure by a few
words...  :-)

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 13:48:30 -08:00
Greg Kroah-Hartman cca2362c64 [PATCH] USB: fix build breakage in dummy_hcd.c
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-17 11:29:52 -08:00
Linus Torvalds 5643f000c1 Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-11-11 09:24:26 -08:00
Greg Kroah-Hartman 249bb070f5 [PATCH] PCI: removed unneeded .owner field from struct pci_driver
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-11-10 16:09:17 -08:00
Russell King 3ae5eaec1d [DRIVER MODEL] Convert platform drivers to use struct platform_driver
This allows us to eliminate the casts in the drivers, and eventually
remove the use of the device_driver function pointer methods for
platform device drivers.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-11-09 22:32:44 +00:00
Olaf Hering 733482e445 [PATCH] changing CONFIG_LOCALVERSION rebuilds too much, for no good reason
This patch removes almost all inclusions of linux/version.h.  The 3
#defines are unused in most of the touched files.

A few drivers use the simple KERNEL_VERSION(a,b,c) macro, which is
unfortunatly in linux/version.h.

There are also lots of #ifdef for long obsolete kernels, this was not
touched.  In a few places, the linux/version.h include was move to where
the LINUX_VERSION_CODE was used.

quilt vi `find * -type f -name "*.[ch]"|xargs grep -El '(UTS_RELEASE|LINUX_VERSION_CODE|KERNEL_VERSION|linux/version.h)'|grep -Ev '(/(boot|coda|drm)/|~$)'`

search pattern:
/UTS_RELEASE\|LINUX_VERSION_CODE\|KERNEL_VERSION\|linux\/\(utsname\|version\).h

Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:55:57 -08:00
Russell King d052d1beff Create platform_device.h to contain all the platform device details.
Convert everyone who uses platform_bus_type to include
linux/platform_device.h.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-29 19:07:23 +01:00
Ben Dooks d0d5049fb0 [PATCH] USB: gadget drivers - add .owner initialisation
Ensure the the device_driver and usb_gadget_driver
have their .owner fields initialised to associate
the module owner to the driver.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 16:47:45 -07:00
Juha Yrj?l? 4e67185a7a [PATCH] add usb transceiver set_suspend() method
When a USB device is put into suspend mode, the current drawn from VBUS
has to be less than 500 uA. Some transceivers need to be put into a
special power-saving mode to accomplish this, and won't have a separate
OTG driver handling that.

This adds a suspend method to the "otg_transceiver" struct -- misnamed,
it's not only for OTG -- and calls it from the OMAP UDC driver.

Signed-off-by: Juha Yrj?l? <juha.yrjola@nokia.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 16:47:45 -07:00
David Brownell cb97c5c9d0 [PATCH] omap_udc dma off-by-one fix
The change to make DMA work two bytes at a time omitted an important
tweak that affects the file_storage gadget:  it needs to recognize when
the host writes an odd number of bytes.  (The network layer ignores
such extra bytes.)

This patch resolves that issue by checking the relevant bit and adjusting
the rx byte count, so that for example a legal 13 byte request doesn't
morph into an illegal 14 byte one any more.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 16:47:44 -07:00
Alan Stern 0c0382e32d [PATCH] USB: Rename hcd->hub_suspend to hcd->bus_suspend
This patch (as580) is perhaps the only result from the long discussion I
had with David about his changes to the root-hub suspend/resume code.  It
renames the hub_suspend and hub_resume methods in struct usb_hcd to
bus_suspend and bus_resume.  These are more descriptive names, since the
methods really do suspend or resume an entire USB bus, and less likely to
be confused with the hub_suspend and hub_resume routines in hub.c.

It also takes David's advice about removing the layer of bus glue, where
those methods are called.  And it implements a related change that David
made to the other HCDs but forgot to put into dummy_hcd.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 16:47:44 -07:00
Alan Stern a922c68732 [PATCH] g_file_storage: fix obscure race condition
This patch (as575) fixes an unlikely race in the g_file_storage driver.
The problem can occur only when the driver is unbound before its
initialization routine has finished.

I also took the opportunity to replace kmalloc/memset with kzalloc.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 16:47:43 -07:00
Alan Stern 22efcf4ade [PATCH] USB: File-Storage gadget: use the kthread API
This patch (as566) converts the File-Storage gadget over to the kthread
API.  The new code doesn't use kthread_stop because the control thread
needs to terminate asynchronously when it receives a signal.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

 drivers/usb/gadget/file_storage.c |   32 +++++++++++++-------------------
 1 file changed, 13 insertions(+), 19 deletions(-)
2005-10-28 16:47:42 -07:00
Greg KH 6fbfddcb52 Merge ../bleed-2.6 2005-10-28 10:13:16 -07:00