powerpc.git
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 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>
17 years ago[CRYPTO] templates: Pass type/mask when creating instances
Herbert Xu [Mon, 1 Jan 2007 07:37:02 +0000 (18:37 +1100)]
[CRYPTO] templates: Pass type/mask when creating instances

This patch passes the type/mask along when constructing instances of
templates.  This is in preparation for templates that may support
multiple types of instances depending on what is requested.  For example,
the planned software async crypto driver will use this construct.

For the moment this allows us to check whether the instance constructed
is of the correct type and avoid returning success if the type does not
match.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
17 years ago[CRYPTO] tcrypt: Use async blkcipher interface
Herbert Xu [Wed, 4 Apr 2007 07:41:07 +0000 (17:41 +1000)]
[CRYPTO] tcrypt: Use async blkcipher interface

This patch converts the tcrypt module to use the asynchronous block cipher
interface.  As all synchronous block ciphers can be used through the async
interface, tcrypt is still able to test them.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
17 years ago[CRYPTO] api: Add async block cipher interface
Herbert Xu [Sat, 24 Mar 2007 03:35:34 +0000 (14:35 +1100)]
[CRYPTO] api: Add async block cipher interface

This patch adds the frontend interface for asynchronous block ciphers.
In addition to the usual block cipher parameters, there is a callback
function pointer and a data pointer.  The callback will be invoked only
if the encrypt/decrypt handlers return -EINPROGRESS.  In other words,
if the return value of zero the completion handler (or the equivalent
code) needs to be invoked by the caller.

The request structure is allocated and freed by the caller.  Its size
is determined by calling crypto_ablkcipher_reqsize().  The helpers
ablkcipher_request_alloc/ablkcipher_request_free can be used to manage
the memory for a request.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
17 years ago[CRYPTO] api: Proc functions should be marked as unused
Herbert Xu [Sat, 30 Dec 2006 23:42:06 +0000 (10:42 +1100)]
[CRYPTO] api: Proc functions should be marked as unused

The proc functions were incorrectly marked as used rather than unused.
They may be unused if proc is disabled.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
17 years agoi2c-s3c2410: Fix bug in releasing driver
Ben Dooks [Tue, 1 May 2007 21:26:35 +0000 (23:26 +0200)]
i2c-s3c2410: Fix bug in releasing driver

When compiled as a module, the i2c-s3c2410 driver does not
free either the IRQ or the i2c adapter it attached to the system.

As part of this fix, move to the usual kernel style
of freeing items as part of the probe error path
making the remove process easier.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c-s3c2410: Fix I2C SDA to SCL setup time
Ben Dooks [Tue, 1 May 2007 21:26:35 +0000 (23:26 +0200)]
i2c-s3c2410: Fix I2C SDA to SCL setup time

Fix the setup time for SDA to SCL due to the way
the S3C24XX I2C controller works.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c: New i2c-tiny-usb bus driver
Till Harbaum [Tue, 1 May 2007 21:26:35 +0000 (23:26 +0200)]
i2c: New i2c-tiny-usb bus driver

Add a driver for the i2c-tiny-usb interface. This is a simple
do-it-yourself USB to I2C interface targeted at experimental and
home use. See the i2c-tiny-usb homepage for hardware details:
http://www.harbaum.org/till/i2c_tiny_usb

Signed-off-by: Till Harbaum <till@harbaum.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c: Documentation update
Jean Delvare [Tue, 1 May 2007 21:26:35 +0000 (23:26 +0200)]
i2c: Documentation update

Make the documentation on how to write and port i2c drivers more in
line with the current state of things:
* i2c-isa is deprecated and soon gone, so stop advertising it.
* Drop many sensors-specific references. Most of them were outdated
  anyway.
* Update the example code to reflect the recent and not-so-recent
  API and coding style preference changes.
* Simplify the example init and cleanup functions.

This should make things less complex to understand for newcomers.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c: SPIN_LOCK_UNLOCKED cleanup
Milind Arun Choudhary [Tue, 1 May 2007 21:26:34 +0000 (23:26 +0200)]
i2c: SPIN_LOCK_UNLOCKED cleanup

SPIN_LOCK_UNLOCKED cleanup, use __SPIN_LOCK_UNLOCKED instead.

Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c: Obsolete i2c-ixp2000, i2c-ixp4xx and scx200_i2c
Jean Delvare [Tue, 1 May 2007 21:26:34 +0000 (23:26 +0200)]
i2c: Obsolete i2c-ixp2000, i2c-ixp4xx and scx200_i2c

The new generic i2c-gpio driver should be used instead.
The obsolete drivers will be removed in September 2007.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Deepak Saxena <dsaxena@plexity.net>
Cc: Jordan Crouse <jordan.crouse@amd.com>
17 years agoi2c: New Simtec I2C bus driver
Ben Dooks [Tue, 1 May 2007 21:26:34 +0000 (23:26 +0200)]
i2c: New Simtec I2C bus driver

Platform driver for the Simtec CPLD based simple I2C logic.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c: Bitbanging I2C bus driver using the GPIO API
Haavard Skinnemoen [Tue, 1 May 2007 21:26:34 +0000 (23:26 +0200)]
i2c: Bitbanging I2C bus driver using the GPIO API

This is a very simple bitbanging I2C bus driver utilizing the new
arch-neutral GPIO API. Useful for chips that don't have a built-in
I2C controller, additional I2C busses, or testing purposes.

To use, include something similar to the following in the
board-specific setup code:

  #include <linux/i2c-gpio.h>

  static struct i2c_gpio_platform_data i2c_gpio_data = {
.sda_pin = GPIO_PIN_FOO,
.scl_pin = GPIO_PIN_BAR,
  };
  static struct platform_device i2c_gpio_device = {
.name = "i2c-gpio",
.id = 0,
.dev = {
.platform_data = &i2c_gpio_data,
},
  };

Register this platform_device, set up the I2C pins as GPIO if
required and you're ready to go. This will use default values for
udelay and timeout, and will work with GPIO hardware that does not
support open drain mode, but allows sensing of the SDA and SCL lines
even when they are being driven.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoUse menuconfig objects - I2C
Jan Engelhardt [Tue, 1 May 2007 21:26:34 +0000 (23:26 +0200)]
Use menuconfig objects - I2C

Allow the whole I2C menu to be disabled at once without diving into
the submenus for deselecting all options (should the user desire so).

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c: Restore i2c_smbus_read_block_data
Jean Delvare [Tue, 1 May 2007 21:26:34 +0000 (23:26 +0200)]
i2c: Restore i2c_smbus_read_block_data

Add back the i2c_smbus_read_block_data helper function, it is needed
by the upcoming lm93 hardware monitoring driver and possibly others.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c-pxa: Clean transaction stop
Jean Delvare [Tue, 1 May 2007 21:26:33 +0000 (23:26 +0200)]
i2c-pxa: Clean transaction stop

It was reported to me that the i2c-pxa driver was not able to process
more that 50 transactions per second. Investigation revealed that the
I2C unit was busy for 20 ms after every transaction. The reason seems
to be that we forget to clear the STOP and ACKNACK bits at the end of
the transaction. According to the PXA27x developer's manual, we shall
do so.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Cc: Nicolas Pitre <nico@cam.org>
17 years agoi2c-algo-bit: Improve debugging
Jean Delvare [Tue, 1 May 2007 21:26:33 +0000 (23:26 +0200)]
i2c-algo-bit: Improve debugging

Improve the debugging features of the i2c-algo-bit driver:
* Make it possible to compile the driver without debugging support
  at all, making it much smaller.
* Use dev_dbg() for debugging messages where possible, and dev_err()
  for error messages.
* Remove redundant debugging messages.

These changes allowed for minor code cleanups, which are included
as well.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c-algo-bit: Implement a 50/50 SCL duty cycle
Jean Delvare [Tue, 1 May 2007 21:26:33 +0000 (23:26 +0200)]
i2c-algo-bit: Implement a 50/50 SCL duty cycle

The original i2c-algo-bit implementation uses a 33/66 SCL duty cycle
when bits are being written on the bus. While the I2C specification
doesn't forbid it, this prevents us from driving the I2C bus to its
max speed, limiting us to 66 kbps max on standard I2C busses.

Implementing a 50/50 duty cycle instead lets us max out the bandwidth
up to the theoretical max of 100 kbps on standard I2C busses. This is
particularly important when large amounts of data need to be transfered
over the bus, as is the case with some TV adapters when the firmware is
being uploaded.

In fact this change even allows, at least in theory, fast-mode I2C
support at 125, 166 and 250 kbps. There's no way to reach the
theoretical max of 400 kbps with this implementation. But I don't
think we want to put efforts in that direction anyway: software-driven
I2C is very CPU-intensive and bad for latency.

Other timing changes:
* Don't set SDA high explicitly on error, we're going to issue a stop
  condition before we leave anyway.
* If an error occurs when sending the slave address, yield the CPU
  before retrying, and remove the additional delay after the new start
  condition.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c-omap: Switch to static adapter numbering
David Brownell [Tue, 1 May 2007 21:26:32 +0000 (23:26 +0200)]
i2c-omap: Switch to static adapter numbering

Update the OMAP I2C driver to use i2c_add_numbered_adapter(), so that
later patches can convert boards to using new-style drivers.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c: Blackfin Two Wire Interface driver
Bryan Wu [Tue, 1 May 2007 21:26:32 +0000 (23:26 +0200)]
i2c: Blackfin Two Wire Interface driver

The i2c linux driver for blackfin architecture which supports blackfin
on-chip TWI controller i2c operation.

Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Reviewed-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c-algo-sgi: Comment and whitespace cleanups
Ladislav Michl [Tue, 1 May 2007 21:26:32 +0000 (23:26 +0200)]
i2c-algo-sgi: Comment and whitespace cleanups

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c: Make i2c_del_driver a void function
Jean Delvare [Tue, 1 May 2007 21:26:32 +0000 (23:26 +0200)]
i2c: Make i2c_del_driver a void function

Make i2c_del_driver a void function, like all other driver removal
functions. It always returned 0 even when errors occured, and nobody
ever actually checked the return value anyway. And we cannot fail
a module removal anyway.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c: Move i2c-isa-only exported symbol declarations
Jean Delvare [Tue, 1 May 2007 21:26:32 +0000 (23:26 +0200)]
i2c: Move i2c-isa-only exported symbol declarations

Move the declaration of i2c-isa-only exported symbols to i2c-isa
itself, that's the best way to ensure nobody will attempt to use them.
Hopefully we'll get rid of the exports themselves soon anyway.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
17 years agoi2c: Document i2c_new_device()
Jean Delvare [Tue, 1 May 2007 21:26:32 +0000 (23:26 +0200)]
i2c: Document i2c_new_device()

Document the new i2c_new_device(), i2c_new_probed_device() and
i2c_unregister_device() functions.

Signed-off-by: Jean Delvare <khali@linux-fr.org>