linux-2.6
17 years agoIB/ehca: Implement modify_port
Joachim Fenkes [Tue, 24 Apr 2007 15:44:31 +0000 (17:44 +0200)] 
IB/ehca: Implement modify_port

Add "Modify Port" verb support to eHCA driver.  The IB communication
manager needs this to set the IsCM port capability bit when
initializing.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/umad: Clarify documentation of transaction ID
Hal Rosenstock [Wed, 25 Apr 2007 04:30:38 +0000 (21:30 -0700)] 
IB/umad: Clarify documentation of transaction ID

Signed-off-by: Hal Rosenstock <halr@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIPoIB/cm: spin_lock_irqsave() -> spin_lock_irq() replacements
Roland Dreier [Wed, 25 Apr 2007 04:30:37 +0000 (21:30 -0700)] 
IPoIB/cm: spin_lock_irqsave() -> spin_lock_irq() replacements

There are quite a few places in ipoib_cm.c where we know IRQs are
enabled because we do something that sleeps in the same function, so
we can convert several occurrences of spin_lock_irqsave() to a plain
spin_lock_irq().  This cleans up the source a little and makes the
code smaller too:

add/remove: 0/0 grow/shrink: 1/5 up/down: 3/-51 (-48)
function                                     old     new   delta
ipoib_cm_tx_reap                             403     406      +3
ipoib_cm_stale_task                          146     145      -1
ipoib_cm_dev_stop                            173     172      -1
ipoib_cm_tx_handler                          964     956      -8
ipoib_cm_rx_handler                          956     937     -19
ipoib_cm_skb_reap                            212     190     -22

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mad: Change SMI to use enums rather than magic return codes
Hal Rosenstock [Mon, 2 Apr 2007 15:24:07 +0000 (11:24 -0400)] 
IB/mad: Change SMI to use enums rather than magic return codes

Clarify code by changing return values from SMI functions to named
enum values instead of magic 0/1 values.

Signed-off-by: Hal Rosenstock <halr@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/umad: Implement GRH handling for sent/received MADs
Sean Hefty [Thu, 5 Apr 2007 18:49:21 +0000 (11:49 -0700)] 
IB/umad: Implement GRH handling for sent/received MADs

We need to set the SGID index for routed MADs and pass received
GRH information to userspace when a MAD is received.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
17 years agoIB/ipoib: Use ib_init_ah_from_path to initialize ah_attr
Sean Hefty [Thu, 5 Apr 2007 18:50:11 +0000 (11:50 -0700)] 
IB/ipoib: Use ib_init_ah_from_path to initialize ah_attr

To support destinations that are not on the local IB subnet, IPoIB
should include the GRH information when constructing an address
handle.  Using the existing ib_init_ah_from_path() call will do this
for us.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
17 years agoIB/sa: Set src_path_bits correctly in ib_init_ah_from_path()
Sean Hefty [Thu, 5 Apr 2007 17:51:10 +0000 (10:51 -0700)] 
IB/sa: Set src_path_bits correctly in ib_init_ah_from_path()

src_path_bits needs to mask off the base LID value.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
17 years agoIB/ucm: Simplify ib_ucm_event()
Sean Hefty [Thu, 5 Apr 2007 17:51:05 +0000 (10:51 -0700)] 
IB/ucm: Simplify ib_ucm_event()

Use wait_event_interruptible() instead of a more complicated
open-coded equivalent.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
17 years agoRDMA/ucma: Simplify ucma_get_event()
Sean Hefty [Thu, 5 Apr 2007 17:49:51 +0000 (10:49 -0700)] 
RDMA/ucma: Simplify ucma_get_event()

Use wait_event_interruptible() instead of a more complicated
open-coded equivalent.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
17 years agoIB/mthca: Simplify CQ cleaning in mthca_free_qp()
Roland Dreier [Tue, 24 Apr 2007 23:31:11 +0000 (16:31 -0700)] 
IB/mthca: Simplify CQ cleaning in mthca_free_qp()

mthca_free_qp() already has local variables to hold the QP's send_cq
and recv_cq, so we can slightly clean up the calls to mthca_cq_clean()
by using those local variables instead of expressions like
to_mcq(qp->ibqp.send_cq).

Also, by cleaning the recv_cq first, we can avoid worrying about
whether the QP is attached to an SRQ for the second call, because we
would only clean send_cq if send_cq is not equal to recv_cq, and that
means send_cq cannot have any receive completions from the QP being
destroyed.

All this work even improves the generated code a bit:

add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5 (-5)
function                                     old     new   delta
mthca_free_qp                                510     505      -5

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mthca: Fix mthca_write_mtt() on HCAs with hidden memory
Roland Dreier [Tue, 24 Apr 2007 23:31:04 +0000 (16:31 -0700)] 
IB/mthca: Fix mthca_write_mtt() on HCAs with hidden memory

Commit b2875d4c ("IB/mthca: Always fill MTTs from CPU") causes a crash
in mthca_write_mtt() with non-memfree HCAs that have their memory
hidden (that is, have only two PCI BARs instead of having a third BAR
that allows access to the RAM attached to the HCA) on 64-bit
architectures.  This is because the commit just before, c20e20ab
("IB/mthca: Merge MR and FMR space on 64-bit systems") makes
dev->mr_table.fmr_mtt_buddy equal to &dev->mr_table.mtt_buddy and
hence mthca_write_mtt() tries to write directly into the HCA's MTT
table.  However, since that table is in the HCA's memory, this is
impossible without the PCI BAR that gives access to that memory.

This causes a crash because mthca_tavor_write_mtt_seg() basically
tries to dereference some offset of a NULL pointer.  Fix this by
adding a test of MTHCA_FLAG_FMR in mthca_write_mtt() so that we always
use the WRITE_MTT firmware command rather than writing directly if
FMRs are not enabled.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mthca: Update HCA firmware revisions
Roland Dreier [Thu, 19 Apr 2007 03:21:02 +0000 (20:21 -0700)] 
IB/mthca: Update HCA firmware revisions

Update the driver's list of current firmware versions with Mellanox's
latest releases.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix WC format drift between user and kernel space
Robert Walsh [Thu, 15 Mar 2007 21:45:17 +0000 (14:45 -0700)] 
IB/ipath: Fix WC format drift between user and kernel space

The kernel ib_wc structure now uses a QP pointer, but the user space
equivalent uses a QP number instead.  This means we can no longer use
a simple structure copy to copy stuff into user space.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Check that a UD work request's address handle is valid
Robert Walsh [Thu, 15 Mar 2007 21:45:16 +0000 (14:45 -0700)] 
IB/ipath: Check that a UD work request's address handle is valid

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Remove duplicate stuff from ipath_verbs.h
Robert Walsh [Thu, 15 Mar 2007 21:45:15 +0000 (14:45 -0700)] 
IB/ipath: Remove duplicate stuff from ipath_verbs.h

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Check reserved memory keys
Robert Walsh [Thu, 15 Mar 2007 21:45:14 +0000 (14:45 -0700)] 
IB/ipath: Check reserved memory keys

Don't let userspace use the direct-physical-map L_key or R_key.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix unit selection when all CPU affinity bits set
Bryan O'Sullivan [Thu, 15 Mar 2007 21:45:13 +0000 (14:45 -0700)] 
IB/ipath: Fix unit selection when all CPU affinity bits set

At some point things changed so that all the affinity bits can be set,
but cpus_full() macro is not true.  This caused problems with the unit
selection logic on multi-unit (board) configurations.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Don't allow QPs 0 and 1 to be opened multiple times
Bryan O'Sullivan [Thu, 15 Mar 2007 21:45:12 +0000 (14:45 -0700)] 
IB/ipath: Don't allow QPs 0 and 1 to be opened multiple times

Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Disable IB link earlier in shutdown sequence
Bryan O'Sullivan [Thu, 15 Mar 2007 21:45:11 +0000 (14:45 -0700)] 
IB/ipath: Disable IB link earlier in shutdown sequence

Move the code that shuts down the IB link earlier in the unload
process, to be sure no new packets can arrive while we are unloading.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Prevent random program use of diags interface
Bryan O'Sullivan [Thu, 15 Mar 2007 21:45:10 +0000 (14:45 -0700)] 
IB/ipath: Prevent random program use of diags interface

To prevent random utility reads and writes of the diag interface to the
chip, we first require a handshake of reading from offset 0 and writing
to offset 0 before any other reads or writes can be done through the
diags device.   Otherwise chip errors can be triggered.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: On unrecoverable errors, force link down, LEDs off
Bryan O'Sullivan [Thu, 15 Mar 2007 21:45:09 +0000 (14:45 -0700)] 
IB/ipath: On unrecoverable errors, force link down, LEDs off

If the chip is no longer usable, LEDs should be turned off so system
can be found easily in the cluster.

Also some minor reorganizing so both chips print hardware error
message at same point and only if there were unrecovered errors

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix driver crash (in interrupt or during unload) after chip reset
Michael Albaugh [Thu, 15 Mar 2007 21:45:08 +0000 (14:45 -0700)] 
IB/ipath: Fix driver crash (in interrupt or during unload) after chip reset

Re-init of the kernel structures after a chip reset was leaving the
portdata structure for port zero in an inconsistent state, and a
pointer to it either stale (in re-init code) or NULL (in devdata)
Fixing the order of operations on this struct, and the condition for
interrupt access, prevents the crashes.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Improve handling and reporting of parity errors
Bryan O'Sullivan [Thu, 15 Mar 2007 21:45:07 +0000 (14:45 -0700)] 
IB/ipath: Improve handling and reporting of parity errors

Mostly cleanup.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Print better error messages if kernel is misconfigured
Bryan O'Sullivan [Thu, 15 Mar 2007 21:45:06 +0000 (14:45 -0700)] 
IB/ipath: Print better error messages if kernel is misconfigured

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Force PIOAvail update entry point
Arthur Jones [Thu, 15 Mar 2007 21:45:05 +0000 (14:45 -0700)] 
IB/ipath: Force PIOAvail update entry point

Due to a chip bug, the PIOAvail register is not always updated to
memory.  This patch allows userspace to force an update.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Call free_irq() on chip specific initialization failure
Arthur Jones [Thu, 15 Mar 2007 21:45:04 +0000 (14:45 -0700)] 
IB/ipath: Call free_irq() on chip specific initialization failure

In initialization, if we bailed at chip specific initialization, we
forgot to clean up the irq we had requested.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Discard multicast packets without a GRH
Bryan O'Sullivan [Thu, 15 Mar 2007 21:45:03 +0000 (14:45 -0700)] 
IB/ipath: Discard multicast packets without a GRH

This patch fixes a bug where multicast packets without a GRH were not
being dropped as per the IB spec.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix calculation for number of kernel PIO buffers
Bryan O'Sullivan [Thu, 15 Mar 2007 21:45:02 +0000 (14:45 -0700)] 
IB/ipath: Fix calculation for number of kernel PIO buffers

If the module parameter "kpiobufs" is set too high, the calculation to
reset it to a sane value was incorrect.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Remove unused ipath_read_kreg64_port()
Bryan O'Sullivan [Thu, 15 Mar 2007 21:45:01 +0000 (14:45 -0700)] 
IB/ipath: Remove unused ipath_read_kreg64_port()

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix RDMA reads of length zero and error handling
Ralph Campbell [Thu, 15 Mar 2007 21:45:00 +0000 (14:45 -0700)] 
IB/ipath: Fix RDMA reads of length zero and error handling

Fix RDMA read response length checking for RDMA_READ_RESPONSE_ONLY to
allow a zero length response.  RDMA read responses which don't match
the expected length or occur in response to some other operation
should generate a completion queue error (see table 56, ch. 9.9.2.3 in
the IB spec).

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Allow receive ports mapped into userspace to be shared
Mark Debbage [Thu, 15 Mar 2007 21:44:59 +0000 (14:44 -0700)] 
IB/ipath: Allow receive ports mapped into userspace to be shared

Improve port-sharing performance by allowing any process to receive
packets from the shared hardware port under a spin lock for mutual
exclusion. Previously, one process was nominated as the master and
that process was responsible for receiving all packets from the shared
hardware port and either consuming them or forwarding them to their
destination. This led to starvation problems for other processes when
the master process was busy in computation phases.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix port sharing on powerpc
Ralph Campbell [Thu, 15 Mar 2007 21:44:58 +0000 (14:44 -0700)] 
IB/ipath: Fix port sharing on powerpc

The port sharing feature mixed kernel virtual addresses as well as
physical addresses for the offset used to describe the mmap address to
map the InfiniPath hardware into user space.  This had a conflict on
powerpc.  The new scheme converts it to a physical address so it
doesn't conflict with chip addresses and yet still fits in 40/44 bits
so it isn't truncated by 32-bit applications calling mmap64().

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix CQ flushing when QP is modified to error state
Bryan O'Sullivan [Thu, 15 Mar 2007 21:44:57 +0000 (14:44 -0700)] 
IB/ipath: Fix CQ flushing when QP is modified to error state

If a receive work request has been removed from the queue but has not
had a CQ entry generated for it and the QP is modified to the error
state, the completion entry generated is incorrect.  This patch fixes
the problem.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix bad argument to clear_bit()
Bryan O'Sullivan [Thu, 15 Mar 2007 21:44:56 +0000 (14:44 -0700)] 
IB/ipath: Fix bad argument to clear_bit()

Code was converted from a &= ~mask to clear_bit, but the bit was left
shifted instead of being used directly, so we were either trashing
memory several pages away, or sometimes taking a kernel page fault on
an invalid page.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Change packet problems vs chip errors handling and reporting
Bryan O'Sullivan [Thu, 15 Mar 2007 21:44:55 +0000 (14:44 -0700)] 
IB/ipath: Change packet problems vs chip errors handling and reporting

Some types of packet errors are moderately common with longer IB
cables and large clusters, and are not reported with prints by other
IB HCA drivers.  This suppresses those messages unless the new
__IPATH_ERRPKTDBG bit is set in ipath_debug.  Reporting of temporarily
disabled frequent error interrupts was also made clearer

We also distinguish between chip errors, and bad packets sent or
received in the wording of the messages.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix PSN update for RC retries
Ralph Campbell [Thu, 15 Mar 2007 21:44:54 +0000 (14:44 -0700)] 
IB/ipath: Fix PSN update for RC retries

This patch fixes a number of bugs with updating the PSN for retries of
RC requests.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix QP error completion queue entries
Ralph Campbell [Thu, 15 Mar 2007 21:44:53 +0000 (14:44 -0700)] 
IB/ipath: Fix QP error completion queue entries

When switching to the QP error state, the completion queue entries
(error or flush) were not being generated correctly.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix up some debug messages
Bryan O'Sullivan [Thu, 15 Mar 2007 21:44:52 +0000 (14:44 -0700)] 
IB/ipath: Fix up some debug messages

ipath_dbg doesn't need the same prefixes that printk does.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Support larger IB_QP_MAX_DEST_RD_ATOMIC and IB_QP_MAX_QP_RD_ATOMIC
Ralph Campbell [Thu, 15 Mar 2007 21:44:51 +0000 (14:44 -0700)] 
IB/ipath: Support larger IB_QP_MAX_DEST_RD_ATOMIC and IB_QP_MAX_QP_RD_ATOMIC

This patch adds support for multiple RDMA reads and atomics to be sent
before an ACK is required to be seen by the requester.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: NMI cpu lockup if local loopback used
Ralph Campbell [Thu, 15 Mar 2007 21:44:50 +0000 (14:44 -0700)] 
IB/ipath: NMI cpu lockup if local loopback used

If a post send is done in loopback and there is no receive queue
entry, the sending QP is put on a timeout list for a while so the
receiver has a chance to post a receive buffer. If the another post
send is done, the code incorrectly tried to put the QP on the timeout
list again an corrupted the timeout list. This eventually leads to a
spin lock deadlock NMI due to the timer function looping forever with
the lock held.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix SRQ limit event causing dropped CQ entry
Ralph Campbell [Thu, 15 Mar 2007 21:44:49 +0000 (14:44 -0700)] 
IB/ipath: Fix SRQ limit event causing dropped CQ entry

A silly programming error causes a CQ entry to not be generated if a
SRQ limit event is generated.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Don't initialize port memory for subports
Ralph Campbell [Thu, 15 Mar 2007 21:44:48 +0000 (14:44 -0700)] 
IB/ipath: Don't initialize port memory for subports

A recent change was made to allocate memory for a port after CPU
affinity is set. That change didn't account for subports and was
trying to allocate memory for the port twice.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Definitions of two RXE parity err bits were reversed
Bryan O'Sullivan [Thu, 15 Mar 2007 21:44:47 +0000 (14:44 -0700)] 
IB/ipath: Definitions of two RXE parity err bits were reversed

The chip documentation on the expected TID vs eager TID parity error
bits was reversed from what was implemented in the RTL, for both
chips.  This corrects the definitions.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix user memory region creation when IOMMU present
Bryan O'Sullivan [Thu, 15 Mar 2007 21:44:46 +0000 (14:44 -0700)] 
IB/ipath: Fix user memory region creation when IOMMU present

The loop which initializes the user memory region from an array of
pages was using the wrong limit for the array.  This worked OK when
dma_map_sg() returned the same number as the number of pages.  This
patch fixes the problem.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Add ability to set and clear IB local loopback
Bryan O'Sullivan [Thu, 15 Mar 2007 21:44:45 +0000 (14:44 -0700)] 
IB/ipath: Add ability to set and clear IB local loopback

This is a sticky state.  It is useful for diagnosing problems with
boards versus cable/switch problems.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIPoIB: Remove pointless opcode field from debugging output
Roland Dreier [Thu, 19 Apr 2007 03:20:53 +0000 (20:20 -0700)] 
IPoIB: Remove pointless opcode field from debugging output

There's no point in printing the opcode field in the completion
handling debugging output, since the type of completion is already
printed at the beginning of the line.  In fact the opcode field is not
even defined for completions with a status other than success.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/umad: Fix declaration of dev_map[]
Hal Rosenstock [Mon, 2 Apr 2007 16:45:16 +0000 (12:45 -0400)] 
IB/umad: Fix declaration of dev_map[]

The current ib_umad code never accesses bits past IB_UMAD_MAX_PORTS in
dev_map[].  We shouldn't declare it to be twice as big.

Pointed-out-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Hal Rosenstock <halr@voltaire.com>
17 years agoIB: Remove reference to obsolete CONFIG_IPATH_CORE
Roland Dreier [Thu, 19 Apr 2007 03:20:53 +0000 (20:20 -0700)] 
IB: Remove reference to obsolete CONFIG_IPATH_CORE

Since commit b1c1b6a3 ("IB/ipath: merge ipath_core and ib_ipath
drivers"), CONFIG_IPATH_CORE no longer exists, so there's no reason to
have a line for it in drivers/Makefile.

Pointed out by Robert P. J. Day <rpjday@mindspring.com>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Tue, 17 Apr 2007 23:51:32 +0000 (16:51 -0700)] 
Merge /pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [BRIDGE]: Unaligned access when comparing ethernet addresses
  [SCTP]: Unmap v4mapped addresses during SCTP_BINDX_REM_ADDR operation.
  [SCTP]: Fix assertion (!atomic_read(&sk->sk_rmem_alloc)) failed message
  [NET]: Set a separate lockdep class for neighbour table's proxy_queue
  [NET]: Fix UDP checksum issue in net poll mode.
  [KEY]: Fix conversion between IPSEC_MODE_xxx and XFRM_MODE_xxx.
  [NET]: Get rid of alloc_skb_from_cache

17 years agoMerge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
Linus Torvalds [Tue, 17 Apr 2007 23:50:59 +0000 (16:50 -0700)] 
Merge branch 'for-linus' of /linux/kernel/git/roland/infiniband

* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband:
  IB/mthca: Fix data corruption after FMR unmap on Sinai

17 years agoMerge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6
Linus Torvalds [Tue, 17 Apr 2007 23:44:05 +0000 (16:44 -0700)] 
Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6

* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6:
  [PATCH] x86: Fix potential overflow in perfctr reservation
  [PATCH] x86: Fix gcc 4.2 _proxy_pda workaround

17 years agoMinor bug fixes to i2c-pasemi
Olof Johansson [Tue, 17 Apr 2007 07:32:29 +0000 (00:32 -0700)] 
Minor bug fixes to i2c-pasemi

* Last write during i2c_xfer is of the wrong byte (off-by-1).
* Read length is wrong for some of the reads (mistakenly used the PEC
  version)

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoi2c-pasemi: Depend on PPC_PASEMI again
Jean Delvare [Tue, 17 Apr 2007 07:32:28 +0000 (00:32 -0700)] 
i2c-pasemi: Depend on PPC_PASEMI again

Looks like a local change I made to be able to test-compile the i2c-pasemi
driver leaked upstream.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agohwmon/w83627ehf: Fix the fan5 clock divider write
Jean Delvare [Tue, 17 Apr 2007 07:32:27 +0000 (00:32 -0700)] 
hwmon/w83627ehf: Fix the fan5 clock divider write

Users have been complaining about the w83627ehf driver flooding their logs
with debug messages like:

w83627ehf 9191-0a10: Increasing fan 4 clock divider from 64 to 128

or:

w83627ehf 9191-0290: Increasing fan 4 clock divider from 4 to 8

The reason is that we failed to actually write the LSB of the encoded clock
divider value for that fan, causing the next read to report the same old value
again and again.

Additionally, the fan number was improperly reported, making the bug harder to
find.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoProvide dummy devm_ioport_* if !HAS_IOPORT
Russell King [Tue, 17 Apr 2007 07:32:26 +0000 (00:32 -0700)] 
Provide dummy devm_ioport_* if !HAS_IOPORT

Provide an dummy implementation of devm_ioport_map() and
devm_ioport_unmap() to allow drivers (eg, pata_platform) to build for
platforms where CONFIG_NO_IOPORT is selected.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoknfsd: use a spinlock to protect sk_info_authunix
NeilBrown [Tue, 17 Apr 2007 05:53:25 +0000 (22:53 -0700)] 
knfsd: use a spinlock to protect sk_info_authunix

sk_info_authunix is not being protected properly so the object that it
points to can be cache_put twice, leading to corruption.

We borrow svsk->sk_defer_lock to provide the protection.  We should
probably rename that lock to have a more generic name - later.

Thanks to Gabriel for reporting this.

Cc: Greg Banks <gnb@melbourne.sgi.com>
Cc: Gabriel Barazer <gabriel@oxeva.fr>
Signed-off-by: Neil Brown <neilb@suse.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agodrivers/macintosh/smu.c: fix locking snafu
Andrew Morton [Tue, 17 Apr 2007 05:53:25 +0000 (22:53 -0700)] 
drivers/macintosh/smu.c: fix locking snafu

It got its lock and unlock backwards.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=8334

(obviously, this code could be using plain old spin_lock_irq(), too)

Cc: <matthias.kaehlcke@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoufs proper handling of zero link case
Evgeniy Dushistov [Tue, 17 Apr 2007 05:53:24 +0000 (22:53 -0700)] 
ufs proper handling of zero link case

This patch should fix or partly fix this bug:
http://bugzilla.kernel.org/show_bug.cgi?id=8276

The problem is:

- if we see "zero link case" during reading inode operation, we call
  ufs_error(which remount fs readonly), but not "mark" inode as bad (1)

- in readonly case we do not fill some data structures, which are used in
  read and write case (2)

- VFS call ufs_delete_inode if link count is zero (3)

so (1)->(3)->(2) cause oops, this patch should fix such scenario

Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Jim Paris <jim@jtan.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agospi: fix use of set_cs in spi_s3c24xx driver
Ben Dooks [Tue, 17 Apr 2007 05:53:22 +0000 (22:53 -0700)] 
spi: fix use of set_cs in spi_s3c24xx driver

It turns out that the last patch to change set_cs to be kept in the
controller's structure instead of the platform data was an incomplete
change, and did not change the references to platfrom data in the setup
xfer code.  (This can prevent an oops.)

Reported-by: <Ling.Alex@iac.com.tw>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoalpha: build fixes - force architecture
Ivan Kokshaysky [Tue, 17 Apr 2007 05:53:21 +0000 (22:53 -0700)] 
alpha: build fixes - force architecture

Override compiler .arch directive for generic kernel build.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoalpha: more fixes for specific machine types
Ivan Kokshaysky [Tue, 17 Apr 2007 05:53:21 +0000 (22:53 -0700)] 
alpha: more fixes for specific machine types

arch/alpha/kernel/sys_sx164.c

Earlier firmware revisions need MVI fix as well.

arch/alpha/kernel/sys_nautilus.c

On UP1500 firmware reports wrong AGP IRQ (10 instead of 5).
This causes interrupt storm if there is a PCI device that
uses IRQ 5.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoalpha: fixes for specific machine types
Ivan Kokshaysky [Tue, 17 Apr 2007 05:53:17 +0000 (22:53 -0700)] 
alpha: fixes for specific machine types

Files:

arch/alpha/kernel/core_mcpcia.c
arch/alpha/kernel/sys_rawhide.c
include/asm-alpha/core_mcpcia.h

Determine correct hose configuration; RAWHIDE family can have
        2 or 4 hoses, so make sure non-existent hoses are ignored.

arch/alpha/kernel/err_titan.c

Supply a needed #include <asm/irq_regs.h>

arch/alpha/kernel/module.c

Add some useful output to the relocation overflow messages.

arch/alpha/kernel/sys_noritake.c

Supply necessary noritake_end_irq() to correct interrupt handling.
This fixes a problem first noted by hangs during boot probing with
a DE500-BA TULIP NIC present.

arch/alpha/kernel/sys_sio.c

Correct saving of original PIRQ register (PCI IRQ routing);
change default PIRQ setting to leave PCI IRQs 9 and 14 free to
be used for sound (Multia) and IDE (any), respectively.

include/asm-alpha/io.h

Supply the "isa_virt_to_bus" routine.

Signed-off-by: Jay Estabrook <jay.estabrook@hp.com>
Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agofix bogon in /dev/mem mmap'ing on nommu
Benjamin Herrenschmidt [Tue, 17 Apr 2007 05:53:16 +0000 (22:53 -0700)] 
fix bogon in /dev/mem mmap'ing on nommu

While digging through my MAP_FIXED changes, I found that rather obvious
bug in /dev/mem mmap implementation for nommu archs. get_unmapped_area()
is expected to return an address, not a pfn.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-By: David Howells <dhowells@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agokernel-doc: fix plist.h comments
Randy Dunlap [Tue, 17 Apr 2007 05:53:15 +0000 (22:53 -0700)] 
kernel-doc: fix plist.h comments

Make kernel-doc comments match macro names.
Correct parameter names in a few places.
Remove '#' from beginning of kernel-doc comment macro names.
Remove extra (erroneous) blank lines in kernel-doc.

Warning(plist.h:100): Cannot understand  * #PLIST_HEAD_INIT - static struct plist_head initializer on line 100 - I thought it was a doc line
Warning(plist.h:112): Cannot understand  * #PLIST_NODE_INIT - static struct plist_node initializer on line 112 - I thought it was a doc line
Warning(plist.h:103): No description found for parameter '_lock'
Warning(plist.h:129): No description found for parameter 'lock'
Warning(plist.h:158): No description found for parameter 'pos'
Warning(plist.h:169): No description found for parameter 'pos'
Warning(plist.h:169): No description found for parameter 'n'
Warning(plist.h:179): No description found for parameter 'mem'

This still leaves one warning & one error that need attention:
Error(plist.h:219): cannot understand prototype: '('
Warning(plist.h): no structured comments found

Acked-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Cc: Daniel Walker <dwalker@mvista.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoexec.c: fix coredump to pipe problem and obscure "security hole"
Alan Cox [Tue, 17 Apr 2007 05:53:13 +0000 (22:53 -0700)] 
exec.c: fix coredump to pipe problem and obscure "security hole"

The patch checks for "|" in the pattern not the output and doesn't nail a
pid on to a piped name (as it is a program name not a file)

Also fixes a very very obscure security corner case.  If you happen to have
decided on a core pattern that starts with the program name then the user
can run a program called "|myevilhack" as it stands.  I doubt anyone does
this.

Signed-off-by: Alan Cox <alan@redhat.com>
Confirmed-by: Christopher S. Aker <caker@theshore.net>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoallow vmsplice to work in 32-bit mode on ppc64
Don Zickus [Tue, 17 Apr 2007 05:53:12 +0000 (22:53 -0700)] 
allow vmsplice to work in 32-bit mode on ppc64

Trivial change to pass vmsplice arguments through the compat layer on
pp64.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years ago[BRIDGE]: Unaligned access when comparing ethernet addresses
Evgeny Kravtsunov [Tue, 17 Apr 2007 19:31:24 +0000 (12:31 -0700)] 
[BRIDGE]: Unaligned access when comparing ethernet addresses

compare_ether_addr() implicitly requires that the addresses
passed are 2-bytes aligned in memory.

This is not true for br_stp_change_bridge_id() and
br_stp_recalculate_bridge_id() in which one of the addresses
is unsigned char *, and thus may not be 2-bytes aligned.

Signed-off-by: Evgeny Kravtsunov <emkravts@openvz.org>
Signed-off-by: Kirill Korotaev <dev@openvz.org>
Signed-off-by: Pavel Emelianov <xemul@openvz.org>
17 years ago[SCTP]: Unmap v4mapped addresses during SCTP_BINDX_REM_ADDR operation.
Paolo Galtieri [Tue, 17 Apr 2007 19:52:36 +0000 (12:52 -0700)] 
[SCTP]: Unmap v4mapped addresses during SCTP_BINDX_REM_ADDR operation.

During the sctp_bindx() call to add additional addresses to the
endpoint, any v4mapped addresses are converted and stored as regular
v4 addresses.  However, when trying to remove these addresses, the
v4mapped addresses are not converted and the operation fails.  This
patch unmaps the addresses on during the remove operation as well.

Signed-off-by: Paolo Galtieri <pgaltieri@mvista.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[SCTP]: Fix assertion (!atomic_read(&sk->sk_rmem_alloc)) failed message
Tsutomu Fujii [Tue, 17 Apr 2007 19:49:53 +0000 (12:49 -0700)] 
[SCTP]: Fix assertion (!atomic_read(&sk->sk_rmem_alloc)) failed message

In current implementation, LKSCTP does receive buffer accounting for
data in sctp_receive_queue and pd_lobby. However, LKSCTP don't do
accounting for data in frag_list when data is fragmented. In addition,
LKSCTP doesn't do accounting for data in reasm and lobby queue in
structure sctp_ulpq.
When there are date in these queue, assertion failed message is printed
in inet_sock_destruct because sk_rmem_alloc of oldsk does not become 0
when socket is destroyed.

Signed-off-by: Tsutomu Fujii <t-fujii@nb.jp.nec.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET]: Set a separate lockdep class for neighbour table's proxy_queue
Pavel Emelianov [Tue, 17 Apr 2007 19:45:31 +0000 (12:45 -0700)] 
[NET]: Set a separate lockdep class for neighbour table's proxy_queue

Otherwise the following calltrace will lead to a wrong
lockdep warning:

  neigh_proxy_process()
    `- lock(neigh_table->proxy_queue.lock);
  arp_redo /* via tbl->proxy_redo */
  arp_process
  neigh_event_ns
  neigh_update
  skb_queue_purge
    `- lock(neighbor->arp_queue.lock);

This is not a deadlock actually, as neighbor table's proxy_queue
and the neighbor's arp_queue are different queues.

Lockdep thinks there is a deadlock as both queues are initialized
with skb_queue_head_init() and thus have a common class.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET]: Fix UDP checksum issue in net poll mode.
Aubrey.Li [Tue, 17 Apr 2007 19:40:20 +0000 (12:40 -0700)] 
[NET]: Fix UDP checksum issue in net poll mode.

In net poll mode, the current checksum function doesn't consider the
kind of packet which is padded to reach a specific minimum length. I
believe that's the problem causing my test case failed. The following
patch fixed this issue.

Signed-off-by: Aubrey.Li <aubreylee@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[KEY]: Fix conversion between IPSEC_MODE_xxx and XFRM_MODE_xxx.
Kazunori MIYAZAWA [Tue, 17 Apr 2007 19:32:20 +0000 (12:32 -0700)] 
[KEY]: Fix conversion between IPSEC_MODE_xxx and XFRM_MODE_xxx.

We should not blindly convert between IPSEC_MODE_xxx and XFRM_MODE_xxx just
by incrementing / decrementing because the assumption is not true any longer.

Signed-off-by: Kazunori MIYAZAWA <miyazawa@linux-ipv6.org>
Singed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
17 years ago[NET]: Get rid of alloc_skb_from_cache
Herbert Xu [Tue, 17 Apr 2007 19:28:27 +0000 (12:28 -0700)] 
[NET]: Get rid of alloc_skb_from_cache

Since this was added originally for Xen, and Xen has recently (~2.6.18)
stopped using this function, we can safely get rid of it.  Good timing
too since this function has started to bit rot.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agocache_k8_northbridges() overflows beyond allocation
Badari Pulavarty [Fri, 13 Apr 2007 15:13:42 +0000 (08:13 -0700)] 
cache_k8_northbridges() overflows beyond allocation

cache_k8_northbridges() is storing config values to incorrect locations
(in flush_words) and also its overflowing beyond the allocation, causing
slab verification failures.

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoIB/mthca: Fix data corruption after FMR unmap on Sinai
Michael S. Tsirkin [Mon, 16 Apr 2007 14:04:55 +0000 (17:04 +0300)] 
IB/mthca: Fix data corruption after FMR unmap on Sinai

In mthca_arbel_fmr_unmap(), the high bits of the key are masked off.
This gets rid of the effect of adjust_key(), which makes sure that
bits 3 and 23 of the key are equal when the Sinai throughput
optimization is enabled, and so it may happen that an FMR will end up
with bits 3 and 23 in the key being different.  This causes data
corruption, because when enabling the throughput optimization, the
driver promises the HCA firmware that bits 3 and 23 of all memory keys
will always be equal.

Fix by re-applying adjust_key() after masking the key.

Thanks to Or Gerlitz for reproducing the problem, and Ariel Shahar for
help in debug.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoMerge master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Mon, 16 Apr 2007 20:21:11 +0000 (13:21 -0700)] 
Merge master.kernel.org:/home/rmk/linux-2.6-arm

* master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] 4313/1: S3C24XX: Update s3c2410 defconfig to 2.6.21-rc6
  [ARM] Update mach-types

17 years ago[ARM] 4313/1: S3C24XX: Update s3c2410 defconfig to 2.6.21-rc6
Ben Dooks [Mon, 9 Apr 2007 09:15:20 +0000 (10:15 +0100)] 
[ARM] 4313/1: S3C24XX: Update s3c2410 defconfig to 2.6.21-rc6

Update defconfig to the latest kernel version
and enable the h1940 LED driver

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] Update mach-types
Russell King [Sun, 8 Apr 2007 08:57:26 +0000 (09:57 +0100)] 
[ARM] Update mach-types

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[PATCH] x86: Fix potential overflow in perfctr reservation
Andi Kleen [Mon, 16 Apr 2007 08:30:27 +0000 (10:30 +0200)] 
[PATCH] x86: Fix potential overflow in perfctr reservation

While reviewing this code again I found a potential overflow of the bitmap.
The p4 oprofile can theoretically set bits beyond the reservation bitmap for
specific configurations. Avoid that by sizing the bitmaps properly.

Signed-off-by: Andi Kleen <ak@suse.de>
17 years ago[PATCH] x86: Fix gcc 4.2 _proxy_pda workaround
Andi Kleen [Mon, 16 Apr 2007 08:30:27 +0000 (10:30 +0200)] 
[PATCH] x86: Fix gcc 4.2 _proxy_pda workaround

Due to an over aggressive optimizer gcc 4.2 cannot optimize away _proxy_pda
in all cases (counter intuitive, but true).  This breaks loading of some
modules.

The earlier workaround to just export a dummy symbol didn't work unfortunately
because the module code ignores exports with 0 value.

Make it 1 instead.

Signed-off-by: Andi Kleen <ak@suse.de>
17 years agoLinux 2.6.21-rc7 v2.6.21-rc7
Linus Torvalds [Sun, 15 Apr 2007 23:50:57 +0000 (16:50 -0700)] 
Linux 2.6.21-rc7

I tend to prefer to not have to cut an -rc7, but we still have some
network device driver and suspend issues. So here's -rc7.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoNFS: Fix a list corruption problem
Trond Myklebust [Sun, 15 Apr 2007 20:21:49 +0000 (16:21 -0400)] 
NFS: Fix a list corruption problem

We must remove the request from whatever list it is currently on before we
can add it to the dirty list.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoFix VMI relocation processing logic error
Zachary Amsden [Fri, 13 Apr 2007 02:28:46 +0000 (19:28 -0700)] 
Fix VMI relocation processing logic error

Fix logic error in VMI relocation processing.  NOPs would always cause
a BUG_ON to fire because the != RELOCATION_NONE in the first if clause
precluding the == VMI_RELOCATION_NOP in the second clause.  Make these
direct equality tests and just warn for unsupported relocation types
(which should never happen), falling back to native in that case.

Thanks to Anthony Liguori for noting this!

Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoNFS: Ensure PG_writeback is cleared when writeback fails
Trond Myklebust [Sat, 14 Apr 2007 23:10:12 +0000 (19:10 -0400)] 
NFS: Ensure PG_writeback is cleared when writeback fails

If the writebacks are cancelled via nfs_cancel_dirty_list, or due to the
memory allocation failing in nfs_flush_one/nfs_flush_multi, then we must
ensure that the PG_writeback flag is cleared.

Also ensure that we actually own the PG_writeback flag whenever we
schedule a new writeback by making nfs_set_page_writeback() return the
value of test_set_page_writeback().
The PG_writeback page flag ends up replacing the functionality of the
PG_FLUSHING nfs_page flag, so we rip that out too.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoNFS: Fix two bugs in the O_DIRECT write code
Trond Myklebust [Sat, 14 Apr 2007 23:11:52 +0000 (19:11 -0400)] 
NFS: Fix two bugs in the O_DIRECT write code

Do not flag an error if the COMMIT call fails and we decide to resend the
writes. Let the resend flag the error if it fails.

If a write has failed, then nfs_direct_write_result should not attempt to
send a commit. It should just exit asap and return the error to the user.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoNFS: Fix an Oops in nfs_setattr()
Trond Myklebust [Sat, 14 Apr 2007 23:07:28 +0000 (19:07 -0400)] 
NFS: Fix an Oops in nfs_setattr()

It looks like nfs_setattr() and nfs_rename() also need to test whether the
target is a regular file before calling nfs_wb_all()...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agofailsafe mechanism to HPET clock calibration
Ravikiran G Thirumalai [Fri, 13 Apr 2007 23:28:20 +0000 (16:28 -0700)] 
failsafe mechanism to HPET clock calibration

Provide a failsafe mechanism to avoid kernel spinning forever at
read_hpet_tsc during early kernel bootup.

This failsafe mechanism was originally introduced in commit
2f7a2a79c3ebb44f8b1b7d9b4fd3a650eb69e544, but looks like the hpet split
from time.c lost it again.

This reintroduces the failsafe mechanism

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Cc: Jack Steiner <steiner@sgi.com>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Sun, 15 Apr 2007 04:41:12 +0000 (21:41 -0700)] 
Merge /pub/scm/linux/kernel/git/davem/sparc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SCSI] QLOGICPTI: Do not unmap DMA unless we actually mapped something.

17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Linus Torvalds [Sun, 15 Apr 2007 04:35:52 +0000 (21:35 -0700)] 
Merge /linux/kernel/git/jejb/scsi-rc-fixes-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] 3w-xxxx: fix oops caused by incorrect REQUEST_SENSE handling

17 years ago[SCSI] QLOGICPTI: Do not unmap DMA unless we actually mapped something.
David S. Miller [Sat, 14 Apr 2007 17:29:10 +0000 (10:29 -0700)] 
[SCSI] QLOGICPTI: Do not unmap DMA unless we actually mapped something.

We only map DMA when cmd->request_bufflen is non-zero for non-sg
buffers, we thus should make the same check when unmapping.

Based upon a report from Pasi Pirhonen.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[SCSI] 3w-xxxx: fix oops caused by incorrect REQUEST_SENSE handling
James Bottomley [Fri, 6 Apr 2007 16:14:56 +0000 (11:14 -0500)] 
[SCSI] 3w-xxxx: fix oops caused by incorrect REQUEST_SENSE handling

3w-xxxx emulates a REQUEST_SENSE response by simply returning nothing.
Unfortunately, it's assuming that the REQUEST_SENSE command is
implemented with use_sg == 0, which is no longer the case.  The oops
occurs because it's clearing the scatterlist in request_buffer instead
of the memory region.

This is fixed by using tw_transfer_internal() to transfer correctly to
the scatterlist.

Acked-by: adam radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
17 years agoDVB: dvb-usb-remote - fix oops when changing keymap
Olaf Kirch [Fri, 13 Apr 2007 05:18:44 +0000 (01:18 -0400)] 
DVB: dvb-usb-remote - fix oops when changing keymap

DVB USB remotes do not support changing keycode maps but set
input_dev->keycodesize and input_dev->keycodemax without setting
input_dev->keycode. This causes kernel oops when user tries to
look up (or change) current keymap.

While the proper fix would be to make remotes handle keymap changes
we'll just remove keycodemax and keycodesize initialization so
EVIOCGKEYCODE and EVIOCSKEYCODE will simply return -EINVAL.

http://bugzilla.kernel.org/show_bug.cgi?id=8312

Signed-off-by: olaf.kirch@oracle.com
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Sat, 14 Apr 2007 01:20:39 +0000 (18:20 -0700)] 
Merge /pub/scm/linux/kernel/git/davem/sparc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Fix inline directive in pci_iommu.c
  [SPARC64]: Fix arg passing to compat_sys_ipc().
  [SPARC]: Fix section mismatch warnings in pci.c and pcic.c
  [SUNRPC]: Make sure on-stack cmsg buffer is properly aligned.
  [SPARC]: avoid CHILD_MAX and OPEN_MAX constants
  [SPARC64]: Fix SBUS IOMMU allocation code.

17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Sat, 14 Apr 2007 01:20:16 +0000 (18:20 -0700)] 
Merge /pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NETFILTER] arp_tables: Fix unaligned accesses.
  [IPV6] SNMP: Fix {In,Out}NoRoutes statistics.
  [IPSEC] XFRM_USER: kernel panic when large security contexts in ACQUIRE
  [VLAN]: Allow VLAN interface on top of bridge interface
  [PKTGEN]: Add try_to_freeze()
  [NETFILTER]: ipt_ULOG: use put_unaligned

17 years ago[NETFILTER] arp_tables: Fix unaligned accesses.
David S. Miller [Fri, 13 Apr 2007 23:37:54 +0000 (16:37 -0700)] 
[NETFILTER] arp_tables: Fix unaligned accesses.

There are two device string comparison loops in arp_packet_match().
The first one goes byte-by-byte but the second one tries to be
clever and cast the string to a long and compare by longs.

The device name strings in the arp table entries are not guarenteed
to be aligned enough to make this value, so just use byte-by-byte
for both cases.

Based upon a report by <drraid@gmail.com>.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPV6] SNMP: Fix {In,Out}NoRoutes statistics.
YOSHIFUJI Hideaki [Fri, 13 Apr 2007 23:18:02 +0000 (16:18 -0700)] 
[IPV6] SNMP: Fix {In,Out}NoRoutes statistics.

A packet which is being discarded because of no routes in the
forwarding path should not be counted as OutNoRoutes but as
InNoRoutes.
Additionally, on this occasion, a packet whose destinaion is
not valid should be counted as InAddrErrors separately.

Based on patch from Mitsuru Chinen <mitch@linux.vnet.ibm.com>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC] XFRM_USER: kernel panic when large security contexts in ACQUIRE
Joy Latten [Fri, 13 Apr 2007 23:14:35 +0000 (16:14 -0700)] 
[IPSEC] XFRM_USER: kernel panic when large security contexts in ACQUIRE

When sending a security context of 50+ characters in an ACQUIRE
message, following kernel panic occurred.

kernel BUG in xfrm_send_acquire at net/xfrm/xfrm_user.c:1781!
cpu 0x3: Vector: 700 (Program Check) at [c0000000421bb2e0]
    pc: c00000000033b074: .xfrm_send_acquire+0x240/0x2c8
    lr: c00000000033b014: .xfrm_send_acquire+0x1e0/0x2c8
    sp: c0000000421bb560
   msr: 8000000000029032
  current = 0xc00000000fce8f00
  paca    = 0xc000000000464b00
    pid   = 2303, comm = ping
kernel BUG in xfrm_send_acquire at net/xfrm/xfrm_user.c:1781!
enter ? for help
3:mon> t
[c0000000421bb650c00000000033538c .km_query+0x6c/0xec
[c0000000421bb6f0c000000000337374 .xfrm_state_find+0x7f4/0xb88
[c0000000421bb7f0c000000000332350 .xfrm_tmpl_resolve+0xc4/0x21c
[c0000000421bb8d0c0000000003326e8 .xfrm_lookup+0x1a0/0x5b0
[c0000000421bba00c0000000002e6ea0 .ip_route_output_flow+0x88/0xb4
[c0000000421bbaa0c0000000003106d8 .ip4_datagram_connect+0x218/0x374
[c0000000421bbbd0c00000000031bc00 .inet_dgram_connect+0xac/0xd4
[c0000000421bbc60c0000000002b11ac .sys_connect+0xd8/0x120
[c0000000421bbd90c0000000002d38d0 .compat_sys_socketcall+0xdc/0x214
[c0000000421bbe30c00000000000869c syscall_exit+0x0/0x40
--- Exception: c00 (System Call) at 0000000007f0ca9c
SP (fc0ef8f0) is in userspace

We are using size of security context from xfrm_policy to determine
how much space to alloc skb and then putting security context from
xfrm_state into skb. Should have been using size of security context
from xfrm_state to alloc skb. Following fix does that

Signed-off-by: Joy Latten <latten@austin.ibm.com>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[VLAN]: Allow VLAN interface on top of bridge interface
Jerome Borsboom [Fri, 13 Apr 2007 23:12:47 +0000 (16:12 -0700)] 
[VLAN]: Allow VLAN interface on top of bridge interface

When a VLAN interface is created on top of a bridge interface and
netfilter is enabled to see the bridged packets, the packets can be
corrupted when passing through the netfilter code. This is caused by the
VLAN driver not setting the 'protocol' and 'nh' members of the sk_buff
structure. In general, this is no problem as the VLAN interface is mostly
connected to a physical ethernet interface which does not use the
'protocol' and 'nh' members. For a bridge interface, however, these
members do matter.

Signed-off-by: Jerome Borsboom <j.borsboom@erasmusmc.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[SPARC64]: Fix inline directive in pci_iommu.c
Tom "spot" Callaway [Fri, 13 Apr 2007 20:35:35 +0000 (13:35 -0700)] 
[SPARC64]: Fix inline directive in pci_iommu.c

While building a test kernel for the new esp driver (against
git-current), I hit this bug. Trivial fix, put the inline declaration
in the right place. :)

Signed-off-by: Tom "spot" Callaway <tcallawa@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[SPARC64]: Fix arg passing to compat_sys_ipc().
David S. Miller [Fri, 13 Apr 2007 20:27:08 +0000 (13:27 -0700)] 
[SPARC64]: Fix arg passing to compat_sys_ipc().

Do not sign extend args using the sys32_ipc stub, that is
buggy and unnecessary.

Based upon an excellent report by Mikael Pettersson.

Signed-off-by: David S. Miller <davem@davemloft.net>