pandora-kernel.git
15 years agoregulator core: fix double-free in regulator_register() error path
Paul Walmsley [Sat, 25 Apr 2009 11:28:36 +0000 (05:28 -0600)]
regulator core: fix double-free in regulator_register() error path

During regulator registration, any error after device_register() will
cause a double-free on the struct regulator_dev 'rdev'.  The bug is in
drivers/regulator/core.c:regulator_register():

...
scrub:
device_unregister(&rdev->dev);
clean:
kfree(rdev);                           <---
rdev = ERR_PTR(ret);
goto out;
...

device_unregister() calls regulator_dev_release() which frees rdev.  The
subsequent kfree corrupts memory and causes some OMAP3 systems to oops on
boot in regulator_get().

Applies against 2.6.30-rc3.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
15 years agodrivers/regulator: fix when type is different from REGULATOR_VOLTAGE or REGULATOR_CURRENT
Diego Liziero [Tue, 14 Apr 2009 01:04:47 +0000 (03:04 +0200)]
drivers/regulator: fix when type is different from REGULATOR_VOLTAGE or REGULATOR_CURRENT

When regulator_desc->type is something different from REGULATOR_VOLTAGE or REGULATOR_CURRENT
the if should probably return ERR_PTR(-EINVAL)

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

@@ expression E; constant C; @@
(
- !E == C
+ E != C
)

Signed-off-by: Diego Liziero <diegoliz@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
15 years agounreachable code in drms_uA_update()
Dan Carpenter [Wed, 8 Apr 2009 10:52:39 +0000 (13:52 +0300)]
unreachable code in drms_uA_update()

I removed the extra semi-colon and indented the return statement.

The unreachable code was found by smatch (http://repo.or.cz/w/smatch.git).
The patch was compile tested.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
15 years agoregulator: fix header file missing kernel-doc
Randy Dunlap [Sat, 4 Apr 2009 04:31:30 +0000 (21:31 -0700)]
regulator: fix header file missing kernel-doc

Add regulator header file missing kernel-doc:

Warning(include/linux/regulator/driver.h:117): No description found for parameter 'set_mode'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
cc: Liam Girdwood <lrg@slimlogic.co.uk>
cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
15 years agoInput: add detailed multi-touch finger data report protocol
Henrik Rydberg [Tue, 28 Apr 2009 14:47:33 +0000 (07:47 -0700)]
Input: add detailed multi-touch finger data report protocol

In order to utilize the full power of the new multi-touch devices, a
way to report detailed finger data to user space is needed. This patch
adds a multi-touch (MT) protocol which allows drivers to report details
for an arbitrary number of fingers.

The driver sends a SYN_MT_REPORT event via the input_mt_sync() function
when a complete finger has been reported.

In order to stay compatible with existing applications, the data
reported in a finger packet must not be recognized as single-touch
events. In addition, all finger data must bypass input filtering,
since subsequent events of the same type refer to different fingers.

A set of ABS_MT events with the desired properties are defined. The
events are divided into categories, to allow for partial implementation.
The minimum set consists of ABS_MT_TOUCH_MAJOR, ABS_MT_POSITION_X and
ABS_MT_POSITION_Y, which allows for multiple fingers to be tracked.
If the device supports it, the ABS_MT_WIDTH_MAJOR may be used to provide
the size of the approaching finger. Anisotropy and direction may be
specified with ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MINOR and
ABS_MT_ORIENTATION. Devices with more granular information may specify
general shapes as blobs, i.e., as a sequence of rectangular shapes
grouped together by a ABS_MT_BLOB_ID. Finally, the ABS_MT_TOOL_TYPE
may be used to specify whether the touching tool is a finger or a pen.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
15 years agoInput: allow certain EV_ABS events to bypass all filtering
Henrik Rydberg [Tue, 28 Apr 2009 14:45:31 +0000 (07:45 -0700)]
Input: allow certain EV_ABS events to bypass all filtering

With the upcoming multi-touch interface as an example, there is
a need to make certain that all reported events actually get passed
to the event handler. This patch equips the input core with the
ability to bypass all filtering for certain EV_ABS events.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
15 years agoInput: bcm5974 - add documentation for the driver
Henrik Rydberg [Tue, 28 Apr 2009 14:07:07 +0000 (07:07 -0700)]
Input: bcm5974 - add documentation for the driver

This patch adds documentation for the bcm5974 to Documentation/input/.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
15 years agoInput: bcm5974 - augment debug information
Henrik Rydberg [Tue, 28 Apr 2009 14:04:42 +0000 (07:04 -0700)]
Input: bcm5974 - augment debug information

Add more button and finger data to the debug output.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
15 years agoInput: bcm5974 - Add support for the Macbook 5 (Unibody)
Henrik Rydberg [Tue, 28 Apr 2009 14:03:54 +0000 (07:03 -0700)]
Input: bcm5974 - Add support for the Macbook 5 (Unibody)

This patch adds support for the new unibody Macbook, with physically
integrated button and trackpad. Since the integrated button changes
the logic for touch-and-click, a device capability bit mask is now
reported in input_id.version, which can be picked up by user space
via a EVIOCGID call.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Tested-by: David M. Lary <dmlary@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
15 years agoInput: bcm5974 - add quad-finger tapping
Henrik Rydberg [Mon, 27 Apr 2009 18:52:43 +0000 (11:52 -0700)]
Input: bcm5974 - add quad-finger tapping

The integrated button on the new unibody Macbooks presents a need to
report explicit four-finger actions. Evidently, the finger pressing
the button is also touching the trackpad, so in order to fully support
three-finger actions, the driver must be able to report four-finger
actions. This patch adds a new button, BTN_TOOL_QUADTAP, which
achieves this.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
15 years agoInput: bcm5974 - prepare for a new trackpad header type
Henrik Rydberg [Mon, 27 Apr 2009 18:52:42 +0000 (11:52 -0700)]
Input: bcm5974 - prepare for a new trackpad header type

The new unibody Macbooks are equipped with an integrated button and
trackpad. The package header of the trackpad interface has changed to
also contain information about the integrated button.  This patch
performs the necessary preparations to allow for the new package
header.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
15 years agoInput: appletouch - fix DMA to/from stack buffer
Bob Copeland [Tue, 28 Apr 2009 14:49:53 +0000 (07:49 -0700)]
Input: appletouch - fix DMA to/from stack buffer

CONFIG_DMA_API_DEBUG spotted an instance of appletouch using
an array on the stack as a DMA buffer for certain hardware.
Change it to use a kmalloc()ed buffer instead.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
15 years agoInput: wacom - fix TabletPC touch bug
Ping Cheng [Tue, 28 Apr 2009 14:49:54 +0000 (07:49 -0700)]
Input: wacom - fix TabletPC touch bug

This patch fixed a bug that was introduced in kernel 2.6.28 for
TabletPC touch data. The wacom_parse_hid routine in wacom_sys.c
should always return 0 even when usb_control_msg got an error.

Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
15 years agoBluetooth: Fix connection establishment with low security requirement
Marcel Holtmann [Tue, 28 Apr 2009 16:04:55 +0000 (09:04 -0700)]
Bluetooth: Fix connection establishment with low security requirement

The Bluetooth 2.1 specification introduced four different security modes
that can be mapped using Legacy Pairing and Simple Pairing. With the
usage of Simple Pairing it is required that all connections (except
the ones for SDP) are encrypted. So even the low security requirement
mandates an encrypted connection when using Simple Pairing. When using
Legacy Pairing (for Bluetooth 2.0 devices and older) this is not required
since it causes interoperability issues.

To support this properly the low security requirement translates into
different host controller transactions depending if Simple Pairing is
supported or not. However in case of Simple Pairing the command to
switch on encryption after a successful authentication is not triggered
for the low security mode. This patch fixes this and actually makes
the logic to differentiate between Simple Pairing and Legacy Pairing
a lot simpler.

Based on a report by Ville Tervo <ville.tervo@nokia.com>

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
15 years agoBluetooth: Add different pairing timeout for Legacy Pairing
Marcel Holtmann [Sun, 26 Apr 2009 18:01:22 +0000 (20:01 +0200)]
Bluetooth: Add different pairing timeout for Legacy Pairing

The Bluetooth stack uses a reference counting for all established ACL
links and if no user (L2CAP connection) is present, the link will be
terminated to save power. The problem part is the dedicated pairing
when using Legacy Pairing (Bluetooth 2.0 and before). At that point
no user is present and pairing attempts will be disconnected within
10 seconds or less. In previous kernel version this was not a problem
since the disconnect timeout wasn't triggered on incoming connections
for the first time. However this caused issues with broken host stacks
that kept the connections around after dedicated pairing. When the
support for Simple Pairing got added, the link establishment procedure
needed to be changed and now causes issues when using Legacy Pairing

When using Simple Pairing it is possible to do a proper reference
counting of ACL link users. With Legacy Pairing this is not possible
since the specification is unclear in some areas and too many broken
Bluetooth devices have already been deployed. So instead of trying to
deal with all the broken devices, a special pairing timeout will be
introduced that increases the timeout to 60 seconds when pairing is
triggered.

If a broken devices now puts the stack into an unforeseen state, the
worst that happens is the disconnect timeout triggers after 120 seconds
instead of 4 seconds. This allows successful pairings with legacy and
broken devices now.

Based on a report by Johan Hedberg <johan.hedberg@nokia.com>

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
15 years agoBluetooth: Ensure that HCI sysfs add/del is preempt safe
Roger Quadros [Thu, 23 Apr 2009 11:50:54 +0000 (14:50 +0300)]
Bluetooth: Ensure that HCI sysfs add/del is preempt safe

Use a different work_struct variables for add_conn() and del_conn() and
use single work queue instead of two for adding and deleting connections.

It eliminates the following error on a preemptible kernel:

[  204.358032] Unable to handle kernel NULL pointer dereference at virtual address 0000000c
[  204.370697] pgd = c0004000
[  204.373443] [0000000c] *pgd=00000000
[  204.378601] Internal error: Oops: 17 [#1] PREEMPT
[  204.383361] Modules linked in: vfat fat rfcomm sco l2cap sd_mod scsi_mod iphb pvr2d drm omaplfb ps
[  204.438537] CPU: 0    Not tainted  (2.6.28-maemo2 #1)
[  204.443664] PC is at klist_put+0x2c/0xb4
[  204.447601] LR is at klist_put+0x18/0xb4
[  204.451568] pc : [<c0270f08>]    lr : [<c0270ef4>]    psr: a0000113
[  204.451568] sp : cf1b3f10  ip : cf1b3f10  fp : cf1b3f2c
[  204.463104] r10: 00000000  r9 : 00000000  r8 : bf08029c
[  204.468353] r7 : c7869200  r6 : cfbe2690  r5 : c78692c8  r4 : 00000001
[  204.474945] r3 : 00000001  r2 : cf1b2000  r1 : 00000001  r0 : 00000000
[  204.481506] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM Segment kernel
[  204.488861] Control: 10c5387d  Table: 887fc018  DAC: 00000017
[  204.494628] Process btdelconn (pid: 515, stack limit = 0xcf1b22e0)

Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
15 years agonet: Avoid extra wakeups of threads blocked in wait_for_packet()
Eric Dumazet [Tue, 28 Apr 2009 09:24:21 +0000 (02:24 -0700)]
net: Avoid extra wakeups of threads blocked in wait_for_packet()

In 2.6.25 we added UDP mem accounting.

This unfortunatly added a penalty when a frame is transmitted, since
we have at TX completion time to call sock_wfree() to perform necessary
memory accounting. This calls sock_def_write_space() and utimately
scheduler if any thread is waiting on the socket.
Thread(s) waiting for an incoming frame was scheduled, then had to sleep
again as event was meaningless.

(All threads waiting on a socket are using same sk_sleep anchor)

This adds lot of extra wakeups and increases latencies, as noted
by Christoph Lameter, and slows down softirq handler.

Reference : http://marc.info/?l=linux-netdev&m=124060437012283&w=2

Fortunatly, Davide Libenzi recently added concept of keyed wakeups
into kernel, and particularly for sockets (see commit
37e5540b3c9d838eb20f2ca8ea2eb8072271e403
epoll keyed wakeups: make sockets use keyed wakeups)

Davide goal was to optimize epoll, but this new wakeup infrastructure
can help non epoll users as well, if they care to setup an appropriate
handler.

This patch introduces new DEFINE_WAIT_FUNC() helper and uses it
in wait_for_packet(), so that only relevant event can wakeup a thread
blocked in this function.

Trace of function calls from bnx2 TX completion bnx2_poll_work() is :
__kfree_skb()
 skb_release_head_state()
  sock_wfree()
   sock_def_write_space()
    __wake_up_sync_key()
     __wake_up_common()
      receiver_wake_function() : Stops here since thread is waiting for an INPUT

Reported-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopowerpc/ps3: Fix build error on UP
Geoff Levand [Thu, 16 Apr 2009 09:05:37 +0000 (09:05 +0000)]
powerpc/ps3: Fix build error on UP

A non-SMP version of smp_send_stop() is now included in smp.h.
Remove the unneeded definition in the PS3 smp.c.

Fixes build errors like these when CONFIG_SMP=n:

  arch/powerpc/platforms/ps3/setup.c:49: error: redefinition of 'smp_send_stop'
  include/linux/smp.h:125: error: previous definition of 'smp_send_stop' was here

Reported-by: Subrata Modak <subrata@linux.vnet.ibm.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agopowerpc/cell: Select PCI for IBM_CELL_BLADE AND CELLEB
Michael Ellerman [Wed, 22 Apr 2009 22:43:03 +0000 (22:43 +0000)]
powerpc/cell: Select PCI for IBM_CELL_BLADE AND CELLEB

Currently PPC_CELL_NATIVE selects PPC_OF_PLATFORM_PCI, but does not
select PCI. This can lead to a config with the former and the latter
disabled, which does not build.

To fix this PPC_CELL_NATIVE should select PCI. However, that would
force PCI on for QPACE, which also selects PPC_CELL_NATIVE. So
instead move the select of PPC_OF_PLATFORM_PCI and PCI under both
IBM_CELL_BLADE and CELLEB.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agopowerpc: ppc32 needs elf_read_implies_exec()
Kumar Gala [Fri, 17 Apr 2009 08:03:01 +0000 (08:03 +0000)]
powerpc: ppc32 needs elf_read_implies_exec()

On ppc64 we implemented elf_read_implies_exec() for 32-bit binaries
because old toolchains had bugs where they didn't mark program
segments executable that needed to be.  For some reason we didn't do
this on ppc32 builds.  This hadn't been an issue until commit 8d30c14c
("powerpc/mm: Rework I$/D$ coherency (v3)"), which had as a side
effect that we are now enforcing execute permissions to some extent on
32-bit 4xx and Book E processors.

This fixes it by defining elf_read_implies_exec on 32-bit to turn on
the read-implies-exec behaviour on programs that are sufficiently old
that they don't have a PT_GNU_STACK program header.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agoRemove unused support code for refok sections.
Tim Abbott [Mon, 27 Apr 2009 18:02:27 +0000 (14:02 -0400)]
Remove unused support code for refok sections.

The old refok sections

  .text.init.refok
  .data.init.refok
  .exit.text.refok

have been deprecated since commit
312b1485fb509c9bc32eda28ad29537896658cb8.  After the other patches in
this patch series nothing is put in these sections, so clean things up
by eliminating all the remaining references to them.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosparc: cleanup references to deprecated .text.init* sections.
Tim Abbott [Mon, 27 Apr 2009 18:02:26 +0000 (14:02 -0400)]
sparc: cleanup references to deprecated .text.init* sections.

The section .text.init.refok is deprecated and __REF (.ref.text)
should be used in assembly files instead.  This patch cleans up a few
uses of .text.init.refok in the sparc architecture.

Also fix a reference to .text.init in a comment that wasn't updated to
.init.text.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosh: Use __INIT macro instead of .text.init.
Tim Abbott [Mon, 27 Apr 2009 18:02:25 +0000 (14:02 -0400)]
sh: Use __INIT macro instead of .text.init.

The sh architecture has some code in the .text.init section, but it
does not reference that section in its linker scripts.

This change moves this code from the .text.init section to the
.init.text section, which is presumably where it belongs.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopowerpc: Use __REF macro instead of old .text.init.refok.
Tim Abbott [Mon, 27 Apr 2009 18:02:24 +0000 (14:02 -0400)]
powerpc: Use __REF macro instead of old .text.init.refok.

The section .text.init.refok is deprecated and __REF (.ref.text)
should be used in assembly files instead.  This patch cleans up a few
uses of .text.init.refok in the powerpc architecture.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopowerpc: Use TEXT_TEXT macro in linker script.
Tim Abbott [Mon, 27 Apr 2009 18:02:23 +0000 (14:02 -0400)]
powerpc: Use TEXT_TEXT macro in linker script.

Rather than adding .ref.text to the powerpc linker script so that we
can use __REF on the powerpc architecture, it seems simpler to switch
to using the generic TEXT_TEXT macro.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoarm: Use __INIT macro instead of .text.init.
Tim Abbott [Mon, 27 Apr 2009 18:02:22 +0000 (14:02 -0400)]
arm: Use __INIT macro instead of .text.init.

arm is placing some code in the .text.init section, but it does not
reference that section in its linker scripts.

This change moves this code from the .text.init section to the
.init.text section, which is presumably where it belongs.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoFRV: Use __INIT macro instead of .text.init.
Tim Abbott [Mon, 27 Apr 2009 23:37:58 +0000 (00:37 +0100)]
FRV: Use __INIT macro instead of .text.init.

FRV is placing some code in the .text.init section but does not reference that
section in its linker scripts.

This change moves this code from the .text.init section to the .init.text
section, which is presumably where it belongs.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoFRV: Remove unused header asm/init.h.
Tim Abbott [Mon, 27 Apr 2009 23:37:53 +0000 (00:37 +0100)]
FRV: Remove unused header asm/init.h.

It seems nothing has included the frv asm/init.h header for some time, and its
actual contents are out of date with include/linux/init.h.  So just delete it.

Signed-off-by: Tim Abbott <tabbott@mit.edu>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc...
Paul Mackerras [Tue, 28 Apr 2009 00:47:16 +0000 (10:47 +1000)]
Merge branch 'merge' of git://git./linux/kernel/git/jwboyer/powerpc-4xx into merge

15 years agoRDMA/nes: Update iw_nes version
Chien Tung [Mon, 27 Apr 2009 20:46:29 +0000 (13:46 -0700)]
RDMA/nes: Update iw_nes version

Update version number to 1.5.0.0

Signed-off-by: Chien Tung <chien.tin.tung@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRDMA/nes: Fix error path in nes_accept()
Faisal Latif [Mon, 27 Apr 2009 20:45:19 +0000 (13:45 -0700)]
RDMA/nes: Fix error path in nes_accept()

If reg_phys_mem() fails, we need to free memory allocated for MPA
frame with private data before returning the error. Also move
nes_add_ref() after the reg_phys_mem() is successful.

Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRDMA/nes: Fix hang issues for large cluster dynamic connections
Faisal Latif [Mon, 27 Apr 2009 20:41:06 +0000 (13:41 -0700)]
RDMA/nes: Fix hang issues for large cluster dynamic connections

Running large cluster setup, we are hanging after many hours of
testing.  Fixing this required going over the code and making sure the
rexmit entry was properly removed based on the cm_node's state and
packet received.  Also when receiving a FIN packet, check seq# and
make sure there were no errors before calling handle_fin().

Following are the changes done in nes_cm.c:

* handle_ack_pkt() needs to return error value, so in case of error,
  handle_fin() is not called. Some cleanup done while going over the code.

* handle_rst_pkt(), handling of cm_node's NES_CM_STATE_LAST_ACK is missing.

* process_packet(), in case of FIN only packet is received, call
  check_seq() before processing.

* in handle_fin_pkt(), we are calling cleanup_retrans_entry() for all
  conditions, even if the packets need to be dropped.

Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRDMA/nes: Increase rexmit timeout interval
Faisal Latif [Mon, 27 Apr 2009 20:39:36 +0000 (13:39 -0700)]
RDMA/nes: Increase rexmit timeout interval

Under heavy load with large cluster testing, it may take longer to
receive a response to MPA requests.  Change the driver to wait longer
after each rexmit to max time value.

Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRDMA/nes: Check for sequence number wrap-around
Faisal Latif [Mon, 27 Apr 2009 20:38:31 +0000 (13:38 -0700)]
RDMA/nes: Check for sequence number wrap-around

check_seq() was not checking if the seq#s have wrapped.  Fix it.

Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRDMA/nes: Do not set apbvt entry for loopback
Faisal Latif [Mon, 27 Apr 2009 20:37:34 +0000 (13:37 -0700)]
RDMA/nes: Do not set apbvt entry for loopback

When a connect request comes, apbvt should only be set for
non-loopback connections.

Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRDMA/nes: Fix unused variable compile warning when INFINIBAND_NES_DEBUG=n
Chien Tung [Mon, 27 Apr 2009 20:36:03 +0000 (13:36 -0700)]
RDMA/nes: Fix unused variable compile warning when INFINIBAND_NES_DEBUG=n

Remove the NES_DEBUG that is causing the compile warning about an
unused variable when INFINIBAND_NES_DEBUG is not enabled.

Signed-off-by: Chien Tung <chien.tin.tung@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRDMA/nes: Fix fw_ver in /sys
Chien Tung [Mon, 27 Apr 2009 20:33:48 +0000 (13:33 -0700)]
RDMA/nes: Fix fw_ver in /sys

/sys/class/infiniband/nes?/fw_ver is not displaying firmware version
properly (it shows 0.0.0 with the current code).  Fill in the correct
firmware version number.

Signed-off-by: Chien Tung <chien.tin.tung@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRDMA/nes: Set trace length to 1 inch for SFP_D
Chien Tung [Mon, 27 Apr 2009 20:30:35 +0000 (13:30 -0700)]
RDMA/nes: Set trace length to 1 inch for SFP_D

With updated PHY firmware for SFP_D, setting the trace length to 1
inch for SFP_D provides a more stable link.

Signed-off-by: Chien Tung <chien.tin.tung@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRDMA/nes: Enable repause timer for port 1
Chien Tung [Mon, 27 Apr 2009 20:29:42 +0000 (13:29 -0700)]
RDMA/nes: Enable repause timer for port 1

Enable repause timer for port 1.  Without this setting, under stress,
the chip may misbehave.

Signed-off-by: Chien Tung <chien.tin.tung@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRDMA/nes: Correct CDR loop filter setting for port 1
Chien Tung [Mon, 27 Apr 2009 20:28:41 +0000 (13:28 -0700)]
RDMA/nes: Correct CDR loop filter setting for port 1

In commit 1b949324 ("RDMA/nes: Fix SFP+ PHY initialization") there is
a mistake in the clean up code that removed port 1 CDR loop filter
settings for 10G cards other than CX4.  Put the correct setting back
for appropriate PHY types.

Signed-off-by: Chien Tung <chien.tin.tung@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRDMA/nes: Modify thermo mitigation to flip SerDes1 ref clk to internal
Chien Tung [Mon, 27 Apr 2009 20:27:21 +0000 (13:27 -0700)]
RDMA/nes: Modify thermo mitigation to flip SerDes1 ref clk to internal

Change thermo mitigation code to flip the SerDes1 reference clock to
internal, to match the change in commit a4849fc1 ("RDMA/nes: Add
wide_ppm_offset parm for switch compatibility").

Signed-off-by: Chien Tung <chien.tin.tung@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
15 years agoRevert "linux.conf.au 2009: Tuz"
Linus Torvalds [Mon, 27 Apr 2009 19:00:27 +0000 (12:00 -0700)]
Revert "linux.conf.au 2009: Tuz"

This reverts commit 8032b526d1a3bd91ad633dd3a3b5fdbc47ad54f1.

Hey, it was only meant to be a single release.  Now they can all die as
far as I'm concerned.

[ Just kidding.  They're cute and cuddly.

  Except when they have horrible nasty facial diseases.  Oh, and I guess
  they're not actually that cuddly even when disease-free. ]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
Linus Torvalds [Mon, 27 Apr 2009 18:59:46 +0000 (11:59 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI: only save/restore existent registers in the PCIe capability
  x86/PCI: don't bother with root quirks if _CRS is used
  docbooks: add/fix PCI kernel-doc
  PCI: cleanup debug output resources
  x86/PCI: set_pci_bus_resources_arch_default cleanups
  x86/PCI: Move set_pci_bus_resources_arch_default into arch/x86
  x86/PCI: don't call e820_all_mapped with -1 in the mmconfig case
  PCI quirk: disable MSI on VIA VT3364 chipsets

15 years agoeCryptfs: Fix min function comparison warning
Tyler Hicks [Mon, 27 Apr 2009 18:31:12 +0000 (13:31 -0500)]
eCryptfs: Fix min function comparison warning

This warning shows up on 64 bit builds:

fs/ecryptfs/inode.c:693: warning: comparison of distinct pointer types
lacks a cast

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
Linus Torvalds [Mon, 27 Apr 2009 18:16:33 +0000 (11:16 -0700)]
Merge git://git./linux/kernel/git/mason/btrfs-unstable

* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: look for acls during btrfs_read_locked_inode
  Btrfs: fix acl caching
  Btrfs: Fix a bunch of printk() warnings.
  Btrfs: Fix a trivial warning using max() of u64 vs ULL.
  Btrfs: remove unused btrfs_bit_radix slab
  Btrfs: ratelimit IO error printks
  Btrfs: remove #if 0 code
  Btrfs: When shrinking, only update disk size on success
  Btrfs: fix deadlocks and stalls on dead root removal
  Btrfs: fix fallocate deadlock on inode extent lock
  Btrfs: kill btrfs_cache_create
  Btrfs: don't export symbols
  Btrfs: simplify makefile
  Btrfs: try to keep a healthy ratio of metadata vs data block groups

15 years agoecryptfs: fix printk format warning
Randy Dunlap [Tue, 28 Apr 2009 04:24:28 +0000 (21:24 -0700)]
ecryptfs: fix printk format warning

fs/ecryptfs/inode.c:670: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Cc: Dustin Kirkland <kirkland@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
15 years agopowerpc/86xx: Add device_type entry to soc for ppc9a
Martyn Welch [Mon, 27 Apr 2009 16:24:28 +0000 (17:24 +0100)]
powerpc/86xx: Add device_type entry to soc for ppc9a

The 'device_type = "soc";' line *is* needed in the DTS for get_immrbase()
to return the correct address.

Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
15 years agoBtrfs: look for acls during btrfs_read_locked_inode
Chris Mason [Mon, 27 Apr 2009 15:47:50 +0000 (11:47 -0400)]
Btrfs: look for acls during btrfs_read_locked_inode

This changes btrfs_read_locked_inode() to peek ahead in the btree for acl items.
If it is certain a given inode has no acls, it will set the in memory acl
fields to null to avoid acl lookups completely.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
15 years agoBtrfs: fix acl caching
Chris Mason [Mon, 27 Apr 2009 14:49:53 +0000 (10:49 -0400)]
Btrfs: fix acl caching

Linus noticed the btrfs code to cache acls wasn't properly caching
a NULL acl when the inode didn't have any acls.  This meant the common
case of no acls resulted in expensive btree searches every time the
kernel checked permissions (which is quite often).

This is a modified version of Linus' original patch:

Properly set initial acl fields to BTRFS_ACL_NOT_CACHED in the inode.
This forces an acl lookup when permission checks are done.

Fix btrfs_get_acl to avoid lookups and locking when the inode acls fields
are set to null.

Fix btrfs_get_acl to use the right return value from __btrfs_getxattr
when deciding to cache a NULL acl.  It was storing a NULL acl when
__btrfs_getxattr return -ENOENT, but __btrfs_getxattr was actually returning
-ENODATA for this case.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
15 years agoMerge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux...
Russell King [Mon, 27 Apr 2009 17:06:24 +0000 (18:06 +0100)]
Merge branch 'for-rmk' of git://git./linux/kernel/git/khilman/linux-davinci

15 years agodavinci: DM644x: NAND: update partitioning
David Brownell [Wed, 15 Apr 2009 19:19:21 +0000 (14:19 -0500)]
davinci: DM644x: NAND: update partitioning

Update NAND partitioning for the dm6446 evm, unmasking the hidden
data at the beginning and letting the kernel be updated from Linux.

 - This is boot-compatible with TI's software (U-Boot 1.20 and both
   the 2.6.10 and 2.6.18 kernels), in terms of startup and loading
   kernels from flash.

 - In the same way, it's also boot-compatible with mainline U-Boot,
   which stores U-Boot params in block 0 not block 16.

 - It's not quite compatible with systems that previously used NAND
   partitions to hold (filesystem) data.  The compatibilities are a
   bit different based on which kernel was used previously
     + Users of TI/MV kernels no longer see mtd2 "params"
       (mainline u-boot env is in a different place)
* Filesystem is now mtd2 ... vs mtd3
     + Users of GIT kernels now see mtd0 and mtd1 partitions
* Filesystem partition starts 640 KBytes earlier
* Filesystem is now mtd2 ... vs mtd0
     * Linux now *uses* the flash-resident BBT
* Removes annoying slowdown/hiccup during boot
* Potentially ~64KB less space available with TI/MV kernels

If you *used* NAND partitions from Linux, there is no solution that's
fully compatible with all previous kernels in those respects ... ergo
this "best compromise".  It'd be good to back back up the filesystem
data; or, carry your own backwards-compatibility patch for awhile.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agodavinci: update DM644x support in preparation for more SoCs
Kevin Hilman [Tue, 14 Apr 2009 16:30:11 +0000 (11:30 -0500)]
davinci: update DM644x support in preparation for more SoCs

Rework DM644x code into SoC specific and board specific parts.
This is also to generalize the structure a bit so it's easier to add
support for new SoCs in the DaVinci family.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agodavinci: DM644x: rename board file
Kevin Hilman [Tue, 14 Apr 2009 15:57:40 +0000 (10:57 -0500)]
davinci: DM644x: rename board file

Rename DM6446 EVM board file, no functional changes.  Code is updated
and reworked in following patch.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agodavinci: update pin-multiplexing support
Kevin Hilman [Tue, 14 Apr 2009 14:50:37 +0000 (09:50 -0500)]
davinci: update pin-multiplexing support

Update MUX support to be more general and useful across multiple
SoCs in the DaVinci family.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agodavinci: serial: generalize for more SoCs
Kevin Hilman [Tue, 14 Apr 2009 13:04:26 +0000 (08:04 -0500)]
davinci: serial: generalize for more SoCs

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agodavinci: DM355 IRQ Definitions
s-paulraj@ti.com [Thu, 18 Sep 2008 19:35:00 +0000 (15:35 -0400)]
davinci: DM355 IRQ Definitions

Adding IRQ defintions for DaVinci DM355 and default interrupt
priorities for DM355

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agodavinci: DM646x: add interrupt number and priorities
Sudhakar Rajashekhara [Tue, 14 Apr 2009 12:53:02 +0000 (07:53 -0500)]
davinci: DM646x: add interrupt number and priorities

Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agodavinci: PSC: Clear bits in MDCTL reg before setting new bits
Mark A. Greer [Fri, 27 Mar 2009 02:33:21 +0000 (19:33 -0700)]
davinci: PSC: Clear bits in MDCTL reg before setting new bits

Clear any set bits in the 'NEXT' field of the MDCTL register in the
Power and Sleep Controller (PSC) before setting any new bits.
This also allows some minor cleanup by removing some no longer
needed lines of code.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agodavinci: gpio bugfixes
David Brownell [Sun, 7 Dec 2008 19:46:23 +0000 (11:46 -0800)]
davinci: gpio bugfixes

Update the DaVinci GPIO code to work better on non-dm6446 parts,
notably the dm355:

 - Only handle the number of GPIOs the chip actually has.  So
   for example on dm6467, GPIO-42 is the last GPIO, and trying
   to use GPIO-43 now fails cleanly; or GPIO-72 on dm6446.

 - Enable GPIO interrupts on each 16-bit GPIO-irq bank ...
   previously, only the first five were enabled, so GPIO-80
   and above (on dm355) wouldn't trigger IRQs.

 - Use the right IRQ for each GPIO bank.  The wrong values were
   used for dm355 chips, so GPIO IRQs got routed incorrectly.

 - Handle up to four pairs of 16-bit GPIO banks ... previously
   only three were handled, so accessing GPIO-96 and up (e.g. on
   dm355) would oops.

 - Update several comments that were dm6446-specific.

Verified by receiving GPIO-1 (dm9000) and GPIO-5 (msp430) IRQs
on the DM355 EVM.

One thing this doesn't do is handle the way some of the GPIO
numbers on dm6467 are reserved but aren't valid as GPIOs.  Some
bitmap logic could fix that if needed.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agodavinci: add EDMA driver
Kevin Hilman [Tue, 14 Apr 2009 12:18:14 +0000 (07:18 -0500)]
davinci: add EDMA driver

Original code for 2.6.10 and 2.6.28 series done by Texas Instruments
and MontaVista, but major updates and rework done by Troy Kisky and
David Brownell.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years agodavinci: timers: use clk_get_rate()
Kevin Hilman [Tue, 14 Apr 2009 12:06:37 +0000 (07:06 -0500)]
davinci: timers: use clk_get_rate()

Use clock framework instead of hard-coded CLOCK_TICK_RATE for
determining timer tick frequencies.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
15 years ago[SCSI] libosd: OSD2r05: on-the-wire changes for latest OSD2 revision 5.
Boaz Harrosh [Sun, 19 Apr 2009 16:17:54 +0000 (19:17 +0300)]
[SCSI] libosd: OSD2r05: on-the-wire changes for latest OSD2 revision 5.

OSC's OSD2 target: [git clone git://git.open-osd.org/osc-osd/ master]
(Initiator code prior to this patch must use: "git checkout CDB_VER_OSD2r01"
 in the target tree above)

This is a summery of the wire changes:

 * OSDv2_ADDITIONAL_CDB_LENGTH == 192 => 228 (Total CDB is now 236 bytes)
 * Attributes List Element Header grew, so attribute values are 8 bytes
   aligned.
 * Cryptographic keys and signatures are 20 => 32
 * Few new definitions.

(Still missing new standard definitions attribute values, these do not change
 wire format and will be added later when needed)

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] libosd: OSD2r05: OSD_CRYPTO_KEYID_SIZE will grow 20 => 32 bytes
Boaz Harrosh [Sun, 19 Apr 2009 16:13:39 +0000 (19:13 +0300)]
[SCSI] libosd: OSD2r05: OSD_CRYPTO_KEYID_SIZE will grow 20 => 32 bytes

In OSD2r04 draft, cryptographic key size changed to 32 bytes from
OSD1's 20 bytes. This causes a couple of on-the-wire structures
to change, including the CDB.

In this patch the OSD1/OSD2 handling is separated out in regard
to affected structures, but on-the-wire is still the same. All
on the wire changes will be submitted in one patch for bisect-ability.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] libosd: OSD2r05: Prepare for rev5 attribute list changes
Boaz Harrosh [Sun, 19 Apr 2009 16:11:42 +0000 (19:11 +0300)]
[SCSI] libosd: OSD2r05: Prepare for rev5 attribute list changes

In OSD2r05 draft each attribute list element header was changed
so attribute-value would be 8 bytes aligned. In OSD2r01-r04
it was aligned on 2 bytes. (This is because in OSD2r01 the complete
element was 8 bytes padded at end but the header was not adjusted
and caused permanent miss-alignment.)

OSD1 elements are not padded and might be or might not be aligned.
OSD1 is still supported.

In this code we do all the code re-factoring to separate OSD1/OSD2
differences but do not change actual wire format. All wire format
changes will happen in one patch later, for bisect-ability.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] libosd: fix potential ERR_PTR dereference in osd_initiator.c
Dan Carpenter [Sun, 19 Apr 2009 16:07:47 +0000 (19:07 +0300)]
[SCSI] libosd: fix potential ERR_PTR dereference in osd_initiator.c

bio_map_kern() returns an ERR_PTR() not NULL.

Found by smatch (http://repo.or.cz/w/smatch.git).  Compile tested.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Mon, 27 Apr 2009 15:54:43 +0000 (08:54 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: Fix Trivial Warnining in sound/pci/cmipci.c
  ALSA: snd-usb-caiaq: fix reported elapsed periods
  ASoC: s3c-i2s-v2 needs to declare a license for modular builds
  ALSA: hda - Fix init verbs of AD1884A mobile model
  ASoC: remove non-existing referece to CONFIG_SND_SOC_CODEC_WM8991
  ASoC: Fix WM8580 volume update handling for large register changes
  ASoC: Fix offset of freqmode in WM8580 PLL configuration

15 years ago[SCSI] mpt2sas : bump driver version to 01.100.02.00
Eric Moore [Tue, 21 Apr 2009 21:44:27 +0000 (15:44 -0600)]
[SCSI] mpt2sas : bump driver version to 01.100.02.00

Bump driver version.

Signed-off-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] mpt2sas: fix hotplug event processing
Eric Moore [Tue, 21 Apr 2009 21:43:33 +0000 (15:43 -0600)]
[SCSI] mpt2sas: fix hotplug event processing

Here's a fix for hotplug events.  The useage of queue_delayed_work seems
to broke the fifo for processing of firmware events.  After several iterations
of adding and removing cabling connected to jbods, the devices are not
getting added becuase kernel thread is activited out of order.

Signed-off-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] mpt2sas : release diagnotic buffers prior host reset
Eric Moore [Tue, 21 Apr 2009 21:42:13 +0000 (15:42 -0600)]
[SCSI] mpt2sas : release diagnotic buffers prior host reset

Diagnostic buffer support is already there in the driver.  This support allows
applications to pull ring buffers from controller firmware for debugging
firmware related issues.

What this patch does is sends reqeust to firmware to release the buffers prior
to host reset.   This will allow what ever debug info is there prior to reset
to be dma'd to host memory. With out this fix, some of the debug data would
been lost.

Signed-off-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] mpt2sas : Broadcast Primative AEN bug fix
Eric Moore [Tue, 21 Apr 2009 21:41:32 +0000 (15:41 -0600)]
[SCSI] mpt2sas : Broadcast Primative AEN bug fix

Bug fix in the broadcast primative async event code where the driver would
stop sending tm queries after the first queury was completed. This was due
driver not reseting the tm_cmds.status field back to MPT2_CMD_NOT_USED after
completing a task management request.

An addtional fix adding sanity check to insure sas_device->starget set to NULL.
During multipath testing fail over/fail back, the mid layer was holding onto
sdev longer than the fail back period, thus starget was getting set to NULL
for device being added.

Signed-off-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] mpt2sas : Identify Dell series-7 adapters at driver load time
Eric Moore [Tue, 21 Apr 2009 21:40:48 +0000 (15:40 -0600)]
[SCSI] mpt2sas : Identify Dell series-7 adapters at driver load time

The Dell branding along with the VID, DID, SSVID, SSDID following the LSI
branding that contains the card firmware/chip/bios versions.  If the SSDID
is not known but it is a Dell HBA, the driver will print the SSDID instead
of the Dell branding string.  Nothing will be printed for non Dell HBAs

Signed-off-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] mpt2sas : driver name needs to be in the MPT2IOCINFO ioctl
Eric Moore [Tue, 21 Apr 2009 21:40:01 +0000 (15:40 -0600)]
[SCSI] mpt2sas : driver name needs to be in the MPT2IOCINFO ioctl

The driver name needs to be at the beginining of the driver_version string in
MPT2IOCINFO ioctl.  This is the same behaviour is there already in the mptsas
driver.

Signed-off-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] mpt2sas : running out of message frames
Eric Moore [Tue, 21 Apr 2009 21:39:24 +0000 (15:39 -0600)]
[SCSI] mpt2sas : running out of message frames

The driver is not freeing message frame when returning failure from
_ctl_do_task_abort.   If you call this function 500 times when its unable
to find an active task mid, you end up with no message frames.

Signed-off-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] mpt2sas : fix oops when firmware sends large sense buffer size
Eric Moore [Tue, 21 Apr 2009 21:38:43 +0000 (15:38 -0600)]
[SCSI] mpt2sas : fix oops when firmware sends large sense buffer size

There is a bug in firmware where the reply message frame says there is a
16kb sense buffer, when in reality its only 20 bytes.  This fix insures
the memcpy action doesn't corrupte the memory beyond the 90 bytes allocated in
the scsi command for sense buffer.

Signed-off-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] mpt2sas : the sanity check in base_interrupt needs to be on dword boundary
Eric Moore [Tue, 21 Apr 2009 21:37:57 +0000 (15:37 -0600)]
[SCSI] mpt2sas : the sanity check in base_interrupt needs to be on dword boundary

The poison sanity check on the reply_post_free register needs to be by 32bit,
not 64bit. The poison check is there because its possible that the driver read
the 1st 32bit before the 2nd 32bit has been written to by firmware.  In other
words, this handles race between driver reading the 64 bit register, and it
being dma'd across pci memory from controller firmware as two 32bit pci writes.

Signed-off-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] mpt2sas : unique ioctl magic number
Eric Moore [Tue, 21 Apr 2009 21:37:20 +0000 (15:37 -0600)]
[SCSI] mpt2sas : unique ioctl magic number

The current magic number is shared with mptsas driver. This to be unique to
fix issues with register_ioctls32_conversion in older kernels.  We are making
this change across all versions of the sas2.0 drivers.

Signed-off-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
Linus Torvalds [Mon, 27 Apr 2009 15:40:00 +0000 (08:40 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-quota-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-quota-2.6:
  ext2: missing unlock in ext2_quota_write()
  quota: remove obsolete comments in fs/quota/Makefile

15 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Linus Torvalds [Mon, 27 Apr 2009 15:39:02 +0000 (08:39 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: Do not try to validate extents on special files
  ext4: Ignore i_file_acl_high unless EXT4_FEATURE_INCOMPAT_64BIT is present
  ext4: Fix softlockup caused by illegal i_file_acl value in on-disk inode

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Mon, 27 Apr 2009 15:38:51 +0000 (08:38 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  ptrace: ptrace_attach: fix the usage of ->cred_exec_mutex

15 years agoMerge branch 'sh/for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal...
Linus Torvalds [Mon, 27 Apr 2009 15:38:15 +0000 (08:38 -0700)]
Merge branch 'sh/for-2.6.30' of git://git./linux/kernel/git/lethal/sh-2.6

* 'sh/for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Fix up unsigned syscall_nr in SH-5 pt_regs.
  maple: input: fix up maple mouse driver
  sh: sh7785lcr: fix defconfig for 29-bit mode

15 years ago[SCSI] fix sign extension with 1.5TB usb-storage LBD=y
Dave Hansen [Tue, 21 Apr 2009 23:43:27 +0000 (16:43 -0700)]
[SCSI] fix sign extension with 1.5TB usb-storage LBD=y

Shifting an unsigned char implicitly casts it to a signed int.  This
caused 'lba' to sign-extend and Linux would then try READ CAPACITY 16
which was not supported by at least one drive.  Using the
get_unaligned_be*() helpers keeps us from having to worry about how the
extension might occur.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] ipr: Fix sleeping function called with interrupts disabled
Brian King [Wed, 22 Apr 2009 13:58:02 +0000 (08:58 -0500)]
[SCSI] ipr: Fix sleeping function called with interrupts disabled

The ata_sas_slave_configure was changed such that it now allocates
some memory for a drain buffer for ATAPI devices. Fixup the ipr
driver such that we no longer make this call with interrupts disabled.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] fcoe: fip: add multicast filter to receive FIP advertisements.
Joe Eykholt [Tue, 21 Apr 2009 23:27:46 +0000 (16:27 -0700)]
[SCSI] fcoe: fip: add multicast filter to receive FIP advertisements.

The FCoE forwarder (FCF) would be selected, but then would soon time
out after three advertisements were missed.  This would be 24 seconds
by default, or 3 times the keep-alive interval configured on the switch.

The cause was that the multicast address for all FIP E-nodes
was never added.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] libfc: Fix compilation warnings with allmodconfig
Robert Love [Tue, 21 Apr 2009 23:27:41 +0000 (16:27 -0700)]
[SCSI] libfc: Fix compilation warnings with allmodconfig

When building with a .config generated from 'make allmodconfig'
some build warnings are generated. This patch corrects the warnings,
adds a FC_FID_NONE (= 0) enumeration for FC-IDs and cleans up one
variable naming to meet our variable naming conventions. For example,
fc_lport's should be named "lport," not "lp."

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] fcoe: fix spelling typos and bad comments
Chris Leech [Tue, 21 Apr 2009 23:27:36 +0000 (16:27 -0700)]
[SCSI] fcoe: fix spelling typos and bad comments

Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] fcoe: don't export functions that are internal to fcoe
Chris Leech [Tue, 21 Apr 2009 23:27:30 +0000 (16:27 -0700)]
[SCSI] fcoe: don't export functions that are internal to fcoe

These probably never should have been exported.
If they were needed outside of the fcoe module, they
would have been moved to libfcoe.

Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] fcoe: kfree() -> kfree_skb()
Dan Carpenter [Tue, 21 Apr 2009 23:27:25 +0000 (16:27 -0700)]
[SCSI] fcoe: kfree() -> kfree_skb()

sk_buff pointers should use kfree_skb() instead of vanilla kfree().

Found by smatch (http://repo.or.cz/w/smatch.git).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] libfc: whenever queueing delete ev for rport, set state to NONE
Abhijeet Joglekar [Tue, 21 Apr 2009 23:27:19 +0000 (16:27 -0700)]
[SCSI] libfc: whenever queueing delete ev for rport, set state to NONE

When a delete event is queued for an rport, set state to NONE so that no
other processing is done on the rport as it is being removed.

Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] libfc: Change state to NONE in fc_lport_destroy
Abhijeet Joglekar [Tue, 21 Apr 2009 23:27:14 +0000 (16:27 -0700)]
[SCSI] libfc: Change state to NONE in fc_lport_destroy

After lport_destroy, the local port should not be used again. Transition
to state NONE, any incoming frames or link up should not transition out
of this state since we are deleting exchange table and cleaning up the
local port. Also, mark link as down.

Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] libfc: During fabric logoff, flush the rport Q after logging off dns port
Abhijeet Joglekar [Tue, 21 Apr 2009 23:27:09 +0000 (16:27 -0700)]
[SCSI] libfc: During fabric logoff, flush the rport Q after logging off dns port

We want to generate the rport queue event (from the logoff)
before flushing the queue otherwise the event may still be
in the queue when we logoff.

Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] libfc: Track rogue remote ports
Abhijeet Joglekar [Tue, 21 Apr 2009 23:27:04 +0000 (16:27 -0700)]
[SCSI] libfc: Track rogue remote ports

Rogue ports are currently not tracked on any list. The only reference
to them is through any outstanding exchanges pending on the rogue ports.
If the module is removed while a retry is set on a rogue port
(say a Plogi retry for instance), this retry is not cancelled because there
is no reference to the rogue port in the discovery rports list. Thus the
local port can clean itself up, delete the exchange pool, and then the
rogue port timeout can fire and try to start up another exchange.

This patch tracks the rogue ports in a new list disc->rogue_rports. Creating
a new list instead of using the disc->rports list keeps remote port code
change to a minimum.

1)  Whenever a rogue port is created, it is immediately added to the
disc->rogue_rports list.

2) When the rogues port goes to ready, it is removed from the rogue list
and the real remote port is added to the disc->rports list

3) The removal of the rogue from the disc->rogue_rports list is done in
the context of the fc_rport_work() workQ thread in discovery callback.

4) Real rports are removed from the disc->rports list like before. Lookup
is done only in the real rports list. This avoids making large changes
to the remote port code.

5) In fc_disc_stop_rports, the rogues list is traversed in addition to the
real list to stop the rogue ports and issue logoffs on them. This way, rogue
ports get cleaned up when the local port goes away.

6) rogue remote ports are not removed from the list right away, but
removed late in fc_rport_work() context, multiple threads can find the same
remote port in the list and call rport_logoff(). Rport_logoff() only
continues with the logoff if port is not in NONE state, thus preventing
multiple logoffs and multiple list deletions.

7) Since the rport is removed from the disc list at a later stage
(in the disc callback), incoming frames can find the rport even if
rport_logoff() has been called on the rport. When rport_logoff() is called,
the rport state is set to NONE, and we are trying to cancel all exchanges
and retries on that port. While in this state, if an incoming
Plogi/Prli/Logo or other frames match the rport, we should not reply
because the rport is in the NONE state. Just drop the frame, since the
rport will be deleted soon in the disc callback (fc_rport_work)

8)  In fc_disc_single(), remove rport lookup and call to fc_disc_del_target.
fc_disc_single() is called from recv_rscn_req() where rport lookup
and rport_logoff is already done.

Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] libfc: Do not retry if the new state is not the same as old state
Abhijeet Joglekar [Tue, 21 Apr 2009 23:26:58 +0000 (16:26 -0700)]
[SCSI] libfc: Do not retry if the new state is not the same as old state

For instance, if there is a Plogi pending (remote port is in Plogi state),
and the state changes to say NONE (because the port is being logged off),
then when the Plogi resp times out, do not start a retry.

This patch partially reverts an earlier patch (libfc: check for err when
recv and state is incorrect), by moving the state check back to before
checking for error. However, if the state does not match, then there is
an additional check to see if its an error ptr or a real frame before
jumping to err or out respectively.

Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] libfc: Hold disc mutex while processing gpn ft resp
Abhijeet Joglekar [Tue, 21 Apr 2009 23:26:52 +0000 (16:26 -0700)]
[SCSI] libfc: Hold disc mutex while processing gpn ft resp

gpn_ft_resp processing currently does not hold the discovery lock.
disc_done() thus gets called from gpn_ft_resp or from gpn_ft_parse
without the lock held. This then sets disc->pending to zero or calls
gpn_ft_req() without disc_lock held.

- Hold disc mutex during gpn_ft resp processing
- In disc_done, release the disc mutex while calling lport callback

Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years agoMerge branch 'fix/misc' into for-linus
Takashi Iwai [Mon, 27 Apr 2009 15:15:44 +0000 (17:15 +0200)]
Merge branch 'fix/misc' into for-linus

* fix/misc:
  ALSA: Fix Trivial Warnining in sound/pci/cmipci.c

15 years agoMerge branch 'fix/caiaq' into for-linus
Takashi Iwai [Mon, 27 Apr 2009 15:15:41 +0000 (17:15 +0200)]
Merge branch 'fix/caiaq' into for-linus

* fix/caiaq:
  ALSA: snd-usb-caiaq: fix reported elapsed periods

15 years agoMerge branch 'fix/hda' into for-linus
Takashi Iwai [Mon, 27 Apr 2009 15:15:35 +0000 (17:15 +0200)]
Merge branch 'fix/hda' into for-linus

* fix/hda:
  ALSA: hda - Fix init verbs of AD1884A mobile model

15 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Mon, 27 Apr 2009 15:15:32 +0000 (17:15 +0200)]
Merge branch 'fix/asoc' into for-linus

* fix/asoc:
  ASoC: s3c-i2s-v2 needs to declare a license for modular builds
  ASoC: remove non-existing referece to CONFIG_SND_SOC_CODEC_WM8991
  ASoC: Fix WM8580 volume update handling for large register changes
  ASoC: Fix offset of freqmode in WM8580 PLL configuration

15 years ago[SCSI] cxgb3i: fix ddp map overrun
kxie@chelsio.com [Tue, 21 Apr 2009 20:32:35 +0000 (15:32 -0500)]
[SCSI] cxgb3i: fix ddp map overrun

(version 2)

Fixed a bug in calculating ddp map range when search for free entries:
it was going beyond the end by one, thus corrupting gl_skb[0].

Signed-off-by: Karen Xie <kxie@chelsio.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] cxgb3i: fix cpu use abuse during writes
Mike Christie [Tue, 21 Apr 2009 20:32:34 +0000 (15:32 -0500)]
[SCSI] cxgb3i: fix cpu use abuse during writes

When doing a lot (128) of large writes (256K) we can hit the cxgb3_snd_win
check pretty easily. The driver's xmit thread then takes 100% of the cpu.

The driver should not be returning -EAGAIN for this problem. It should
be returing -ENOBUFS, then when the window is opened again it should
queue the xmit thread (it already wakes the xmit thread).

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
15 years ago[SCSI] cxgb3i: fix can_queue and cmd_per_lun initialization
Mike Christie [Tue, 21 Apr 2009 20:32:33 +0000 (15:32 -0500)]
[SCSI] cxgb3i: fix can_queue and cmd_per_lun initialization

cxgb3i was setting can_queue to only 128 commands, and was
setting the can_queue and cmd_per_lun to the same value.

This sets the can_queue to 1024 commands, and sets the cmd_per_lun
to a safer default of 32.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>