sfrench/cifs-2.6.git
17 years agoUSB: autosuspend for usb printer driver
Oliver Neukum [Thu, 18 Jan 2007 14:06:07 +0000 (15:06 +0100)]
USB: autosuspend for usb printer driver

this implements autosuspend for usb printers. It compiles and is tested.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB Input: Added kernel module to support all GTCO CalComp USB InterWrite School...
Jeremy Roberson [Thu, 18 Jan 2007 15:10:25 +0000 (08:10 -0700)]
USB Input: Added kernel module to support all GTCO CalComp USB InterWrite School products

Added a kernel module (gtco) to the USB Input subsystem.  This kernel
module adds support for all GTCO CalComp USB InterWrite School products.

Signed-off-by: Jeremy A. Roberson <jroberson@gtcocalcomp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Sierra Wireless auto set D0
Kevin Lloyd [Thu, 18 Jan 2007 00:04:18 +0000 (16:04 -0800)]
USB: Sierra Wireless auto set D0

This patch ensures that the device is turned on when inserted into the system.
It also adds more VID/PIDs and matches the N_OUT_URB with the airprime driver.

Signed-off-by: Kevin Lloyd <linux@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: usb ethernet gadget recognizes HUSB2DEV
Håvard Skinnemoen [Mon, 27 Feb 2006 17:15:04 +0000 (18:15 +0100)]
USB: usb ethernet gadget recognizes HUSB2DEV

Define DEV_CONFIG_CDC when compiling for HUSB2DEV.

From: Håvard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: list atmel husb2_udc gadget controller
Håvard Skinnemoen [Wed, 17 Jan 2007 19:03:29 +0000 (11:03 -0800)]
USB: list atmel husb2_udc gadget controller

This identifies the driver for the Atmel HUSB2 Device Controller,
as integrated into the first AVR32 chip, the AT32AP700.

From: Håvard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: gadgetfs AIO tweaks
Alan Stern [Wed, 17 Jan 2007 07:28:48 +0000 (23:28 -0800)]
USB: gadgetfs AIO tweaks

This patch (as837) fixes several mistakes in the AIO interface of the
gadgetfs driver:

The ki_retry method is not supposed to do a put on the kiocb.
The extra call to aio_put_req() causes memory corruption.
(Note: This call was removed before, by patch as691, and then
mysteriously re-introduced later.)

Even if a read transfer is cancelled, we can and should send
to the user all the data that did manage to get transferred.

Testing for AIO cancellation in the I/O completion handler
is both racy and (now) unnecessary.  aio_complete() does its
own checking, in a safe manner.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: gadgetfs behaves better on userspace init bug
David Brownell [Wed, 17 Jan 2007 07:06:07 +0000 (23:06 -0800)]
USB: gadgetfs behaves better on userspace init bug

Resolve an initizlization issue that could come up if the userspace
driver wrote invalid descriptors to a dual-speed device.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: gadgetfs race fix
David Brownell [Wed, 17 Jan 2007 06:56:26 +0000 (22:56 -0800)]
USB: gadgetfs race fix

This resolves a race in gadgetfs associated with changing device/ep0
when processing control requests.  The fix is to change that state
earlier, when the control response is issued, so there's no window
in which userspace could see the wrong state; and enlarge the scope
of the spinlock during the ep0 request completion handler.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: gadgetfs simplifications
David Brownell [Wed, 17 Jan 2007 06:53:58 +0000 (22:53 -0800)]
USB: gadgetfs simplifications

This simplifies event reading by eliminating arithmetic and being
more direct/obvious, and tweaks some debug messages slightly.
The math elimination will change timings, sometimes enough to
allow a race to appear.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: gadgetfs cleanups
David Brownell [Wed, 17 Jan 2007 06:51:04 +0000 (22:51 -0800)]
USB: gadgetfs cleanups

Minor gadgetfs cleanups:

 - EP0 state constants become consistently STATE_DEV_* rather than
   sometimes omitting the "DEV_"; STATE_EP_* were already consistent.

 - Comment that ep0 state is protected by the spinlock, and update
   code that was neglecting that rule.

None of this is expected to change behavior.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: race fixes for usb-serial, step 3
Oliver Neukum [Sat, 13 Jan 2007 06:32:27 +0000 (07:32 +0100)]
USB: race fixes for usb-serial, step 3

- fix an error code returned if a device has been disconnected

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: race fixes for usb-serial, step 2
Oliver Neukum [Sat, 13 Jan 2007 06:31:27 +0000 (07:31 +0100)]
USB: race fixes for usb-serial, step 2

- take BKL before looking up a driver to associate with a device to make
  sure the module is not unloaded after looking up but before association
  & bumping module count

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: race fixes for usb-serial step 1
Oliver Neukum [Sat, 13 Jan 2007 06:29:26 +0000 (07:29 +0100)]
USB: race fixes for usb-serial step 1

- introduce a spinlock for serial_table to eliminate the window between
  looking up a device and getting a reference
- delay inscription of a new device into serial_table until it is fully
  initialised
- make sure disconnect() kills all URBs to avoid leckage across a soft unbind

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agofix for bugzilla #7544 (keyspan USB-to-serial converter)
Rainer Weikusat [Wed, 3 Jan 2007 14:36:25 +0000 (15:36 +0100)]
fix for bugzilla #7544 (keyspan USB-to-serial converter)

At least the Keyspan USA-19HS USB-to-serial converter supports
two different configurations, one where the input endpoints
have interrupt transfer type and one where they are bulk endpoints.
The default UHCI configuration uses the interrupt input endpoints.
The keyspan driver, OTOH, assumes that the device has only bulk
endpoints (all URBs are initialized by calling usb_fill_bulk_urb
in keyspan.c/ keyspan_setup_urb). This causes the interval field
of the input URBs to have a value of zero instead of one, which
'accidentally' worked with Linux at least up to 2.6.17.11 but
stopped to with 2.6.18, which changed the UHCI support code handling
URBs for interrupt endpoints. The patch below modifies to driver to
initialize its input URBs either as interrupt or as bulk URBs,
depending on the transfertype contained in the associated endpoint
descriptor (only tested with the default configuration) enabling
the driver to again receive data from the serial converter.

Greg K-H reworked the patch.

Signed-off-by: Rainer Weikusat <rweikusat@sncag.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: total removal of multithreaded probing in usb
Oliver Neukum [Thu, 11 Jan 2007 13:35:50 +0000 (14:35 +0100)]
USB: total removal of multithreaded probing in usb

The whole approach is simply wrong.  Forking a thread means that
  - errors are ignored
  - locking is ignored

Doing this correctly would require major surgery for questionable benefit.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: at91_udc wakeup event updates
David Brownell [Tue, 16 Jan 2007 20:46:39 +0000 (12:46 -0800)]
USB: at91_udc wakeup event updates

This updates the AT91 UDC driver's handling of wakeup events:

 - Fix a bug in the original scheme, which was never updated after
   the {enable,disable}_irq_wake() semantics were updated to address
   refcounting issues (i.e. behave for shared irqs).

 - Couple handling of both type of wakeup events, to be more direct.  The
   controller can be source of wakeup events for cases like bus reset
   and USB resume.  On some boards, VBUS sensing is also IRQ driven.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoEHCI: force high-speed devices to run at full speed
Alan Stern [Tue, 16 Jan 2007 16:59:45 +0000 (11:59 -0500)]
EHCI: force high-speed devices to run at full speed

This patch (as710) adds a sysfs class-device attribute file named
"companion" for EHCI controllers.  The file contains a list of port
numbers that are dedicated to the companion controller; by writing a
port number to the file the user can force a high-speed device
attached directly to the computer to run at full speed.  (As far as I
know it is not possible to do this for a device attached to an
external hub.)  A port is removed from the file by writing the
negative of its port number.

Several users have asked for this facility and it seems like a useful
thing to have.  Every now and then one runs across a device which
behaves much better at full speed than at high speed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoEHCI: don't hide ports owned by the companion
Alan Stern [Tue, 16 Jan 2007 16:58:47 +0000 (11:58 -0500)]
EHCI: don't hide ports owned by the companion

This patch (as709) changes the way ehci-hcd presents port status
values for ports owned by the companion controller.  It no longer
hides the information; in particular, it allows the core to see the
disconnect event that occurs when a full- or low-speed device is
switched over to the companion.  This is required for the next patch
in this series.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoEHCI: local variable for port status register
Alan Stern [Tue, 16 Jan 2007 16:58:00 +0000 (11:58 -0500)]
EHCI: local variable for port status register

This patch (as708) introduces a local variable to hold the port
status-register address in ehci-hub.c.  There's not much improvement
in the object code, but it sure is a lot easier to read.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: remove unused bandwith-related code
Alan Stern [Tue, 16 Jan 2007 16:57:13 +0000 (11:57 -0500)]
usbcore: remove unused bandwith-related code

This patch (as841) removes from usbcore a couple of support routines
meant to help with bandwidth allocation.  With the changes to uhci-hcd
in the previous patch, these routines are no longer used anywhere.
Also removed is the CONFIG_USB_BANDWIDTH option; it no longer does
anything and is no longer needed since the HCDs now handle bandwidth
issues correctly.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUHCI: fix bandwidth allocation
Alan Stern [Tue, 16 Jan 2007 16:56:32 +0000 (11:56 -0500)]
UHCI: fix bandwidth allocation

This patch (as840) fixes the bandwidth allocation mechanism in
uhci-hcd.  It has never worked correctly.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: ps3 ohci bus glue
Geoff Levand [Tue, 16 Jan 2007 04:12:10 +0000 (20:12 -0800)]
USB: ps3 ohci bus glue

USB OHCI driver bus glue for the PS3 game console.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: ohci error handling cleanup
Benjamin Herrenschmidt [Tue, 16 Jan 2007 04:12:06 +0000 (20:12 -0800)]
USB: ohci error handling cleanup

Restructure the ohci_hcd_mod_init error handling code in to better support
the multiple platform drivers.  This does not change the functionality.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: ps3 controller hid quirk
Geoff Levand [Tue, 16 Jan 2007 04:11:52 +0000 (20:11 -0800)]
USB: ps3 controller hid quirk

Add the USB HID quirk HID_QUIRK_SONY_PS3_CONTROLLER.  This sends an
HID_REQ_GET_REPORT to the the PS3 controller to put the device into
'operational mode'.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: ps3 ehci bus glue
Geoff Levand [Tue, 16 Jan 2007 04:11:47 +0000 (20:11 -0800)]
USB: ps3 ehci bus glue

USB EHCI driver bus glue for the PS3 game console.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: better ethtool support for kaweth
Oliver Neukum [Tue, 16 Jan 2007 11:01:26 +0000 (12:01 +0100)]
USB: better ethtool support for kaweth

this implements enough ethtool support to make NetworkManager happy.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: power management for kaweth
Oliver Neukum [Tue, 16 Jan 2007 08:47:12 +0000 (09:47 +0100)]
USB: power management for kaweth

- implements suspend when the network interface is down
- fixes a typo in comments
- adds debugging output for power management
- fixes a compiler warning

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: gadgetfs remove delayed init mode
Phil Endecott [Mon, 15 Jan 2007 19:35:01 +0000 (11:35 -0800)]
usb: gadgetfs remove delayed init mode

Gadgetfs had a mode in which endpoint descriptors were written by the user
program before connection.  This mode had some bugs, and hasn't seen much
(if any) use.  This patch removes that mode, leaving the mode of operation
where the user program waits for endpoint 0 to report a SET_CONFIGURATION,
and only then configures the endpoints.

From: "Phil Endecott" <spam_from_usb_devel@chezphil.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb: gadgetfs whitespace cleanup
David Brownell [Mon, 15 Jan 2007 19:30:28 +0000 (11:30 -0800)]
usb: gadgetfs whitespace cleanup

Remove some whitespace bugs in gadgetfs (mostly from someone's
patch updating the AIO support).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: ohci-at91 refcount fix for irq wake enables
Marc Pignat [Tue, 9 Jan 2007 22:00:11 +0000 (14:00 -0800)]
USB: ohci-at91 refcount fix for irq wake enables

The attached patch fixes the unbalanced calls to enable_irq_wake() and
disable_irq_wake() in the AT91 USB Host driver.

It should resolve these kernel messages:
  Unbalanced IRQ x wake disable
  BUG: warning at kernel/irq/manage.c:167/set_irq_wake()

(The original code was debugged before a bug in the genirq wakeup irq
logic was fixed by adding the IRQ wake enable/disable refcounting.
Not all code yet uses the bugfixed model.)

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb-storage: SCSI level fixes
Alan Stern [Mon, 8 Jan 2007 21:18:05 +0000 (16:18 -0500)]
usb-storage: SCSI level fixes

This patch (as835) removes from usb-storage the code which sets all
devices to a SCSI level of at least SCSI-2.  The original reasons for
doing this no longer apply, and in fact it prevents certain kinds of
ATA pass-thru commands from being used.

The patch also marks CB and CBI devices that are SCSI-0 (legacy SCSI)
as being single-LUN, since the combined SCSI-over-USB transport
protocol has no way to convey LUN information to these devices.

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>
17 years agoUHCI: no dummy TDs for Iso QHs
Alan Stern [Mon, 8 Jan 2007 17:01:43 +0000 (12:01 -0500)]
UHCI: no dummy TDs for Iso QHs

Isochronous queues don't need a dummy TD because the Queue Header
isn't managed by the hardware.  This patch (as836) removes the
unnecessary dummy TDs.

The patch also fixes a long-standing typo in a comment (a "don't" was
missing -- potentially very confusing!).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUHCI: improved debugging checks for the frame list
Alan Stern [Mon, 8 Jan 2007 17:00:28 +0000 (12:00 -0500)]
UHCI: improved debugging checks for the frame list

This patch (as768) improves the debugging checks for the uhci-hcd
frame list.  The number of entries displayed is limited to 10, and the
driver now checks for the correct Skeleton QH link value at the end of
each chain of Isochronous TDs.  The code to compute these link values
is now used in two spots, so it is moved into its own separate
subroutine.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: race on disconnect in mdc800
Oliver Neukum [Fri, 5 Jan 2007 16:42:35 +0000 (17:42 +0100)]
USB: race on disconnect in mdc800

I overlooked one. Setting the flag and killing the URBs must be under the lock
so that no URB is submitted after usb_kill_urb()

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: add binary API to usbmon
Pete Zaitcev [Sun, 31 Dec 2006 06:43:10 +0000 (22:43 -0800)]
USB: add binary API to usbmon

This patch adds a new, "binary" API in addition to the old, text API usbmon
had before. The new API allows for less CPU use, and it allows to capture
all data from a packet where old API only captured 32 bytes at most. There
are some limitations and conditions to this, e.g. in case someone constructs
a URB with 1GB of data, it's not likely to be captured, because even the
huge buffers of the new reader are finite. Nonetheless, I expect this new
capability to capture all data for all real life scenarios.

The downside is, a special user mode application is required where cat(1)
worked before. I have sample code at http://people.redhat.com/zaitcev/linux/
and Paolo Abeni is working on patching libpcap.

This patch was initially written by Paolo and later I tweaked it, and
we had a little back-and-forth. So this is a jointly authored patch, but
I am submitting this I am responsible for the bugs.

Signed-off-by: Paolo Abeni <paolo.abeni@email.it>
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Add usb_endpoint_xfer_control to usb.h
Sarah Bailey [Sun, 24 Dec 2006 07:14:58 +0000 (23:14 -0800)]
USB: Add usb_endpoint_xfer_control to usb.h

Added a function to check if an endpoint is a control endpoint.
There were similar functions for bulk, interrupt, and isoc,
but not for control endpoints.

Signed-off-by: Sarah Bailey <saharabeara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB Gadget file_storage.c: remove unnecessary casts
John Daiker [Sat, 30 Dec 2006 03:02:06 +0000 (19:02 -0800)]
USB Gadget file_storage.c: remove unnecessary casts

Went looking through some usb stuff and found some unnecessary casts in
file_storage.c  This is part of the KernelJanitors TODO list.

Signed-off-by: John Daiker <daikerjohn@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Bugfix for aircable: Add module and name to usb_serial_driver
Johannes Hölzl [Sun, 17 Dec 2006 21:05:09 +0000 (22:05 +0100)]
USB: Bugfix for aircable: Add module and name to usb_serial_driver

While adding the dynamic-id support to usb serial I found a small bug in
the air cable driver:

Adds module and name information to the usb_serial_driver instance
of aircable. So the aircable driver is correctly shown under
/sys/bus/usb-serial/drivers/aircable and has the module link.

Signed-off-by: Johannes Hölzl <johannes.hoelzl@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB serial: add driver pointer to all usb-serial drivers
Johannes Hölzl [Sun, 17 Dec 2006 20:50:24 +0000 (21:50 +0100)]
USB serial: add driver pointer to all usb-serial drivers

Every usb serial driver should have a pointer to the corresponding usb driver.
So the usb serial core can add a new id not only to the usb serial driver, but
also to the usb driver.

Also the usb drivers of ark3116, mos7720 and mos7840 missed the flag
no_dynamic_id=1. This is added now.

Signed-off-by: Johannes Hölzl <johannes.hoelzl@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB serial: add dynamic id support to usb-serial core
Greg Kroah-Hartman [Sun, 17 Dec 2006 20:50:23 +0000 (21:50 +0100)]
USB serial: add dynamic id support to usb-serial core

Thanks to Johannes Hölzl <johannes.hoelzl@gmx.de> for fixing a few
things and getting it all working properly.

This adds support for dynamic usb ids to the usb serial core.  The file
"new_id" will show up under the usb serial driver, not the usb driver
associated with the usb-serial driver (yeah, it can be a bit confusing
at first glance...)

This patch also modifies the USB core to allow the usb-serial core to
reuse much of the dynamic id logic.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Johannes Hölzl <johannes.hoelzl@gmx.de>
17 years agoohci: Add support for OHCI controller on the of_platform bus
Sylvain Munaut [Wed, 13 Dec 2006 20:09:55 +0000 (21:09 +0100)]
ohci: Add support for OHCI controller on the of_platform bus

PPC embedded systems can have a ohci controller builtin. In the
new model, it will end up as a driver on the of_platform bus,
this patches takes care of them.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoohci: Rework bus glue integration to allow several at once
Sylvain Munaut [Wed, 13 Dec 2006 20:09:54 +0000 (21:09 +0100)]
ohci: Rework bus glue integration to allow several at once

The previous model had the module_init & module_exit function in the
bus glue .c files themselves. That's a problem if several glues need
to be selected at once and the driver is built has module. This case
is quite common in embedded system where you want to handle both the
integrated ohci controller and some extra controller on PCI.

The ohci-hcd.c file now provide the module_init & module_exit and
appropriate driver registering/unregistering is done conditionally,
using #ifdefs.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agorndis_host learns ActiveSync basics
Ole Andre Vadla Ravnas [Fri, 15 Dec 2006 00:01:28 +0000 (16:01 -0800)]
rndis_host learns ActiveSync basics

Windows Mobile 5 based devices described as supporting "ActiveSync":

 - Speak RNDIS but lack the CDC and union descriptors.  This patch
   updates the cdc ethernet code to fake ACM descriptors we need.

 - Require RNDIS_MSG_QUERY messages to include a buffer of the size the
   response should generate.  This patch updates the rndis host code to
   pass this will-be-ignored data.

The resulting RNDIS host code has been reported to work with several
WM5 based devices.

(Note that a fancier patch is available at synce.sf.net.)

Some bugfixes, affecting not just ActiveSync:
    (a) when cleaning up after RNDS init fails, scrub the second interface
just like cdc_ether does, so disconnect won't oops.
    (b) handle peripherals that use the pad-to-end-of-packet option; some
devices can't talk to us if that option doesn't work.
    (c) when choosing configurations, don't forget about an RNDIS config
just because the RNDIS driver is dynamically linked.

Cleanup, streamlining, bugfixes, Kconfig, and matching hub driver update.
Also for paranoia's sake, refuse to talk to something that looks like a
real modem instead of RNDIS.

Signed-off-by: Ole Andre Vadla Ravnaas <oleavr@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: ethernet gadget interop with MCCI Windows driver
David Brownell [Mon, 11 Dec 2006 23:59:04 +0000 (15:59 -0800)]
USB: ethernet gadget interop with MCCI Windows driver

It turns out that minor tweaks to the "CDC Subset" support in the Ethernet
gadget driver, just updating a config descriptor, let it be automagically
recognized by a Windows driver supported by MCCI.

This patch adds those descriptors, so systems using PXA 255 processors
(like Gumstix etc) can interop with those commercial MS-Windows drivers.
This is a Good Thing since Microsoft's RNDIS code has bugginess issues,
which are unfortunately compounded by "won't fix" issues as well as "the
published specs are incomplete and wrong" issues.  Being able to talk to
the MCCI driver gives Windows users another connectivity option.  (MCCI
also has CDC Ethernet drivers, which can help most non-PXA processors.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: remove unneeded error check
Alan Stern [Fri, 15 Dec 2006 21:04:52 +0000 (16:04 -0500)]
usbcore: remove unneeded error check

This patch (as830) removes some unnecessary error checking.  According
to the kerneldoc, schedule_work() can't fail.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: indicate active altsetting in proc/bus/usb/devices file
David Brownell [Wed, 13 Dec 2006 21:07:10 +0000 (13:07 -0800)]
USB: indicate active altsetting in proc/bus/usb/devices file

Update /proc/bus/usb/devices output to report active altsettings.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: devio.c add missing INIT_LIST_HEAD()
Dan Carpenter [Wed, 13 Dec 2006 08:03:38 +0000 (00:03 -0800)]
USB: devio.c add missing INIT_LIST_HEAD()

It should hopefully fix the list corruption bug on:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214402

Add a missing INIT_LIST_HEAD()

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: mutexification of rio500
Oliver Neukum [Fri, 15 Dec 2006 22:48:56 +0000 (23:48 +0100)]
USB: mutexification of rio500

this makes the rio500 misc usb driver use mutexes and turns uninterruptible
sleep into interruptible sleep where the semantics are not affected.

Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Remove unneeded void * casts in idmouse.c
Tobias Klauser [Wed, 20 Dec 2006 10:42:12 +0000 (11:42 +0100)]
USB: Remove unneeded void * casts in idmouse.c

The patch removes unneeded void * casts for the following (void *) pointers:
- struct file: private_data

The patch also contains some whitespace and coding style cleanups in the
relevant areas.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: define USB_CLASS_MISC in <linux/usb/ch9.h>
David Brownell [Tue, 12 Dec 2006 23:12:30 +0000 (15:12 -0800)]
USB: define USB_CLASS_MISC in <linux/usb/ch9.h>

Add USB_CLASS_MISC to <linux/usb/ch9.h>

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: <linux/usb_ch9.h> becomes <linux/usb/ch9.h>
David Brownell [Sat, 16 Dec 2006 23:34:53 +0000 (15:34 -0800)]
USB: <linux/usb_ch9.h> becomes <linux/usb/ch9.h>

This moves <linux/usb_ch9.h> to <linux/usb/ch9.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>
17 years agoUSB: Fix EHCI warning
Benjamin Herrenschmidt [Thu, 28 Dec 2006 04:27:27 +0000 (15:27 +1100)]
USB: Fix EHCI warning

This patch fixes a warning introduced by the big endian MMIO EHCI
support patch on platforms that don't have readl_be/writel_be variants
(though mostly harmless as those are called in an if (0) statement,
but gcc still warns).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
17 years agoUSB: Fix OHCI warning
Benjamin Herrenschmidt [Thu, 28 Dec 2006 04:26:59 +0000 (15:26 +1100)]
USB: Fix OHCI warning

This patch fixes a warning introduces by the split endian OHCI support
patch on platforms that don't have readl_be/writel_be variants (though
mostly harmless as those are called in an if (0) statement, but gcc
still warns).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Implement support for EHCI with big endian MMIO
Benjamin Herrenschmidt [Thu, 14 Dec 2006 19:54:08 +0000 (06:54 +1100)]
USB: Implement support for EHCI with big endian MMIO

This patch implements supports for EHCI controllers whose MMIO
registers are big endian and enables that functionality for
the Toshiba SCC chip. It does _not_ add support for big endian
in-memory data structures as this is not needed for that chip
and I hope it will never be.

The guts of the patch are to convert readl(...) to
ehci_readl(ehci, ...) and similarly for register writes.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Implement support for "split" endian OHCI
Benjamin Herrenschmidt [Thu, 14 Dec 2006 19:54:03 +0000 (06:54 +1100)]
USB: Implement support for "split" endian OHCI

This patch separates support for big endian MMIO register access
and big endian descriptors in order to support the Toshiba SCC
implementation which has big endian registers but little endian
in-memory descriptors.

It simplifies the access functions a bit in ohci.h while at it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Rework the OHCI quirk mecanism as suggested by David
Benjamin Herrenschmidt [Thu, 14 Dec 2006 19:53:55 +0000 (06:53 +1100)]
USB: Rework the OHCI quirk mecanism as suggested by David

This patch applies David Brownell's suggestion for reworking the
OHCI quirk mechanism via a table of PCI IDs. It adapts the existing
quirks to use that mechanism.

This also moves the quirks to reset() as suggested by the comment
in there. This is necessary as we need to have the endian properly
set before we try to init the controller.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: convert usb class devices to real devices
Greg Kroah-Hartman [Tue, 20 Jun 2006 20:09:50 +0000 (13:09 -0700)]
USB: convert usb class devices to real devices

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: move usb_device_class class devices to be real devices
Greg Kroah-Hartman [Tue, 20 Jun 2006 06:59:31 +0000 (23:59 -0700)]
USB: move usb_device_class class devices to be real devices

This moves the usb class devices that control the usbfs nodes to show up
in the proper place in the larger device tree.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: add EPIC support to the io_edgeport driver
Greg Kroah-Hartman [Thu, 18 Jan 2007 08:20:19 +0000 (00:20 -0800)]
USB: add EPIC support to the io_edgeport driver

This patch adds EPiC support to the io_edgeport driver which adds
support for a number of NCR printers:
- NCR (Axiohm) 7401-K580 printer
- NCR (TEC) 7401-K590 printer, 7402-K592
- NCR (TEC) 7167, 7168 printers
- NCR (TEC) 7197, 7198, F306, F307, F309 printers
- NCR (Axiohm) 7194 printer
- NCR (Axiohm) 7158 printer
and a few more.

It is based on the 2.6.19 kernel.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
17 years agoUSB: unusual_devs.h for Sony floppy
Luiz Fernando N. Capitulino [Wed, 24 Jan 2007 18:19:37 +0000 (16:19 -0200)]
USB: unusual_devs.h for Sony floppy

This patch increases the range for 0x054c:0x002c devices to make
the following Sony USB floppy to work:

T:  Bus=02 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#=  6 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=054c ProdID=002c Rev=20.00
S:  Manufacturer=SONY
S:  Product=USB Floppy
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=04 Prot=00 Driver=usb-storage
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=   2 Ivl=127ms

Signed-off-by: Marcelo Ricardo Leitner <mrl@mandriva.com>
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Wed, 7 Feb 2007 23:36:08 +0000 (15:36 -0800)]
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (140 commits)
  ACPICA: reduce table header messages to fit within 80 columns
  asus-laptop: merge with ACPICA table update
  ACPI: bay: Convert ACPI Bay driver to be compatible with sysfs update.
  ACPI: bay: new driver is EXPERIMENTAL
  ACPI: bay: make drive_bays static
  ACPI: bay: make bay a platform driver
  ACPI: bay: remove prototype procfs code
  ACPI: bay: delete unused variable
  ACPI: bay: new driver adding removable drive bay support
  ACPI: dock: check if parent is on dock
  ACPICA: fix gcc build warnings
  Altix: Add ACPI SSDT PCI device support (hotplug)
  Altix: ACPI SSDT PCI device support
  ACPICA: reduce conflicts with Altix patch series
  ACPI_NUMA: fix HP IA64 simulator issue with extended memory domain
  ACPI: fix HP RX2600 IA64 boot
  ACPI: build fix for IBM x440 - CONFIG_X86_SUMMIT
  ACPICA: Update version to 20070126
  ACPICA: Fix for incorrect parameter passed to AcpiTbDeleteTable during table load.
  ACPICA: Update copyright to 2007.
  ...

17 years ago[PATCH] kbuild, Kbuild.include: avoid using spaces in call arguments
Oleg Verych [Wed, 7 Feb 2007 22:04:35 +0000 (23:04 +0100)]
[PATCH] kbuild, Kbuild.include: avoid using spaces in call arguments

Do not use whitespace in arguments of functions in makefiles, as they
propagate further without notice.  Thus we get

  + echo ' y'

  instead of

  + echo y

Fix misleading comments.

Signed-off-by: Oleg Verych <olecom@flower.upol.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoconfigfs: Zero terminate data in configfs attribute writes.
Joel Becker [Wed, 24 Jan 2007 01:00:45 +0000 (17:00 -0800)]
configfs: Zero terminate data in configfs attribute writes.

Attributes in configfs are text files.  As such, most handlers expect to be
able to call functions like simple_strtoul() without checking the bounds
of the buffer.  Change the call to zero terminate the buffer before calling
the client's ->store() method.  This does reduce the attribute size from
PAGE_SIZE to PAGE_SIZE-1.

Also, change get_zeroed_page() to alloc_page(), as we are handling the
termination.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years ago[PATCH] ocfs2 heartbeat: clean up bio submission code
Philipp Reisner [Thu, 11 Jan 2007 09:58:10 +0000 (10:58 +0100)]
[PATCH] ocfs2 heartbeat: clean up bio submission code

As was already pointed out Mathieu Avila on Thu, 07 Sep 2006 03:15:25 -0700
that OCFS2 is expecting bio_add_page() to add pages to BIOs in an easily
predictable manner.

That is not true, especially for devices with own merge_bvec_fn().

Therefore OCFS2's heartbeat code is very likely to fail on such devices.

Move the bio_put() call into the bio's bi_end_io() function. This makes the
whole idea of trying to predict the behaviour of bio_add_page() unnecessary.
Removed compute_max_sectors() and o2hb_compute_request_limits().

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2: introduce sc->sc_send_lock to protect outbound outbound messages
Zhen Wei [Wed, 24 Jan 2007 01:19:59 +0000 (17:19 -0800)]
ocfs2: introduce sc->sc_send_lock to protect outbound outbound messages

When there is a lot of multithreaded I/O usage, two threads can collide
while sending out a message to the other nodes. This is due to the lack of
locking between threads while sending out the messages.

When a connected TCP send(), sendto(), or sendmsg() arrives in the Linux
kernel, it eventually comes through tcp_sendmsg(). tcp_sendmsg() protects
itself by acquiring a lock at invocation by calling lock_sock().
tcp_sendmsg() then loops over the buffers in the iovec, allocating
associated sk_buff's and cache pages for use in the actual send. As it does
so, it pushes the data out to tcp for actual transmission. However, if one
of those allocation fails (because a large number of large sends is being
processed, for example), it must wait for memory to become available. It
does so by jumping to wait_for_sndbuf or wait_for_memory, both of which
eventually cause a call to sk_stream_wait_memory(). sk_stream_wait_memory()
contains a code path that calls sk_wait_event(). Finally, sk_wait_event()
contains the call to release_sock().

The following patch adds a lock to the socket container in order to
properly serialize outbound requests.

From: Zhen Wei <zwei@novell.com>
Acked-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years ago[PATCH] ocfs2: drop INET from Kconfig, not needed
Randy Dunlap [Thu, 25 Jan 2007 22:51:50 +0000 (14:51 -0800)]
[PATCH] ocfs2: drop INET from Kconfig, not needed

OCFS2: drop 'depends on INET' since local mounts are now allowed.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Add timeout to dlm join domain
Sunil Mushran [Mon, 29 Jan 2007 23:44:27 +0000 (15:44 -0800)]
ocfs2_dlm: Add timeout to dlm join domain

Currently the ocfs2 dlm has no timeout during dlm join domain. While this is
not a problem in normal operation, this does become an issue if, say, the
other node is refusing to let the node join the domain because of a stuck
recovery. This patch adds a 90 sec timeout.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Silence some messages during join domain
Sunil Mushran [Mon, 29 Jan 2007 23:37:02 +0000 (15:37 -0800)]
ocfs2_dlm: Silence some messages during join domain

These messages can easily be activated using the mlog infrastructure
and don't need to be enabled by default.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: disallow a domain join if node maps mismatch
Srinivas Eeda [Mon, 29 Jan 2007 23:31:35 +0000 (15:31 -0800)]
ocfs2_dlm: disallow a domain join if node maps mismatch

There is a small window where a joining node may not see the node(s) that
just died but are still part of the domain. To fix this, we must disallow
join requests if the joining node has a different node map.

A new field node_map is added to dlm_query_join_request to send the current
nodes nodemap along with join request. On the receiving end the nodes that
are part of the cluster verifies if this new node sees all the nodes that
are still part of the cluster. They disallow the join if the maps mismatch.

Signed-off-by: Srinivas Eeda <srinivas.eeda@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Ensure correct ordering of set/clear refmap bit on lockres
Sunil Mushran [Mon, 29 Jan 2007 23:19:16 +0000 (15:19 -0800)]
ocfs2_dlm: Ensure correct ordering of set/clear refmap bit on lockres

Eventhough the set refmap bit message is sent before the clear refmap
message, currently there is no guarentee that the set message will be
handled before the clear. This patch prevents the clear refmap to be
processed while the node is sending assert master messages to other
nodes. (The set refmap message is sent as a response to the assert
master request).

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2: Binds listener to the configured ip address
Sunil Mushran [Mon, 29 Jan 2007 22:57:14 +0000 (14:57 -0800)]
ocfs2: Binds listener to the configured ip address

This patch binds the o2net listener to the configured ip address
instead of INADDR_ANY for security. Fixes oss.oracle.com bugzilla#814.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Calling post handler function in assert master handler
Kurt Hackel [Thu, 18 Jan 2007 01:05:53 +0000 (17:05 -0800)]
ocfs2_dlm: Calling post handler function in assert master handler

This patch prevents the dlm from sending the clear refmap message
before the set refmap. We use the newly created post function handler
routine to accomplish the task.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2: Added post handler callable function in o2net message handler
Kurt Hackel [Thu, 18 Jan 2007 01:04:25 +0000 (17:04 -0800)]
ocfs2: Added post handler callable function in o2net message handler

Currently o2net allows one handler function per message type. This
patch adds the ability to call another function to be called after
the handler has returned the message to the other node.

Handlers are now given the option of returning a context (in the form of a
void **) which will be passed back into the post message handler function.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Cookies in locks not being printed correctly in error messages
Kurt Hackel [Wed, 17 Jan 2007 23:11:36 +0000 (15:11 -0800)]
ocfs2_dlm: Cookies in locks not being printed correctly in error messages

The dlm encodes the node number and a sequence number in the lock cookie.
It also stores the cookie in the lockres in the big endian format to avoid
swapping 8 bytes on each lock request. The bug here was that it was assuming
the cookie to be in the cpu format when decoding it for printing the error
message. This patch swaps the bytes before the print.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Silence a failed convert
Kurt Hackel [Wed, 17 Jan 2007 23:01:45 +0000 (15:01 -0800)]
ocfs2_dlm: Silence a failed convert

When the lockres is in migrate or recovery state, all convert requests
are denied with the appropriate error status that is handled on the
requester node. This patch silences the erroneous error message printed
on the master node.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: wake up sleepers on the lockres waitqueue
Kurt Hackel [Wed, 17 Jan 2007 22:59:12 +0000 (14:59 -0800)]
ocfs2_dlm: wake up sleepers on the lockres waitqueue

The dlm was not waking up threads waiting on the lockres wait queue,
waiting for the lockres to be no longer be in the DLM_LOCK_RES_IN_PROGRESS
and the DLM_LOCK_RES_MIGRATING states.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Dlm dispatch was stopping too early
Kurt Hackel [Wed, 17 Jan 2007 22:57:50 +0000 (14:57 -0800)]
ocfs2_dlm: Dlm dispatch was stopping too early

dlm_dispatch_work was not processing the queued up tasks at
the first sign of the node leaving the domain leading to not
only incompleted tasks but also a mismatch in the dlm refcnt.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Drop inflight refmap even if no locks found on the lockres
Kurt Hackel [Wed, 17 Jan 2007 22:54:39 +0000 (14:54 -0800)]
ocfs2_dlm: Drop inflight refmap even if no locks found on the lockres

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Flush dlm workqueue before starting to migrate
Kurt Hackel [Wed, 17 Jan 2007 22:53:37 +0000 (14:53 -0800)]
ocfs2_dlm: Flush dlm workqueue before starting to migrate

This is to prevent the condition in which a previously queued
up assert master asserts after we start the migration. Now
migration ensures the workqueue is flushed before proceeding
with migrating the lock to another node. This condition is
typically encountered during parallel umounts.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Fix migrate lockres handler queue scanning
Kurt Hackel [Fri, 5 Jan 2007 23:04:49 +0000 (15:04 -0800)]
ocfs2_dlm: Fix migrate lockres handler queue scanning

The migrate lockres handler was only searching for its lock on
migrated lockres on the expected queue. This could be problematic
as the new master could have also issued a convert request
during the migration and thus moved the lock to the convert queue.
We now search for the lock on all three queues.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <Sunil.Mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Make dlmunlock() wait for migration to complete
Kurt Hackel [Fri, 5 Jan 2007 23:02:30 +0000 (15:02 -0800)]
ocfs2_dlm: Make dlmunlock() wait for migration to complete

dlmunlock() was not waiting for migration to complete before releasing locks
on locally mastered locks.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <Sunil.Mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: Fixes race between migrate and dirty
Kurt Hackel [Fri, 5 Jan 2007 23:00:17 +0000 (15:00 -0800)]
ocfs2_dlm: Fixes race between migrate and dirty

dlmthread was removing lockres' from the dirty list
and resetting the dirty flag before shuffling the list.
This patch retains the dirty state flag until the lists
are shuffled.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <Sunil.Mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years ago[PATCH] fs/ocfs2/dlm/: make functions static
Adrian Bunk [Wed, 13 Dec 2006 23:17:32 +0000 (00:17 +0100)]
[PATCH] fs/ocfs2/dlm/: make functions static

This patch makes some needlessly global functions static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2_dlm: fix cluster-wide refcounting of lock resources
Kurt Hackel [Fri, 1 Dec 2006 22:47:20 +0000 (14:47 -0800)]
ocfs2_dlm: fix cluster-wide refcounting of lock resources

This was previously broken and migration of some locks had to be temporarily
disabled. We use a new (and backward-incompatible) set of network messages
to account for all references to a lock resources held across the cluster.
once these are all freed, the master node may then free the lock resource
memory once its local references are dropped.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agosysfs: Shadow directory support
Eric W. Biederman [Wed, 24 Jan 2007 19:35:52 +0000 (12:35 -0700)]
sysfs: Shadow directory support

The problem.  When implementing a network namespace I need to be able
to have multiple network devices with the same name.  Currently this
is a problem for /sys/class/net/*.

What I want is a separate /sys/class/net directory in sysfs for each
network namespace, and I want to name each of them /sys/class/net.

I looked and the VFS actually allows that.  All that is needed is
for /sys/class/net to implement a follow link method to redirect
lookups to the real directory you want.

Implementing a follow link method that is sensitive to the current
network namespace turns out to be 3 lines of code so it looks like a
clean approach.  Modifying sysfs so it doesn't get in my was is a bit
trickier.

I am calling the concept of multiple directories all at the same path
in the filesystem shadow directories.  With the directory entry really
at that location the shadow master.

The following patch modifies sysfs so it can handle a directory
structure slightly different from the kobject tree so I can implement
the shadow directories for handling /sys/class/net/.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDriver Core: Increase the default timeout value of the firmware subsystem
Dave Jones [Thu, 25 Jan 2007 20:56:15 +0000 (15:56 -0500)]
Driver Core: Increase the default timeout value of the firmware subsystem

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=174589

The ipw driver sometimes takes a long time to load its firmware.
Whilst the ipw driver should be using the async interface of
the firmware loader to make this a non-issue, this is a minimal fix.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDriver core: allow to delay the uevent at device creation time
Kay Sievers [Sat, 7 Oct 2006 19:54:55 +0000 (21:54 +0200)]
Driver core: allow to delay the uevent at device creation time

For the block subsystem, we want to delay all uevents until the
disk has been scanned and allpartitons are already created before
the first event is sent out.

Signed-off-by: Kay Sievers <kay.sievers@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDriver core: add device_type to struct device
Kay Sievers [Sat, 7 Oct 2006 19:54:55 +0000 (21:54 +0200)]
Driver core: add device_type to struct device

This allows us to add type specific attributes, uevent vars and
release funtions.

A subsystem can carry different types of devices like the "block"
subsys has disks and partitions. Both types create a different set
of attributes, but belong to the same subsystem.

This corresponds to the low level objects:
  kobject   -> device       (object/device data)
  kobj_type -> device_type  (type of object/device we are embedded in)
  kset      -> class/bus    (list of objects/devices of a subsystem)

Signed-off-by: Kay Sievers <kay.sievers@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDriver core: add uevent vars for devices of a class
Kay Sievers [Sat, 7 Oct 2006 19:54:55 +0000 (21:54 +0200)]
Driver core: add uevent vars for devices of a class

Devices converted from class_device to device should have
the same uevent keys as the original class_device had. We
search up the parents until we find the first bus device and
add the (already deprecated) PHYDEV* values.

Signed-off-by: Kay Sievers <kay.sievers@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoSYSFS: Fix missing include of list.h in sysfs.h
Frank Haverkamp [Wed, 17 Jan 2007 16:51:18 +0000 (17:51 +0100)]
SYSFS: Fix missing include of list.h in sysfs.h

Sysfs.h uses definitions (e.g. struct list_head s_sibling) from list.h
but does not include it.

Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoHOWTO: Add a reference to Harbison and Steele
Robert P. J. Day [Wed, 17 Jan 2007 09:54:07 +0000 (04:54 -0500)]
HOWTO: Add a reference to Harbison and Steele

Add a reference to Harbison and Steele's C book.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agosysfs: error handling in sysfs, fill_read_buffer()
Oliver Neukum [Tue, 2 Jan 2007 07:48:08 +0000 (08:48 +0100)]
sysfs: error handling in sysfs, fill_read_buffer()

if a driver returns an error in fill_read_buffer(), the buffer will be
marked as filled. Subsequent reads will return eof. But there is
no data because of an error, not because it has been read.
Not marking the buffer filled is the obvious fix.

Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agokobject: kobject_put cleanup
Mariusz Kozlowski [Tue, 2 Jan 2007 12:44:44 +0000 (13:44 +0100)]
kobject: kobject_put cleanup

This patch removes redundant argument checks for kobject_put().

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agosysfs: kobject_put cleanup
Mariusz Kozlowski [Tue, 2 Jan 2007 12:41:10 +0000 (13:41 +0100)]
sysfs: kobject_put cleanup

This patch removes redundant argument checks for kobject_put().

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agosysfs: suppress lockdep warnings
Frederik Deweerdt [Fri, 5 Jan 2007 20:04:33 +0000 (12:04 -0800)]
sysfs: suppress lockdep warnings

Lockdep issues the following warning:
[    9.064000] =============================================
[    9.064000] [ INFO: possible recursive locking detected ]
[    9.064000] 2.6.20-rc3-mm1 #3
[    9.064000] ---------------------------------------------
[    9.064000] init/1 is trying to acquire lock:
[    9.064000]  (&sysfs_inode_imutex_key){--..}, at: [<c03e6afc>] mutex_lock+0x1c/0x1f
[    9.064000]
[    9.064000] but task is already holding lock:
[    9.064000]  (&sysfs_inode_imutex_key){--..}, at: [<c03e6afc>] mutex_lock+0x1c/0x1f
[    9.065000]
[    9.065000] other info that might help us debug this:
[    9.065000] 2 locks held by init/1:
[    9.065000]  #0:  (tty_mutex){--..}, at: [<c03e6afc>] mutex_lock+0x1c/0x1f
[    9.065000]  #1:  (&sysfs_inode_imutex_key){--..}, at: [<c03e6afc>] mutex_lock+0x1c/0x1f
[    9.065000]
[    9.065000] stack backtrace:
[    9.065000]  [<c010390d>] show_trace_log_lvl+0x1a/0x30
[    9.066000]  [<c0103935>] show_trace+0x12/0x14
[    9.066000]  [<c0103a2f>] dump_stack+0x16/0x18
[    9.066000]  [<c0138cb8>] print_deadlock_bug+0xb9/0xc3
[    9.066000]  [<c0138d17>] check_deadlock+0x55/0x5a
[    9.066000]  [<c013a953>] __lock_acquire+0x371/0xbf0
[    9.066000]  [<c013b7a9>] lock_acquire+0x69/0x83
[    9.066000]  [<c03e6b7e>] __mutex_lock_slowpath+0x75/0x2d1
[    9.066000]  [<c03e6afc>] mutex_lock+0x1c/0x1f
[    9.066000]  [<c01b249c>] sysfs_drop_dentry+0xb1/0x133
[    9.066000]  [<c01b25d1>] sysfs_hash_and_remove+0xb3/0x142
[    9.066000]  [<c01b30ed>] sysfs_remove_file+0xd/0x10
[    9.067000]  [<c02849e0>] device_remove_file+0x23/0x2e
[    9.067000]  [<c02850b2>] device_del+0x188/0x1e6
[    9.067000]  [<c028511b>] device_unregister+0xb/0x15
[    9.067000]  [<c0285318>] device_destroy+0x9c/0xa9
[    9.067000]  [<c0261431>] vcs_remove_sysfs+0x1c/0x3b
[    9.067000]  [<c0267a08>] con_close+0x5e/0x6b
[    9.067000]  [<c02598f2>] release_dev+0x4c4/0x6e5
[    9.067000]  [<c0259faa>] tty_release+0x12/0x1c
[    9.067000]  [<c0174872>] __fput+0x177/0x1a0
[    9.067000]  [<c01746f5>] fput+0x3b/0x41
[    9.068000]  [<c0172ee1>] filp_close+0x36/0x65
[    9.068000]  [<c0172f73>] sys_close+0x63/0xa4
[    9.068000]  [<c0102a96>] sysenter_past_esp+0x5f/0x99
[    9.068000]  =======================

This is due to sysfs_hash_and_remove() holding dir->d_inode->i_mutex
before calling sysfs_drop_dentry() which calls orphan_all_buffers()
which in turn takes node->i_mutex.

Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDriver core: fix race in sysfs between sysfs_remove_file() and read()/write()
Oliver Neukum [Wed, 20 Dec 2006 09:52:44 +0000 (10:52 +0100)]
Driver core: fix race in sysfs between sysfs_remove_file() and read()/write()

This patch prevents a race between IO and removing a file from sysfs.
It introduces a list of sysfs_buffers associated with a file at the inode.
Upon removal of a file the list is walked and the buffers marked orphaned.
IO to orphaned buffers fails with -ENODEV. The driver can safely free
associated data structures or be unloaded.

Signed-off-by: Oliver Neukum <oliver@neukum.name>
Acked-by: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agodriver core: Change function call order in device_bind_driver().
Cornelia Huck [Mon, 27 Nov 2006 09:35:12 +0000 (10:35 +0100)]
driver core: Change function call order in device_bind_driver().

Change function call order in device_bind_driver().

If we create symlinks (which might fail) before adding the device to the list
we don't have to clean up afterwards (which we didn't).

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agodriver core: Don't stop probing on ->probe errors.
Cornelia Huck [Mon, 27 Nov 2006 09:35:10 +0000 (10:35 +0100)]
driver core: Don't stop probing on ->probe errors.

Don't stop on the first ->probe error that is not -ENODEV/-ENXIO.

There might be a driver registered returning an unresonable return code, and
this stops probing completely even though it may make sense to try the next
possible driver. At worst, we may end up with an unbound device.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agodriver core fixes: device_register() retval check in platform.c
Cornelia Huck [Mon, 27 Nov 2006 09:35:08 +0000 (10:35 +0100)]
driver core fixes: device_register() retval check in platform.c

Check the return value of device_register() in platform_bus_init().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agodriver core fixes: make_class_name() retval checks
Cornelia Huck [Mon, 27 Nov 2006 09:35:05 +0000 (10:35 +0100)]
driver core fixes: make_class_name() retval checks

Make make_class_name() return NULL on error and fixup callers in the
driver core.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>