]> git.karo-electronics.de Git - mv-sheeva.git/log
mv-sheeva.git
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.kernel.org/pub/scm/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 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>
17 years ago/sys/modules/*/holders
Kay Sievers [Thu, 18 Jan 2007 12:26:15 +0000 (13:26 +0100)]
/sys/modules/*/holders

  /sys/module/usbcore/
  |-- drivers
  |   |-- usb:hub -> ../../../subsystem/usb/drivers/hub
  |   |-- usb:usb -> ../../../subsystem/usb/drivers/usb
  |   `-- usb:usbfs -> ../../../subsystem/usb/drivers/usbfs
  |-- holders
  |   |-- ehci_hcd -> ../../../module/ehci_hcd
  |   |-- uhci_hcd -> ../../../module/uhci_hcd
  |   |-- usb_storage -> ../../../module/usb_storage
  |   `-- usbhid -> ../../../module/usbhid
  |-- initstate

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: add the sysfs driver name to all modules
Greg Kroah-Hartman [Mon, 15 Jan 2007 19:50:02 +0000 (11:50 -0800)]
USB: add the sysfs driver name to all modules

This adds the module name to all USB drivers, if they are built into the
kernel or not.  It will show up in /sys/modules/MODULE_NAME/drivers/

Cc: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoSERIO: add the sysfs driver name to all modules
Greg Kroah-Hartman [Mon, 15 Jan 2007 19:50:02 +0000 (11:50 -0800)]
SERIO: add the sysfs driver name to all modules

This adds the module name to all SERIO drivers, if they are built into
the kernel or not.  It will show up in /sys/modules/MODULE_NAME/drivers/

Cc: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: add the sysfs driver name to all modules
Greg Kroah-Hartman [Mon, 15 Jan 2007 19:50:02 +0000 (11:50 -0800)]
PCI: add the sysfs driver name to all modules

This adds the module name to all PCI drivers, if they are built into the
kernel or not.  It will show up in /sys/modules/MODULE_NAME/drivers/

It also fixes up the IDE core, which was calling __pci_register_driver()
directly.

Cc: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoModules: only add drivers/ direcory if needed
Greg Kroah-Hartman [Mon, 15 Jan 2007 19:50:02 +0000 (11:50 -0800)]
Modules: only add drivers/ direcory if needed

This changes the module core to only create the drivers/ directory if we
are going to put something in it.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMODULES: add the module name for built in kernel drivers
Kay Sievers [Mon, 15 Jan 2007 19:22:02 +0000 (20:22 +0100)]
MODULES: add the module name for built in kernel drivers

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agodriver core: Allow device_move(dev, NULL).
Cornelia Huck [Mon, 8 Jan 2007 19:16:44 +0000 (20:16 +0100)]
driver core: Allow device_move(dev, NULL).

If we allow NULL as the new parent in device_move(), we need to make sure
that the device is placed into the same place as it would if it was
newly registered:

- Consider the device virtual tree. In order to be able to reuse code,
  setup_parent() has been tweaked a bit.
- kobject_move() can fall back to the kset's kobject.
- sysfs_move_dir() uses the sysfs root dir as fallback.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agodriver core: Remove device_is_registered() in device_move().
Cornelia Huck [Mon, 8 Jan 2007 19:16:41 +0000 (20:16 +0100)]
driver core: Remove device_is_registered() in device_move().

device_is_registered() will always be false for a device with no bus. Remove
this check and trust the caller to know what they're doing.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoNetwork: convert network devices to use struct device instead of class_device
Greg Kroah-Hartman [Tue, 9 Apr 2002 19:14:34 +0000 (12:14 -0700)]
Network: convert network devices to use struct device instead of class_device

This lets the network core have the ability to handle suspend/resume
issues, if it wants to.

Thanks to Frederik Deweerdt <frederik.deweerdt@gmail.com> for the arm
driver fixes.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDriver core: convert SPI code to use struct device
Greg Kroah-Hartman [Mon, 22 Jan 2007 21:45:38 +0000 (13:45 -0800)]
Driver core: convert SPI code to use struct device

Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Cc: <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDriver core: convert pcmcia code to use struct device
Greg Kroah-Hartman [Tue, 12 Sep 2006 15:00:10 +0000 (17:00 +0200)]
Driver core: convert pcmcia code to use struct device

Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Cc: <linux-pcmcia@lists.infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoKobject: make kobject apis more robust in handling NULL pointers
Greg Kroah-Hartman [Thu, 18 Jan 2007 20:23:51 +0000 (12:23 -0800)]
Kobject: make kobject apis more robust in handling NULL pointers

It should be ok to pass in NULL for some kobject functions, so add error
checking for all exported kobject functions to be more robust.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoide-acpi support warning fix
Andrew Morton [Wed, 7 Feb 2007 17:19:42 +0000 (18:19 +0100)]
ide-acpi support warning fix

drivers/ide/ide-acpi.c: In function 'ide_acpi_get_timing':
drivers/ide/ide-acpi.c:537: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'long unsigned int'

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoACPI support for IDE devices
Hannes Reinecke [Wed, 7 Feb 2007 17:19:37 +0000 (18:19 +0100)]
ACPI support for IDE devices

This patch implements ACPI integration for generic IDE devices.
The ACPI spec mandates that some methods are called during suspend and
resume. And consequently there most modern Laptops cannot resume
properly without it.

According to the spec, we should call '_GTM' (Get Timing) upon suspend
to store the current IDE adapter settings.
Upon resume we should call '_STM' (Set Timing) to initialize the
adapter with the stored settings; afterwards '_GTF' (Get Taskfile)
should be called which returns a buffer with some IDE initialisation
commands. Those commands should be passed to the drive.

There are two module params which control the behaviour of this patch:

'ide=noacpi'
Do not call any ACPI methods (Disables any ACPI method calls)
'ide=acpigtf'
Enable execution of _GTF methods upon resume.
Has no effect if 'ide=noacpi' is set.
'ide=acpionboot'
Enable execution of ACPI methods during boot.
This might be required on some machines if 'ide=acpigtf' is
selected as some machines modify the _GTF information
depending on the drive identification passed down with _STM.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoIDE Driver for Delkin/Lexar/etc.. cardbus CF adapter
Mark Lord [Wed, 7 Feb 2007 17:19:32 +0000 (18:19 +0100)]
IDE Driver for Delkin/Lexar/etc.. cardbus CF adapter

On Thursday 11 January 2007 23:17, Bartlomiej Zolnierkiewicz wrote:
>
> My working IDE tree (against Linus' tree) now resides here:
>
>  http://kernel.org/pub/linux/kernel/people/bart/pata-2.6/patches/

Bart, here's a driver I've been keeping out-of-tree for the past couple
of years.  This is for the Delking/Lexar/ASKA/etc.. 32-bit cardbus IDE
CompactFlash adapter card.

It's probably way out of sync with the latest driver model (??), but it
still builds/works.  I'm not interested in doing much of a rewrite, other
than for libata someday, as I no longer use the card myself.

But lots of other people do seem to use it, so it might be nice to see it
"in-tree".

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: it8213 IDE driver update (version 2)
Bartlomiej Zolnierkiewicz [Wed, 7 Feb 2007 17:19:26 +0000 (18:19 +0100)]
ide: it8213 IDE driver update (version 2)

* set ATAPI/IORDY/TIME bits correctly in it8213_tuneproc()
* fix UDMA/MWDMA/SWDMA masks in it8213_init_hwif()
* in it8213_tune_chipset() SWDMA2 mode should be used instead of MWDMA0
* backport various fixes from piix/slc90e66 drivers:
  - in it8213_tuneproc() the highest possible PIO mode is PIO4 (not PIO5)
  - clear ATAPI/IORDY/TIME bits before setting them also for slave device
  - use ->speedproc in it8213_config_drive_for_dma()
  - don't try to tune PIO in config_chipset_for_pio()
  - simplify is_slave calculation in it8213_tuneproc()
  - misc cleanups
* fix it8213_ratemask() and it8213_tuneproc() comments
* simplify it8213_init_hwif()
* remove init_chipset_it8213()
* add missing Copyrights and update MODULE_AUTHOR()
* CodingStyle cleanups
* remove dead code

v2:
* PCI_DEVICE_ID_ITE_8213 is only defined in -mm kernels,
  so just use PCI Device ID (0x8213) directly
* fix ->ultra_mask incorrectly changed to 0x3f in v1 version of the patch

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: add it8213 IDE driver
Jack Lee [Wed, 7 Feb 2007 17:19:09 +0000 (18:19 +0100)]
ide: add it8213 IDE driver

From: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agotc86c001: add missing __init tag for tc86c001_ide_init()
Bartlomiej Zolnierkiewicz [Wed, 7 Feb 2007 17:19:09 +0000 (18:19 +0100)]
tc86c001: add missing __init tag for tc86c001_ide_init()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agotc86c001: mark init_chipset_tc86c001() with __devinit tag
Andrew Morton [Wed, 7 Feb 2007 17:19:01 +0000 (18:19 +0100)]
tc86c001: mark init_chipset_tc86c001() with __devinit tag

Signed-off-by: Andrew Morton <akpm@osdl.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agotc86c001: init_hwif_tc86c001() can be static
Adrian Bunk [Wed, 7 Feb 2007 17:18:52 +0000 (18:18 +0100)]
tc86c001: init_hwif_tc86c001() can be static

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: add Toshiba TC86C001 IDE driver (take 2)
Sergei Shtylyov [Wed, 7 Feb 2007 17:18:45 +0000 (18:18 +0100)]
ide: add Toshiba TC86C001 IDE driver (take 2)

This is the driver for the Toshiba TC86C001 GOKU-S PCI IDE controller,
completely reworked from the original brain-damaged Toshiba's 2.4 version.

This single channel UltraDMA/66 controller is very simple in programming,
yet Toshiba managed to plant many interesting bugs in it.  The particularly
nasty "limitation 5" (as they call the errata) caused me to abuse the IDE
core in a possibly most interesting way so far.  However, this is still
better than the #ifdef mess in drivers/ide/ide-io.c that the original
version included (well, it had much more mess)...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Alan Cox <alan@redhat.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agopdc202xx_new: remove check_in_drive_lists abomination
Sergei Shtylyov [Wed, 7 Feb 2007 17:18:39 +0000 (18:18 +0100)]
pdc202xx_new: remove check_in_drive_lists abomination

Fold check_in_drive_lists() into quirkproc() handler in both PDC202xx
drivers-- this function was never called with a list other than
pdc_quirk_drives and was a bad example of code overall...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agopdc202xx_new: remove useless code
Sergei Shtylyov [Wed, 7 Feb 2007 17:18:37 +0000 (18:18 +0100)]
pdc202xx_new: remove useless code

Remove the following useless fragments from the driver:

- the ide_dma_lostirq() and ide_dma_timeout() handlers which boil down to just
  printing the incoherent reset message and calling their default counterparts;

- check for non-NULL drive->id in the ide_dma_check() handler -- this is assumed
  to be true by all other handlers (also, get rid of unnecessary nesting of the
  conditional statements there);

- the comment before pdcnew_tune_drive() which has nothing to do with the code.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoslc90e66: carry over fixes from piix driver
Sergei Shtylyov [Wed, 7 Feb 2007 17:18:34 +0000 (18:18 +0100)]
slc90e66: carry over fixes from piix driver

Synchronize with version 0.46 of the Intel PIIX/ICH driver:

- carry over Alan's and my own fixes in the tuneproc() method and my cleanups
  both there and in the ratemask() method;

- SLC90E66 only supports MW DMA modes 1/2 and SW DMA mode 2 (just like Intel
  chips), so don't claim support for other MW/SW DMA modes;

- don't check dor non-NULL drive->id in the ide_dma_check() method -- this is
  assumed to be true in all other drivers;

- do some coding/formatting cleanups while at it...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agopiix: tuneproc() fixes/cleanups
Sergei Shtylyov [Wed, 7 Feb 2007 17:18:28 +0000 (18:18 +0100)]
piix: tuneproc() fixes/cleanups

Fix/cleanup the driver's tuneproc() and ratemask() methods:

- PPE, IE, and TIME bits need to be cleared beforehand for the slave drive as
  well as master (Alan probably just forgot about it);

- this driver only supports PIO modes up to 4, so must pass the correct limit
  to ide_get_best_pio_mode();

- use min_t() macro instead of min();

- simplify slave vs master drive evaluation;

- do come coding and formatting cleanups...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agopiix: fix 82371MX enablebits
Sergei Shtylyov [Wed, 7 Feb 2007 17:18:25 +0000 (18:18 +0100)]
piix: fix 82371MX enablebits

According to the datasheet, Intel 82371MX (MPIIX) actually has only a
single IDE channel mapped to the primary or secondary ports depending on
the value of the bit 14 of the IDETIM register at PCI config.  offset 0x6C
(the register at 0x6F which the driver refers to.  doesn't exist).  So,
disguise the controller as dual channel and set enablebits masks/values
such that only either primary or secondary channel is detected enabled.
Also, preclude the IDE probing code from reading PCI BARs, this controller
just doesn't have them (it's not the separate PCI function like the other
PCI controllers), it only decodes the legacy addresses.

[ Alan sayeth " MPIIX does not work with or without the change.  It needs its
  own different driver and not to use setup-pci.  Huge job and since it works
  well with libata who cares.  Ditto the early PIIX chip." ]

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agohpt366: HPT36x PCI clock detection fix
Sergei Shtylyov [Wed, 7 Feb 2007 17:18:20 +0000 (18:18 +0100)]
hpt366: HPT36x PCI clock detection fix

Fix minor coding mistake in the HPT36x PCI clock detection code noticed by
Bartlomiej Zolnierkiewicz -- it always reported 33 MHz due to the missing
'break' statements.  This, however, most probably never mattered -- in fact, I
was thinking of removing the 25/40 MHz cases completely since HPT36x BIOSes
didn't seem to set any other value than 7 into the 'cmd_high_time' field, i.e.
 supported only 33 MHz PCI.

Note that in the original driver there was another bug: 25 and 40 MHz cases
were interchanged.  Since the 'cmd_high_time' field is in units of PCI clocks,
a lower clock count just *cannot* correspond to a higher frequency, i.  e.  it
should be 5 for 25 MHz PCI and 9 for 40 MHz PCI, not the other way around.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agohpt366: init code rewrite
Sergei Shtylyov [Wed, 7 Feb 2007 17:18:16 +0000 (18:18 +0100)]
hpt366: init code rewrite

Finally, rework the driver init.  code to correctly handle all the chip
variants HighPoint has created so far.  This should cure the rest of the
timing issues in the driver (especially, on 66 MHz PCI) caused by the
HighPoint's habit of switching the base DPLL clock with every new revision
of the chips...

  - switch to using the enumeration type to differ between the numerous chip
    variants, matching PCI device/revision ID with the chip type early, at the
    init_setup stage;

  - extend the hpt_info structure to hold the DPLL and PCI clock frequencies,
    stop duplicating it for each channel by storing the pointer in the pci_dev
    structure: first, at the init_setup stage, point it to a static "template"
    with only the chip type and its specific base DPLL frequency, the highest
    supported DMA mode, and the chip settings table pointer filled, then, at
    the init_chipset stage, allocate per-chip instance  and fill it with the
    rest of the necessary information;

  - get rid of the constant thresholds in the HPT37x PCI clock detection code,
    switch  to calculating  PCI clock frequency based on the chip's base DPLL
    frequency;

  - switch to using the DPLL clock and enable UltraATA/133 mode by default on
    anything newer than HPT370/A;

  - fold PCI clock detection and DPLL setup code into init_chipset_hpt366(),
    unify the HPT36x/37x setup code and the speedproc handlers by joining the
    register setting lists into the table indexed by the clock selected;

  - add enablebits for all the chips to avoid touching disabled channels
    (though the HighPoint BIOS seem to only disable the primary one on
    HPT371/N);

  - separate the UltraDMA and MWDMA masks there to avoid changing PIO timings
    when setting an UltraDMA mode in hpt37x_tune_chipset().

This version has been tested on HPT370/302/371N.

Thanks to Alan for the inspiration. Hopefully, his libata driver will also
benefit from the work done on this "obsolete" driver...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agohpt366: clean up DMA timeout handling for HPT370
Sergei Shtylyov [Wed, 7 Feb 2007 17:18:13 +0000 (18:18 +0100)]
hpt366: clean up DMA timeout handling for HPT370

Clean up DMA timeout handling for HPT370:

- hpt370_lostirq_timeout() cleared the DMA status which made __ide_dma_end()
   called afterwards return the incorrect result, and the DMA engine was reset
   both before and after stopping DMA while the HighPoint drivers only do it
   after (which seems logical) -- fix this and also rename the function;

- get rid of the needless mutual recursion in hpt370_ide_dma_end() and
   hpt370_ide_dma_timeout();

- get rid of hpt370_lostirq_timeout() since hwif->ide_dma_end() called from
   the driver's interrupt handler later does all its work.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agohpt366: merge HPT37x speedproc handlers
Sergei Shtylyov [Wed, 7 Feb 2007 17:18:11 +0000 (18:18 +0100)]
hpt366: merge HPT37x speedproc handlers

Continue with the driver rewrite:

- move the interrupt twiddling code from the speedproc handlers into the
    init_hwif_hpt366 which allows to merge the two HPT37x speedproc handlers
    into one;

- get rid of in init_hpt366 which solely consists of the duplicate code, then
    fold init_hpt37x() into init_chipset_hpt366();

- fix hpt3xx_tune_drive() to always set the PIO mode requested, not the best
    possible one, change hpt366_config_drive_xfer_rate() accordingly, simplify
    it a bit;

- group all the DMA related code together init_hwif_hpt366(), and generally
    clean up and beautify it.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agohpt366: cache channel's MCR address
Sergei Shtylyov [Wed, 7 Feb 2007 17:18:05 +0000 (18:18 +0100)]
hpt366: cache channel's MCR address

Begin the real driver redesign. For the starters:

- cache the offset of the IDE channel's MISC. control registers which are used
   throughout the driver in hwif->select_data;

- only touch the relevant MCR when detecting the cable type on HPT374's
   function 1;

- make HPT36x's speedproc handler look the same way as HPT37x ones; fix the
   PIO timing register mask for HPT37x.

- rename all the HPT3xx register related variables consistently; clean up the
   whitespace.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agohpt366: switch to using pci_get_slot
Sergei Shtylyov [Wed, 7 Feb 2007 17:17:54 +0000 (18:17 +0100)]
hpt366: switch to using pci_get_slot

Switch to using pci_get_slot() to get to the function 1 of HPT36x/374 chips --
there's no need for the driver itself to walk the list of the PCI devices, and
it also forgets to check the bus number of the device found.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agohpt366: print the real chip name at startup
Sergei Shtylyov [Wed, 7 Feb 2007 17:17:51 +0000 (18:17 +0100)]
hpt366: print the real chip name at startup

- Rework the driver setup code so that it prefixes the driver startup
  messages with the real chip name.

- Print the measured f_CNT value and the DPLL setting for non-HPT3xx
  chips as well.

- Claim the extra 240 bytes of I/O space for all chips, not only for
  those having PCI device ID of 0x0004.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agohpt366: rework rate filtering tidy
Andrew Morton [Wed, 7 Feb 2007 17:17:37 +0000 (18:17 +0100)]
hpt366: rework rate filtering tidy

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agohpt366: rework rate filtering
Sergei Shtylyov [Wed, 7 Feb 2007 17:17:37 +0000 (18:17 +0100)]
hpt366: rework rate filtering

- Rework hpt3xx_ratemask() and hpt3xx_ratefilter() so that the former
  returns the max.  mode computed at the load time and doesn't have to do
  bad Ultra33 drive list lookups anymore; remove the duplicate code from
  the latter function.  Move the quirky drive list lookup into
  hpt3xx_quirkproc() where it should have been from the start...

- Disable UltraATA/100 for HPT370 by default as the 33 MHz ATA clock
  being used does not allow for it, and this *greatly* increases the
  transfer speed.

- Save some space by using byte-wide fields in struct hpt_info; switch to
  reading the 8-bit PCI revision ID reg.  only, not the whole 32-bit reg.

- Start incrementing the driver version number with each patch (should
  have been done from the first one posted).

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
Linus Torvalds [Wed, 7 Feb 2007 16:10:48 +0000 (08:10 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  JFS: Remove incorrect kgdb define
  JFS: call io_schedule() instead of schedule() to avoid deadlock
  JFS: Add lockdep annotations
  JFS: Avoid BUG() on a damaged file system

17 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
Linus Torvalds [Wed, 7 Feb 2007 16:09:00 +0000 (08:09 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw

* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw: (57 commits)
  [GFS2] make gfs2_writepages() static
  [GFS2] Unlock page on prepare_write try lock failure
  [GFS2] nfsd readdirplus assertion failure
  [DLM] fix softlockup in dlm_recv
  [DLM] zero new user lvbs
  [DLM/GFS2] indent help text
  [GFS2] Fix unlink deadlocks
  [GFS2] Put back semaphore to avoid umount problem
  [GFS2] more CURRENT_TIME_SEC
  [GFS2/DLM] fix GFS2 circular dependency
  [GFS2/DLM] use sysfs
  [GFS2] make lock_dlm drop_count tunable in sysfs
  [GFS2] increase default lock limit
  [GFS2] Fix list corruption in lops.c
  [GFS2] Fix recursive locking attempt with NFS
  [DLM] can miss clearing resend flag
  [DLM] saved dlm message can be dropped
  [DLM] Make sock_sem into a mutex
  [GFS2] Fix typo in glock.c
  [GFS2] use CURRENT_TIME_SEC instead of get_seconds in gfs2
  ...

17 years ago[GFS2] make gfs2_writepages() static
Adrian Bunk [Tue, 6 Feb 2007 22:12:49 +0000 (23:12 +0100)]
[GFS2] make gfs2_writepages() static

On Mon, Jan 29, 2007 at 08:45:28PM -0800, Andrew Morton wrote:
>...
> Changes since 2.6.20-rc6-mm2:
>...
>  git-gfs2-nmw.patch
>...
>  git trees
>...

This patch makes the needlessly global gfs2_writepages() static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
17 years ago[GFS2] Unlock page on prepare_write try lock failure
Steven Whitehouse [Wed, 7 Feb 2007 15:25:59 +0000 (10:25 -0500)]
[GFS2] Unlock page on prepare_write try lock failure

When the try lock of the glock failed in prepare_write we were
incorrectly exiting this function with the page still locked.
This was resulting in further I/O to this page hanging.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
17 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Wed, 7 Feb 2007 01:24:58 +0000 (17:24 -0800)]
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6: (27 commits)
  [IA64] swiotlb abstraction (e.g. for Xen)
  [IA64] swiotlb cleanup
  [IA64] make swiotlb use bus_to_virt/virt_to_bus
  [IA64] swiotlb bug fixes
  [IA64] Hook up getcpu system call for IA64
  [IA64] clean up sparsemem memory_present call
  [IA64] show_mem() for IA64 sparsemem NUMA
  [IA64] missing exports hwsw_sync_...
  [IA64] virt_to_page() can be called with NULL arg
  [IA64] alignment bug in ldscript
  [IA64] register memory ranges in a consistent manner
  [IA64] Enable SWIOTLB only when needed
  [IA64-SGI] Check for TIO errors on shub2 Altix
  [IA64] remove bogus prototype ia64_esi_init()
  [IA64] Clear IRQ affinity when unregistered
  [IA64] fix ACPI Kconfig issues
  [IA64] Fix NULL-pointer dereference in ia64_machine_kexec()
  [IA64] find thread for user rbs address
  [IA64] use snprintf() on features field of /proc/cpuinfo
  [IA64] enable singlestep on system call
  ...

17 years agoNET: turn local_save_flags() + local_irq_disable() into local_irq_save()
Jiri Kosina [Tue, 6 Feb 2007 00:29:49 +0000 (16:29 -0800)]
NET: turn local_save_flags() + local_irq_disable() into local_irq_save()

drivers/net/amd8111e.c::amd8111e_poll() contains local_irq_disable() after
local_save_flags().  Turn it into local_irq_save().

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoNET-3c59x: turn local_save_flags() + local_irq_disable() into local_irq_save()
Jiri Kosina [Tue, 6 Feb 2007 00:29:48 +0000 (16:29 -0800)]
NET-3c59x: turn local_save_flags() + local_irq_disable() into local_irq_save()

drivers/net/3c59x.c::poll_vortex() contains local_irq_disable() after
local_save_flags().  Turn it into local_irq_save().

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agohp100: convert pci_module_init() to pci_register_driver()
Richard Knutsson [Tue, 6 Feb 2007 00:29:48 +0000 (16:29 -0800)]
hp100: convert pci_module_init() to pci_register_driver()

Convert pci_module_init() to pci_register_driver().

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoNetXen: Added ethtool support for user level tools.
Amit S. Kale [Mon, 5 Feb 2007 15:40:49 +0000 (07:40 -0800)]
NetXen: Added ethtool support for user level tools.

NetXen: Added ethtool support for user level firmware management utilities.

Signed-off-by: Amit S. Kale <amitkale@netxen.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoNetXen: Firmware crb init changes.
Amit S. Kale [Mon, 5 Feb 2007 15:35:26 +0000 (07:35 -0800)]
NetXen: Firmware crb init changes.

NetXen: firmware crb init changes.

Signed-off-by: Amit S. Kale <amitkale@netxen.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agomaintainers: add atl1 maintainers
Jay Cliburn [Sun, 4 Feb 2007 02:25:10 +0000 (20:25 -0600)]
maintainers: add atl1 maintainers

MAINTAINERS: add atl1 maintainers

Add a maintainers entry for atl1.

Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoskge: version 1.10
Stephen Hemminger [Fri, 2 Feb 2007 16:22:54 +0000 (08:22 -0800)]
skge: version 1.10

Mark this as 1.10 because WOL now works

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoskge: WOL support
Stephen Hemminger [Fri, 2 Feb 2007 16:22:53 +0000 (08:22 -0800)]
skge: WOL support

Add WOL support for Yukon chipsets in skge device.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoskge: use dev_printk
Stephen Hemminger [Fri, 2 Feb 2007 16:22:52 +0000 (08:22 -0800)]
skge: use dev_printk

Use dev_printk related macros for PCI related errors and warnings

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoskge: handle zero address at open
Stephen Hemminger [Fri, 2 Feb 2007 16:22:51 +0000 (08:22 -0800)]
skge: handle zero address at open

Some motherboards are broken and have no address set. Failing at probe time
prevents the device from ever being used (like to download a fixed BIOS). Instead
warn on probe and check again when device is brought up. That way the address
can be set.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agob44 endian annotations
Al Viro [Mon, 29 Jan 2007 20:36:54 +0000 (15:36 -0500)]
b44 endian annotations

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
Linus Torvalds [Tue, 6 Feb 2007 22:59:27 +0000 (14:59 -0800)]
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
  ocfs2: ocfs2_link() journal credits update