linux-2.6
15 years agoinclude/linux/ata.h: add some more transfer masks
Erik Inge Bolsø [Sat, 14 Mar 2009 20:37:48 +0000 (21:37 +0100)] 
include/linux/ata.h: add some more transfer masks

Signed-off-by: Erik Inge Bolsø <knan-lkml@anduin.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agoahci: Blacklist HP Compaq 6720s that spins off disks during ACPI power off
Maciej Rutecki [Thu, 19 Mar 2009 23:06:46 +0000 (00:06 +0100)] 
ahci: Blacklist HP Compaq 6720s that spins off disks during ACPI power off

Blacklist HP Compaq 6720s so that it doesn't play a "spin down,
spin up, spin down" ping-pong with the hard disk during system
power off.

Signed-off-by: Maciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years ago[libata] sata_mv: Implement direct FIS transmission via mv_qc_issue_fis().
Mark Lord [Wed, 25 Feb 2009 20:19:20 +0000 (15:19 -0500)] 
[libata] sata_mv: Implement direct FIS transmission via mv_qc_issue_fis().

This is initially needed to work around NCQ errata,
whereby the READ_LOG_EXT command sometimes fails
when issued in the traditional (sff) fashion.

Portions of this code will likely be reused for
implementation of the target mode feature later on.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years ago[libata] Export ata_pio_queue_task() so that it can be used from sata_mv.
Mark Lord [Wed, 25 Feb 2009 20:18:32 +0000 (15:18 -0500)] 
[libata] Export ata_pio_queue_task() so that it can be used from sata_mv.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years ago[libata] sata_mv: Add a new mv_sff_check_status() function to sata_mv.
Mark Lord [Wed, 25 Feb 2009 20:17:43 +0000 (15:17 -0500)] 
[libata] sata_mv: Add a new mv_sff_check_status() function to sata_mv.
This is necessary for use with the upcoming "mv_qc_issue_fis()" patch,
but is being added separately here for easier code review.

When using command issue via the "mv_qc_issue_fis()" mechanism,
the initial ATA_BUSY bit does not show in the ATA status (shadow) register.
This can confuse libata!  So here we add a hook to fake ATA_BUSY
for that situation, until the first time a BUSY, DRQ, or ERR bit is seen.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years ago[libata] sata_mv: Tighten up interrupt masking in mv_qc_issue()
Mark Lord [Wed, 25 Feb 2009 20:15:39 +0000 (15:15 -0500)] 
[libata] sata_mv: Tighten up interrupt masking in mv_qc_issue()
so that it doesn't miss any protocols.  Handle future cases where a
qc is specially marked for polled issue or where a particular chip
version prefers interrupts over polling for PIO.

This mimics the polling decision logic from ata_sff_qc_issue().

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years ago[libata] sata_mv: Enable use of (basic) DMA for ATAPI on GEN_IIE chips
Mark Lord [Wed, 25 Feb 2009 20:14:48 +0000 (15:14 -0500)] 
[libata] sata_mv: Enable use of (basic) DMA for ATAPI on GEN_IIE chips

This also gets rid of any need for mv_mode_filter().

Using basic DMA on GEN_IIE requires setting an undocumented
bit in an undocumented register.  For safety, we clear that
bit again when switching back to EDMA mode.

To avoid a performance penalty when switching modes,
we cache the register in port_priv, as already done for other regs.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years ago[libata] sata_mv: cache frequently-accessed registers
Mark Lord [Wed, 25 Feb 2009 20:13:03 +0000 (15:13 -0500)] 
[libata] sata_mv: cache frequently-accessed registers

Maintain a local (mv_port_priv) cache of frequently accessed registers,
to avoid having to re-read them (very slow) on every transistion
between EDMA and non-EDMA modes.  This speeds up things like
flushing the drive write cache, and anything using basic DMA transfers.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agoahci: drop intx manipulation on msi enable
Tejun Heo [Fri, 23 Jan 2009 02:31:39 +0000 (11:31 +0900)] 
ahci: drop intx manipulation on msi enable

There's no need to turn off intx explicitly on msi enable.  This is
automatically handled by pci.  Drop it.

This might be needed on machines if the BIOS turns intx off during
boot.  However, there's no evidence of such behavior for ahci and
the only such case seems to be ICH5 PATA according to ata_piix.
Also, given the way ahci operates, it's highly unlikely BIOS ever
disables IRQ for the controller.  However, as this change has slight
possibility of introducing failure, please schedule it for #upstream.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agopata-rb532-cf: drop custom freeze and thaw
Phil Sutter [Tue, 27 Jan 2009 13:35:53 +0000 (14:35 +0100)] 
pata-rb532-cf: drop custom freeze and thaw

I'm not quite sure what freezing and thawing is used for. Tests showed
that the port is being frozen at initialisation state and thawed right
afterwards, then the functions were not called anymore. Dropping the
complete custom code for handling the frozen state seems to work at
least for a standard use case including mounting a partition, copying
some files in it (in parallel) and finally removing them and unmounting
the partition.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agopata-rb532-cf: use ata_sff_data_xfer32()
Phil Sutter [Tue, 27 Jan 2009 13:35:52 +0000 (14:35 +0100)] 
pata-rb532-cf: use ata_sff_data_xfer32()

The biggest difference between rb532_pata_data_xfer() and
ata_sff_data_xfer32() is the call to ata_sff_pause() at the end of
rb532_pata_data_xfer() which I suppose to be unnecessary since it works
without. I've also tested using ata_sff_data_xfer() as replacement, but
since we know that the driver supports 32bit IO, using the optimised
version should be safe.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agopata-rb532-cf: use ata_sff_exec_command()
Phil Sutter [Tue, 27 Jan 2009 13:35:51 +0000 (14:35 +0100)] 
pata-rb532-cf: use ata_sff_exec_command()

The only difference between rb532_pata_exec_command() and
ata_sff_exec_command() is added debugging output, so it can be dropped
and the standard op used instead.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agopata-rb532-cf: replace rb532_pata_finish_io()
Phil Sutter [Tue, 27 Jan 2009 13:35:50 +0000 (14:35 +0100)] 
pata-rb532-cf: replace rb532_pata_finish_io()

Since the delay used internally is just the same as ata_sff_pause()
uses, rb532_pata_finish_io() does exactly the same as ata_sff_pause()
and thus can be replaced by the later one.

Signed-off-by: Phil Sutter <n0-1@freewrt.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agosata_mv: remove leftovers
Mark Lord [Sat, 31 Jan 2009 02:40:48 +0000 (21:40 -0500)] 
sata_mv: remove leftovers

Remove redundant code left over from the earlier patch 04/07.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agosata_mv: optimize use of mv_edma_cfg
Mark Lord [Fri, 30 Jan 2009 23:52:58 +0000 (18:52 -0500)] 
sata_mv: optimize use of mv_edma_cfg

Try and avoid unnecessary reconfiguration of the EDMA config register
on every single non-EDMA I/O operation, by moving the call to
mv_edma_cfg() into mv_stop_edma().  It must then also be invoked
from mv_hardreset() and from mv_port_start().

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agosata_mv: introduce support for ATAPI devices
Mark Lord [Fri, 30 Jan 2009 23:51:54 +0000 (18:51 -0500)] 
sata_mv: introduce support for ATAPI devices

Add ATAPI support to sata_mv, using sff DMA for GEN_II chipsets,
and plain old PIO for GEN_IIE.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agosata_mv: mv_fill_sg fixes v2
Mark Lord [Sun, 1 Feb 2009 21:50:32 +0000 (16:50 -0500)] 
sata_mv: mv_fill_sg fixes v2

Fix mv_fill_sg() to zero out the reserved word (required for ATAPI),
and to include a memory barrier.  This may also help with problems
reported by Jens on the PPC platform.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agosata_mv: update ata_qc_from_tag
Mark Lord [Fri, 30 Jan 2009 23:49:29 +0000 (18:49 -0500)] 
sata_mv: update ata_qc_from_tag

Update the logic in ata_qc_from_tag() to match that used
in similar places elsewhere in libata.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agosata_mv: restructure mv_qc_issue
Mark Lord [Fri, 30 Jan 2009 23:48:41 +0000 (18:48 -0500)] 
sata_mv: restructure mv_qc_issue

Rearrange logic in mv_qc_issue() to handle protocols
other than ATA_PROT_DMA, ATA_PROT_NCQ, and ATA_PROT_PIO.
This is in preparation for later enabling ATAPI support.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agosata_mv: rearrange mv_start_dma() and friends
Mark Lord [Fri, 30 Jan 2009 23:47:51 +0000 (18:47 -0500)] 
sata_mv: rearrange mv_start_dma() and friends

Rearrange mv_start_dma() and friends, in preparation for adding
non-EDMA DMA modes, and non-EDMA interrupts, to the driver.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agosata_mv: cleanup chipset GENeration FLAGS
Mark Lord [Fri, 30 Jan 2009 23:46:39 +0000 (18:46 -0500)] 
sata_mv: cleanup chipset GENeration FLAGS

Clean up the chipset GENeration FLAGS, and rename them
for consistency with other uses of GEN_XX within sata_mv.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agobe2net: cleanup rx/tx rate calculations
Sathya Perla [Tue, 24 Mar 2009 23:40:13 +0000 (16:40 -0700)] 
be2net: cleanup rx/tx rate calculations

Hi, Pls accept this patch to cleanup rx/tx rate calculations as follows:
- check for jiffies wraparound
- remove typecast of a denominator
- do rate calculation only in workqueue context periodically

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
David S. Miller [Tue, 24 Mar 2009 23:38:53 +0000 (16:38 -0700)] 
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-2.6

15 years agoDynamic debug: fix pr_fmt() build error
Greg Banks [Wed, 11 Mar 2009 10:07:28 +0000 (21:07 +1100)] 
Dynamic debug: fix pr_fmt() build error

When CONFIG_DYNAMIC_DEBUG is enabled, allow callers of pr_debug()
to provide their own definition of pr_fmt() even if that definition
uses tricks like

#define pr_fmt(fmt) "%s:" fmt, __func__

Signed-off-by: Greg Banks <gnb@sgi.com>
Cc: Jason Baron <jbaron@redhat.com>
Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoDynamic debug: allow simple quoting of words
Greg Banks [Fri, 6 Feb 2009 01:54:26 +0000 (12:54 +1100)] 
Dynamic debug: allow simple quoting of words

Allow simple quoting of words in the dynamic debug control language.

This allows more natural specification when using the control language
to match against printk formats, e.g

#echo -n 'format "Setting node for non-present cpu" +p' >
/mnt/debugfs/dynamic_debug/control

instead of

#echo -n 'format Setting\040node\040for\040non-present\040cpu +p' >
/mnt/debugfs/dynamic_debug/control

Adjust the dynamic debug documention to describe that and provide a
new example.  Adjust the existing examples in the documentation to
reflect the current whitespace escaping behaviour when reading the
control file.  Fix some minor documentation trailing whitespace.

Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
Acked-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodynamic debug: update docs
Jason Baron [Thu, 5 Feb 2009 16:53:15 +0000 (11:53 -0500)] 
dynamic debug: update docs

updates the documentation for 'dynamic debug' feature.

Signed-off-by: Greg Banks <gnb@sgi.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodynamic debug: combine dprintk and dynamic printk
Jason Baron [Thu, 5 Feb 2009 16:51:38 +0000 (11:51 -0500)] 
dynamic debug: combine dprintk and dynamic printk

This patch combines Greg Bank's dprintk() work with the existing dynamic
printk patchset, we are now calling it 'dynamic debug'.

The new feature of this patchset is a richer /debugfs control file interface,
(an example output from my system is at the bottom), which allows fined grained
control over the the debug output. The output can be controlled by function,
file, module, format string, and line number.

for example, enabled all debug messages in module 'nf_conntrack':

echo -n 'module nf_conntrack +p' > /mnt/debugfs/dynamic_debug/control

to disable them:

echo -n 'module nf_conntrack -p' > /mnt/debugfs/dynamic_debug/control

A further explanation can be found in the documentation patch.

Signed-off-by: Greg Banks <gnb@sgi.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: fix some bin_vm_ops errors
Hugh Dickins [Mon, 23 Mar 2009 01:41:27 +0000 (01:41 +0000)] 
sysfs: fix some bin_vm_ops errors

Commit 86c9508eb1c0ce5aa07b5cf1d36b60c54efc3d7a
"sysfs: don't block indefinitely for unmapped files" in linux-next
crashes the PowerMac G5 when X starts up.  It's caught out by the way
powerpc's pci_mmap of legacy_mem uses shmem_zero_setup(), substituting
a new vma->vm_file whose private_data no longer points to the bin_buffer
(substitution done because some versions of X crash if that mmap fails).

The fix to this is straightforward: the original vm_file is fput() in
that case, so this mmap won't block sysfs at all, so just don't switch
over to bin_vm_ops if vm_file has changed.

But more fixes made before realizing that was the problem:-

It should not be an error if bin_page_mkwrite() finds no underlying
page_mkwrite().

Check that a file already mmap'ed has the same underlying vm_ops
_before_ pointing vma->vm_ops at bin_vm_ops.

If the file being mmap'ed is a shmem/tmpfs file, don't fail the mmap
on CONFIG_NUMA=y, just because that has a set_policy and get_policy:
provide bin_set_policy, bin_get_policy and bin_migrate.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Eric Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agokobject: don't block for each kobject_uevent
Arjan van de Ven [Thu, 19 Mar 2009 16:09:05 +0000 (09:09 -0700)] 
kobject: don't block for each kobject_uevent

Right now, the kobject_uevent code blocks for each uevent that's being
generated, due to using (for hystoric reasons) UHM_WAIT_EXEC as flag to
call_usermode_helper().  Specifically, the effect is that each uevent
that is being sent causes the code to wake up keventd, then block until
keventd has processed the work. Needless to say, this happens many times
during the system boot.

This patches changes that to UHN_NO_WAIT (brilliant name for a constant
btw) so that we only schedule the work to fire the uevent message, but
do not wait for keventd to process the work.

This removes one of the bottlenecks during boot; each one of them is
only a small effect, but the sum of them does add up.

[Note, distros that need this are broken, they should be setting
CONFIG_UEVENT_HELPER_PATH to "", that way this code path will never be
excuted at all -- gregkh]

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: only allow one scheduled removal callback per kobj
Alex Chiang [Fri, 13 Mar 2009 18:07:36 +0000 (12:07 -0600)] 
sysfs: only allow one scheduled removal callback per kobj

The only way for a sysfs attribute to remove itself (without
deadlock) is to use the sysfs_schedule_callback() interface.

Vegard Nossum discovered that a poorly written sysfs ->store
callback can repeatedly schedule remove callbacks on the same
device over and over, e.g.

$ while true ; do echo 1 > /sys/devices/.../remove ; done

If the 'remove' attribute uses the sysfs_schedule_callback API
and also does not protect itself from concurrent accesses, its
callback handler will be called multiple times, and will
eventually attempt to perform operations on a freed kobject,
leading to many problems.

Instead of requiring all callers of sysfs_schedule_callback to
implement their own synchronization, provide the protection in
the infrastructure.

Now, sysfs_schedule_callback will only allow one scheduled
callback per kobject. On subsequent calls with the same kobject,
return -EAGAIN.

This is a short term fix. The long term fix is to allow sysfs
attributes to remove themselves directly, without any of this
callback hokey pokey.

[cornelia.huck@de.ibm.com: s390 ccwgroup bits]

Reported-by: vegard.nossum@gmail.com
Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoDriver core: Fix device_move() vs. dpm list ordering, v2
Cornelia Huck [Wed, 4 Mar 2009 11:44:00 +0000 (12:44 +0100)] 
Driver core: Fix device_move() vs. dpm list ordering, v2

dpm_list currently relies on the fact that child devices will
be registered after their parents to get a correct suspend
order. Using device_move() however destroys this assumption, as
an already registered device may be moved under a newly registered
one.

This patch adds a new argument to device_move(), allowing callers
to specify how dpm_list should be adapted.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoDriver core: some cleanup on drivers/base/sys.c
Zhenwen Xu [Tue, 3 Mar 2009 10:36:02 +0000 (18:36 +0800)] 
Driver core: some cleanup on drivers/base/sys.c

do some cleanup on drivers/base/sys.c

Signed-off-by: Zhenwen Xu <helight.xu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoDriver core: implement uevent suppress in kobject
Ming Lei [Sun, 1 Mar 2009 13:10:49 +0000 (21:10 +0800)] 
Driver core: implement uevent suppress in kobject

This patch implements uevent suppress in kobject and removes it
from struct device, based on the following ideas:

1,Uevent sending should be one attribute of kobject, so suppressing it
in kobject layer is more natural than in device layer. By this way,
we can do it for other objects embedded with kobject.

2,It may save several bytes for each instance of struct device.(On my
omap3(32bit ARM) based box, can save 8bytes per device object)

This patch also introduces dev_set|get_uevent_suppress() helpers to
set and query uevent_suppress attribute in case to help kobject
as private part of struct device in future.

[This version is against the latest driver-core patch set of Greg,please
ignore the last version.]

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agovcs: hook sysfs devices into object lifetime instead of "binding"
Kay Sievers [Mon, 9 Mar 2009 13:18:52 +0000 (14:18 +0100)] 
vcs: hook sysfs devices into object lifetime instead of "binding"

During bootup performance tracing I noticed many occurrences of
vca* device creation and removal, leading to the usual userspace
uevent processing, which are, in this case, rather pointless.

A simple test showing the kernel timing (not including all the
work userspace has to do), gives us these numbers:
  $ time for i in `seq 1000`; do echo a > /dev/tty2; done
  real    0m1.142s
  user    0m0.015s
  sys     0m0.540s

If we move the hook for the vcs* driver core devices from the
tty "binding" to the vc allocation/deallocation, which is what
the vcs* devices represent, we get the following numbers:
  $ time for i in `seq 1000`; do echo a > /dev/tty2; done
  real    0m0.152s
  user    0m0.030s
  sys     0m0.072s

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: fix passing platform_data
Ming Lei [Fri, 13 Mar 2009 15:06:59 +0000 (23:06 +0800)] 
driver core: fix passing platform_data

We will remove platform_data field from struct device until
all platform devices pass its specific data from platfom_device
and all platform drivers use platform specific data passed by
platform_device->platform_data. This kind of conversion will
need a long time, for thousands of files is affected.

To make the conversion easily, we allow platform specific data
passed by struct device or struct platform_device and platform
driver may use it from struct device or struct platform_device.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: move platform_data into platform_device
Ming Lei [Sun, 8 Mar 2009 15:13:32 +0000 (23:13 +0800)] 
driver core: move platform_data into platform_device

This patch moves platform_data from struct device into
struct platform_device, based on the two ideas:

1. Now all platform_driver is registered by platform_driver_register,
   which makes probe()/release()/... of platform_driver passed parameter
   of platform_device *, so platform driver can get platform_data from
   platform_device;

2. Other kind of devices do not need to use platform_data, we can
   decrease size of device if moving it to platform_device.

Taking into consideration of thousands of files to be fixed and they
can't be finished in one night(maybe it will take a long time), so we
keep platform_data in device to allow two kind of cases coexist until
all platform devices pass its platfrom data from
platform_device->platform_data.

All patches to do this kind of conversion are welcome.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: don't block indefinitely for unmapped files.
Eric W. Biederman [Wed, 4 Mar 2009 19:57:20 +0000 (11:57 -0800)] 
sysfs: don't block indefinitely for unmapped files.

Modify sysfs bin files so that we can remove the bin file while they are
still mapped.  When the kobject is removed we unmap the bin file and
arrange for future accesses to the mapping to receive SIGBUS.

Implementing this prevents a nasty DOS when pci devices are hot plugged
and unplugged.  Where if any of their resources were mmaped the kernel
could not free up their pci resources or release their pci data
structures.

[akpm@linux-foundation.org: remove unused var]
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: move knode_bus into private structure
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:26:21 +0000 (12:26 -0800)] 
driver core: move knode_bus into private structure

Nothing outside of the driver core should ever touch knode_bus, so
move it out of the public eye.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: move knode_driver into private structure
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:25:49 +0000 (12:25 -0800)] 
driver core: move knode_driver into private structure

Nothing outside of the driver core should ever touch knode_driver, so
move it out of the public eye.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: move klist_children into private structure
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:24:56 +0000 (12:24 -0800)] 
driver core: move klist_children into private structure

Nothing outside of the driver core should ever touch klist_children, or
knode_parent, so move them out of the public eye.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: create a private portion of struct device
Greg Kroah-Hartman [Tue, 16 Dec 2008 20:23:36 +0000 (12:23 -0800)] 
driver core: create a private portion of struct device

This is to be used to move things out of struct device that no code
outside of the driver core should ever touch.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: remove polling for driver_probe_done(v5)
Ming Lei [Sat, 21 Feb 2009 08:45:07 +0000 (16:45 +0800)] 
driver core: remove polling for driver_probe_done(v5)

This patch removes 100ms polling for driver_probe_done in
wait_for_device_probe(), and uses wait_event() instead.
Removing polling in fs initialization may lead to
a faster boot.

This patch also changes the return type of wait_for_device_done()
from int to void.

This patch is against Arjan's patch in linux-next tree.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: reference sysfs_dirent from sysfs inodes
Eric W. Biederman [Wed, 11 Feb 2009 21:20:23 +0000 (13:20 -0800)] 
sysfs: reference sysfs_dirent from sysfs inodes

The sysfs_dirent serves as both an inode and a directory entry
for sysfs.  To prevent the sysfs inode numbers from being freed
prematurely hold a reference to sysfs_dirent from the sysfs inode.

[akpm@linux-foundation.org: add comment]
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: sysfs_add_one WARNs with full path to duplicate filename
Alex Chiang [Thu, 12 Feb 2009 17:56:59 +0000 (10:56 -0700)] 
sysfs: sysfs_add_one WARNs with full path to duplicate filename

sysfs: sysfs_add_one WARNs with full path to duplicate filename

As a debugging aid, it can be useful to know the full path to a
duplicate file being created in sysfs.

We now will display warnings such as:

sysfs: cannot create duplicate filename '/foo'

when attempting to create multiple files named 'foo' in the sysfs
root, or:

sysfs: cannot create duplicate filename '/bus/pci/slots/5/foo'

when attempting to create multiple files named 'foo' under a
given directory in sysfs.

The path displayed is always a relative path to sysfs_root. The
leading '/' in the path name refers to the sysfs_root mount
point, and should not be confused with the "real" '/'.

Thanks to Alex Williamson for essentially writing sysfs_pathname.

Cc: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver-core: do not register a driver with bus_type not registered
Dave Young [Sat, 14 Feb 2009 13:23:22 +0000 (21:23 +0800)] 
driver-core: do not register a driver with bus_type not registered

If the bus_type is not registerd, driver_register to that bus will cause oops.

I found this bug when test built-in usb serial drivers (ie. aircable driver)
with 'nousb' cmdline params.

In this patch:
1. set the bus->p=NULL when bus_register failed and unregisterd.
2. if bus->p is NULL, driver_register BUG_ON will be triggered.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoscsi/m68k: Kill NCR_700_detect() warnings
Geert Uytterhoeven [Wed, 11 Mar 2009 08:23:52 +0000 (09:23 +0100)] 
scsi/m68k: Kill NCR_700_detect() warnings

The patch from Ming Lei <tom.leiming@gmail.com> entitled:
    platform driver: fix incorrect use of 'platform_bus_type' with 'struct devic
introduced the following warnings on m68k, as `dev' is now a `struct
platform_device *' instead of a `struct device *':

| drivers/scsi/a4000t.c:64: warning: passing argument 3 of 'NCR_700_detect' from incompatible pointer type
| drivers/scsi/mvme16x_scsi.c:67: warning: passing argument 3 of 'NCR_700_detect' from incompatible pointer type
| drivers/scsi/bvme6000_scsi.c:61: warning: passing argument 3 of 'NCR_700_detect' from incompatible pointer type

I think the below is missing (untested on real hardware).

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoplatform driver: fix incorrect use of 'platform_bus_type' with 'struct device_driver'
Ming Lei [Fri, 6 Feb 2009 15:40:12 +0000 (23:40 +0800)] 
platform driver: fix incorrect use of 'platform_bus_type' with 'struct device_driver'

This patch fixes the bug reported in
http://bugzilla.kernel.org/show_bug.cgi?id=11681.

"Lots of device drivers register a 'struct device_driver' with
the '.bus' member set to '&platform_bus_type'. This is wrong,
since the platform_bus functions expect the 'struct device_driver'
to be wrapped up in a 'struct platform_driver' which provides
some additional callbacks (like suspend_late, resume_early).
The effect may be that platform_suspend_late() uses bogus data
outside the device_driver struct as a pointer pointer to the
device driver's suspend_late() function or other hard to
reproduce failures."(Lothar Wassmann)

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUIO: Take offset into account when determining number of pages that can be mapped
Ian Abbott [Tue, 24 Feb 2009 17:22:59 +0000 (17:22 +0000)] 
UIO: Take offset into account when determining number of pages that can be mapped

If a UIO memory region does not start on a page boundary but straddles one,
the number of actual pages that overlap the memory region may be calculated
incorrectly because the offset isn't taken into account.  If userspace sets
the mmap length to offset+size, it may fail with -EINVAL if UIO thinks it's
trying to allocate too many pages.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agouio: add the uio_aec driver
Brandon Philips [Tue, 27 Jan 2009 21:00:04 +0000 (13:00 -0800)] 
uio: add the uio_aec driver

UIO driver for the Adrienne Electronics Corporation PCI time code
device.

This device differs from other UIO devices since it uses I/O ports instead of
memory mapped I/O. In order to make it possible for UIO to work with this
device a utility, uioport, can be used to read and write the ports.

uioport is designed to be a setuid program and checks the permissions of
the /dev/uio* node and if the user has write permissions it will use
iopl and out*/in* to access the device.

[1] git clone git://ifup.org/philips/uioport.git

Signed-off-by: Brandon Philips <brandon@ifup.org>
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUIO: Add name attributes for mappings and port regions
Hans J. Koch [Tue, 6 Jan 2009 23:15:39 +0000 (00:15 +0100)] 
UIO: Add name attributes for mappings and port regions

If a UIO device has several memory mappings, it can be difficult for userspace
to find the right one. The situation becomes even worse if the UIO driver can
handle different versions of a card that have different numbers of mappings.
Benedikt Spranger has such cards and pointed this out to me. Thanks, Bene!

To address this problem, this patch adds "name" sysfs attributes for each
mapping. Userspace can use these to clearly identify each mapping. The name
string is optional. If a driver doesn't set it, an empty string will be
returned, so this patch won't break existing drivers.

The same problem exists for port region information, so a "name" attribute is
added there, too.

Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoplatform: introduce module id table for platform devices
Eric Miao [Wed, 4 Feb 2009 03:52:40 +0000 (11:52 +0800)] 
platform: introduce module id table for platform devices

Now platform_device is being widely used on SoC processors where the
peripherals are attached to the system bus, which is simple enough.

However, silicon IPs for these SoCs are usually shared heavily across
a family of processors, even products from different companies.  This
makes the original simple driver name based matching insufficient, or
simply not straight-forward.

Introduce a module id table for platform devices, and makes it clear
that a platform driver is able to support some shared IP and handle
slight differences across different platforms (by 'driver_data').
Module alias is handled automatically when a MODULE_DEVICE_TABLE()
is defined.

To not disturb the current platform drivers too much, the matched id
entry is recorded and can be retrieved by platform_get_device_id().

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoplatform: make better use of to_platform_{device,driver}() macros
Eric Miao [Sat, 31 Jan 2009 14:47:44 +0000 (22:47 +0800)] 
platform: make better use of to_platform_{device,driver}() macros

This helps the code look more consistent and cleaner.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: check bus->match without holding device lock
Ming Lei [Wed, 21 Jan 2009 15:27:47 +0000 (23:27 +0800)] 
driver core: check bus->match without holding device lock

This patch moves bus->match out from driver_probe_device and
does not hold device lock to check the match between a device
and a driver.

The idea has been verified by the commit 6cd495860901,
which leads to a faster boot. But the commit 6cd495860901 has
the following drawbacks: 1),only does the quick check in
the path of __driver_attach->driver_probe_device, not in other
paths; 2),for a matched device and driver, check the same match
twice. It is a waste of cpu ,especially for some drivers with long
device id table (eg. usb-storage driver).

This patch adds a helper of driver_match_device to check the match
in all paths, and testes the match only once.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agosysfs: Take sysfs_mutex when fetching the root inode.
Eric W. Biederman [Wed, 21 Jan 2009 19:55:11 +0000 (11:55 -0800)] 
sysfs: Take sysfs_mutex when fetching the root inode.

sysfs_get_inode ultimately calls sysfs_count_nlink when the a
directory inode is fectched.  sysfs_count_nlink needs to be
called under the sysfs_mutex to guard against the unlikely
but possible scenario that the root directory is changing
as we are counting the number entries in it, and just in
general to be consistent.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoSYSFS: use standard magic.h for sysfs
Qinghuang Feng [Wed, 14 Jan 2009 07:45:13 +0000 (15:45 +0800)] 
SYSFS: use standard magic.h for sysfs

SYSFS_MAGIC has been added into magic.h, so only use that definition
in magic.h to avoid potential consistency problem.

Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agodriver core: get rid of struct device's bus_id string array
Kay Sievers [Sun, 25 Jan 2009 14:17:37 +0000 (15:17 +0100)] 
driver core: get rid of struct device's bus_id string array

Now that all users of bus_id is gone, we can remove it from struct
device.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: FHCI: use dev_name() in place of bus_id.
Sachin Sant [Mon, 16 Feb 2009 13:40:11 +0000 (19:10 +0530)] 
USB: FHCI: use dev_name() in place of bus_id.

Replace references to bus_id with dev_name() to fix fhci driver build break.

drivers/usb/host/fhci-hcd.c:586: error: struct device has no member named bus_id
drivers/usb/host/fhci-hcd.c:653: error: struct device has no member named bus_id
drivers/usb/host/fhci-dbg.c:111: error: struct device has no member named bus_id

Signed-off-by: Sachin Sant <sachinp@in.ibm.com>
Acked-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoPS3: replace bus_id usage
Greg Kroah-Hartman [Mon, 26 Jan 2009 17:12:12 +0000 (09:12 -0800)] 
PS3: replace bus_id usage

These simple debug statments should be using dev_dbg() instead of
accessing bus_id directly (or they should use device_name).

As bus_id is going away, this patch is necessary.

Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)] 
usb: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agowimax: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)] 
wimax: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: inaky.perez-gonzalez@intel.com
Cc: linux-wimax@intel.com
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agomfd: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)] 
mfd: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: sameo@openedhand.com
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agomca: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)] 
mca: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: James.Bottomley@HansenPartnership.com
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agogpio: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:23 +0000 (16:38 -0700)] 
gpio: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: Michael Buesch <mb@bu3sch.de>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoeisa: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
eisa: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agodma: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
dma: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: Dan Williams <dan.j.williams@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agodio: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
dio: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoamba: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
amba: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agov4l: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
v4l: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: mchehab@infradead.org
Cc: linux-media@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agodrm: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
drm: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: airlied@linux.ie
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agonet: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
net: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: davem@davemloft.net
Cc: netdev@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agortc: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
rtc: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: a.zummo@towertech.it
Cc: rtc-linux@googlegroups.com
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agopcmcia: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
pcmcia: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: linux-pcmcia@lists.infradead.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agotc: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:22 +0000 (16:38 -0700)] 
tc: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: macro@linux-mips.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agosh: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
sh: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoserial: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
serial: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: davem@davemloft.net
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agos390: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
s390: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: schwidefsky@de.ibm.com
Cc: linux-s390@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agorapidio: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
rapidio: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: mporter@kernel.crashing.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agopci: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
pci: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: jbarnes@virtuousgeek.org
Cc: linux-pci@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agomtd: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
mtd: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: dwmw2@infradead.org
Cc: linux-mtd@lists.infradead.org
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agommc: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
mmc: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: drzeus-mmc@drzeus.cx
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agozorro: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
zorro: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agovideo: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
video: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agospi: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
spi: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: dbrownell@users.sourceforge.net
Cc: spi-devel-general@lists.sourceforge.net
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agoedac: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Tue, 24 Mar 2009 23:38:21 +0000 (16:38 -0700)] 
edac: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: dougthompson@xmission.com
Cc: bluesmoke-devel@lists.sourceforge.net
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
15 years agonetlink: add NETLINK_NO_ENOBUFS socket flag
Pablo Neira Ayuso [Tue, 24 Mar 2009 23:37:55 +0000 (16:37 -0700)] 
netlink: add NETLINK_NO_ENOBUFS socket flag

This patch adds the NETLINK_NO_ENOBUFS socket flag. This flag can
be used by unicast and broadcast listeners to avoid receiving
ENOBUFS errors.

Generally speaking, ENOBUFS errors are useful to notify two things
to the listener:

a) You may increase the receiver buffer size via setsockopt().
b) You have lost messages, you may be out of sync.

In some cases, ignoring ENOBUFS errors can be useful. For example:

a) nfnetlink_queue: this subsystem does not have any sort of resync
method and you can decide to ignore ENOBUFS once you have set a
given buffer size.

b) ctnetlink: you can use this together with the socket flag
NETLINK_BROADCAST_SEND_ERROR to stop getting ENOBUFS errors as
you do not need to resync (packets whose event are not delivered
are drop to provide reliable logging and state-synchronization).

Moreover, the use of NETLINK_NO_ENOBUFS also reduces a "go up, go down"
effect in terms of performance which is due to the netlink congestion
control when the listener cannot back off. The effect is the following:

1) throughput rate goes up and netlink messages are inserted in the
receiver buffer.
2) Then, netlink buffer fills and overruns (set on nlk->state bit 0).
3) While the listener empties the receiver buffer, netlink keeps
dropping messages. Thus, throughput goes dramatically down.
4) Then, once the listener has emptied the buffer (nlk->state
bit 0 is set off), goto step 1.

This effect is easy to trigger with netlink broadcast under heavy
load, and it is more noticeable when using a big receiver buffer.
You can find some results in [1] that show this problem.

[1] http://1984.lsi.us.es/linux/netlink/

This patch also includes the use of sk_drop to account the number of
netlink messages drop due to overrun. This value is shown in
/proc/net/netlink.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: update firmware headers to 1.4.41
Brice Goglin [Tue, 24 Mar 2009 23:32:13 +0000 (16:32 -0700)] 
myri10ge: update firmware headers to 1.4.41

Update myri10ge firmware headers to firmware version 1.4.41.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomacb: fix warning "warning: unused variable `dev' "
vibi sreenivasan [Tue, 24 Mar 2009 23:30:20 +0000 (16:30 -0700)] 
macb: fix warning "warning: unused variable `dev' "

Removed unused variable dev

Signed-off-by: vibi sreenivasan <vibi_sreenivasan@cms.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoucc_geth: Convert to net_device_ops
Joakim Tjernlund [Fri, 20 Mar 2009 20:09:14 +0000 (21:09 +0100)] 
ucc_geth: Convert to net_device_ops

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoUSB: qcserial: add device id for HP devices
Alexander Shumakovitch [Sat, 21 Mar 2009 04:50:16 +0000 (00:50 -0400)] 
USB: qcserial: add device id for HP devices

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: isp1760: Add a delay before reading the SKIPMAP registers in isp1760-hcd.c
Catalin Marinas [Mon, 23 Mar 2009 12:38:16 +0000 (12:38 +0000)] 
USB: isp1760: Add a delay before reading the SKIPMAP registers in isp1760-hcd.c

The data read from the SKIPMAP registers is not immediately available
after writing and the driver panics when a packet is enqueued from the
interrupt handler. This patch adds an ndelay(195) before these registers
are read (delay value mentioned in section 15.1.1.3 of the ISP1760 data
sheet).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: allow malformed LANGID descriptors
Daniel Mack [Fri, 20 Mar 2009 18:58:57 +0000 (19:58 +0100)] 
USB: allow malformed LANGID descriptors

When an USB hardware does not provide a valid LANGID, fall back to value
zero which is still a reasonable default for most devices.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: pxa27x_udc: typo fixes and code cleanups
Vernon Sauder [Fri, 20 Mar 2009 08:44:50 +0000 (01:44 -0700)] 
USB: pxa27x_udc: typo fixes and code cleanups

This patch is a merge of patches :
 - fix function doc and debug
 - cleanup loop count
 - optimize code to remove local variable and extra check
 - init 'req' before use
 - add missing iounmap call

[dbrownell@users.sourceforge.net: capitalize IN/OUT directions in doc]

Signed-off-by: Vernon Sauder <vsauder@inhand.com>
[folded by Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: gadget: gadget zero uses new suspend/resume hooks
David Brownell [Thu, 19 Mar 2009 21:16:09 +0000 (14:16 -0700)] 
USB: gadget: gadget zero uses new suspend/resume hooks

Use the new device-level suspend/resume hooks for Gadget Zero;
always enable them with the OTG test mode; and support remote
wakeup on both configurations even in non-OTG mode.

This ensures that both configurations can pass the USBCV remote
wakeup tests when the OTG test mode is enabled.  This changes
behavior by adding autoresume support to the loopback config
even in non-OTG mode; the test failure was that it didn't work
in OTG mode.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: gadget: composite device-level suspend/resume hooks
David Brownell [Thu, 19 Mar 2009 21:14:17 +0000 (14:14 -0700)] 
USB: gadget: composite device-level suspend/resume hooks

Address one open question in the composite gadget framework:
Yes, we should have device-level suspend/resume callbacks
in addition to the function-level ones.  We have at least one
scenario (with gadget zero in OTG test mode) that's awkward
to handle without it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: r8a66597-hcd: suspend/resume support
Yoshihiro Shimoda [Thu, 19 Mar 2009 05:18:15 +0000 (14:18 +0900)] 
USB: r8a66597-hcd: suspend/resume support

Fix the problem that system cannot suspend.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: more u32 conversion after transfer_buffer_length and actual_length
Roel Kluin [Fri, 13 Mar 2009 11:19:18 +0000 (12:19 +0100)] 
USB: more u32 conversion after transfer_buffer_length and actual_length

transfer_buffer_length and actual_length have become unsigned, therefore some
additional conversion of local variables, function arguments and print
specifications is desired.

A test for a negative urb->transfer_buffer_length became obsolete; instead
we ensure that it does not exceed INT_MAX. Also, urb->actual_length is always
less than urb->transfer_buffer_length.

rh_string() does no longer return -EPIPE in the case of an unsupported ID.
Instead its only caller, rh_call_control() does the check.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: Fix cp2101 USB serial device driver termios functions for console use
VomLehn [Thu, 12 Mar 2009 21:37:42 +0000 (14:37 -0700)] 
USB: Fix cp2101 USB serial device driver termios functions for console use

This is really a follow up to the modifications Alan Cox made for commit
95da310e66ee8090119596c70ca8432e57f9a97f to pass a tty_struct to various
interface functions, which broke the serial configuration (termios) functions
when the device is being used as a console. These changes restore the
configuration to proper functioning both as a tty and as a console.  As Alan
notes in that commit, these changes will need to be tweaked when we have
a proper console abstraction.

Signed-off-by: David VomLehn <dvomlehn@cisco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: CP2101 New Device ID
Alex Stephens [Tue, 17 Mar 2009 00:06:19 +0000 (00:06 +0000)] 
USB: CP2101 New Device ID

One new device ID for CP2101 driver.

Signed-off-by: Alex Stephens alex@miranova.com
15 years agoUSB: ipaq: handle 4 endpoint devices
Mark Ellis [Mon, 9 Mar 2009 22:24:29 +0000 (22:24 +0000)] 
USB: ipaq: handle 4 endpoint devices

The ipaq driver currently enforces one port on all devices. This
is correct for 2 and 3 endpoint devices, but with 4 endpoint devices
meaningful communication occurs on the second pair.

This patch allows 2 ports for 4 endpoint devices.

Signed-off-by: Mark Ellis <mark@mpellis.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoUSB: S3C: Move usb-control.h to platform include
Ben Dooks [Sat, 7 Mar 2009 11:44:21 +0000 (11:44 +0000)] 
USB: S3C: Move usb-control.h to platform include

The usb-control.h is needed by ohci-s3c2410.c for both S3C24XX and S3C64XX
architectures, so move it to <plat/usb-control.h>

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>