]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
17 years ago[NETFILTER]: sip: Fix RTP address NAT
Herbert Xu [Thu, 3 May 2007 10:35:31 +0000 (03:35 -0700)]
[NETFILTER]: sip: Fix RTP address NAT

I needed to use this recently to talk to a Cisco server.  In my case
I only did SNAT while the Cisco server used a different address for
RTP traffic than the one for SIP.  I discovered that nf_nat_sip NATed
the RTP address to the SIP one which was unnecessary but OK.  However,
in doing so it did not DNAT the destination address on the RTP traffic
to the Cisco back to the original RTP address.

This patch corrects this by noting down the RTP address and using it
when the expectation fires.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: nf_nat_proto_gre: do not modify/corrupt GREv0 packets through NAT
Jorge Boncompte [Thu, 3 May 2007 10:34:42 +0000 (03:34 -0700)]
[NETFILTER]: nf_nat_proto_gre: do not modify/corrupt GREv0 packets through NAT

While porting some changes of the 2.6.21-rc7 pptp/proto_gre conntrack
and nat modules to a 2.4.32 kernel I noticed that the gre_key function
returns a wrong pointer to the GRE key of a version 0 packet thus
corrupting the packet payload.

The intended behaviour for GREv0 packets is to act like
nf_conntrack_proto_generic/nf_nat_proto_unknown so I have ripped the
offending functions (not used anymore) and modified the
nf_nat_proto_gre modules to not touch version 0 (non PPTP) packets.

Signed-off-by: Jorge Boncompte <jorge@dti2.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: ipt_DNAT: accept port randomization option
Patrick McHardy [Thu, 3 May 2007 10:34:03 +0000 (03:34 -0700)]
[NETFILTER]: ipt_DNAT: accept port randomization option

Also accept the --random option for DNAT to allow randomly selecting a
destination port from the given range.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TCP]: Use S+L catcher only with SACK for now
Ilpo Järvinen [Thu, 3 May 2007 10:30:34 +0000 (03:30 -0700)]
[TCP]: Use S+L catcher only with SACK for now

TCP has a transitional state when SACK is not in use during
which this invariant is temporarily broken. Without SACK,
tcp_clean_rtx_queue does not decrement sacked_out. Therefore
calls to tcp_sync_left_out before sacked_out is again
corrected by tcp_fastretrans_alert can trigger this trap as
sacked_out still has couple of segments that are already out
of window.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS]: Adjust the new netdevice scanning code
David Howells [Thu, 3 May 2007 10:29:41 +0000 (03:29 -0700)]
[AFS]: Adjust the new netdevice scanning code

Adjust the new netdevice scanning code provided by Patrick McHardy:

 (1) Restore the function banner comments that were dropped.

 (2) Rather than using an array size of 6 in some places and an array size of
     ETH_ALEN in others, pass a pointer instead and pass the array size
     through so that we can actually check it.

 (3) Do the buffer fill count check before checking the for_primary_ifa
     condition again.  This permits us to skip that check should maxbufs be
     reached before we run out of interfaces.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS]: Replace rtnetlink client by direct dev_base walking
Patrick McHardy [Thu, 3 May 2007 10:28:49 +0000 (03:28 -0700)]
[AFS]: Replace rtnetlink client by direct dev_base walking

Replace the large and complicated rtnetlink client by two simple
functions for getting the MAC address for the first ethernet device
and building a list of IPv4 addresses.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET]: Add __dev_getfirstbyhwtype
Patrick McHardy [Thu, 3 May 2007 10:28:13 +0000 (03:28 -0700)]
[NET]: Add __dev_getfirstbyhwtype

Add __dev_getfirstbyhwtype for callers that don't want a reference but
some data from the device and thus need to take the rtnl anyway.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS]: Fix memory leak in SRXAFSCB_GetCapabilities
Patrick McHardy [Thu, 3 May 2007 10:27:39 +0000 (03:27 -0700)]
[AFS]: Fix memory leak in SRXAFSCB_GetCapabilities

The interface array is not freed on exit.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETLINK]: Fix use after free in netlink_recvmsg
Patrick McHardy [Thu, 3 May 2007 10:27:01 +0000 (03:27 -0700)]
[NETLINK]: Fix use after free in netlink_recvmsg

When the user passes in MSG_TRUNC the skb is used after getting freed.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETLINK]: Kill CB only when socket is unused
Herbert Xu [Thu, 3 May 2007 10:17:14 +0000 (03:17 -0700)]
[NETLINK]: Kill CB only when socket is unused

Since we can still receive packets until all references to the
socket are gone, we don't need to kill the CB until that happens.
This also aligns ourselves with the receive queue purging which
happens at that point.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET] skbuff: fix kernel-doc
Randy Dunlap [Thu, 3 May 2007 10:16:20 +0000 (03:16 -0700)]
[NET] skbuff: fix kernel-doc

Fix skbuff.h kernel-doc:
linux-2.6.21-git4//include/linux/skbuff.h:316): No description found for parameter 'transport_header'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TCP]: Delete unused header file net/ipv4/tcp_yeah.h.
Robert P. J. Day [Thu, 3 May 2007 10:13:35 +0000 (03:13 -0700)]
[TCP]: Delete unused header file net/ipv4/tcp_yeah.h.

Delete the apparently unused header file net/ipv4/tcp_yeah.h.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS]: Fix use of __exit functions from __init path
David Howells [Thu, 3 May 2007 10:12:46 +0000 (03:12 -0700)]
[AFS]: Fix use of __exit functions from __init path

Fix use of __exit functions from __init path.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS/AF_RXRPC]: Miscellaneous fixes.
David Howells [Thu, 3 May 2007 10:11:29 +0000 (03:11 -0700)]
[AFS/AF_RXRPC]: Miscellaneous fixes.

Make miscellaneous fixes to AFS and AF_RXRPC:

 (*) Make AF_RXRPC select KEYS rather than RXKAD or AFS_FS in Kconfig.

 (*) Don't use FS_BINARY_MOUNTDATA.

 (*) Remove a done 'TODO' item in a comemnt on afs_get_sb().

 (*) Don't pass a void * as the page pointer argument of kmap_atomic() as this
     breaks on m68k.  Patch from Geert Uytterhoeven <geert@linux-m68k.org>.

 (*) Use match_*() functions rather than doing my own parsing.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS]: Make the match_*() functions take const options.
David Howells [Thu, 3 May 2007 10:10:39 +0000 (03:10 -0700)]
[AFS]: Make the match_*() functions take const options.

Make the match_*() functions take a const pointer to the options table
and make strings pointers in the options table const too.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPV6]: Get rid of __HAVE_ARCH_ADDR_SET.
Eric Dumazet [Thu, 3 May 2007 10:08:43 +0000 (03:08 -0700)]
[IPV6]: Get rid of __HAVE_ARCH_ADDR_SET.

__HAVE_ARCH_ADDR_SET seems unused these days, just get rid of it.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoPCI: Free resource files in error path of pci_create_sysfs_dev_files()
Michael Ellerman [Wed, 18 Apr 2007 03:34:12 +0000 (13:34 +1000)]
PCI: Free resource files in error path of pci_create_sysfs_dev_files()

pci_create_sysfs_dev_files() should call pci_remove_resource_files() in
its error path, to match the call it makes to pci_create_resource_files().

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agopci-quirks: disable MSI on RS400-200 and RS480
Tejun Heo [Mon, 16 Apr 2007 04:59:18 +0000 (13:59 +0900)]
pci-quirks: disable MSI on RS400-200 and RS480

MSI doesn't work on RS400-200 and RS480 requiring pci=nomsi kernel
boot parameter for ahci to work.  This patch disables MSI on those
chips.

  http://thread.gmane.org/gmane.linux.ide/17820
  http://thread.gmane.org/gmane.linux.ide/17516
  https://bugzilla.novell.com/show_bug.cgi?id=263893

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI hotplug: Use menuconfig objects
Jan Engelhardt [Fri, 13 Apr 2007 22:34:27 +0000 (15:34 -0700)]
PCI hotplug: Use menuconfig objects

Use menuconfigs instead of menus, so the whole menu can be disabled at
once instead of going through all options.

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Cc: Scott Murray <scottm@somanetworks.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: ZT5550 CPCI Hotplug driver fix
Scott Murray [Fri, 13 Apr 2007 22:34:26 +0000 (15:34 -0700)]
PCI: ZT5550 CPCI Hotplug driver fix

cc: Philip Guo <pg@cs.stanford.edu>

Here's a small patch against the current git tree for the ZT5550 CPCI
hotplug driver to fix an issue with port freeing that Philip Guo found.

Signed-off-by: Scott Murray <scottm@somanetworks.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Remove semaphores
Linas Vepstas [Fri, 13 Apr 2007 22:34:25 +0000 (15:34 -0700)]
PCI: rpaphp: Remove semaphores

Remove the semaphores from the get routine. These do not
appear to be protecting anything that I can make out,
and they also do not seem to be required by the hotplug
driver.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Ensure more pcibios_add/pcibios_remove symmetry
Linas Vepstas [Fri, 13 Apr 2007 22:34:24 +0000 (15:34 -0700)]
PCI: rpaphp: Ensure more pcibios_add/pcibios_remove symmetry

Calls to pcibios_add should be symmetric with calls to pcibios_remove.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically
Linas Vepstas [Fri, 13 Apr 2007 22:34:23 +0000 (15:34 -0700)]
PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically

At first blush, the disable_slot() routine does not look
at all like its symmetric with the enable_slot() routine;
as it seems to call a very different set of routines.
However, this is easily fixed: pcibios_remove_pci_devices()
does the right thing.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Document is_php_dn()
Linas Vepstas [Fri, 13 Apr 2007 22:34:22 +0000 (15:34 -0700)]
PCI: rpaphp: Document is_php_dn()

Fix up the documentation: the rpaphp_add_slot() does not actually
handle embedded slots: in fact, it ignores them. Fix the flow of
control in the routine that checks for embedded slots.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Document find_php_slot()
Linas Vepstas [Fri, 13 Apr 2007 22:34:21 +0000 (15:34 -0700)]
PCI: rpaphp: Document find_php_slot()

Document some of the interaction between dlpar and hotplug.
viz, the a dlpar remove of a htoplug slot uses hotplug to remove it.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Rename rpaphp_register_pci_slot() to rpaphp_enable_slot()
Linas Vepstas [Fri, 13 Apr 2007 22:34:20 +0000 (15:34 -0700)]
PCI: rpaphp: Rename rpaphp_register_pci_slot() to rpaphp_enable_slot()

Rename rpaphp_register_pci_slot() because its easy to confuse
with  rpaphp_register_slot() even though it does something
completely different. Rename it to rpaphp_enable_slot() because
its almost identical to enbale_slot().

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: refactor tail call to rpaphp_register_slot()
Linas Vepstas [Fri, 13 Apr 2007 22:34:19 +0000 (15:34 -0700)]
PCI: rpaphp: refactor tail call to rpaphp_register_slot()

Eliminate the tail call to rpaphp_register_slot()
by placing it in the caller. This will help later
dis-entanglement.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: remove rpaphp_set_attention_status()
Linas Vepstas [Fri, 13 Apr 2007 22:34:18 +0000 (15:34 -0700)]
PCI: rpaphp: remove rpaphp_set_attention_status()

The rpaphp_set_attention_status() routine seems to be a wrapper
around a single rtas call. Abolish it.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: remove print_slot_pci_funcs()
Linas Vepstas [Fri, 13 Apr 2007 22:34:17 +0000 (15:34 -0700)]
PCI: rpaphp: remove print_slot_pci_funcs()

The debug function print_slot_pci_funcs() is a large wrapper
around two debug print statements.  Just invoke these directly.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Remove setup_pci_slot()
Linas Vepstas [Fri, 13 Apr 2007 22:34:16 +0000 (15:34 -0700)]
PCI: rpaphp: Remove setup_pci_slot()

The setup_pci_slot() routine appears to be nothing else than
a big, complicated wrapper around pcibios_add_pci_devices().
Remove the wrapping, and call pcibios_add_pci_devices() directly.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: remove a call that does nothing but a pointer lookup
Linas Vepstas [Fri, 13 Apr 2007 22:34:15 +0000 (15:34 -0700)]
PCI: rpaphp: remove a call that does nothing but a pointer lookup

Delete another stovepipe: a call to a routine which does nothing.
Remove un-needed semaphore as well.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Remove another wrappered function
Linas Vepstas [Fri, 13 Apr 2007 22:34:14 +0000 (15:34 -0700)]
PCI: rpaphp: Remove another wrappered function

Remove another stove-pipe; this funcion was called from
two different places, with a compile-time const that is
then run-time checked to perform two different things.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Remve another call that is a wrapper
Linas Vepstas [Fri, 13 Apr 2007 22:34:13 +0000 (15:34 -0700)]
PCI: rpaphp: Remve another call that is a wrapper

Remove another stovepipe: a call which wraps another call, and
just adds printks.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: remove a function that does nothing but wrap debug printks
Linas Vepstas [Fri, 13 Apr 2007 22:34:12 +0000 (15:34 -0700)]
PCI: rpaphp: remove a function that does nothing but wrap debug printks

Remove a stove-pipe-- a function that is called from only one place,
does nothing but wraps another function with debug printk's.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Remove un-needed goto
Linas Vepstas [Fri, 13 Apr 2007 22:34:11 +0000 (15:34 -0700)]
PCI: rpaphp: Remove un-needed goto

Remove un-needed goto.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Fix a memleak; slot->location string was never freed
Linas Vepstas [Fri, 13 Apr 2007 22:34:10 +0000 (15:34 -0700)]
PCI: rpaphp: Fix a memleak; slot->location string was never freed

Fix a memleak; the slot->location string was never freed.
Fix some whitespace and overlong-line probelms while we're here.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: match up alloc and free in same routine
Linas Vepstas [Fri, 13 Apr 2007 22:34:09 +0000 (15:34 -0700)]
PCI: rpaphp: match up alloc and free in same routine

The routine that called an alloc should be the same routine that
calles the mathcing free, if anything in the middle failed.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Remove global num_slots variable
Linas Vepstas [Fri, 13 Apr 2007 22:34:08 +0000 (15:34 -0700)]
PCI: rpaphp: Remove global num_slots variable

Cleanup cruft: remove the global "num_slots" variable;
although scattered across multiple files, it is used only
once, in a debug statement.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: rpaphp: Cleanup flow of control for rpaphp_add_slot
Linas Vepstas [Fri, 13 Apr 2007 22:34:07 +0000 (15:34 -0700)]
PCI: rpaphp: Cleanup flow of control for rpaphp_add_slot

Cleanup the flow of control for rpaphp_add_slot(), so as to
make it easier to read. The ext patch will fix a bug in this
same code.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: add debug information to resource collision message
Chuck Ebbert [Tue, 10 Apr 2007 14:25:44 +0000 (10:25 -0400)]
PCI: add debug information to resource collision message

Add more information to PCI resource collision message
to help with debugging.

Signed-off-by: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: the overdue removal of pci_module_init()
Adrian Bunk [Fri, 6 Apr 2007 10:19:48 +0000 (12:19 +0200)]
PCI: the overdue removal of pci_module_init()

Unless we finally completely remove it, people will always add new users.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: remove the broken PCI_MULTITHREAD_PROBE option
Adrian Bunk [Tue, 27 Mar 2007 01:02:51 +0000 (03:02 +0200)]
PCI: remove the broken PCI_MULTITHREAD_PROBE option

This patch removes the PCI_MULTITHREAD_PROBE option that had already
been marked as broken.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Give archs the option to free all MSI/Xs at once.
Michael Ellerman [Wed, 18 Apr 2007 09:39:22 +0000 (19:39 +1000)]
MSI: Give archs the option to free all MSI/Xs at once.

This patch introduces an optional function, arch_teardown_msi_irqs(),
which gives an arch the opportunity to do per-device teardown for
MSI/X. If that's not required, the default version simply calls
arch_teardown_msi_irq() for each msi irq required.

arch_teardown_msi_irqs() is simply passed a pdev, attached to the pdev
is a list of msi_descs, it is up to the arch to free the irq associated
with each of these as appropriate.

For archs that _don't_ implement arch_teardown_msi_irqs(), all msi_descs
with irq == 0 are considered unallocated, and the arch teardown routine
is not called on them.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Give archs the option to allocate all MSI/Xs at once.
Michael Ellerman [Wed, 18 Apr 2007 09:39:21 +0000 (19:39 +1000)]
MSI: Give archs the option to allocate all MSI/Xs at once.

This patch introduces an optional function, arch_setup_msi_irqs(),
(note the plural) which gives an arch the opportunity to do per-device
setup for MSI/X and then allocate all the requested MSI/Xs at once.

If that's not required by the arch, the default version simply calls
arch_setup_msi_irq() for each MSI irq required.

arch_setup_msi_irqs() is passed a pdev, attached to the pdev is a list
of msi_descs with irq == 0, it is up to the arch to connect these up to
an irq (via set_irq_msi()) or return an error. For convenience the number
of vectors and the type are passed also.

All msi_descs with irq != 0 are considered allocated, and the arch
teardown routine will be called on them when necessary.

The existing semantics of pci_enable_msix() are that if the requested
number of irqs can not be allocated, the maximum number that _could_ be
allocated is returned. To support that, we define that in case of an
error from arch_setup_msi_irqs(), the number of msi_descs with irq != 0
are considered allocated, and are counted toward the "max that could be
allocated".

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: arch must connect the irq and the msi_desc
Michael Ellerman [Wed, 18 Apr 2007 09:39:21 +0000 (19:39 +1000)]
MSI: arch must connect the irq and the msi_desc

set_irq_msi() currently connects an irq_desc to an msi_desc. The archs call
it at some point in their setup routine, and then the generic code sets up the
reverse mapping from the msi_desc back to the irq.

set_irq_msi() should do both connections, making it the one and only call
required to connect an irq with it's MSI desc and vice versa.

The arch code MUST call set_irq_msi(), and it must do so only once it's sure
it's not going to fail the irq allocation.

Given that there's no need for the arch to return the irq anymore, the return
value from the arch setup routine just becomes 0 for success and anything else
for failure.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agomsi: introduce ARCH_SUPPORTS_MSI Kconfig option (rev2)
Dan Williams [Wed, 18 Apr 2007 08:46:20 +0000 (18:46 +1000)]
msi: introduce ARCH_SUPPORTS_MSI Kconfig option (rev2)

Allows architectures to advertise that they support MSI rather than listing
each architecture as a PCI_MSI dependency.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Remove dev->first_msi_irq
Michael Ellerman [Thu, 5 Apr 2007 07:19:12 +0000 (17:19 +1000)]
MSI: Remove dev->first_msi_irq

Now that we keep a list of msi descriptors, we don't need first_msi_irq
in the pci dev.

If we somehow have zero MSIs configured list_entry() will give us weird
oopes or nice memory corruption bugs. So be paranoid. Add BUG_ONs and also
a check in pci_msi_check_device() to make sure nvec > 0.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Use a list instead of the custom link structure
Michael Ellerman [Thu, 5 Apr 2007 07:19:10 +0000 (17:19 +1000)]
MSI: Use a list instead of the custom link structure

The msi descriptors are linked together with what looks a lot like
a linked list, but isn't a struct list_head list. Make it one.

The only complication is that previously we walked a list of irqs, and
got the descriptor for each with get_irq_msi(). Now we have a list of
descriptors and need to get the irq out of it, so it needs to be in the
actual struct msi_desc. We use 0 to indicate no irq is setup.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Convert to alloc_pci_dev()
Michael Ellerman [Thu, 5 Apr 2007 07:19:09 +0000 (17:19 +1000)]
PCI: Convert to alloc_pci_dev()

Convert code that allocs a struct pci_dev to use alloc_pci_dev().

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Create alloc_pci_dev(), the one true way to create a struct pci_dev
Michael Ellerman [Thu, 5 Apr 2007 07:19:08 +0000 (17:19 +1000)]
PCI: Create alloc_pci_dev(), the one true way to create a struct pci_dev

There are currently several places in the kernel where we kmalloc()
a struct pci_dev and start initialising it. It'd be preferable to
have an allocator so we can ensure the pci_dev is correctly initialised
in one place.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Add an arch_msi_check_device()
Michael Ellerman [Thu, 5 Apr 2007 07:19:08 +0000 (17:19 +1000)]
MSI: Add an arch_msi_check_device()

Add an arch_check_device(), which gives archs a chance to check the input
to pci_enable_msi/x. The arch might be interested in the value of nvec so
pass it in. Propagate the error value returned from the arch routine out
to the caller.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Rename pci_msi_supported() to pci_msi_check_device()
Michael Ellerman [Thu, 5 Apr 2007 07:19:07 +0000 (17:19 +1000)]
MSI: Rename pci_msi_supported() to pci_msi_check_device()

As pointed out by Eric, the name pci_msi_supported() suggests it should
return a boolean value, however it doesn't. So update the name to be
a bit less confusing and update the doco too.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Consolidate precondition checks
Michael Ellerman [Thu, 22 Mar 2007 10:51:39 +0000 (21:51 +1100)]
MSI: Consolidate precondition checks

Consolidate precondition checks into a single if statement.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Expand pci_msi_supported()
Michael Ellerman [Thu, 22 Mar 2007 10:51:39 +0000 (21:51 +1100)]
MSI: Expand pci_msi_supported()

pci_enable_msi() and pci_enable_msix() both search for the MSI/MSI-X
capability, we can fold this into pci_msi_supported() by passing the
type in.

Update the code to match the comment for pci_msi_supported(). That is
it returns 0 on success, and anything else indicates an error.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Remove msi_cache
Michael Ellerman [Thu, 22 Mar 2007 10:51:36 +0000 (21:51 +1100)]
MSI: Remove msi_cache

We don't need a special cache just for msi descriptors. They're not
particularly large, under 100 bytes for sure, and don't seem to require any
special alignment etc. On most systems there will be relatively few MSIs,
and hence we waste most of a page on the cache. Better to just kzalloc the
space for the few we do need.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Move EXPORT_SYMBOL()s near their definition
Michael Ellerman [Thu, 22 Mar 2007 10:51:34 +0000 (21:51 +1100)]
MSI: Move EXPORT_SYMBOL()s near their definition

Move EXPORT_SYMBOL()s near their definition.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Consolidate BUG_ON()s.
Michael Ellerman [Thu, 22 Mar 2007 10:51:34 +0000 (21:51 +1100)]
MSI: Consolidate BUG_ON()s.

When freeing MSIs and MSI-Xs, we BUG_ON() if the irq has not been
freed, ie. if it still has an action. We can consolidate all of these
BUG_ON()s into msi_free_irqs() as all the code paths lead there almost
immediately anyway.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Consolidate MSI-X irq freeing code
Michael Ellerman [Thu, 22 Mar 2007 10:51:33 +0000 (21:51 +1100)]
MSI: Consolidate MSI-X irq freeing code

For the MSI-X case we do exactly the same logic in pci_disable_msix() and
msi_remove_pci_irq_vectors(), so consolidate them.

msi_remove_pci_irq_vectors() wasn't setting dev->first_msi_irq to 0, but
I think it should have been, so the consolidated version does.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Simplify BUG() handling in msi_remove_pci_irq_vectors() part 2
Michael Ellerman [Thu, 22 Mar 2007 10:51:31 +0000 (21:51 +1100)]
MSI: Simplify BUG() handling in msi_remove_pci_irq_vectors() part 2

Although it might be nice to do a printk before BUG'ing, it's really not
necessary, and it complicates the code.

The behaviour has changed slightly, in that before we set a flag if the irq
had an action, and continued freeing the other irqs. But as I see it that's
all irrelevant because we end up BUG'ing anyway.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Simplify BUG() handling in msi_remove_pci_irq_vectors() part 1
Michael Ellerman [Thu, 22 Mar 2007 10:51:31 +0000 (21:51 +1100)]
MSI: Simplify BUG() handling in msi_remove_pci_irq_vectors() part 1

Although it might be nice to do a printk before BUG'ing, it's really not
necessary, and it complicates the code.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Simplify BUG() handling in pci_disable_msix()
Michael Ellerman [Thu, 22 Mar 2007 10:51:27 +0000 (21:51 +1100)]
MSI: Simplify BUG() handling in pci_disable_msix()

Although it might be nice to do a printk before BUG'ing, it's really not
necessary, and it complicates the code.

The behaviour has changed slightly, in that before we set a flag if the irq
had an action, and continued freeing the other irqs. But as I see it that's
all irrelevant because we end up BUG'ing anyway.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMSI: Simplify BUG() handling in pci_disable_msi()
Michael Ellerman [Thu, 22 Mar 2007 10:51:27 +0000 (21:51 +1100)]
MSI: Simplify BUG() handling in pci_disable_msi()

Although it might be nice to do a printk before BUG'ing, it's really not
necessary, and it complicates the code.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI Documentation: power/pci.txt fix copy/paste error
Randy Dunlap [Thu, 5 Apr 2007 04:35:39 +0000 (21:35 -0700)]
PCI Documentation: power/pci.txt fix copy/paste error

Correct function name copy-paste error.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: define pci_request/release_regions() for CONFIG_PCI=n
Sergei Shtylyov [Sun, 1 Apr 2007 17:13:58 +0000 (21:13 +0400)]
PCI: define pci_request/release_regions() for CONFIG_PCI=n

Balance declarations of pci_request_regions() and pci_release_regions() with
empty inline definitions for the CONFIG_PCI=n case -- otherwise my patch to
drivers/net/3c59x.c in the -mm tree doesn't compile. :-)

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agopci: do not mark exported functions as __devinit
Sam Ravnborg [Tue, 27 Mar 2007 05:53:30 +0000 (21:53 -0800)]
pci: do not mark exported functions as __devinit

Functions marked __devinit will be removed after kernel init.  But being
exported they are potentially called by a module much later.

So the safer choice seems to be to keep the function even in the non
CONFIG_HOTPLUG case.

This silence the follwoing section mismatch warnings:
WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_add_device from __ksymtab_gpl between '__ksymtab_pci_bus_add_device' (at offset 0x20) and '__ksymtab_pci_walk_bus'
WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_create_bus from __ksymtab_gpl between '__ksymtab_pci_create_bus' (at offset 0x40) and '__ksymtab_pci_stop_bus_device'
WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_max_busnr from __ksymtab_gpl between '__ksymtab_pci_bus_max_busnr' (at offset 0xc0) and '__ksymtab_pci_assign_resource_fixed'
WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_claim_resource from __ksymtab_gpl between '__ksymtab_pci_claim_resource' (at offset 0xe0) and '__ksymtab_pcie_port_bus_type'
WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_add_devices from __ksymtab between '__ksymtab_pci_bus_add_devices' (at offset 0x70) and '__ksymtab_pci_bus_alloc_resource'
WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_scan_bus_parented from __ksymtab between '__ksymtab_pci_scan_bus_parented' (at offset 0x90) and '__ksymtab_pci_root_buses'
WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_assign_resources from __ksymtab between '__ksymtab_pci_bus_assign_resources' (at offset 0x4d0) and '__ksymtab_pci_bus_size_bridges'
WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_size_bridges from __ksymtab between '__ksymtab_pci_bus_size_bridges' (at offset 0x4e0) and '__ksymtab_pci_setup_cardbus'

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>
17 years agoPCI: Require vendor and device for new_id
Jean Delvare [Sat, 7 Apr 2007 15:21:28 +0000 (17:21 +0200)]
PCI: Require vendor and device for new_id

Currently, there is no minimum number of fields required when adding
a new device ID to a PCI driver through the new_id sysfs file. It is
possible to add a new ID with only the vendor ID set, causing the
driver to attempt to attach to all PCI devices from that vendor. This
has been reported to happen accidentally:
  http://lists.lm-sensors.org/pipermail/lm-sensors/2007-March/019366.html
It is even possible to not even set the vendor ID field, causing the
driver to attempt to attach to _all_ the PCI devices.

This sounds dangerous and I fail to see any valid use of this
"feature". Thus I suggest that we now require at least the first two
fields (vendor ID and device ID) to be set. For what it's worth, this
is what the USB subsystem does.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: fix sysfs rom file creation for BIOS ROM shadows
Jesse Barnes [Sat, 24 Mar 2007 18:03:32 +0000 (11:03 -0700)]
PCI: fix sysfs rom file creation for BIOS ROM shadows

At one time, if a BIOS ROM shadow was detected for the boot video
device (stored at offset 0xc0000), we'd set a special resource flag,
IORESOURCE_ROM_SHADOW, so that the sysfs ROM file code could handle
it properly.  That broke along the way somewhere though, so current
kernels will be missing 'rom' files in sysfs if the video device
doesn't have an explicit ROM BAR.

This patch fixes the regression by moving the video fixup quirk to a
little later in the boot cycle (to avoid having its work undone by
PCI resource allocation) and checking in the PCI sysfs code whether
a rom file should be created due to a shadow resource, which is also
moved to a little later in the boot cycle so it will occur after the
video fixup.  Tested and works on my i386 test box.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: kernel-doc fix
Randy Dunlap [Sat, 17 Mar 2007 02:55:52 +0000 (19:55 -0700)]
PCI: kernel-doc fix

Warning(linux-2621-rc3g7/drivers/pci/pci.c:1283): No description found for parameter 'dev'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Cleanup the includes of <linux/pci.h>
Jean Delvare [Tue, 6 Mar 2007 10:45:12 +0000 (02:45 -0800)]
PCI: Cleanup the includes of <linux/pci.h>

I noticed that many source files include <linux/pci.h> while they do
not appear to need it. Here is an attempt to clean it all up.

In order to find all possibly affected files, I searched for all
files including <linux/pci.h> but without any other occurence of "pci"
or "PCI". I removed the include statement from all of these, then I
compiled an allmodconfig kernel on both i386 and x86_64 and fixed the
false positives manually.

My tests covered 66% of the affected files, so there could be false
positives remaining. Untested files are:

arch/alpha/kernel/err_common.c
arch/alpha/kernel/err_ev6.c
arch/alpha/kernel/err_ev7.c
arch/ia64/sn/kernel/huberror.c
arch/ia64/sn/kernel/xpnet.c
arch/m68knommu/kernel/dma.c
arch/mips/lib/iomap.c
arch/powerpc/platforms/pseries/ras.c
arch/ppc/8260_io/enet.c
arch/ppc/8260_io/fcc_enet.c
arch/ppc/8xx_io/enet.c
arch/ppc/syslib/ppc4xx_sgdma.c
arch/sh64/mach-cayman/iomap.c
arch/xtensa/kernel/xtensa_ksyms.c
arch/xtensa/platform-iss/setup.c
drivers/i2c/busses/i2c-at91.c
drivers/i2c/busses/i2c-mpc.c
drivers/media/video/saa711x.c
drivers/misc/hdpuftrs/hdpu_cpustate.c
drivers/misc/hdpuftrs/hdpu_nexus.c
drivers/net/au1000_eth.c
drivers/net/fec_8xx/fec_main.c
drivers/net/fec_8xx/fec_mii.c
drivers/net/fs_enet/fs_enet-main.c
drivers/net/fs_enet/mac-fcc.c
drivers/net/fs_enet/mac-fec.c
drivers/net/fs_enet/mac-scc.c
drivers/net/fs_enet/mii-bitbang.c
drivers/net/fs_enet/mii-fec.c
drivers/net/ibm_emac/ibm_emac_core.c
drivers/net/lasi_82596.c
drivers/parisc/hppb.c
drivers/sbus/sbus.c
drivers/video/g364fb.c
drivers/video/platinumfb.c
drivers/video/stifb.c
drivers/video/valkyriefb.c
include/asm-arm/arch-ixp4xx/dma.h
sound/oss/au1550_ac97.c

I would welcome test reports for these files. I am fine with removing
the untested files from the patch if the general opinion is that these
changes aren't safe. The tested part would still be nice to have.

Note that this patch depends on another header fixup patch I submitted
to LKML yesterday:
  [PATCH] scatterlist.h needs types.h
  http://lkml.org/lkml/2007/3/01/141

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: scatterlist.h needs types.h
Jean Delvare [Tue, 6 Mar 2007 10:45:12 +0000 (02:45 -0800)]
PCI: scatterlist.h needs types.h

Most architectures' scatterlist.h use the type dma_addr_t, but omit to
include <asm/types.h> which defines it.  This could lead to build failures,
so let's add the missing includes.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: fix multiple definition of `queue_pushbutton_work'
Kristen Carlson Accardi [Wed, 21 Mar 2007 18:45:31 +0000 (11:45 -0700)]
PCI: fix multiple definition of `queue_pushbutton_work'

Fix duplicate names in shpchp and pciehp.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agopciehp: Adapt to device driver model
Kenji Kaneshige [Tue, 6 Mar 2007 23:02:32 +0000 (15:02 -0800)]
pciehp: Adapt to device driver model

This patch adapts PCIEHP driver to PCI device driver model.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agopciehp: Event handling rework
Kenji Kaneshige [Tue, 6 Mar 2007 23:02:26 +0000 (15:02 -0800)]
pciehp: Event handling rework

The event handler of PCIEHP driver is unnecessarily very complex. In
addition, current event handler can only a fixed number of events at
the same time, and some of events would be lost if several number of
events happened at the same time.

This patch simplify the event handler using 'work queue', and it also
fix the above-mentioned issue.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agopci: New PCI-E reset API
Brian King [Fri, 6 Apr 2007 21:39:36 +0000 (16:39 -0500)]
pci: New PCI-E reset API

Adds a new API which can be used to issue various types
of PCI-E reset, including PCI-E warm reset and PCI-E hot reset.
This is needed for an ipr PCI-E adapter which does not properly
implement BIST. Running BIST on this adapter results in PCI-E
errors. The only reliable reset mechanism that exists on this
hardware is PCI Fundamental reset (warm reset). Since driving
this type of reset is architecture unique, this provides the
necessary hooks for architectures to add this support.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Acked-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoPCI: Flush MSI-X table writes
Mitch Williams [Fri, 30 Mar 2007 18:54:08 +0000 (11:54 -0700)]
PCI: Flush MSI-X table writes

This patch fixes a kernel bug which is triggered when using the
irqbalance daemon with MSI-X hardware.

Because both MSI-X interrupt messages and MSI-X table writes are posted,
it's possible for them to cross while in-flight.  This results in
interrupts being received long after the kernel thinks they're disabled,
and in interrupts being sent to stale vectors after rebalancing.

This patch performs a read flush after writes to the MSI-X table for
mask and unmask operations.  Since the SMP affinity is set while
the interrupt is masked, and since it's unmasked immediately after,
no additional flushes are required in the various affinity setting
routines.

This patch has been validated with (unreleased) network hardware which
uses MSI-X.

Revised with input from Eric Biederman.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoremove "struct subsystem" as it is no longer needed
Greg Kroah-Hartman [Fri, 13 Apr 2007 20:15:19 +0000 (13:15 -0700)]
remove "struct subsystem" as it is no longer needed

We need to work on cleaning up the relationship between kobjects, ksets and
ktypes.  The removal of 'struct subsystem' is the first step of this,
especially as it is not really needed at all.

Thanks to Kay for fixing the bugs in this patch.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agosysfs: printk format warning
Randy Dunlap [Tue, 1 May 2007 00:55:03 +0000 (17:55 -0700)]
sysfs: printk format warning

Fix sysfs printk format warning:
fs/sysfs/bin.c:62: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDOC: Fix wrong identifier name in Documentation/driver-model/devres.txt
Rolf Eike Beer [Tue, 1 May 2007 09:00:19 +0000 (11:00 +0200)]
DOC: Fix wrong identifier name in Documentation/driver-model/devres.txt

Above and below we talk about my_midlayer_create_something, I assume that is
also meant here.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoplatform: reorder platform_device_del
Jean Delvare [Wed, 2 May 2007 18:55:54 +0000 (20:55 +0200)]
platform: reorder platform_device_del

In platform_device_del(), we currently delete the device resources
first, then we delete the device itself. This causes a (minor) bug to
occur when one unregisters a platform device before unregistering its
platform driver, and the driver is requesting (in .probe()) and
releasing (in .remove()) a resource of the device. The device
resources are already gone by the time the driver gets the chance to
release the resources it had been requesting, causing an error like:
Trying to free nonexistent resource <0000000000000295-0000000000000296>

If the platform driver is unregistered first, the problem doesn't
occur, as the driver will have the opportunity to release the
resources it had requested before the device resources themselves are
released. It's a bit odd that unregistering the driver first or the
device first doesn't lead to the same result.

So I believe that we should delete the device first in
platform_device_del(). I've searched the git history and found that it
used to be the case before 2.6.8, but was changed here:

http://www.kernel.org/git/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git;a=commitdiff;h=96ef7b3689936ee1e64b711511342026a8ce459c

> 2004/07/14 16:09:44-07:00 dtor_core
> [PATCH] Driver core: Fix OOPS in device_platform_unregister
>
> Driver core: platform_device_unregister should release resources first
>              and only then call device_unregister, otherwise if there
>              are no more references to the device it will be freed and
>              the fucntion will try to access freed memory.

However we now have an explicit call to put_device() at the end of
platform_device_unregister() so I guess the original problem no longer
exists and it is safe to revert that change.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoDriver core: fix show_uevent from taking up way too much stack
Greg Kroah-Hartman [Wed, 2 May 2007 12:14:11 +0000 (14:14 +0200)]
Driver core: fix show_uevent from taking up way too much stack

Declaring an array of PAGE_SIZE does bad things for people running with
4k stacks...

Thanks to Tilman Schmidt for tracking this down.

Cc: Tilman Schmidt <tilman@imap.cc>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoocfs2: Force use of GFP_NOFS in ocfs2_write()
Mark Fasheh [Wed, 2 May 2007 00:44:20 +0000 (17:44 -0700)]
ocfs2: Force use of GFP_NOFS in ocfs2_write()

We can otherwise recurse into the file system.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2: fix sparse warnings in fs/ocfs2/cluster
Mark Fasheh [Fri, 27 Apr 2007 23:50:03 +0000 (16:50 -0700)]
ocfs2: fix sparse warnings in fs/ocfs2/cluster

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2: fix sparse warnings in fs/ocfs2/dlm
Mark Fasheh [Fri, 27 Apr 2007 23:49:20 +0000 (16:49 -0700)]
ocfs2: fix sparse warnings in fs/ocfs2/dlm

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2: fix sparse warnings in fs/ocfs2
Mark Fasheh [Fri, 27 Apr 2007 23:01:25 +0000 (16:01 -0700)]
ocfs2: fix sparse warnings in fs/ocfs2

None of these are actually harmful, but the noise makes looking for real
problems difficult.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years ago[PATCH] Copy i_flags to ocfs2 inode flags on write
Jan Kara [Fri, 27 Apr 2007 18:08:01 +0000 (11:08 -0700)]
[PATCH] Copy i_flags to ocfs2 inode flags on write

Propagate flags such as S_APPEND, S_IMMUTABLE, etc. from i_flags into
ocfs2-specific ip_attr. Hence, when someone sets these flags via a different
interface than ioctl, they are stored correctly.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years ago[PATCH] ocfs2: use __set_current_state()
Milind Arun Choudhary [Thu, 26 Apr 2007 07:29:35 +0000 (00:29 -0700)]
[PATCH] ocfs2: use __set_current_state()

use __set_current_state(TASK_*) instead of current->state = TASK_*, in
fs/ocfs2

Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2: Wrap access of directory allocations with ip_alloc_sem.
Joel Becker [Thu, 29 Mar 2007 01:27:07 +0000 (18:27 -0700)]
ocfs2: Wrap access of directory allocations with ip_alloc_sem.

OCFS2_I(inode)->ip_alloc_sem is a read-write semaphore protecting
local concurrent access of ocfs2 inodes.  However, ocfs2 directories were
not taking the semaphore while they accessed or modified the allocation
tree.

ocfs2_extend_dir() needs to take the semaphore in a write mode when it
adds to the allocation.  All other directory users get there via
ocfs2_bread(), which takes the semaphore in read mode.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years ago[PATCH] fs/ocfs2/: make 3 functions static
Adrian Bunk [Thu, 26 Apr 2007 07:29:35 +0000 (00:29 -0700)]
[PATCH] fs/ocfs2/: make 3 functions static

This patch makes the following needlessly global functions static:
- aops.c: ocfs2_write_data_page()
- dlmglue.c: ocfs2_dump_meta_lvb_info()
- file.c: ocfs2_set_inode_size()

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoocfs2: Implement compat_ioctl()
Mark Fasheh [Fri, 9 Mar 2007 23:56:28 +0000 (15:56 -0800)]
ocfs2: Implement compat_ioctl()

We need this to support 32 bit system calls on 64 bit kernels.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
17 years agoNFS: Clean up nfs_create_request comments
Jason Uhlenkott [Fri, 27 Apr 2007 00:25:51 +0000 (17:25 -0700)]
NFS: Clean up nfs_create_request comments

Remove some stale comments about hard limits which went away in 2.5.

Signed-off-by: Jason Uhlenkott <juhlenko@akamai.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
17 years agospkm3: initialize hash
J. Bruce Fields - unquoted [Sat, 10 Feb 2007 06:33:27 +0000 (01:33 -0500)]
spkm3: initialize hash

There's an initialization step here I missed.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
17 years agospkm3: remove bad kfree, unnecessary export
J. Bruce Fields - unquoted [Sat, 10 Feb 2007 06:33:26 +0000 (01:33 -0500)]
spkm3: remove bad kfree, unnecessary export

We're kfree()'ing something that was allocated on the stack!

Also remove an unnecessary symbol export while we're at it.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
17 years agospkm3: fix spkm3's use of hmac
J. Bruce Fields - unquoted [Sat, 10 Feb 2007 06:33:25 +0000 (01:33 -0500)]
spkm3: fix spkm3's use of hmac

I think I botched an attempt to keep an spkm3 patch up-to-date with a recent
crypto api change.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
17 years agoNFS4: invalidate cached acl on setacl
J. Bruce Fields [Tue, 1 May 2007 14:56:25 +0000 (10:56 -0400)]
NFS4: invalidate cached acl on setacl

The ACL that the server sets may not be exactly the one we set--for
example, it may silently turn off bits that it does not support.  So we
should remove any cached ACL so that any subsequent request for the ACL
will go to the server.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
17 years ago[CRYPTO] padlock: Remove pointless padlock module
Simon Arlott [Wed, 2 May 2007 12:08:26 +0000 (22:08 +1000)]
[CRYPTO] padlock: Remove pointless padlock module

When this is compiled in it is run too early to do anything useful:
[    6.052000] padlock: No VIA PadLock drivers have been loaded.
[    6.052000] padlock: Using VIA PadLock ACE for AES algorithm.
[    6.052000] padlock: Using VIA PadLock ACE for SHA1/SHA256 algorithms.

When it's a module it isn't doing anything special, the same functionality
can be provided in userspace by "probeall padlock padlock-aes padlock-sha"
in modules.conf if it is required.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: Michal Ludvig <michal@logix.cz>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
17 years ago[CRYPTO] api: Add ablkcipher_request_set_tfm
Herbert Xu [Sat, 14 Apr 2007 06:09:14 +0000 (16:09 +1000)]
[CRYPTO] api: Add ablkcipher_request_set_tfm

This patch adds ablkcipher_request_set_tfm for those users that need
to manage the memory for ablkcipher requests directly.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
17 years ago[CRYPTO] cryptd: Add software async crypto daemon
Herbert Xu [Mon, 16 Apr 2007 10:49:20 +0000 (20:49 +1000)]
[CRYPTO] cryptd: Add software async crypto daemon

This patch adds the cryptd module which is a template that takes a
synchronous software crypto algorithm and converts it to an asynchronous
one by executing it in a kernel thread.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
17 years ago[CRYPTO] api: Do not remove users unless new algorithm matches
Herbert Xu [Sun, 8 Apr 2007 11:31:36 +0000 (21:31 +1000)]
[CRYPTO] api: Do not remove users unless new algorithm matches

As it is whenever a new algorithm with the same name is registered
users of the old algorithm will be removed so that they can take
advantage of the new algorithm.  This presents a problem when the
new algorithm is not equivalent to the old algorithm.  In particular,
the new algorithm might only function on top of the existing one.

Hence we should not remove users unless they can make use of the
new algorithm.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
17 years ago[CRYPTO] cryptomgr: Fix parsing of nested templates
Herbert Xu [Thu, 29 Mar 2007 07:32:59 +0000 (17:32 +1000)]
[CRYPTO] cryptomgr: Fix parsing of nested templates

This patch allows the use of nested templates by allowing the use of
brackets inside a template parameter.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
17 years ago[CRYPTO] api: Add async blkcipher type
Herbert Xu [Mon, 16 Apr 2007 10:48:54 +0000 (20:48 +1000)]
[CRYPTO] api: Add async blkcipher type

This patch adds the mid-level interface for asynchronous block ciphers.
It also includes a generic queueing mechanism that can be used by other
asynchronous crypto operations in future.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>