linux-2.6
16 years agoclockevents: fix typo in tick-broadcast.c
Glauber Costa [Fri, 18 Apr 2008 20:38:58 +0000 (13:38 -0700)] 
clockevents: fix typo in tick-broadcast.c

braodcast -> broadcast

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agojiffies: add time_is_after_jiffies and others which compare with jiffies
Dave Young [Fri, 18 Apr 2008 20:38:57 +0000 (13:38 -0700)] 
jiffies: add time_is_after_jiffies and others which compare with jiffies

Most of time_after like macros usages just compare jiffies and another number,
so here add some time_is_* macros for convenience.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16 years agoPCI: Change PCI subsystem MAINTAINER
Greg Kroah-Hartman [Thu, 17 Apr 2008 17:22:27 +0000 (10:22 -0700)] 
PCI: Change PCI subsystem MAINTAINER

Jesse foolishly volunteered to handle PCI patches.  Update MAINTAINERS to
reflect this.

Woho!  Time to kick back and relax...

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pci-iommu-iotlb-flushing-speedup
mark gross [Fri, 18 Apr 2008 20:53:58 +0000 (13:53 -0700)] 
PCI: pci-iommu-iotlb-flushing-speedup

The following patch is an update to use an array instead of a list of
IOVA's in the implementation of defered iotlb flushes.  It takes
inspiration from sba_iommu.c

I like this implementation better as it encapsulates the batch process
within intel-iommu.c, and no longer touches iova.h (which is shared)

Performance data:  Netperf 32byte UDP streaming
2.6.25-rc3-mm1:
IOMMU-strict : 58Mps @ 62% cpu
NO-IOMMU : 71Mbs @ 41% cpu
List-based IOMMU-default-batched-IOTLB flush: 66Mbps @ 57% cpu

with this patch:
IOMMU-strict : 73Mps @ 75% cpu
NO-IOMMU : 74Mbs @ 42% cpu
Array-based IOMMU-default-batched-IOTLB flush: 72Mbps @ 62% cpu

Signed-off-by: <mgross@linux.intel.com>
Cc: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pci_setup_bridge() mustn't be __devinit
Adrian Bunk [Fri, 18 Apr 2008 20:53:57 +0000 (13:53 -0700)] 
PCI: pci_setup_bridge() mustn't be __devinit

WARNING: drivers/pci/built-in.o(.text+0x28ee9): Section mismatch in reference from the function pci_bus_assign_resources() to the function .devinit.text:pci_setup_bridge()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pci_bus_size_cardbus() mustn't be __devinit
Adrian Bunk [Fri, 18 Apr 2008 20:53:56 +0000 (13:53 -0700)] 
PCI: pci_bus_size_cardbus() mustn't be __devinit

WARNING: drivers/pci/built-in.o(.text+0x28e1f): Section mismatch in reference from the function pci_bus_size_bridges() to the function .devinit.text:pci_bus_size_cardbus()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pci_scan_device() mustn't be __devinit
Adrian Bunk [Fri, 18 Apr 2008 20:53:55 +0000 (13:53 -0700)] 
PCI: pci_scan_device() mustn't be __devinit

WARNING: drivers/pci/built-in.o(.text+0x150f): Section mismatch in reference from the function pci_scan_single_device() to the function .devinit.text:pci_scan_device()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pci_alloc_child_bus() mustn't be __devinit
Adrian Bunk [Fri, 18 Apr 2008 20:53:55 +0000 (13:53 -0700)] 
PCI: pci_alloc_child_bus() mustn't be __devinit

WARNING: drivers/pci/built-in.o(.text+0xc4c): Section mismatch in reference from the function pci_add_new_bus() to the function .devinit.text:pci_alloc_child_bus()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: replace remaining __FUNCTION__ occurrences
Harvey Harrison [Tue, 4 Mar 2008 03:09:46 +0000 (19:09 -0800)] 
PCI: replace remaining __FUNCTION__ occurrences

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Hotplug: fakephp: Return success, not ENODEV, when bus rescan is triggered
Trent Piepho [Mon, 7 Apr 2008 23:04:16 +0000 (16:04 -0700)] 
PCI: Hotplug: fakephp: Return success, not ENODEV, when bus rescan is triggered

The 'power' attribute of the fakephp driver originally only let one turn a
slot off.  If one tried to turn a slot on (echo 1 > .../power), it would
return ENODEV, as fakephp did not support this function.

An old (pre-git) patch changed this:
2004/11/11 16:33:31-08:00 jdittmer
[PATCH] fakephp: add pci bus rescan ability
http://article.gmane.org/gmane.linux.kernel/251183

Now writing "1" to the power attribute has the effect of triggering a bus
rescan, but it still returns ENODEV, probably an oversight in the above
patch.

Using the BusyBox echo will not produce an error message, but will
trigger *two* bus rescans (and return an exit code of 1):
~ # strace echo -n 1 > /sys/bus/pci/slots/0000:00:00.0/power
...
write(1, "1", 1)                        = -1 ENODEV (No such device)
write(1, "1", 1)                        = -1 ENODEV (No such device)
exit(1)                                 = ?

Using cp gives a write error, even though the write did happen and a rescan
was triggered:
~ # echo -n 1 > tmp ; cp tmp /sys/bus/pci/slots/0000:00:00.0/power
cp: Write Error: No such device

It seems much better to return success instead of failure.  The actual
status of the bus rescan is hard to return.  It happens asynchronously in a
work thread, so the sysfs store functions returns before any status is
ready (the whole point of the work queue).  And even if it didn't do this,
the rescan doesn't have any clear status to return.

Signed-off-by: Trent Piepho <tpiepho@freescale.com>
CC: Jan Dittmer <jdittmer@ppp0.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Hotplug: Fix leaks in IBM Hot Plug Controller Driver - ibmphp_init_devno()
Jesper Juhl [Fri, 21 Mar 2008 23:07:13 +0000 (00:07 +0100)] 
PCI: Hotplug: Fix leaks in IBM Hot Plug Controller Driver - ibmphp_init_devno()

In drivers/pci/hotplug/ibmphp_core.c::ibmphp_init_devno() we allocate
space dynamically for a PCI irq routing table by calling
pcibios_get_irq_routing_table(), but we never free the allocated space.

This patch frees the allocated space at the function exit points.

Spotted by the Coverity checker. Compile tested only.

Please consider applying.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: clean up resource alignment management
Ivan Kokshaysky [Sun, 30 Mar 2008 15:50:14 +0000 (19:50 +0400)] 
PCI: clean up resource alignment management

Done per Linus' request and suggestions. Linus has explained that
better than I'll be able to explain:

On Thu, Mar 27, 2008 at 10:12:10AM -0700, Linus Torvalds wrote:
> Actually, before we go any further, there might be a less intrusive
> alternative: add just a couple of flags to the resource flags field (we
> still have something like 8 unused bits on 32-bit), and use those to
> implement a generic "resource_alignment()" routine.
>
> Two flags would do it:
>
>  - IORESOURCE_SIZEALIGN: size indicates alignment (regular PCI device
>    resources)
>
>  - IORESOURCE_STARTALIGN: start field is alignment (PCI bus resources
>    during probing)
>
> and then the case of both flags zero (or both bits set) would actually be
> "invalid", and we would also clear the IORESOURCE_STARTALIGN flag when we
> actually allocate the resource (so that we don't use the "start" field as
> alignment incorrectly when it no longer indicates alignment).
>
> That wouldn't be totally generic, but it would have the nice property of
> automatically at least add sanity checking for that whole "res->start has
> the odd meaning of 'alignment' during probing" and remove the need for a
> new field, and it would allow us to have a generic "resource_alignment()"
> routine that just gets a resource pointer.

Besides, I removed IORESOURCE_BUS_HAS_VGA flag which was unused for ages.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Gary Hade <garyhade@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: aerdrv_acpi.c: remove unneeded NULL check
Adrian Bunk [Sun, 30 Mar 2008 22:41:01 +0000 (01:41 +0300)] 
PCI: aerdrv_acpi.c: remove unneeded NULL check

There's no reason for checking pdev->bus for being NULL here (and we'd
anyway Oops 3 lines below if it was).

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Update VIA CX700 quirk
Tim Yamin [Sun, 30 Mar 2008 19:58:59 +0000 (20:58 +0100)] 
PCI: Update VIA CX700 quirk

This follows up 53a9bf4267b8b1f958dbeb7c8c1ef21c82229b71. Some newer
CX700 BIOSes from our vendor have PCI Bus Parking disabled but PCI
Master read caching enabled. This creates problems such as system
freezing when both the network controller and the USB controller are
active and one of them is pretty busy (e.g. heavy network traffic).

This patch separates the checks and both the bus parking and the read
caching are disabled independently if either is enabled by the BIOS.

Signed-off-by: Tim Yamin <tim.yamin@zonbu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Expose PCI VPD through sysfs
Ben Hutchings [Wed, 5 Mar 2008 16:52:39 +0000 (16:52 +0000)] 
PCI: Expose PCI VPD through sysfs

Vital Product Data (VPD) may be exposed by PCI devices in several
ways.  It is generally unsafe to read this information through the
existing interfaces to user-land because of stateful interfaces.

This adds:
- abstract operations for VPD access (struct pci_vpd_ops)
- VPD state information in struct pci_dev (struct pci_vpd)
- an implementation of the VPD access method specified in PCI 2.2
  (in access.c)
- a 'vpd' binary file in sysfs directories for PCI devices with VPD
  operations defined

It adds a probe for PCI 2.2 VPD in pci_scan_device() and release of
VPD state in pci_release_dev().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: iommu: iotlb flushing
mark gross [Tue, 4 Mar 2008 23:22:08 +0000 (15:22 -0800)] 
PCI: iommu: iotlb flushing

This patch is for batching up the flushing of the IOTLB for the DMAR
implementation found in the Intel VT-d hardware.  It works by building a list
of to be flushed IOTLB entries and a bitmap list of which DMAR engine they are
from.

After either a high water mark (250 accessible via debugfs) or 10ms the list
of iova's will be reclaimed and the DMAR engines associated are IOTLB-flushed.

This approach recovers 15 to 20% of the performance lost when using the IOMMU
for my netperf udp stream benchmark with small packets.  It can be disabled
with a kernel boot parameter "intel_iommu=strict".

Its use does weaken the IOMMU protections a bit.

Signed-off-by: Mark Gross <mgross@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: simplify quirk debug output
Bjorn Helgaas [Tue, 4 Mar 2008 23:22:07 +0000 (15:22 -0800)] 
PCI: simplify quirk debug output

print_fn_descriptor_symbol() prints the address if we don't have a symbol,
so no need to print both.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: iova RB tree setup tweak
mark gross [Tue, 4 Mar 2008 23:22:04 +0000 (15:22 -0800)] 
PCI: iova RB tree setup tweak

The following patch merges two functions into one allowing for a 3%
reduction in overhead in locating, allocating and inserting pages for
use in IOMMU operations.

Its a bit of a eye-crosser so I welcome any RB-tree / MM experts to take
a look.  It works by re-using some of the information gathered in the
search for the pages to use in setting up the IOTLB's in the insertion
of the iova structure into the RB tree.

Signed-off-by: <mgross@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: parisc: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:55 +0000 (11:56 -0700)] 
PCI: parisc: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.

Unlike this arch-specific code, the generic version:
    - checks PCI_NUM_RESOURCES (11), not DEVICE_COUNT_RESOURCE (12), resources
    - skips resources that have neither IORESOURCE_IO nor IORESOURCE_MEM set
    - skips ROM resources unless IORESOURCE_ROM_ENABLE is set
    - checks for resource collisions with "!r->parent"

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: ppc: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:57 +0000 (11:56 -0700)] 
PCI: ppc: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.

Unlike this arch-specific code, the generic version:
    - checks PCI_NUM_RESOURCES (11), not 6, resources
    - skips resources that have neither IORESOURCE_IO nor IORESOURCE_MEM set
    - skips ROM resources unless IORESOURCE_ROM_ENABLE is set
    - checks for resource collisions with "!r->parent", not IORESOURCE_UNSET

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: powerpc: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:56 +0000 (11:56 -0700)] 
PCI: powerpc: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.
The generic version is functionally equivalent, but uses dev_printk.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: ia64: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:52 +0000 (11:56 -0700)] 
PCI: ia64: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.

Unlike this arch-specific code, the generic version:
    - does not check for a NULL dev pointer
    - skips resources that have neither IORESOURCE_IO nor IORESOURCE_MEM set

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: alpha: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:48 +0000 (11:56 -0700)] 
PCI: alpha: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.

Unlike this arch-specific code, the generic version:
    - skips resources unless requested in "mask"
    - skips ROM resources unless IORESOURCE_ROM_ENABLE is set
    - checks for resource collisions with "!r->parent"

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: x86: use generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:57:01 +0000 (11:57 -0700)] 
PCI: x86: use generic pci_enable_resources()

Use the generic pci_enable_resources() instead of the arch-specific code.

Unlike this arch-specific code, the generic version:
    - checks for resource collisions with "!r->parent"

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: add generic pci_enable_resources()
Bjorn Helgaas [Tue, 4 Mar 2008 18:56:47 +0000 (11:56 -0700)] 
PCI: add generic pci_enable_resources()

Each architecture has its own pcibios_enable_resources() implementation.
These differ in many minor ways that have nothing to do with actual
architectural differences.  Follow-on patches will make most arches
use this generic version instead.

This version is based on powerpc, which seemed most up-to-date.  The only
functional difference from the x86 version is that this uses "!r->parent"
to check for resource collisions instead of "!r->start && r->end".

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: add PCI Express ASPM support
Shaohua Li [Mon, 25 Feb 2008 01:46:41 +0000 (09:46 +0800)] 
PCI: add PCI Express ASPM support

PCI Express ASPM defines a protocol for PCI Express components in the D0
state to reduce Link power by placing their Links into a low power state
and instructing the other end of the Link to do likewise. This
capability allows hardware-autonomous, dynamic Link power reduction
beyond what is achievable by software-only controlled power management.
However, The device should be configured by software appropriately.
Enabling ASPM will save power, but will introduce device latency.

This patch adds ASPM support in Linux. It introduces a global policy for
ASPM, a sysfs file /sys/module/pcie_aspm/parameters/policy can control
it. The interface can be used as a boot option too. Currently we have
below setting:
        -default, BIOS default setting
        -powersave, highest power saving mode, enable all available ASPM
state and clock power management
        -performance, highest performance, disable ASPM and clock power
management
By default, the 'default' policy is used currently.

In my test, power difference between powersave mode and performance mode
is about 1.3w in a system with 3 PCIE links.

Note: some devices might not work well with aspm, either because chipset
issue or device issue. The patch provide API (pci_disable_link_state),
driver can disable ASPM for specific device.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove "pci=routeirq" noise from dmesg
Bjorn Helgaas [Mon, 18 Feb 2008 16:44:13 +0000 (09:44 -0700)] 
PCI: remove "pci=routeirq" noise from dmesg

The "pci=routeirq" option was added in 2004, and I don't get any valid
reports anymore.  The option is still mentioned in kernel-parameters.txt.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: Include PCI domain in PCI bus names on x86/x86_64
Gary Hade [Fri, 8 Feb 2008 22:00:52 +0000 (14:00 -0800)] 
PCI: Include PCI domain in PCI bus names on x86/x86_64

The PCI bus names included in /proc/iomem and /proc/ioports are
of the form 'PCI Bus #XX' where XX is the bus number.  This patch
changes the naming to 'PCI Bus XXXX:YY' where XXXX is the domain
number and YY is the bus number.  For example, PCI bus 14 in
domain 0 will show as 'PCI Bus 0000:14' instead of 'PCI Bus #14'.
This change makes the naming consistent with other architectures
such as ia64 where multiple PCI domain support has been around
longer.

Signed-off-by: Gary Hade <garyhade@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: #if 0 pci_cleanup_aer_correct_error_status()
Adrian Bunk [Tue, 5 Feb 2008 07:50:11 +0000 (23:50 -0800)] 
PCI: #if 0 pci_cleanup_aer_correct_error_status()

#if 0 the no longer used pci_cleanup_aer_correct_error_status().

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: pcie AER: don't check _OSC when acpi is disabled
Yinghai Lu [Sun, 3 Feb 2008 06:24:47 +0000 (22:24 -0800)] 
PCI: pcie AER: don't check _OSC when acpi is disabled

[PATCH] pcie AER: don't check _OSC when acpi is disabled

when acpi=off or pci=noacpi, get warning

AER service couldn't init device 0000:00:0a.0:pcie01 - no _OSC support
AER service couldn't init device 0000:00:0e.0:pcie01 - no _OSC support
AER service couldn't init device 0000:00:0f.0:pcie01 - no _OSC support
AER service couldn't init device 0000:80:0b.0:pcie01 - no _OSC support
AER service couldn't init device 0000:80:0e.0:pcie01 - no _OSC support
AER service couldn't init device 0000:80:0f.0:pcie01 - no _OSC support

so don't check _OSC in aer_osc_setup

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove global list of PCI devices
Greg Kroah-Hartman [Thu, 14 Feb 2008 22:56:56 +0000 (14:56 -0800)] 
PCI: remove global list of PCI devices

This patch finally removes the global list of PCI devices.  We are
relying entirely on the list held in the driver core now, and do not
need a separate "shadow" list as no one uses it.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove parisc consumer of the pci global_list
James Bottomley [Wed, 20 Feb 2008 21:14:24 +0000 (15:14 -0600)] 
PCI: remove parisc consumer of the pci global_list

Remove the parisc usage of the global_list, as it's not needed anymore.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove pcibios_fixup_ghosts()
Greg Kroah-Hartman [Thu, 14 Feb 2008 22:56:56 +0000 (14:56 -0800)] 
PCI: remove pcibios_fixup_ghosts()

This function was obviously never being used since early 2.5 days as any
device that it would try to remove would never really be removed from
the system due to the PCI device list being held in the driver core, not
the general list of PCI devices.

As we have not had a single report of a problem here in 4 years, I think
it's safe to remove now.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: add is_added flag to struct pci_dev
Greg Kroah-Hartman [Thu, 14 Feb 2008 22:56:56 +0000 (14:56 -0800)] 
PCI: add is_added flag to struct pci_dev

This lets us check if the device is really added to the driver core or
not, which is what we need when walking some of the bus lists.  The flag
is there in anticipation of getting rid of the other PCI device list,
which is what we used to check in this situation.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: make no_pci_devices() use the pci_bus_type list
Greg Kroah-Hartman [Thu, 14 Feb 2008 06:30:39 +0000 (22:30 -0800)] 
PCI: make no_pci_devices() use the pci_bus_type list

no_pci_devices() should use the driver core list of PCI devices, not our
"separate" one.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove initial bios sort of PCI devices on x86
Greg Kroah-Hartman [Wed, 13 Feb 2008 23:06:38 +0000 (15:06 -0800)] 
PCI: remove initial bios sort of PCI devices on x86

We currently keep 2 lists of PCI devices in the system, one in the
driver core, and one all on its own.  This second list is sorted at boot
time, in "BIOS" order, to try to remain compatible with older kernels
(2.2 and earlier days).  There was also a "nosort" option to turn this
sorting off, to remain compatible with even older kernel versions, but
that just ends up being what we have been doing from 2.5 days...

Unfortunately, the second list of devices is not really ever used to
determine the probing order of PCI devices or drivers[1].  That is done
using the driver core list instead.  This change happened back in the
early 2.5 days.

Relying on BIOS ording for the binding of drivers to specific device
names is problematic for many reasons, and userspace tools like udev
exist to properly name devices in a persistant manner if that is needed,
no reliance on the BIOS is needed.

Matt Domsch and others at Dell noticed this back in 2006, and added a
boot option to sort the PCI device lists (both of them) in a
breadth-first manner to help remain compatible with the 2.4 order, if
needed for any reason.  This option is not going away, as some systems
rely on them.

This patch removes the sorting of the internal PCI device list in "BIOS"
mode, as it's not needed at all anymore, and hasn't for many years.
I've also removed the PCI flags for this from some other arches that for
some reason defined them, but never used them.

This should not change the ordering of any drivers or device probing.

[1] The old-style pci_get_device and pci_find_device() still used this
sorting order, but there are very few drivers that use these functions,
as they are deprecated for use in this manner.  If for some reason, a
driver rely on the order and uses these functions, the breadth-first
boot option will resolve any problem.

Cc: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI Hotplug: the ibm driver is not dependant on PCI_LEGACY
Greg Kroah-Hartman [Wed, 13 Feb 2008 21:32:24 +0000 (13:32 -0800)] 
PCI Hotplug: the ibm driver is not dependant on PCI_LEGACY

This was marked incorrectly for some reason.  Allow the ibmphp driver to
be built even if PCI_LEGACY is not enabled.

Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI Hotplug: make cpcihp driver use modern apis
Greg Kroah-Hartman [Wed, 13 Feb 2008 21:32:24 +0000 (13:32 -0800)] 
PCI Hotplug: make cpcihp driver use modern apis

This removes the depandancy of the cpcihp driver from the PCI_LEGACY
config option by removing its usage of the pci_find_bus() function.

Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Scott Murray <scottm@somanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: clean up search.c a lot
Greg Kroah-Hartman [Wed, 13 Feb 2008 19:03:58 +0000 (11:03 -0800)] 
PCI: clean up search.c a lot

This cleans up the search.c file, now using the pci list of devices that
are created for the driver core, instead of relying on our separate list
of devices.  It's better to use the functions already created for this
kind of thing, instead of rolling our own all the time.

This work is done in anticipation of getting rid of that second list of
pci devices all together.

And it ends up saving code, always a nice benefit.

This also removes one compiler warning for when CONFIG_PCI_LEGACY is
enabled as we no longer internally use the deprecated functions anymore.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove pci_get_device_reverse
Greg Kroah-Hartman [Wed, 13 Feb 2008 17:32:03 +0000 (09:32 -0800)] 
PCI: remove pci_get_device_reverse

This removes the pci_get_device_reverse function as there should not be
any need to walk pci devices backwards anymore.  All users of this call
are now gone from the tree, so it is safe to remove it.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove pci_get_device_reverse from calgary driver
Greg Kroah-Hartman [Wed, 13 Feb 2008 17:32:03 +0000 (09:32 -0800)] 
PCI: remove pci_get_device_reverse from calgary driver

This isn't needed, we can just walk the devices in bus order with no
problems at all, as we really want to remove pci_get_device_reverse from
the kernel tree.

Acked-by: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove pci_find_present
Greg Kroah-Hartman [Tue, 12 Feb 2008 21:36:20 +0000 (13:36 -0800)] 
PCI: remove pci_find_present

No one is using this function anymore for quite some time, so remove it.
Everyone calls pci_dev_present() instead anyway...

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: #if 0 pci_assign_resource_fixed()
Adrian Bunk [Wed, 13 Feb 2008 21:30:12 +0000 (23:30 +0200)] 
PCI: #if 0 pci_assign_resource_fixed()

An unused function that bloated the kernel only when CONFIG_EMBEDDED was
enabled...

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: doc/pci: create Documentation/PCI/ and move files into it
Randy Dunlap [Tue, 11 Mar 2008 00:16:32 +0000 (17:16 -0700)] 
PCI: doc/pci: create Documentation/PCI/ and move files into it

Create Documentation/PCI/ and move PCI-related files to it.
Fix a few instances of trailing whitespace.
Update references to the new file locations.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years ago[HWRNG] omap: Minor updates
David Brownell [Wed, 16 Apr 2008 11:24:42 +0000 (19:24 +0800)] 
[HWRNG] omap: Minor updates

Minor cleanups to the OMAP RNG:

 - Comment update re RNG status:
     * yes, it works on 16xx; "rngtest" is quite happy
     * it's fast enough that polling vs IRQ is a non-issue
 - Get rid of BUG_ON
 - Help GCC not be stupid about inlining (object code shrink)
 - Remove "sparse" warning
 - Cope with new hotplug rule requiring "platform:" modalias

And make the file header match kernel conventions.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] kconfig: Ordering cleanup
Sebastian Siewior [Sat, 5 Apr 2008 13:04:48 +0000 (21:04 +0800)] 
[CRYPTO] kconfig: Ordering cleanup

Ciphers, block modes, name it, are grouped together and sorted.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] all: Clean up init()/fini()
Kamalesh Babulal [Sat, 5 Apr 2008 13:00:57 +0000 (21:00 +0800)] 
[CRYPTO] all: Clean up init()/fini()

On Thu, Mar 27, 2008 at 03:40:36PM +0100, Bodo Eggert wrote:
> Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> wrote:
>
> > This patch cleanups the crypto code, replaces the init() and fini()
> > with the <algorithm name>_init/_fini
>
> This part ist OK.
>
> > or init/fini_<algorithm name> (if the
> > <algorithm name>_init/_fini exist)
>
> Having init_foo and foo_init won't be a good thing, will it? I'd start
> confusing them.
>
> What about foo_modinit instead?

Thanks for the suggestion, the init() is replaced with

<algorithm name>_mod_init ()

and fini () is replaced with <algorithm name>_mod_fini.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] padlock-aes: Use generic setkey function
Sebastian Siewior [Tue, 1 Apr 2008 13:24:50 +0000 (21:24 +0800)] 
[CRYPTO] padlock-aes: Use generic setkey function

The Padlock AES setkey routine is the same as exported by the generic
implementation. So we could use it.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Cc: Michal Ludvig <michal@logix.cz>
Tested-by: Stefan Hellermann <stefan@the2masters.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] aes: Export generic setkey
Sebastian Siewior [Tue, 1 Apr 2008 12:58:51 +0000 (20:58 +0800)] 
[CRYPTO] aes: Export generic setkey

The key expansion routine could be get little more generic, become
a kernel doc entry and then get exported.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Tested-by: Stefan Hellermann <stefan@the2masters.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] api: Make the crypto subsystem fully modular
Sebastian Siewior [Sun, 30 Mar 2008 08:36:09 +0000 (16:36 +0800)] 
[CRYPTO] api: Make the crypto subsystem fully modular

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] cts: Add CTS mode required for Kerberos AES support
Kevin Coffman [Mon, 24 Mar 2008 13:26:16 +0000 (21:26 +0800)] 
[CRYPTO] cts: Add CTS mode required for Kerberos AES support

Implement CTS wrapper for CBC mode required for support of AES
encryption support for Kerberos (rfc3962).

Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] lrw: Replace all adds to big endians variables with be*_add_cpu
Marcin Slusarz [Fri, 14 Mar 2008 08:22:53 +0000 (16:22 +0800)] 
[CRYPTO] lrw: Replace all adds to big endians variables with be*_add_cpu

replace all:
big_endian_variable = cpu_to_beX(beX_to_cpu(big_endian_variable) +
expression_in_cpu_byteorder);
with:
beX_add_cpu(&big_endian_variable, expression_in_cpu_byteorder);

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] tcrypt: Change the XTEA test vectors
Sebastian Siewior [Thu, 13 Mar 2008 12:29:07 +0000 (20:29 +0800)] 
[CRYPTO] tcrypt: Change the XTEA test vectors

The third test vector of ECB-XTEA-ENC fails for me all other
are fine. I could not find a RFC or something else where they
are defined. The test vector has not been modified since git
started recording histrory. The implementation is very close
(not to say equal) to what is available as Public Domain (they
recommend 64 rounds and the in kernel uses 32). Therefore I
belive that there is typo somewhere and tcrypt reported always
*fail* instead of *okey*.
This patch replaces input + result of the third test vector with
result + input from the third decryption vector. The key is the
same, the other three test vectors are also the reverse.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] tcrypt: Shrink the tcrypt module
Sebastian Siewior [Thu, 13 Mar 2008 12:21:51 +0000 (20:21 +0800)] 
[CRYPTO] tcrypt: Shrink the tcrypt module

Currently the tcrypt module is about 2 MiB on x86-32. The
main reason for the huge size is the data segment which contains
all the test vectors for each algorithm. The test vectors are
staticly allocated in an array and the size of the array has been
drastically increased by the merge of the Salsa20 test vectors.

With a hint from Benedigt Spranger I found a way how I could
convert those fixed-length arrays to strings which are flexible
in size. VIM and regex were also very helpfull :)
So, I am talking about a shrinking of ~97% on x86-32:

   text    data     bss     dec     hex filename
  18309 2039708      20 2058037  1f6735 tcrypt-b4.ko
  45628   23516      80   69224   10e68 tcrypt.ko

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] tcrypt: Change the usage of the test vectors
Sebastian Siewior [Thu, 13 Mar 2008 12:20:28 +0000 (20:20 +0800)] 
[CRYPTO] tcrypt: Change the usage of the test vectors

The test routines (test_{cipher,hash,aead}) are makeing a copy
of the test template and are processing the encryption process
in place. This patch changes the creation of the copy so it will
work even if the source address of the input data isn't an array
inside of the template but a pointer.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] api: Constify function pointer tables
Jan Engelhardt [Thu, 13 Mar 2008 11:37:45 +0000 (19:37 +0800)] 
[CRYPTO] api: Constify function pointer tables

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] aes-x86-32: Remove unused return code
Sebastian Siewior [Tue, 11 Mar 2008 13:29:47 +0000 (21:29 +0800)] 
[CRYPTO] aes-x86-32: Remove unused return code

The return parameter isn't used remove it.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] tcrypt: Shrink speed templates
Sebastian Siewior [Tue, 11 Mar 2008 13:27:11 +0000 (21:27 +0800)] 
[CRYPTO] tcrypt: Shrink speed templates

The speed templates as it look always the same. The key size
is repeated for each block size and we test always the same
block size. The addition of one inner loop makes it possible
to get rid of the struct and it is possible to use a tiny
u8 array :)

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] tcrypt: Group common speed templates
Sebastian Siewior [Tue, 11 Mar 2008 13:24:26 +0000 (21:24 +0800)] 
[CRYPTO] tcrypt: Group common speed templates

Some crypto ciphers which are impleneted support similar key sizes
(16,24 & 32 byte). They can be grouped together and use a common
templatte instead of their own which contains the same data.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] sha512: Rename sha512 to sha512_generic
Jan Glauber [Thu, 6 Mar 2008 11:55:38 +0000 (19:55 +0800)] 
[CRYPTO] sha512: Rename sha512 to sha512_generic

Rename sha512 to sha512_generic and add a MODULE_ALIAS for sha512
so all sha512 implementations can be loaded automatically.

Keep the broken tabs so git recognizes this as a rename.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] sha384: Hardware acceleration for s390
Jan Glauber [Thu, 6 Mar 2008 11:53:50 +0000 (19:53 +0800)] 
[CRYPTO] sha384: Hardware acceleration for s390

Exploit the System z10 hardware acceleration for SHA384.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] sha512: Hardware acceleration for s390
Jan Glauber [Thu, 6 Mar 2008 11:52:00 +0000 (19:52 +0800)] 
[CRYPTO] sha512: Hardware acceleration for s390

Exploit the System z10 hardware acceleration for SHA512.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] s390: Generic sha_update and sha_final
Jan Glauber [Thu, 6 Mar 2008 11:50:20 +0000 (19:50 +0800)] 
[CRYPTO] s390: Generic sha_update and sha_final

The sha_{update|final} functions are similar for every sha variant.
Since that is error-prone and redundant replace these functions by
a shared generic implementation for s390.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[CRYPTO] api: Switch to proc_create()
Alexey Dobriyan [Wed, 5 Mar 2008 11:27:51 +0000 (19:27 +0800)] 
[CRYPTO] api: Switch to proc_create()

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
16 years ago[ISDN] minor irq handler cleanups
Jeff Garzik [Wed, 31 Oct 2007 09:42:50 +0000 (05:42 -0400)] 
[ISDN] minor irq handler cleanups

- reference irq number in CardState structure

- remove now-unused 'intno' argument from rs_interrupt_elsa()

- cs->irq_func() should be defined using standard irq_handler_t

- add KERN_DEBUG to printk() where appropriate

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agodrivers/char: minor irq handler cleanups
Jeff Garzik [Wed, 31 Oct 2007 09:20:49 +0000 (05:20 -0400)] 
drivers/char: minor irq handler cleanups

- remove always-false tests

- don't overload 'irq' argument, pass data properly via dev_id

- remove pointless casts from void*

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[PPC] minor irq handler cleanups
Jeff Garzik [Wed, 31 Oct 2007 09:15:20 +0000 (05:15 -0400)] 
[PPC] minor irq handler cleanups

- whitespace cleanups

- remove pointless prototype (uses always follow func implementation)

- 'irq' argument is used here purely as a local variable.  rename
  argument to 'dummy' and define 'irq' as local to make this plain.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[BLACKFIN] minor irq handler cleanups
Jeff Garzik [Wed, 31 Oct 2007 09:11:45 +0000 (05:11 -0400)] 
[BLACKFIN] minor irq handler cleanups

- use standard irq_handler_t to define irq handler function arguments

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[SPARC] minor irq handler cleanups
Jeff Garzik [Wed, 31 Oct 2007 09:08:48 +0000 (05:08 -0400)] 
[SPARC] minor irq handler cleanups

- mark timer_interrupt() static

- sparc_floppy_request_irq() prototype should use irq_handler_t

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: David S. Miller <davem@davemloft.net>
16 years agoARM minor irq handler cleanup: avoid passing unused info to irq
Jeff Garzik [Wed, 31 Oct 2007 09:07:08 +0000 (05:07 -0400)] 
ARM minor irq handler cleanup: avoid passing unused info to irq

Reduce human confusion a bit, by /not/ passing an unused value to
arm_rtc_interrupt()

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[ISDN] Hisax: eliminate many unnecessary references to CardType[]
Jeff Garzik [Wed, 31 Oct 2007 07:42:07 +0000 (03:42 -0400)] 
[ISDN] Hisax: eliminate many unnecessary references to CardType[]

For the vast majority of CardType[card->typ] uses (but not all!),
the string is constant for each driver.  Therefore, we may replace
CardType[card->typ] with the actual string describing the driver, making
each printk() a bit more simple.

This also has the nice, intended side effect of greatly reducing
external references to hisax global CardType[].  This will be of value
once the ISDN drivers are converted to the ISA/PCI/PNP hotplug APIs.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[ISDN] HiSax: modularization prep
Jeff Garzik [Sat, 16 Feb 2008 04:41:15 +0000 (23:41 -0500)] 
[ISDN] HiSax: modularization prep

Pass a function pointer into the core HiSax probe function checkcard(),
in order to facilitate modular drivers passing in their own setup
routines.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[POWERPC] Fix compile breakage for 64-bit UP configs
Paul Mackerras [Sun, 20 Apr 2008 07:57:10 +0000 (17:57 +1000)] 
[POWERPC] Fix compile breakage for 64-bit UP configs

The rearrangements in 945feb174b14e7098cc7ecf0cf4768d35bc52f9c
("[POWERPC] irqtrace support for 64-bit powerpc") caused 64-bit
non-SMP configs to fail to compile with a message about
local_irq_save being undefined in include/linux/proportions.h.
This follows the lead of x86 in including <linux/irqflags.h> in
asm/system.h, which fixes the problem.

Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Define copy_siginfo_from_user32
Roland McGrath [Sat, 19 Apr 2008 22:19:24 +0000 (08:19 +1000)] 
[POWERPC] Define copy_siginfo_from_user32

Define the copy_siginfo_from_user32 entry point for powerpc, so
that generic CONFIG_COMPAT code can call it.  We already had the
code rolled into compat_sys_rt_sigqueueinfo, this just moves it
out into the canonical function that other arch's define.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Add compat handler for PTRACE_GETSIGINFO
Andreas Schwab [Sat, 19 Apr 2008 16:25:13 +0000 (02:25 +1000)] 
[POWERPC] Add compat handler for PTRACE_GETSIGINFO

Current versions of gdb require a working implementation of
PTRACE_GETSIGINFO for proper watchpoint support.  Since struct siginfo
contains pointers it must be converted when passed to a 32-bit debugger.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] i2c: Fix build breakage introduced by OF helpers
Jochen Friedrich [Fri, 18 Apr 2008 14:23:03 +0000 (00:23 +1000)] 
[POWERPC] i2c: Fix build breakage introduced by OF helpers

Fix build breakage introduced in commit "[POWERPC] i2c: OF helpers for
the i2c API".  If i2c-core is compiled as a module, the helper needs
to be compiled as a module, as well.  Rename i2c.c to of_i2c.c to
avoid name space conflict.

[paulus@samba.org: Changed dependency from OF to PPC_OF to avoid
sparc{32,64} allmodconfig breakage.]

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agoSCSI: convert struct class_device to struct device
Tony Jones [Thu, 21 Feb 2008 23:13:36 +0000 (00:13 +0100)] 
SCSI: convert struct class_device to struct device

It's big, but there doesn't seem to be a way to split it up smaller...

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDRM: remove unused dev_class
Greg Kroah-Hartman [Tue, 11 Mar 2008 19:50:38 +0000 (12:50 -0700)] 
DRM: remove unused dev_class

The struct class_device *dev_class is not used in the struct drm_head
structure at all, so remove it as class_device is being removed entirely
from the kernel.

Cc: David Airlie <airlied@linux.ie>
Cc: Tony Jones <tonyj@suse.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoIB: rename "dev" to "srp_dev" in srp_host structure
Greg Kroah-Hartman [Wed, 5 Mar 2008 23:13:36 +0000 (00:13 +0100)] 
IB: rename "dev" to "srp_dev" in srp_host structure

This sets us up to be able to convert the srp_host to use a struct
device instead of a class_device.

Based on a original patch from Tony Jones, but split up into this piece
by Greg.

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Reviewed-by: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoIB: convert struct class_device to struct device
Tony Jones [Thu, 21 Feb 2008 23:13:36 +0000 (00:13 +0100)] 
IB: convert struct class_device to struct device

This converts the main ib_device to use struct device instead of struct
class_device as class_device is going away.

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agomemstick: convert struct class_device to struct device
Greg Kroah-Hartman [Mon, 3 Mar 2008 23:13:36 +0000 (00:13 +0100)] 
memstick: convert struct class_device to struct device

struct class_device is going away, struct device should be used instead.

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: replace remaining __FUNCTION__ occurrences
Harvey Harrison [Wed, 5 Mar 2008 00:41:05 +0000 (16:41 -0800)] 
driver core: replace remaining __FUNCTION__ occurrences

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: refill attribute buffer when reading from offset 0
Dan Williams [Mon, 7 Apr 2008 22:35:01 +0000 (15:35 -0700)] 
sysfs: refill attribute buffer when reading from offset 0

Requiring userspace to close and re-open sysfs attributes has been the
policy since before 2.6.12.  It allows userspace to get a consistent
snapshot of kernel state and consume it with incremental reads and seeks.

Now, if the file position is zero the kernel assumes userspace wants to see
the new value.  The application for this change is to allow a userspace
RAID metadata handler to check the state of an array without causing any
memory allocations.  Thus not causing writeback to a raid array that might
be blocked waiting for userspace to take action.

Cc: Neil Brown <neilb@suse.de>
Acked-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Remove destroy_suspended_device()
Rafael J. Wysocki [Sun, 23 Mar 2008 19:28:24 +0000 (20:28 +0100)] 
PM: Remove destroy_suspended_device()

After 2.6.24 there was a plan to make the PM core acquire all device
semaphores during a suspend/hibernation to protect itself from
concurrent operations involving device objects.  That proved to be
too heavy-handed and we found a better way to achieve the goal, but
before it happened, we had introduced the functions
device_pm_schedule_removal() and destroy_suspended_device() to allow
drivers to "safely" destroy a suspended device and we had adapted some
drivers to use them.  Now that these functions are no longer necessary,
it seems reasonable to remove them and modify their users to use the
normal device unregistration instead.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoFirmware: add iSCSI iBFT Support
Konrad Rzeszutek [Thu, 10 Apr 2008 02:50:41 +0000 (19:50 -0700)] 
Firmware: add iSCSI iBFT Support

Add /sysfs/firmware/ibft/[initiator|targetX|ethernetX] directories along with
text properties which export the the iSCSI Boot Firmware Table (iBFT)
structure.

What is iSCSI Boot Firmware Table?  It is a mechanism for the iSCSI tools to
extract from the machine NICs the iSCSI connection information so that they
can automagically mount the iSCSI share/target.  Currently the iSCSI
information is hard-coded in the initrd.  The /sysfs entries are read-only
one-name-and-value fields.

The usual set of data exposed is:

# for a in `find /sys/firmware/ibft/ -type f -print`; do  echo -n "$a: ";  cat $a; done
/sys/firmware/ibft/target0/target-name: iqn.2007.com.intel-sbx44:storage-10gb
/sys/firmware/ibft/target0/nic-assoc: 0
/sys/firmware/ibft/target0/chap-type: 0
/sys/firmware/ibft/target0/lun: 00000000
/sys/firmware/ibft/target0/port: 3260
/sys/firmware/ibft/target0/ip-addr: 192.168.79.116
/sys/firmware/ibft/target0/flags: 3
/sys/firmware/ibft/target0/index: 0
/sys/firmware/ibft/ethernet0/mac: 00:11:25:9d:8b:01
/sys/firmware/ibft/ethernet0/vlan: 0
/sys/firmware/ibft/ethernet0/gateway: 192.168.79.254
/sys/firmware/ibft/ethernet0/origin: 0
/sys/firmware/ibft/ethernet0/subnet-mask: 255.255.252.0
/sys/firmware/ibft/ethernet0/ip-addr: 192.168.77.41
/sys/firmware/ibft/ethernet0/flags: 7
/sys/firmware/ibft/ethernet0/index: 0
/sys/firmware/ibft/initiator/initiator-name: iqn.2007-07.com:konrad.initiator
/sys/firmware/ibft/initiator/flags: 3
/sys/firmware/ibft/initiator/index: 0

For full details of the IBFT structure please take a look at:
ftp://ftp.software.ibm.com/systems/support/system_x_pdf/ibm_iscsi_boot_firmware_table_v1.02.pdf

[akpm@linux-foundation.org: fix build]
Signed-off-by: Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: Peter Jones <pjones@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Remove legacy PM (fix)
Randy Dunlap [Fri, 28 Mar 2008 21:22:52 +0000 (14:22 -0700)] 
PM: Remove legacy PM (fix)

Source file was removed.  Need to remove docbook reference also.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Pavel Machek <pavel@suse.cz>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: Replace list_for_each() with list_for_each_entry().
Robert P. J. Day [Thu, 27 Mar 2008 05:13:34 +0000 (01:13 -0400)] 
Kobject: Replace list_for_each() with list_for_each_entry().

Use the more concise list_for_each_entry(), which allows for the
deletion of the to_kobj() routine at the same time.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoSYSFS: Explicitly include required header file slab.h.
Robert P. J. Day [Fri, 14 Mar 2008 02:41:52 +0000 (22:41 -0400)] 
SYSFS: Explicitly include required header file slab.h.

After an experimental deletion of the unnecessary inclusion of
<linux/slab.h> from the header file <linux/percpu.h>, the following
files under fs/sysfs were exposed as needing to explicitly include
<linux/slab.h>.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: make device_is_registered() work for class devices
Greg Kroah-Hartman [Thu, 13 Mar 2008 21:07:03 +0000 (17:07 -0400)] 
Driver core: make device_is_registered() work for class devices

device_is_registered() can use the kobject value for this, so it will
now work with devices that are associated with only a class, not a bus
and a driver.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Convert wakeup flag accessors to inline functions
Alan Stern [Wed, 19 Mar 2008 21:39:13 +0000 (22:39 +0100)] 
PM: Convert wakeup flag accessors to inline functions

This patch (as1058) improves the wakeup macros in include/linux/pm.h.
All but the trivial ones are converted to inline routines, which
requires moving them to a separate header file since they depend on
the definition of struct device.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Make wakeup flags available whenever CONFIG_PM is set
Alan Stern [Wed, 19 Mar 2008 21:37:42 +0000 (22:37 +0100)] 
PM: Make wakeup flags available whenever CONFIG_PM is set

The various wakeup flags and their accessor macros in struct
dev_pm_info should be available whenever CONFIG_PM is enabled, not
just when CONFIG_PM_SLEEP is on.  Otherwise remote wakeup won't always
be configurable for runtime power management.  This patch (as1056b)
fixes the oversight.

David Brownell adds:
More accurately, fixes the "regression" ... as noted sometime
last summer, after 296699de6bdc717189a331ab6bbe90e05c94db06
introduced CONFIG_SUSPEND.  But that didn't make the regression
list for that kernel, ergo the delay in fixing it.

[rjw: rebased]

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Fix misuse of wakeup flag accessors in serial core
Alan Stern [Wed, 19 Mar 2008 21:35:13 +0000 (22:35 +0100)] 
PM: Fix misuse of wakeup flag accessors in serial core

This patch (as1059) fixes a mistake in the way the serial core
initializes a device's wakeup settings.  It should use the accessor
routine instead of relying on a macro producing an lvalue.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: Call device_pm_add() after bus_add_device() in device_add()
Rafael J. Wysocki [Tue, 11 Mar 2008 23:59:38 +0000 (00:59 +0100)] 
Driver core: Call device_pm_add() after bus_add_device() in device_add()

Include dpm_sysfs_add() into device_pm_add(), in analogy with
device_pm_remove(), and modify device_add() to call the latter after
bus_add_device(), to avoid situations in which the PM core may
attempt to suspend a device the registration of which has not been
successful.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPM: Handle device registrations during suspend/resume
Rafael J. Wysocki [Tue, 11 Mar 2008 23:57:22 +0000 (00:57 +0100)] 
PM: Handle device registrations during suspend/resume

Modify the PM core to protect its data structures, specifically the
dpm_active list, from being corrupted if a child of the currently
suspending device is registered concurrently with its ->suspend()
callback.  In that case, since the new device (the child) is added
to dpm_active after its parent, the PM core will attempt to
suspend it after the parent, which is wrong.

Introduce a new member of struct dev_pm_info, called 'sleeping',
and use it to check if the parent of the device being added to
dpm_active has been suspended, in which case the device registration
fails.  Also, use 'sleeping' for checking if the ordering of devices
on dpm_active is correct.

Introduce variable 'all_sleeping' that will be set to 'true' once all
devices have been suspended and make new device registrations fail
until 'all_sleeping' is reset to 'false', in order to avoid having
unsuspended devices around while the system is going into a sleep state.

Remove pm_sleep_rwsem which is not necessary any more.

Special thanks to Alan Stern for discussions and suggestions that
lead to the creation of this patch.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoblock: send disk "change" event for rescan_partitions()
Kay Sievers [Sun, 9 Mar 2008 20:26:02 +0000 (21:26 +0100)] 
block: send disk "change" event for rescan_partitions()

Userspace likes to get notified that the disk may have changed, when
rescan_partitions() is called after partitioning or media change. It will
make it possible to update the state of the disk with the "change" event,
before the following partition "add" events are handled.

Cc: David Zeuthen <david@fubar.dk>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysdev: detect multiple driver registrations
Ben Dooks [Tue, 4 Mar 2008 23:09:06 +0000 (15:09 -0800)] 
sysdev: detect multiple driver registrations

I've just found how easy it is to accidentally register a sysdev_driver for
two different classes.  When this happens, bad things happen as the
sysdev_driver structure keeps has the list entry for the driver
registration.

The following patch makes a WARN_ON() if this happens, although I think
BUG_ON or returning -EAGAIN could also be valid responses to this.

Signed-off-by: Ben Dooks <ben@fluff.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>
16 years agodriver core: cpu: fix section mismatch in cpu.c:store_online
Sam Ravnborg [Tue, 4 Mar 2008 23:09:05 +0000 (15:09 -0800)] 
driver core: cpu: fix section mismatch in cpu.c:store_online

Fix following warning:
WARNING: vmlinux.o(.text+0x64609c): Section mismatch in reference from the function store_online() to the function .cpuinit.text:cpu_up()

store_online() is defined inside a HOTPLUG_CPU block so references are OK.
Ignore references by annotating store_online() with __ref.

Note: This is needed because cpu_up() most likely should not have been
__cpuinit but all the hotplug cpu code misuses the __cpuinit annotation.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agopower_state: remove it from driver core
Pavel Machek [Thu, 21 Feb 2008 12:58:10 +0000 (13:58 +0100)] 
power_state: remove it from driver core

power_state is scheduled for removal, and it is used only for debug
prints by driver core. Remove it.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPNP: add all PNP card device id's as individual aliases
Kay Sievers [Wed, 20 Feb 2008 23:35:54 +0000 (00:35 +0100)] 
PNP: add all PNP card device id's as individual aliases

The current PNP combined card + devices module aliase can
never ever match anything, because these values are not available
all at the same time to request a module.

Instead of adding the combined alias, we add the device id's
all as individual aliases. Device id's are exported by the PNP
bus and can now properly used to request the loading of a
matching module.

The module snd-sbawe currently exports aliases, which can never
match anything:
  alias: pnp:cCTLXXXXdCTL0045dCTL0022*
  alias: pnp:cCTLXXXXdCTL0044dCTL0023*
  alias: pnp:cCTLXXXXdCTL0042dCTL0022*
  alias: pnp:cCTLXXXXdCTL0041dCTL0021*
  alias: pnp:cCTLXXXXdCTL0031dCTL0021*
  alias: pnp:cCTL00eddCTL0041dCTL0070*
  alias: pnp:cCTL00e9dCTL0045dCTL0022*
  alias: pnp:cCTL00e4dCTL0045dCTL0022*
  alias: pnp:cCTL00c7dCTL0045dCTL0022*
  alias: pnp:cCTL00c5dCTL0045dCTL0022*
  alias: pnp:cCTL00c3dCTL0045dCTL0022*
  alias: pnp:cCTL00c1dCTL0042dCTL0022*
  alias: pnp:cCTL00b2dCTL0044dCTL0023*
  alias: pnp:cCTL009edCTL0044dCTL0023*
  alias: pnp:cCTL009ddCTL0042dCTL0022*
  alias: pnp:cCTL009fdCTL0041dCTL0021*
  alias: pnp:cCTL009cdCTL0041dCTL0021*
  alias: pnp:cCTL009adCTL0041dCTL0021*
  alias: pnp:cCTL0054dCTL0031dCTL0021*
  alias: pnp:cCTL0048dCTL0031dCTL0021*
  alias: pnp:cCTL0047dCTL0031dCTL0021*
  alias: pnp:cCTL0046dCTL0031dCTL0021*
  alias: pnp:cCTL0045dCTL0031dCTL0021*
  alias: pnp:cCTL0044dCTL0031dCTL0021*
  alias: pnp:cCTL0043dCTL0031dCTL0021*
  alias: pnp:cCTL0042dCTL0031dCTL0021*
  alias: pnp:cCTL0039dCTL0031dCTL0021*
  alias: pnp:cCTL0035dCTL0031dCTL0021*

With this patch it exports only the device id's, as properly
matchable aliases:
  alias: pnp:dCTL0070*
  alias: pnp:dCTL0045*
  alias: pnp:dCTL0023*
  alias: pnp:dCTL0044*
  alias: pnp:dCTL0022*
  alias: pnp:dCTL0042*
  alias: pnp:dCTL0041*
  alias: pnp:dCTL0021*
  alias: pnp:dCTL0031*

Now, the exported value of the PNP bus can be used to autoload
a matching module:
  $ modprobe --first-time -n -v pnp:dCTL0045
  insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/core/snd-rawmidi.ko
  insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/drivers/mpu401/snd-mpu401-uart.ko
  insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/core/snd-hwdep.ko
  insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb-common.ko
  insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb16-csp.ko
  insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sb16-dsp.ko
  insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/drivers/opl3/snd-opl3-lib.ko
  insmod /lib/modules/2.6.24-rc6-g5b825ed2-dirty/kernel/sound/isa/sb/snd-sbawe.ko

  $ grep CTL0045 /sys/bus/pnp/devices/*/id
  /sys/bus/pnp/devices/01:01.00/id:CTL0045

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agofirmware: clean up samples for coding style issues
Greg Kroah-Hartman [Thu, 21 Feb 2008 00:07:07 +0000 (16:07 -0800)] 
firmware: clean up samples for coding style issues

This fixes up a number of coding style issues in the firmware sample files.

Yeah, it still doesn't build properly yet, that's next...

Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>