Jean Delvare [Mon, 28 Aug 2006 12:23:46 +0000 (14:23 +0200)]
it87: Add support for the IT8716F
it87: Add support for the IT8716F
The IT8716F is a Super-I/O chip with integrated hardware monitoring
functions. It is very similar to the IT8712F, so adding support to the
it87 driver was pretty straightforward. The most significant change here
is that the IT8716F has 16-bit fan speed counters, so the user no more
needs to tweak the fan clock dividers to get the best readings.
Userspace support is already in lm_sensors SVN (to be soon released
as 2.10.1.)
Thanks to Stian Oksavik, Olivier Nicolas, Prakash Punnoor and
Juergen Kilb for testing the early versions of this patch.
Thanks also to ITE for providing datasheets and answering my questions.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Rudolf Marek [Wed, 5 Jul 2006 16:14:31 +0000 (18:14 +0200)]
hwmon: Add fan speed control features to w83627ehf
This patch adds long-awaited support for automatic fan modes. Based on
the work of Yuan Mu from Winbond, I finished the support with the great
help of David Hubbard.
Signed-off-by: Yuan Mu <Ymu@Winbond.com.tw> Signed-off-by: Rudolf Marek <r.marek@sh.cvut.cz> Signed-off-by: David Hubbard <david.c.hubbard@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Major cleanup of all s390 inline assemblies. They now have a common
coding style. Quite a few have been shortened, mainly by using register
asm variables. Use of the EX_TABLE macro helps as well. The atomic ops,
bit ops and locking inlines new use the Q-constraint if a newer gcc
is used. That results in slightly better code.
Thanks to Christian Borntraeger for proof reading the changes.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
A user space program can read uninitialised kernel memory
by appending to a file from a bad address and then reading
the result back. The cause is the copy_from_user function
that does not clear the remaining bytes of the kernel
buffer after it got a fault on the user space address.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
The clocksource infrastructure introduced with commit ad596171ed635c51a9eef829187af100cbf8dcf7 broke 31 bit s390.
The reason is that the do_div() primitive for 31 bit always
had a restriction: it could only divide an unsigned 64 bit
integer by an unsigned 31 bit integer. The clocksource code
now uses do_div() with a base value that has the most
significant bit set. The result is that clock->cycle_interval
has a funny value which causes the linux time to jump around
like mad.
The solution is "obvious": implement a proper __div64_32
function for 31 bit s390.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (48 commits)
[PATCH] bonding: update version number
[PATCH] git-netdev-all: pc300_tty build fix
[PATCH] Make PC300 WAN driver compile again
[PATCH] Modularize generic HDLC
[PATCH] more s2io __iomem annotations
[PATCH] restore __iomem annotations in e1000
[PATCH] 64bit bugs in s2io
[PATCH] bonding: Fix primary selection error at enslavement time
[PATCH] bonding: Don't mangle LACPDUs
[PATCH] bonding: Validate probe replies in ARP monitor
[PATCH] bonding: Don't release slaves when master is admin down
[PATCH] bonding: Add priv_flag to avoid event mishandling
[PATCH] bonding: Handle large hard_header_len
[PATCH] bonding: Remove unneeded NULL test
[PATCH] bonding: Format fix in seq_printf call
[PATCH] bonding: Convert delay value from s16 to int
[PATCH] bonding: Allow bonding to enslave a 10 Gig adapter
Delete unused drivers/net/gt64240eth.h
[PATCH] skge: fiber support
[PATCH] fix possible NULL ptr deref in forcedeth
...
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
[libata] Don't use old-EH ->eng_timeout() hook when not needed
[libata] sata_mv: fix oops by filling in missing hook
[libata] One more s/15/ATA_SECONDARY_IRQ/ substitution
[libata] pata_serverworks: fill in ->irq_clear hook
[PATCH] pata_serverworks: correct PCI ID in cable detection table
[PATCH] libata-sff: use our IRQ defines
[PATCH] libata-eh: Remove layering violation and duplication when handling absent ports
[PATCH] libata: tighten rules for legacy dependancies
[PATCH] libata: refuse to register IRQless ports
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (129 commits)
[PATCH] USB Storage: fix Rio Karma eject support build error
USB: Airprime driver improvements to allow full speed EvDO transfers
USB: remove OTG build warning
USB: EHCI update VIA workaround
USB: force root hub resume after power loss
USB: ohci_usb can oops on shutdown
USB: Dealias -110 code (more complete)
USB: Remove unneeded void * casts in core files
USB: u132-hcd: host controller driver for ELAN U132 adapter
USB: ftdi-elan: client driver for ELAN Uxxx adapters
usb serial: support Alcor Micro Corp. USB 2.0 TO RS-232 through pl2303 driver
USB: Moschip 7840 USB-Serial Driver
USB: add PlayStation 2 Trance Vibrator driver
USB: Add ADU support for Ontrak ADU devices
aircable: fix printk format warnings
Add AIRcable USB Bluetooth Dongle Driver
cypress_m8: implement graceful failure handling
cypress_m8: improve control endpoint error handling
cypress_m8: use usb_fill_int_urb where appropriate
cypress_m8: use appropriate URB polling interval
...
Andrew Morton [Wed, 27 Sep 2006 07:40:36 +0000 (00:40 -0700)]
[PATCH] git-netdev-all: pc300_tty build fix
In file included from drivers/net/wan/pc300_tty.c:59:
drivers/net/wan/pc300.h:335: error: field 'pppdev' has incomplete type
Cc: Krzysztof Halasa <khc@pm.waw.pl> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Andrew Morton [Tue, 26 Sep 2006 00:00:52 +0000 (17:00 -0700)]
[PATCH] USB Storage: fix Rio Karma eject support build error
In file included from drivers/usb/storage/usb.c:180:
drivers/usb/storage/unusual_devs.h:221: error: 'US_PR_KARMA' undeclared here (not in a function)
drivers/usb/storage/unusual_devs.h:221: error: 'rio_karma_init' undeclared here (not in a function)
Cc: Keith Bennett <keith@mcs.st-and.ac.uk> Acked-by: Bob Copeland <me@bobcopeland.com> Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Andy Gay [Mon, 3 Jul 2006 22:43:01 +0000 (18:43 -0400)]
USB: Airprime driver improvements to allow full speed EvDO transfers
Adapted from an earlier patch by Greg KH <gregkh@suse.de>.
That patch added multiple read urbs and larger transfer buffers to allow
data transfers at full EvDO speed.
This version includes additional device IDs and fixes a memory leak in
the transfer buffer allocation.
Some (maybe all?) of the supported devices present multiple bulk endpoints,
the additional EPs can be used for control and status functions,
This version allocates 3 EPs by default, that can be changed using
the 'endpoints' module parameter.
Tested with Sierra Wireless EM5625 and MC5720 embedded modules.
Device ID (0x0c88, 0x17da) for the Kyocera Wireless KPC650/Passport
was added but is not yet tested.
From: Andy Gay <andy@andynet.net> Cc: Kevin Lloyd <linux@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Tue, 19 Sep 2006 00:03:16 +0000 (17:03 -0700)]
USB: EHCI update VIA workaround
This revamps handling of the hardware "async advance" IRQ, and its watchdog
timer. Basically it dis-entangles that important timeout from the others,
simplifying the associated state and code to make it more robust.
This reportedly improves behavior of EHCI on some systems with VIA chips,
and AFAIK won't affect non-VIA hardware. VIA systems need this code to
recover from silcon bugs whereby the "async advance" IRQ isn't issued.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Tue, 19 Sep 2006 14:07:58 +0000 (10:07 -0400)]
USB: force root hub resume after power loss
This patch(as785) forces the PM core to resume a root hub after a
power loss during system sleep. If the root hub had been suspended
before the system sleep then normally the PM core would not resume it
afterward. Without this resume, various sorts of wakeup events (like
port change events) can get lost.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Pete Zaitcev [Tue, 19 Sep 2006 05:57:22 +0000 (22:57 -0700)]
USB: ohci_usb can oops on shutdown
When ohci-hcd is shutting down (for rmmod or PC-card removal), there is
a window when the device is shut down, HC communication area (->hcca)
is freed, but the core has not called "free_irq" yet. If another device
triggers a shared interrupt in this window, we oops when trying to
access the freed ->hcca.
This patch removes the window by calling free_irq before ->hcca is freed.
The patch is tested at the PC hotplug test rig at Stratus, and with
rmmod by Rafael Wysocki.
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>
Pete Zaitcev [Tue, 19 Sep 2006 05:49:02 +0000 (22:49 -0700)]
USB: Dealias -110 code (more complete)
The purpose of this patch is to split off the case when a device does
not reply on the lower level (which is reported by HC hardware), and
a case when the device accepted the request, but does not reply at
upper level. This redefinition allows to diagnose issues easier,
without asking the user if the -110 happened "immediately".
The usbmon splits such cases already thanks to its timestamp, but
it's not always available.
I adjusted all drivers which I found affected (by searching for "urb").
Out of tree drivers may suffer a little bit, but I do not expect much
breakage. At worst they may print a few messages.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The patch removes unneeded casts for the following (void *) pointers:
- struct file: private
- struct urb: context
- struct usb_bus: hcpriv
- return value of kmalloc()
The patch also contains some whitespace cleanup in the relevant areas.
Tony Olech [Wed, 13 Sep 2006 10:27:35 +0000 (11:27 +0100)]
USB: u132-hcd: host controller driver for ELAN U132 adapter
This "u132-hcd" module is one half of the "driver" for
ELAN's U132 which is a USB to CardBus OHCI controller
adapter. This module needs the "ftdi-elan" module in
order to communicate to CardBus OHCI controller inserted
into the U132 adapter.
When the "ftdi-elan" module detects a supported CardBus
OHCI controller in the U132 adapter it loads this "u132-hcd"
module.
Upon a successful device probe() the single workqueue
is started up which does all the processing of commands
from the USB core that implement the host controller.
The workqueue maintains the urb queues and issues commands
via the functions exported by the "ftdi-elan" module. Each
such command will result in a callback.
Note that the "ftdi-elan" module is a USB client driver.
Note that this "u132-hcd" module is a (cut-down OHCI)
host controller.
Thus we have a topology with the parent of a host controller
being a USB client! This really stresses the USB subsystem
semaphore/mutex handling in the module removal.
Signed-off-by: Tony Olech <tony.olech@elandigitalsystems.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Tony Olech [Wed, 13 Sep 2006 10:26:04 +0000 (11:26 +0100)]
USB: ftdi-elan: client driver for ELAN Uxxx adapters
This "ftdi-elan" module is one half of the "driver" for
ELAN's Uxxx series adapters which are USB to PCMCIA CardBus
adapters. Currently only the U132 adapter is available and
it's module is called "u132-hcd".
When the USB hot plug subsystem detects a Uxxx series adapter
it should load this module.
Upon a successful device probe() the jtag device file interface
is created and the status workqueue started up.
The jtag device file interface exists for the purpose of
updating the firmware in the Uxxx series adapter, but as
yet it had never been used.
The status workqueue initializes the Uxxx and then sits there
polling the Uxxx until a supported PCMCIA CardBus device is
detected it will start the command and respond workqueues
and then load the module that handles the device. This will
initially be only the u132-hcd module. The status workqueue
then just polls the Uxxx looking for card ejects.
The command and respond workqueues implement a command
sequencer for communicating with the firmware on the other
side of the FTDI chip in the Uxxx. This "ftdi-elan" module
exports some functions to interface with the sequencer.
Note that this module is a USB client driver.
Note that the "u132-hcd" module is a (cut-down OHCI)
host controller.
Thus we have a topology with the parent of a host controller
being a USB client! This really stresses the USB subsystem
semaphore/mutex handling in the module removal.
Signed-off-by: Tony Olech <tony.olech@elandigitalsystems.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
usb serial: support Alcor Micro Corp. USB 2.0 TO RS-232 through pl2303 driver
Patch to add support for Alcor Micro Corp. USB 2.0 TO RS-232 converter.
This patch adds VID and PID to pl2303.[ch], adds it to the "HORRIBLE
HACK FOR PL2303" in usb-serial.c and also prevents cdc-acm to claim
driving this device by blacklisting it in hid-core.
Signed-off-by: Johannes Steingraeber <Jo_Stein@web.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sam Hocevar [Wed, 30 Aug 2006 00:34:56 +0000 (02:34 +0200)]
USB: add PlayStation 2 Trance Vibrator driver
This patch is a driver for the PlayStation 2 specific Trance Vibrator
device. The only thing that device can do is vibrate at various speeds.
Signed-off-by: Sam Hocevar <sam@zoy.org> Cc: Pete Zaitcev <zaitcev@redhat.com> Cc: Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Randy Dunlap [Sat, 26 Aug 2006 17:56:10 +0000 (10:56 -0700)]
aircable: fix printk format warnings
Fix printk format warnings:
drivers/usb/serial/aircable.c:221: warning: format ‘%Zd’ expects type ‘signed size_t’, but argument 4 has type ‘int’
drivers/usb/serial/aircable.c:283: warning: format ‘%Zd’ expects type ‘signed size_t’, but argument 4 has type ‘int’
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mike Isely [Wed, 30 Aug 2006 03:07:11 +0000 (22:07 -0500)]
cypress_m8: implement graceful failure handling
When receiving a fatal error from the USB core, e.g. EILSEQ (which can
happen if the polling interval is too short), fail gracefully.
Previously the driver would fill the log with useless error messages
or (more alarmingly) silently spin forever trying to write updated
control information to the device. This change implements a new flag
which if cleared indicates that the driver has failed. The flag will
be set on initialization, cleared on fatal errors, and anything else
that touches the USB port in the driver will abort if the flag is
clear. When the flag is cleared, a message will be logged indicating
that the driver has failed.
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mike Isely [Wed, 30 Aug 2006 03:07:07 +0000 (22:07 -0500)]
cypress_m8: improve control endpoint error handling
Fix usb core function error return checks to look for negative errno
values, not positive errno values. This bug had rendered those checks
useless. Also remove attempted error recovery on control endpoints
for EPIPE - with control endpoints EPIPE does not indicate a halted
endpoint so trying to recover with usb_clear_halt() is not the correct
action.
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mike Isely [Wed, 30 Aug 2006 03:07:04 +0000 (22:07 -0500)]
cypress_m8: use usb_fill_int_urb where appropriate
Rather than directly filling in URB fields, it's safer to use
usb_fill_int_urb(). This improves robustness of the driver; URB
changes in the future will not go uninitialized here. That point not
withstanding, this driver should at least be self-consistent. Either
use usb_fill_int_urb() everywhere or don't bother with it all.
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mike Isely [Wed, 30 Aug 2006 03:06:59 +0000 (22:06 -0500)]
cypress_m8: use appropriate URB polling interval
The polling interval for the device can't always be 1msec. If it is
too quick, the device can fail causing a fatal (to the driver) EILSEQ
error from the USB core. The actual correct value is reported by the
device as part of its configuration data, so use that value as the
default. On a DeLorme Earthmate for example, the device reports that
it wants a 6msec interval. As part of this fix, the "interval" module
option has been fixed as well; the device's default can be overridden
by specifying interval=<value> as a module option.
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Tue, 19 Sep 2006 14:08:43 +0000 (10:08 -0400)]
USB: fix root-hub resume when CONFIG_USB_SUSPEND is not set
This patch (as786) removes a redundant test and fixes a problem
involving repeated system sleeps when CONFIG_USB_SUSPEND is not set.
During the first wakeup, the root hub's dev.power.power_state.event
field doesn't get updated, causing it not to be suspended during the
second sleep transition.
This takes care of the issue raised by Rafael J. Wysocki and Mattia
Dongili.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Wed, 30 Aug 2006 19:47:11 +0000 (15:47 -0400)]
usbcore: remove usb_suspend_root_hub
This patch (as740) removes the existing support for autosuspend of
root hubs. That support fit in rather awkwardly with the rest of
usbcore and it was used only by ohci-hcd. It won't be needed any more
since the hub driver will take care of autosuspending all hubs, root
or external.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch (as739) adds the basic infrastructure for USB autosuspend
and autoresume. The main features are:
PM usage counters added to struct usb_device and struct
usb_interface, indicating whether it's okay to autosuspend
them or they are currently in use.
Flag added to usb_device indicating whether the current
suspend/resume operation originated from outside or as an
autosuspend/autoresume.
Flag added to usb_driver indicating whether the driver
supports autosuspend. If not, no device bound to the driver
will be autosuspended.
Mutex added to usb_device for protecting PM operations.
Unlike the device semaphore, the locking rule for the pm_mutex
is that you must acquire the locks going _up_ the device tree.
New routines handling autosuspend/autoresume requests for
interfaces and devices.
Suspend and resume requests are propagated up the device tree
(but not outside the USB subsystem).
work_struct added to usb_device, for carrying out delayed
autosuspend requests.
Autoresume added (and autosuspend prevented) during probe and
disconnect.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Wed, 30 Aug 2006 19:46:48 +0000 (15:46 -0400)]
usbcore: store each usb_device's level in the tree
This patch (as778) adds a field to struct usb_device to store the
device's level in the USB tree. In itself this number isn't really
important. But the overhead is very low, and in a later patch it will
be used for preventing bogus warnings from the lockdep checker.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Pete Zaitcev [Thu, 7 Sep 2006 23:54:22 +0000 (16:54 -0700)]
USB: UB: Let cdrecord to see a device with media absent
The command "cdrecord dev=/dev/uba x.iso" prints nasty garbage if a blank
is not in the drive. This happens because drivers have to set req->errors
separately from just returning zero uptodate with end_that_request_first,
end_that_request_last. These functions only set error in BIO, but sg_io()
ignores it.
Since we're on it, let cdrecord access a device when ->changed is set.
It's useful if someone wants to know device capabilities without burning
anything.
Signed-Off-By: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
David Brownell [Sat, 2 Sep 2006 10:13:45 +0000 (03:13 -0700)]
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>
David Brownell [Wed, 30 Aug 2006 20:24:56 +0000 (13:24 -0700)]
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>
Alan Stern [Wed, 30 Aug 2006 15:35:21 +0000 (11:35 -0400)]
usbmon: don't call mon_dmapeek if DMA isn't being used
This patch (as755b) fixes a bug in usbmon. Rather than assuming all
USB host controllers use DMA, the code will check the usb_bus data
structure. If DMA isn't used, we don't want to try peeking into a
non-existent DMA buffer!
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Wed, 30 Aug 2006 15:32:52 +0000 (11:32 -0400)]
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>
Alan Stern [Wed, 30 Aug 2006 15:29:56 +0000 (11:29 -0400)]
usbcore: Add flag for whether a host controller uses DMA
This patch (as770b) introduces a new field to usb_bus: a flag
indicating whether or not the host controller uses DMA. This serves
to encapsulate the computation. It also means we will have only one
spot to update if the DMA API changes.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Wed, 30 Aug 2006 15:27:36 +0000 (11:27 -0400)]
USB: remove struct usb_operations
All of the currently-supported USB host controller drivers use the HCD
bus-glue framework. As part of the program for flattening out the glue
layer, this patch (as769) removes the usb_operations structure. All
function calls now go directly to the HCD routines (slightly renamed
to remain within the "usb_" namespace).
The patch also removes usb_alloc_bus(), because it's not useful in the
HCD framework and it wasn't referenced anywhere.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Mon, 21 Aug 2006 16:08:19 +0000 (12:08 -0400)]
usbcore: help drivers to change device configs
It's generally a bad idea for USB interface drivers to try to change a
device's configuration, and usbcore doesn't provide any way for them
to do it. However in a few exceptional circumstances it can make
sense. This patch (as767) adds a roundabout mechanism to help drivers
that may need it.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Mon, 21 Aug 2006 16:00:53 +0000 (12:00 -0400)]
usb-storage: fix for UFI LUN detection
The UFI specification doesn't permit devices to indicate non-existent
LUNs in the manner prescribed by the SCSI spec. This patch (as773)
sets a special flag so that the SCSI scanner will recognize these
devices and treat them specially.
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>
Jules Villard [Tue, 22 Aug 2006 20:40:15 +0000 (22:40 +0200)]
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).
Eric Sesterhenn [Mon, 21 Aug 2006 22:31:05 +0000 (15:31 -0700)]
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>
This patch marks some USB core's functions parameters as const. This
improves the design (we're saying to the caller that its parameter is
not going to be modified) and may help in compiler's optimisation work.
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch teaches the USB stack handling of WUSB devices (those whose
speed is USB_SPEED_VARIABLE). For these devices, we need to set ep0's
maxpacketsize to 512 (even though the device descriptor reports it as
0xff).
New code being pushed to linuxuwb.org requires this patch to connect WUSB
devices.
Change usb_get_configuration() so that it is more tolerant to devices
with bad configuration descriptors (it'll make it ignore
configurations that fail to load).
Matthew Dharm [Mon, 14 Aug 2006 00:30:14 +0000 (17:30 -0700)]
USB Storage: add rio karma eject support
This changeset from Keith Bennett (via Bob Copeland) moves the Karma
initializer to its own file and adds trapping of the START_STOP command to
enable eject of the device.
Signed-off-by: Keith Bennett <keith@mcs.st-and.ac.uk> Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
o CodingStyle fixes
o Removes trailing spaces
o Do not make not needed initialiation of automatic variables
o Use usb_endpoint_* functions
o If we get an error in the write URB callback print an error message instead
of a debug one
(Pretty unrelated changes, but spliting this up doesn't pay off as our main
changes are just CodingStyle fixes).
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Fri, 11 Aug 2006 20:52:39 +0000 (16:52 -0400)]
usbcore: khubd and busy-port handling
We don't want khubd to start interfering in the device-resume process
merely because the PORT_STATUS_C_SUSPEND feature happens to be set.
Ports need to be marked as busy while a resume is taking place.
In addition, so long as ports are marked as busy, khubd won't be able to
clear their various status-change features. On an interrupt-driven root
hub this could lead to an interrupt storm. Root hub IRQs should not be
re-enabled until the busy_bits value is equal to 0.
This patch (as765) fixes these two potential problems.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Fri, 11 Aug 2006 20:01:45 +0000 (16:01 -0400)]
usbcore: make hcd_endpoint_disable wait for queue to drain
The inconsistent lock state problem in usbcore (the one that shows up
when an HCD is unloaded) comes down to two inter-related problems:
usb_rh_urb_dequeue() isn't set up to be called with interrupts
disabled.
hcd_endpoint_disable() doesn't wait for all URBs on the
endpoint's queue to complete.
The two problems are related because the one type of URB that isn't
likely to be complete when hcd_endpoint_disable() returns is a root-hub
URB. Right now usb_rh_urb_dequeue() waits for them to complete, and it
assumes interrupts are enabled so it can wait. But
hcd_endpoint_disable() calls it with interrupts disabled.
Now, it should be legal to unlink root-hub URBs with interrupts
disabled. The solution is to move the waiting into
hcd_endpoint_disable(), where it belongs. This patch (as754) does that.
It turns out to be completely safe to replace the del_timer_sync() with
a simple del_timer(). It doesn't matter if the timer routine is
running; hcd_root_hub_lock will synchronize the two threads and the
status URB will complete with an unlink error, as it should.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Stern [Fri, 11 Aug 2006 15:33:58 +0000 (11:33 -0400)]
UHCI: increase Resume-Detect-off delay
The UHCI controller in my laptop takes longer to turn off the
Resume-Detect bit than the 4 us allowed by uhci-hcd. Presumably other
computers will have the same problem.
This patch (as752) increases the maximum delay to 10 us, which should be
plenty, and uses polling to avoid penalizing systems which can turn the
bit off more quickly.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Aleksey Gorelov [Wed, 9 Aug 2006 00:24:08 +0000 (17:24 -0700)]
USB: Properly unregister reboot notifier in case of failure in ehci hcd
If some problem occurs during ehci startup, for instance, request_irq fails,
echi hcd driver tries it best to cleanup, but fails to unregister reboot
notifier, which in turn leads to crash on reboot/poweroff.
The following patch resolves this problem by not using reboot notifiers
anymore, but instead making ehci/ohci driver get its own shutdown method. For
PCI, it is done through pci glue, for everything else through platform driver
glue.
One downside: sa1111 does not use platform driver stuff, and does not have its
own shutdown hook, so no 'shutdown' is called for it now. I'm not sure if it
is really necessary on that platform, though.
Signed-off-by: Aleks Gorelov <dared1st@yahoo.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
These functions makes USB driver's code simpler when dealing with endpoints
by avoiding them from accessing the endpoint's descriptor structure directly
when they only need to know the endpoint's transfer type and/or
direction.
Please, read each functions' documentation in order to know how to use
them.
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
USB: making the kernel -Wshadow clean - USB & completion
include/linux/usb.h causes a lot of -Wshadow warnings - fix them.
include/linux/usb.h:901: warning: declaration of 'complete' shadows a global declaration
include/linux/completion.h:52: warning: shadowed declaration is here
include/linux/usb.h:932: warning: declaration of 'complete' shadows a global declaration
include/linux/completion.h:52: warning: shadowed declaration is here
include/linux/usb.h:967: warning: declaration of 'complete' shadows a global declaration
include/linux/completion.h:52: warning: shadowed declaration is here