]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
17 years ago[XFRM] SAD info TLV aggregationx
Jamal Hadi Salim [Fri, 4 May 2007 19:55:13 +0000 (12:55 -0700)]
[XFRM] SAD info TLV aggregationx

Aggregate the SAD info TLVs.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AF_RXRPC]: Sort out MTU handling.
David Howells [Fri, 4 May 2007 19:41:11 +0000 (12:41 -0700)]
[AF_RXRPC]: Sort out MTU handling.

Sort out the MTU determination and handling in AF_RXRPC:

 (1) If it's present, parse the additional information supplied by the peer at
     the end of the ACK packet (struct ackinfo) to determine the MTU sizes
     that peer is willing to support.

 (2) Initialise the MTU size to that peer from the kernel's routing records.

 (3) Send ACKs rather than ACKALLs as the former carry the additional info,
     and the latter do not.

 (4) Declare the interface MTU size in outgoing ACKs as a maximum amount of
     data that can be stuffed into an RxRPC packet without it having to be
     fragmented to come in this computer's NIC.

 (5) If sendmsg() is given MSG_MORE then it should allocate an skb of the
     maximum size rather than one just big enough for the data it's got left
     to process on the theory that there is more data to come that it can
     append to that packet.

     This means, for example, that if AFS does a large StoreData op, all the
     packets barring the last will be filled to the maximum unfragmented size.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AF_IUCV/IUCV] : Add missing section annotations
Heiko Carstens [Fri, 4 May 2007 19:23:27 +0000 (12:23 -0700)]
[AF_IUCV/IUCV] : Add missing section annotations

Add missing section annotations and found and fixed some
Coding Style issues.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>
17 years ago[AF_IUCV]: Implementation of a skb backlog queue
Jennifer Hunt [Fri, 4 May 2007 19:22:07 +0000 (12:22 -0700)]
[AF_IUCV]: Implementation of a skb backlog queue

With the inital implementation we missed to implement a skb backlog
queue . The result is that socket receive processing tossed packets.
Since AF_IUCV connections are working synchronously it leads to
connection hangs. Problems with read, close and select also occured.

Using a skb backlog queue is fixing all of these problems .

Signed-off-by: Jennifer Hunt <jenhunt@us.ibm.com>
Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETLINK]: Remove bogus BUG_ON
Patrick McHardy [Fri, 4 May 2007 19:15:11 +0000 (12:15 -0700)]
[NETLINK]: Remove bogus BUG_ON

Remove bogus BUG_ON(mutex_is_locked(nlk_sk(sk)->cb_mutex)), when the
netlink_kernel_create caller specifies an external mutex it might
validly be locked.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoNFS: Fix a compile glitch on 64-bit systems
Trond Myklebust [Fri, 4 May 2007 18:44:06 +0000 (14:44 -0400)]
NFS: Fix a compile glitch on 64-bit systems

fs/nfs/pagelist.c:226: error: conflicting types for 'nfs_pageio_init'
include/linux/nfs_page.h:80: error: previous declaration of 'nfs_pageio_init' was here

Thanks to Andrew for spotting this...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
17 years ago[S390] add hardware capability support (ELF_HWCAP).
Martin Schwidefsky [Fri, 4 May 2007 16:48:28 +0000 (18:48 +0200)]
[S390] add hardware capability support (ELF_HWCAP).

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
17 years ago[S390] tape: New read configuration data.
Michael Holzheu [Fri, 4 May 2007 16:47:53 +0000 (18:47 +0200)]
[S390] tape: New read configuration data.

Instead of the deprecated read_conf_data(), implement a new function
tape_3590_read_dev_chars().

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
17 years ago[S390] qeth: New read configuration data.
Cornelia Huck [Fri, 4 May 2007 16:47:52 +0000 (18:47 +0200)]
[S390] qeth: New read configuration data.

Instead of the deprecated read_conf_data(), implement a new function
qeth_read_conf_data().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
17 years ago[S390] dasd: New read device characteristics and read configuration data.
Cornelia Huck [Fri, 4 May 2007 16:47:51 +0000 (18:47 +0200)]
[S390] dasd: New read device characteristics and read configuration data.

Instead of the deprecated read_dev_chars() and read_conf_data_lpm(),
implement dasd_generic_read_dev_chars() and dasd_eckd_read_conf_lpm().
These should even recover better from error than the original cio
functions.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
17 years ago[S390] cio: Deprecate read_dev_chars() and read_conf_data{,_lpm}().
Cornelia Huck [Fri, 4 May 2007 16:47:50 +0000 (18:47 +0200)]
[S390] cio: Deprecate read_dev_chars() and read_conf_data{,_lpm}().

These helper functions are a leftover from 2.4 sync I/O and are a
notorious source for bugs. They lead to device driver specific code
creeping into cio, and some issues can't really be fixed at all.

Device drivers can easily implement those functions themselves in a
more robust manner, so let's get rid of them.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
17 years ago[S390] qdio: make qdio statistics SMP-capable
Ursula Braun [Fri, 4 May 2007 16:47:49 +0000 (18:47 +0200)]
[S390] qdio: make qdio statistics SMP-capable

Use atomic_t/atomic64_t to make qdio performance statistics smp safe.
Remove temporarily calculation of "total time of inbound actions".

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
17 years ago[S390] Export uaccess as non-gpl symbol.
Martin Schwidefsky [Fri, 4 May 2007 16:47:48 +0000 (18:47 +0200)]
[S390] Export uaccess as non-gpl symbol.

Commit c1821c2e9711adc3cd298a16b7237c92a2cee78d introduced the
uaccess structure that is used to select the correct set of user
copy functions for the different execution modes (standard vs.
noexec vs. z9 optimized user copy). The uaccess symbol is exported
with EXPORT_SYMBOL_GPL. This breaks all non-gpl modules that use
user copy. To make them work again change the export to
EXPORT_SYMBOL.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
17 years ago[S390] aes-s390 key length.
Jan Glauber [Fri, 4 May 2007 16:47:47 +0000 (18:47 +0200)]
[S390] aes-s390 key length.

Register aes-s390 algorithms with the actual supported max keylen size

Signed-off-by: Jan Glauber <jan.glauber@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
17 years ago[S390] get rid of kprobes notifier call chain.
Christoph Hellwig [Fri, 4 May 2007 16:47:46 +0000 (18:47 +0200)]
[S390] get rid of kprobes notifier call chain.

And here's a port of the powerpc patch to get rid of the notifier
chain completely to s390.  It's ontop of Martins patch as that one
is in mainline already.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
17 years ago[IPV6]: Some cleanups in include/net/ipv6.h
Eric Dumazet [Fri, 4 May 2007 00:39:04 +0000 (17:39 -0700)]
[IPV6]: Some cleanups in include/net/ipv6.h

1) struct ip6_flowlabel : moves 'users' field to avoid two 32bits
   holes for 64bit arches. Shrinks by 8 bytes sizeof(struct
   ip6_flowlabel)

2) ipv6_addr_cmp() and ipv6_addr_copy() dont need (void *) casts :
   Compiler might take into account natural alignement of in6_addr
   structs to emit better code for memcpy()/memcmp() Casts to (void *)
   force byte accesses.

3) ipv6_addr_prefix() optimization :

Better to clear whole struct, as compiler can emit better code for
memset(addr, 0, 16) (2 stores on x86_64), and avoid some conditional
branches.

# size vmlinux.after vmlinux.before
   text    data     bss     dec     hex filename
5262262  647612  557432 6467306  62aeea vmlinux.after
5262550  647612  557432 6467594  62b00a vmlinux.before

thats 288 bytes saved.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TCP]: zero out rx_opt in tcp_disconnect()
Srinivas Aji [Fri, 4 May 2007 00:32:28 +0000 (17:32 -0700)]
[TCP]: zero out rx_opt in tcp_disconnect()

When the server drops its connection, NFS client reconnects using the
same socket after disconnecting. If the new connection's SYN,ACK
doesn't contain the TCP timestamp option and the old connection's did,
tp->tcp_header_len is recomputed assuming no timestamp header but
tp->rx_opt.tstamp_ok remains set. Then tcp_build_and_update_options()
adds in a timestamp option past the end of the allocated TCP header,
overwriting TCP data, or when the data is in skb_shinfo(skb)->frags[],
overwriting skb_shinfo(skb) causing a crash soon after. (The issue was
debugged from such a crash.)

Similarly, wscale_ok and sack_ok also get set based on the SYN,ACK
packet but not reset on disconnect, since they are zeroed out at
initialization. The patch zeroes out the entire tp->rx_opt struct in
tcp_disconnect() to avoid this sort of problem.

Signed-off-by: Srinivas Aji <Aji_Srinivas@emc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Fix TSO problem with small MSS.
Michael Chan [Fri, 4 May 2007 00:23:35 +0000 (17:23 -0700)]
[BNX2]: Fix TSO problem with small MSS.

Remove the check for skb->len greater than MTU when doing TSO.  When
the destination has a smaller MSS than the source, a TSO packet may
be smaller than the MTU at the source and we still need to process it
as a TSO packet.

Thanks to Brian Ristuccia <bristuccia@starentnetworks.com> for
reporting the problem.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET]: Rework dev_base via list_head (v3)
Pavel Emelianov [Thu, 3 May 2007 22:13:45 +0000 (15:13 -0700)]
[NET]: Rework dev_base via list_head (v3)

Cleanup of dev_base list use, with the aim to simplify making device
list per-namespace. In almost every occasion, use of dev_base variable
and dev->next pointer could be easily replaced by for_each_netdev
loop. A few most complicated places were converted to using
first_netdev()/next_netdev().

Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Acked-by: Kirill Korotaev <dev@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TCP] Highspeed: Limited slow-start is nowadays in tcp_slow_start
Ilpo Järvinen [Thu, 3 May 2007 20:28:35 +0000 (13:28 -0700)]
[TCP] Highspeed: Limited slow-start is nowadays in tcp_slow_start

Reuse limited slow-start (RFC3742) included into tcp_cong instead
of having another implementation in High Speed TCP.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Update version and reldate.
Michael Chan [Thu, 3 May 2007 20:25:32 +0000 (13:25 -0700)]
[BNX2]: Update version and reldate.

Update version to 1.5.10.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Print bus information for PCIE devices.
Michael Chan [Thu, 3 May 2007 20:25:11 +0000 (13:25 -0700)]
[BNX2]: Print bus information for PCIE devices.

Fix the code to print PCI or PCIE bus information for all devices.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Add 1-shot MSI handler for 5709.
Michael Chan [Thu, 3 May 2007 20:24:48 +0000 (13:24 -0700)]
[BNX2]: Add 1-shot MSI handler for 5709.

The 5709 supports the one-shot MSI handler similar to some of the tg3
chips.  In this mode, the MSI disables itself automatically until it
is re-enabled at the end of NAPI poll.

Put the request_irq/free_irq logic in common procedures.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Restructure PHY event handling.
Michael Chan [Thu, 3 May 2007 20:24:23 +0000 (13:24 -0700)]
[BNX2]: Restructure PHY event handling.

Restructure by adding bnx2_phy_event_is_set() to make code cleaner
and easier to understand.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Add indirect spinlock.
Michael Chan [Thu, 3 May 2007 20:24:05 +0000 (13:24 -0700)]
[BNX2]: Add indirect spinlock.

The indirect register access method will be used by more than one
caller in BH context (NAPI poll and timer), so a spinlock is required.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Add support for 5709 Serdes.
Michael Chan [Thu, 3 May 2007 20:23:41 +0000 (13:23 -0700)]
[BNX2]: Add support for 5709 Serdes.

Add PCI ID and code to support the 5709 Serdes PHY.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Re-structure the 2.5G Serdes code.
Michael Chan [Thu, 3 May 2007 20:23:13 +0000 (13:23 -0700)]
[BNX2]: Re-structure the 2.5G Serdes code.

Add some common procedures to handle enabling and disabling 2.5G.
Add some missing code to resolve flow control.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Put MII register offsets in the bnx2 struct.
Michael Chan [Thu, 3 May 2007 20:22:52 +0000 (13:22 -0700)]
[BNX2]: Put MII register offsets in the bnx2 struct.

The 5709 Serdes device uses non-standard MII register offsets.  This
re-structuring will make it easier to support 5709 Serdes.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Add ipv6 TSO and checksum for 5709.
Michael Chan [Thu, 3 May 2007 20:22:28 +0000 (13:22 -0700)]
[BNX2]: Add ipv6 TSO and checksum for 5709.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Update 5709 firmware.
Michael Chan [Thu, 3 May 2007 20:21:48 +0000 (13:21 -0700)]
[BNX2]: Update 5709 firmware.

Add ipv6 TSO support in firmware.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Update 5708 firmware.
Michael Chan [Thu, 3 May 2007 20:21:13 +0000 (13:21 -0700)]
[BNX2]: Update 5708 firmware.

This fixes the problem of not counting all dropped multicast packets.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Save PCI state during suspend.
Michael Chan [Thu, 3 May 2007 20:20:40 +0000 (13:20 -0700)]
[BNX2]: Save PCI state during suspend.

This is needed to save the MSI state which will be lost during
suspend.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Fix race conditions when calling register_netdev().
Michael Chan [Thu, 3 May 2007 20:20:19 +0000 (13:20 -0700)]
[BNX2]: Fix race conditions when calling register_netdev().

Hot-plug scripts can call bnx2_open() as soon as register_netdev() is
called in bnx2_init_one().  We need to call pci_set_drvdata() and
setup everything before calling register_netdev(). netif_carrier_off()
also needs to be moved to bnx2_open() to avoid race conditions with
the irq.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Add 40-bit DMA workaround for 5708.
Michael Chan [Thu, 3 May 2007 20:19:18 +0000 (13:19 -0700)]
[BNX2]: Add 40-bit DMA workaround for 5708.

The internal PCIE-to-PCIX bridge of the 5708 has the same 40-bit DMA
limitation as some of the tg3 chips.  Set dma_mask and persistent DMA
mask to 40-bit to workaround.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Fix register and memory test on 5709.
Michael Chan [Thu, 3 May 2007 20:18:46 +0000 (13:18 -0700)]
[BNX2]: Fix register and memory test on 5709.

Tweak registers and memory test range for 5709.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Block MII access when ifdown.
Michael Chan [Thu, 3 May 2007 20:18:03 +0000 (13:18 -0700)]
[BNX2]: Block MII access when ifdown.

The device may be in D3hot state and should not allow MII register
access.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[ETHTOOL]: Add 2.5G bit definitions.
Michael Chan [Thu, 3 May 2007 20:17:25 +0000 (13:17 -0700)]
[ETHTOOL]: Add 2.5G bit definitions.

Add 2.5G supported and advertising bit definitions.  2.5G is supported
by the bnx2 driver.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: bridge netfilter: consolidate header pushing/pulling code
Patrick McHardy [Thu, 3 May 2007 10:36:16 +0000 (03:36 -0700)]
[NETFILTER]: bridge netfilter: consolidate header pushing/pulling code

Consolidate the common push/pull sequences into a few helper functions.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
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 ago[CIFS] Change semaphore to mutex for cifs lock_sem
Roland Dreier [Thu, 3 May 2007 04:33:45 +0000 (04:33 +0000)]
[CIFS] Change semaphore to mutex for cifs lock_sem

Originally at http://lkml.org/lkml/2006/9/2/86

The recent change to "allow Windows blocking locks to be cancelled via a
CANCEL_LOCK call" introduced a new semaphore in struct cifsFileInfo,
lock_sem.  However, semaphores used as mutexes are deprecated these days,
and there's no reason to add a new one to the kernel.  Therefore, convert
lock_sem to a struct mutex (and also fix one indentation glitch on one of
the lines changed anyway).

Signed-off-by: Roland Dreier <roland@digitalvampire.org>
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
17 years ago[CIFS] Fix oops in reset_cifs_unix_caps on reconnect
Steve French [Thu, 3 May 2007 04:30:13 +0000 (04:30 +0000)]
[CIFS] Fix oops in reset_cifs_unix_caps on reconnect

Signed-off-by: Steve French <sfrench@us.ibm.com>
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>