Currently, the freezer treats all tasks as freezable, except for the kernel
threads that explicitly set the PF_NOFREEZE flag for themselves. This
approach is problematic, since it requires every kernel thread to either
set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
care for the freezing of tasks at all.
It seems better to only require the kernel threads that want to or need to
be frozen to use some freezer-related code and to remove any
freezer-related code from the other (nonfreezable) kernel threads, which is
done in this patch.
The patch causes all kernel threads to be nonfreezable by default (ie. to
have PF_NOFREEZE set by default) and introduces the set_freezable()
function that should be called by the freezable kernel threads in order to
unset PF_NOFREEZE. It also makes all of the currently freezable kernel
threads call set_freezable(), so it shouldn't cause any (intentional)
change of behaviour to appear. Additionally, it updates documentation to
describe the freezing of tasks more accurately.
[akpm@linux-foundation.org: build fixes]
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Nigel Cunningham <nigel@nigel.suspend2.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Convert the backlight and LCD classes from struct class_device
to struct device since class_device is scheduled for removal.
One nasty API break is the backlight power attribute has had to be
renamed to bl_power and the LCD power attribute has had to be renamed
to lcd_power since the original names clash with the core. I can't see
a way around this.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
This reverts commit acb11c8b80.
It was broken. We most certainly *do* want the default to be the old
behaviour (and the common case!), instead of breaking everybodys
configuration and making 99% of all people have to override the default.
What were you guys thinking?
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Remove unnecessary cast of return value of kzalloc() in
usb/host/ohci-pnx4008.c
Signed-off-by: Suresh Jayaraman <sjayaraman@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
this adds some scanners reported to be crashed by autosuspend to
the quirk list.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as930) implements autosuspend for usb-storage. It is
adapted from a patch by Oliver Neukum. Autosuspend is allowed except
during LUN scanning, resets, and command execution.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
USB: add new device id to option driver
device is Samsung X180 China cellphone
Signed-off-by: Andrey Arapov <andrey.arapov@gmail.com>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Minor fixes to goku_udc ... whitespace, let -DDEBUG do its thing,
check the return value of device_register(), sparse tweaks.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Although the other USB driver directories got taught how use Kconfig
and the Makefile to enable the debugging messages enabled by -DDEBUG,
the gadget stack was overlooked.
This patch remedies that omission, but doesn't update any drivers to
remove previous idiosyncracies in this area ... other than the RNDIS
code, which defined its own DEBUG() macro in a broken way.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch removes controller driver infrastructure which supported
the now-removed usb_ep_{alloc,free}_buffer() calls.
As can be seen, many of the implementations of this were broken to
various degrees. Many didn't properly return dma-coherent mappings;
those which did so were necessarily ugly because of bogosity in the
underlying dma_free_coherent() calls ... which on many platforms
can't be called from the same contexts (notably in_irq) from which
their dma_alloc_coherent() sibling can be called.
The main potential downside of removing this is that gadget drivers
wouldn't have specific knowledge that the controller drivers have:
endpoints that aren't dma-capable don't need any dma mappings at all.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Remove usb_ep_{alloc,free}_buffer() calls, for small dma-coherent buffers.
This patch just removes the interface and its users; later patches will
remove controller driver support.
- This interface is invariably not implemented correctly in the
controller drivers (e.g. using dma pools, a mechanism which
post-dates the interface by several years).
- At this point no gadget driver really *needs* to use it. In
current kernels, any driver that needs such a mechanism could
allocate a dma pool themselves.
Removing this interface is thus a simplification and improvement.
Note that the gmidi.c driver had a bug in this area; fixed.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Cleanups to the pxa2xx_udc code:
- Primarily removing unused DMA hooks.
- One "sparse" warning removed
- Remove some Lubbock-only LED hooks (for debugging)
That DMA code was never really completed. It worked, mostly, for IN
transfers (to the host) if they were fortuitously aligned, but that
code was never fully tested. And it was never coded for OUT transfers
(which is where DMA would really help) ... because of chip errata on
essentially every chip other than the pxa255, and because of design
botches (nothing automated data toggle). So it's effectively been
dead code for several years now ... no point in keeping it around.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch lets the pxa2xx_udc use the generic gpio layer,
on the relevant PXA and IXP systems.
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>
This patch updates some of the documentation about DMA buffer management
for USB, and ways to avoid extra copying. Our understanding of the issues
has improved over time.
- Most drivers should *avoid* the dma-coherent allocators. There are
a few exceptions (like the HID driver).
- Some methods are currently commented out; it seems folk writing
USB drivers aren't doing performance tuning at that level yet.
- Just avoid highmem; there's no good way to pass an "I can do highmem
DMA" capability through a driver stack. This is easy, everything
already avoids highmem. But it'd be nice if x86_32 systems with much
physical memory could use it directly with network adapters and mass
storage devices. (Patch, anyone?)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Following patch removes trailing whitespaces at the ends of lines and converts
smarttabs/whitespaces into real tabs.
Signed-off-by: S.Caglar Onur <caglar@pardus.org.tr>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The MOS driver is "interesting", in a bad kind of 'how the hell did this
get merged' kind of way
- Remove the bogus termios change check
- Remove the duplicate code for half the ioctls
- Remove the supporting code to duplicate the ioctl code
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
So we can use dev_to_node(&usb_dev->dev) later in kmalloc_node to dma buffer
Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Cc: Andi Kleen <ak@suse.de>
Acked-by: Christoph Lameter <clameter@sgi.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Fix an oops that happens in relation with applying work arounds for buggy
ftdi_sio devices. The quirks were handled too early because due to changes in
the initialisation of usb serial devices the device was not fully initialised
when the old hook was called.
Addresses bug 8564
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Generally, Jens Axboe was against 'default y', so I'll have some patches to
remove it.
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Make usb autosuspend timers 1sec jiffy aligned.
This helps to reduce the frequency at which the CPU must be taken out of a
lower-power state.
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Blackberry devices charge over USB. By autosuspending the port, they are
not able to charge reliably.
Signed-off-by: Jeremy Katz <katzj@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The Blackberry Pearl (8100) needs similar tweaks as older Blackberry models
to be able to charge when connected via USB. The Pearl also adds an
additional need to go into a separate mode for fully accessing the device;
do that by default as well.
Changes based on the changes from bcharge in the barry project
(http://barry.sf.net)
Signed-off-by: Jeremy Katz <katzj@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
USB_IAD: Adds support for USB Interface Association Descriptors.
This patch adds support to the USB host stack for parsing, storing, and
displaying Interface Association Descriptors. In /proc/bus/usb/devices
lines starting with A: show the fields in an IAD. In sysfs if an
interface on a USB device is referenced by an IAD the following files
will be added to the sysfs directory for that interface:
iad_bFirstInterface, iad_bInterfaceCount, iad_bFunctionClass, and
iad_bFunctionSubClass, iad_bFunctionProtocol
Signed-off-by: Craig W. Nadler <craig@nadler.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The loop in usb_sg_wait() is structured in a way that makes it hard to
tell, when the loop exits, whether or not the last URB submission
succeeded. This patch (as928) changes it from a "for" loop to a
"while" loop and keeps "i" always equal to the number of successful
submissions. This fixes an off-by-one error which can show up when
the first URB submission fails.
The patch also removes a couple of lines that initialize fields which
don't need to be initialized.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Root hubs can't be resumed if their parent controller device is still
suspended. This patch (as925) adds a check for that condition in
hcd_bus_resume() and prevents it from being treated as a fatal
controller failure.
ehci-hcd is updated to add the corresponding test. Unnecessary
debugging messages are removed from uhci-hcd and dummy-hcd. The
error return code from dummy-hcd is changed to -ESHUTDOWN, the same as
the others. ohci-hcd doesn't need any changes.
Suspend handling in the non-PCI host drivers is somewhat hit-and-miss.
This patch shouldn't have any effect on them.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as922) removes all but one of the remaining vestiges of
dev->power.power_state from usbcore. The only usage left must remain
until the deprecated "power/state" sysfs attribute is gone.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch's main bulk aims to make usblp the premier driver for code
pillaging once again. The code is as streamlined as possible and is bug-free
as possible. The usb-skeleton performs the same function, but is somewhat
abstract. The usblp is usb-skeleton which is actually used by many.
Since I combed a few small bugs away, this also fixes the small races we
had in usblp for a while. For example, now it's possible for several threads
to make write(2) calls (sounds silly, but consider a printer for paper
record, where every line of text is self-contained and thus it's all right
to have them interleaved). Also gone are issues with interrupts using
barriers dangerously.
This patch makes use of Oliver's anchor, and so it must trail the anchor
patch on the way to Linus.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Fix a bug that PORT_TYPE and PORT_WIDTH aren't masked correctly in portsc.
Signed-off-by: Christopher Cason <chris.cason@nec.com.au>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
this patch implements autosuspend for the usblcd driver. It uses
the new usb_anchor infrastructure. Many thanks to Georges for testing.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Cc: Georges Toth <g.toth@e-biz.lu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
husb2dev was the internal name of the USB Device Controller on
AT32AP7000. Rename it to "atmel_usba", which is closer to the official
name used in documentation and marketing material.
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
USB: Add URB_FREE_BUFFER flag for freeing the transfer buffer
In some cases it is not needed that the driver keeps track of the
transfer buffer of an URB. It can be simply freed along with the
URB itself when the reference count goes down to zero. The new
flag URB_FREE_BUFFER enables this behavior.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Many device manufacturers are using full-speed bInterval values in high-speed
interrupt endpoint descriptors. If the bInterval value is greater than 16,
assume the device uses full-speed descriptors and fix the value accordingly.
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
- Drivers don't call ldisc termios methods. They certainly don't call
them the way this one does - remove wrong call
- The tty buffer code isn't designed to be abused from IRQ handlers and
the new buffering removes the need for the uglies involved - fix them
- Style
- Remove incorrect baud and change handling for termios changes
The driver now has some style, but not a lot - it goes insane if you have
two dongles for example as it continues to use global variables for per
dongle state. That bit isn't my problem.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Use the baud rate stuff from the kernel don't parse CBAUD directly
Remove pointless and wrong 'no change' check
Could do with some good testing as well but again better than adding &&
BROKEN
(The use of BELKIN_SA_BAUD() might seem a bit odd but x/a = b and x/b =
a (rounded for integers)).
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
o Don't parse the cflag for baud rates, its not valid to do so
any more and this driver got it wrong anyway
o Don't do clever termios change checks in drivers and get them
wrong (arguably we should do some smart ones in the tty core but
stty to change nothing is *not* a common or critical path
I don't have the hardware so if you can test this carefully please do. I
thought fixing it up this far was better than marking it and other bits of
USB serial && BROKEN
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This removes the ugly code that was copied from the keyspan driver and
allocates the in urbs in a much shorter code path that can be understood
easier.
Also turned off the interrupt urb when no port was open as it's not nice
to keep the bus busy for no good reason at all (this should be a power
savings.)
All in all, this saved over 40 lines of code and cleaned things up
better.
Cc: Kevin Lloyd <linux@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
You can't rely on the fact that the status really is correct like it was.
Also simplified the write path and now we allocate the urb and data on
the fly, instead of trying to do that really odd timeout check which I
am guessing doesn't really work properly. This should speed up the
device by keeping the hardware queue full easier.
As a benefit, this reduces the size of the driver.
Cc: Kevin Lloyd <linux@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: Peter Berger <pberger@brimson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Kevin Lloyd <linux@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Stuart Lynne <sl@lineo.com>
Cc: Tom Rushworth <tbr@lineo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Paul Schroeder <pschroeder@uplogix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: VijayaKumar G.N. <vijaykumar@aspirecom.net>
Cc: AjayKumar <ajay@aspirecom.net>
Cc: Gurudeva N. <gurudev@aspirecom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Wolfgang Grandegger <wolfgang@ces.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Thomas Wahrenbruch <linuxusb@kobil.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Utz-Uwe Haus <haus@uuhaus.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Gary Brubaker <xavyer@ix.netcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Roelf Diedericks <roelfd@inet.co.za>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Ganesh Varadarajan <ganesh@veritas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: Peter Berger <pberger@brimson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: Peter Berger <pberger@brimson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Hermann Kneissel <herkne@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Kuba Ober <kuba@mareimbrium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Gary Brubaker <xavyer@ix.netcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Peter Berger <pberger@brimson.com>
Cc: Al Borchers <borchers@steinerpoint.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Lonnie Mendez <dignome@gmail.com>
Cc: Neil Whelchel <koyama@firstlight.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: <support@reiner-sct.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Cc: <linux-usb-devel@lists.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch releases DMA resources if enqueue fails in the HCD.
Linux had this bug ever since we converted from virt_to_bus for 2.4.
It is difficult to hit. A user would need a significant memory pressure
or some other unusual condition.
It was reported to me by IBM. They ran a management application for
RSA II adapters which sent Bulk requests to an Interrupt endpoint.
Submissions got rejected by HCD due to an invalid interval value
and the swiotlb pool became depleted in the matter of hours.
We fixed the invalid interval issue in devio.c separately, but this
seems to be a bug worth fixing as well.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
A noticeable number of low-speed devices mistakenly include
descriptors for Bulk endpoints, which is forbidden by the USB spec.
In an attempt to make such devices more usable, this patch (as924)
converts the descriptors to Interrupt with an interval of 1 ms.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
I think there is a race between usb_serial_put() and
usb_serial_get_by_index() (and get_free_serial()) with regards
to handling the serial port refcount.
usb_serial_get_by_index() gets a reference on the serial port under
table_lock while return_serial releases all the returned ports
from the table under the same lock. However, the table_lock is not
taken around the call to kref_put, theoretically allowing to sneak
in and grab a reference after kref_put has already determined that
the reference count is zero (and before calling destroy_serial)
causing use after free.
Signed-off-by: Benny Halevy <bhalevy@ns1.bhalevy.com>
Cc: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
According to the USB Specification Revision 2.0 chapter 11.12.5
a hub experiencing an over-current condition must place all
affected ports in the powered-off state. It seems that some root
hubs need port power to be cycled by software in order to get back
to normal functionality after an over-current condition ... like
the EHCI implementation on an MPC8343E.
Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com>
Signed-off-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Platforms with PCMCIA support can implement host-side USB with "sl811_cs",
so make sure this menu shows up on platforms with PCMCIA.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as923) makes usb-storage's control thread use
kthread_should_stop()/kthread_stop(). The scanning thread can't be
similarly converted until the core kthread implementation allows
threads to call do_exit().
The advantage of this change is that we can now be certain the control
thread has terminated before storage_disconnect() returns. This will
simplify the locking requirements when autosuspend support is added.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch adds the support for the Usb Device Controller on Samsung
S3C24xx SoCs. This driver passes all tests from testusb (including #13)
and has been tested on S3C2410, S3C24212, and S3C2440 SoCs.
Whitespace updates, minor cleanups by David
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Herbert Pötzl <herbert@13thfloor.at>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
USB HCD glue updates to reflect the new PS3 unifed device support.
- Fixed remove() routine.
- Added shutdown() routine.
- Added request_mem_region() call.
- Fixed MODULE_ALIAS().
- Made a proper fix for the hack done to support muti-platform in commit
48fda45120.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Might fix bug 8561
On Mon, 4 Jun 2007, Paulo Pereira wrote:
> The patch that you send is not resolving the problem... :(
> I stil have Kernel panic after 45/60 min of work with Ktorrent/Amule...
>
> The Drump is:
>
> Call Trace:
> [<c055fb36>] usb_hcd_submit+0xb1/0x763
> [<f9276488>] ipt_do_table+0x2c7/0x2ef [ip_tables]
> [<f929a6d7>] nf_ct_deliver_cached_events+0x41/0x96 [nf_conntrak]
> [<f9288254>] ipv4_confirm+0x36/0c3b [nf_conntrack_ipv4]
> [<c05ce7c2>] tcp_v4_rcv+0x827/0x899
> [<c05afcc0>] nf_hook_slow+0x4d/0xb5
> [<c042826f>] irq_enter+0x19/0x23
> [<c042826f>] irq_enter+0x19/0x23
> [<c040794c>] do_IRQ+0xbd/0xd1
> [<f90893c9>] option_write+0xa7/0xef [option]
Okay, from this it looks like there's a problem in the option.c serial
driver. Glancing at the code, it's obvious why: The thing totally
abuses the USB API.
Try applying this patch; it should help.
From: Alan Stern <stern@rowland.harvard.edu>
Cc: Paulo Pereira <pfmp.404@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Currently the driver is expecting max ep number in platform
data which isn't passing this information. This patch fix
the problem by reading it from DCCPARAMS(Device Controller
Capability Parameters) register. The change also need some
reordering of the probe code.
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as920) adds an extra level of protection to the
USB-Persist facility. Now it will apply by default only to hubs; for
all other devices the user must enable it explicitly by setting the
power/persist device attribute.
The disconnect_all_children() routine in hub.c has been removed and
its code placed inline. This is the way it was originally as part of
hub_pre_reset(); the revised usage in hub_reset_resume() is
sufficiently different that the code can no longer be shared.
Likewise, mark_children_for_reset() is now inline as part of
hub_reset_resume(). The end result looks much cleaner than before.
The sysfs interface is updated to add the new attribute file, and
there are corresponding documentation updates.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as919) unifies the code paths used for normal resume and
for reset-resume. Earlier I had failed to note a section in the USB
spec which requires the host to resume a suspended port before
resetting it if the attached device is enabled for remote wakeup.
Since the port has to be resumed anyway, we might as well reuse the
existing code.
The main changes are:
usb_reset_suspended_device() is eliminated.
usb_root_hub_lost_power() is moved down next to the
hub_reset_resume() routine, to which it is logically
related.
finish_port_resume() does a port reset() if the device's
reset_resume flag is set.
usb_port_resume() doesn't check whether the port is initially
enabled if this is a USB-Persist sort of resume.
Code to perform the port reset is added to the resume pathway
for the non-CONFIG_USB_SUSPEND case.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as918) introduces a new USB driver method: reset_resume.
It is called when a device needs to be reset as part of a resume
procedure (whether because of a device quirk or because of the
USB-Persist facility), thereby taking over a role formerly assigned to
the post_reset method. As a consequence, post_reset no longer needs
an argument indicating whether it is being called as part of a
reset-resume. This separation of functions makes the code clearer.
In addition, the pre_reset and post_reset method return types are
changed; they now must return an error code. The return value is
unused at present, but at some later time we may unbind drivers and
re-probe if they encounter an error during reset handling.
The existing pre_reset and post_reset methods in the usbhid,
usb-storage, and hub drivers are updated to match the new
requirements. For usbhid the post_reset routine is also used for
reset_resume (duplicate method pointers); for the other drivers a new
reset_resume routine is added. The change to hub.c looks bigger than
it really is, because mark_children_for_reset_resume() gets moved down
next to the new hub_reset_resume() routine.
A minor change to usb-storage makes the usb_stor_report_bus_reset()
routine acquire the host lock instead of requiring the caller to hold
it already.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as917) removes a now-unnecessary level of subroutine
nesting from hub.c. Since usb_port_suspend() does nothing but call
hub_port_suspend(), and usb_port_resume() does nothing but call
hub_port_resume(), there's no reason to keep the routines separate.
Also included in the patch are a few cosmetic changes involving
whitespace and use of braces.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as916) completes the separation of code paths for suspend
and resume of root hubs as opposed to non-root devices. Root hubs
will be power-managed through their bus_suspend and bus_resume
methods, whereas normal devices will use usb_port_suspend() and
usb_port_resume().
Changes to the hcd_bus_{suspend,resume} routines mostly represent
motion of code that was already present elsewhere. They include:
Adding debugging log messages,
Setting the device state appropriately, and
Adding a resume recovery time delay.
Changes to the port-suspend and port-resume routines in hub.c include:
Removal of checks for root devices (since they will never
be triggered), and
Removal of checks for NULL or invalid device pointers (these
were left over from earlier kernel versions and aren't needed
at all).
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as915b) combines the public routine usb_port_suspend() and
the private routine __usb_port_suspend() into a single function.
By removing the explicit mention of otg_port in the call to
__usb_port_suspend(), we prevent a possible error in which the system
tries to perform HNP on the wrong port when a non-targeted device is
plugged into a non-OTG port.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>