firefly-linux-kernel-4.4.55.git
14 years agoblock: use after free bug in __blkdev_get
Neil Brown [Mon, 26 Oct 2009 07:59:17 +0000 (08:59 +0100)]
block: use after free bug in __blkdev_get

commit 0762b8bde9729f10f8e6249809660ff2ec3ad735
(from 14 months ago) introduced a use-after-free bug which has just
recently started manifesting in my md testing.
I tried git bisect to find out what caused the bug to start
manifesting, and it could have been the recent change to
blk_unregister_queue (48c0d4d4c04) but the results were inconclusive.

This patch certainly fixes my symptoms and looks correct as the two
calls are now in the same order as elsewhere in that function.

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agoNFSv4: The link() operation should return any delegation on the file
Trond Myklebust [Mon, 26 Oct 2009 12:09:46 +0000 (08:09 -0400)]
NFSv4: The link() operation should return any delegation on the file

Otherwise, we have to wait for the server to recall it.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agoNFSv4: Fix two unbalanced put_rpccred() issues.
Trond Myklebust [Mon, 26 Oct 2009 12:09:46 +0000 (08:09 -0400)]
NFSv4: Fix two unbalanced put_rpccred() issues.

Commits 29fba38b (nfs41: lease renewal) and fc01cea9 (nfs41: sequence
operation) introduce a couple of put_rpccred() calls on credentials for
which there is no corresponding get_rpccred().

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

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agosh: add uImage.bin target
Magnus Damm [Mon, 26 Oct 2009 10:12:39 +0000 (10:12 +0000)]
sh: add uImage.bin target

Add an uImage.bin target to allow uncompressed uImages.
Useful for boards with busted u-boot decompression like
the rsk7203 on my desk.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: rsk7203 CONFIG_MTD=n fix
Magnus Damm [Mon, 26 Oct 2009 10:08:55 +0000 (10:08 +0000)]
sh: rsk7203 CONFIG_MTD=n fix

Fix the rsk7203 board code to build with CONFIG_MTD=n.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Check for return_to_handler when unwinding the stack
Matt Fleming [Sat, 24 Oct 2009 18:56:57 +0000 (18:56 +0000)]
sh: Check for return_to_handler when unwinding the stack

When CONFIG_FUNCTION_GRAPH_TRACER is enabled the function graph tracer
may patch return addresses on the stack with the address of
return_to_handler(). This really confuses the DWARF unwinder because it
will try find the caller of return_to_handler(), not the caller of the
real return address.

So teach the DWARF unwinder how to find the real return address whenever
it encounters return_to_handler().

This patch does not cope very well when multiple return addresses on the
stack have been patched. To make it work properly it would require state
to track how many return_to_handler()'s have been seen so that we'd know
where to look in current->curr_ret_stack[]. So for now, instead of
trying to handle this, just moan if more than one return address on the
stack has been patched.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: Build fix: define more __movmem* symbols
Lubomir Rintel [Thu, 22 Oct 2009 11:58:37 +0000 (11:58 +0000)]
sh: Build fix: define more __movmem* symbols

ERROR: "__movmemSI12" [net/unix/unix.ko] undefined!
ERROR: "__movmemSI52" [net/ipv6/sit.ko] undefined!
ERROR: "__movmemSI24" [net/ipv6/ipv6.ko] undefined!
ERROR: "__movmemSI60" [net/ipv6/ipv6.ko] undefined!
ERROR: "__movmemSI16" [net/ipv6/ipv6.ko] undefined!
ERROR: "__movmemSI20" [net/ipv6/ipv6.ko] undefined!
ERROR: "__movmemSI32" [net/ipv6/ipv6.ko] undefined!

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agosh: __irq_entry annotate do_IRQ().
Paul Mundt [Mon, 26 Oct 2009 00:58:31 +0000 (09:58 +0900)]
sh: __irq_entry annotate do_IRQ().

This adds an __irq_entry annotation for do_IRQ() so that the IRQ
annotation in the function graph tracer works as advertized. We already
have the IRQENTRY section wired up, so this is just a trivial addition
to actually make use of it.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
14 years agopcmcia: do not load the pd6729 driver if io_base is NULL
Komuro [Fri, 23 Oct 2009 23:07:39 +0000 (08:07 +0900)]
pcmcia: do not load the pd6729 driver if io_base is NULL

The CL-PD6729 chip in some docking station is not initialized properly
under Linux. In that case, do not load the pd6729 driver.

[Dominik Brodowski <linux@dominikbrodowski.net>: spelling fixes, check for NULL not 0]
Signed-off-by: Komuro <komurojun-mbn@nifty.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
14 years agoblock: silently error unsupported empty barriers too
Mark McLoughlin [Sat, 24 Oct 2009 12:14:31 +0000 (14:14 +0200)]
block: silently error unsupported empty barriers too

With 2.6.32-rc5 in a KVM guest using dm and virtio_blk, we see the
following errors:

  end_request: I/O error, dev vda, sector 0
  end_request: I/O error, dev vda, sector 0

The errors go away if dm stops submitting empty barriers, by reverting:

  commit 52b1fd5a27c625c78373e024bf570af3c9d44a79
  Author: Mikulas Patocka <mpatocka@redhat.com>
    dm: send empty barriers to targets in dm_flush

We should silently error all barriers, even empty barriers, on devices
like virtio_blk which don't support them.

See also:

  https://bugzilla.redhat.com/514901

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Alasdair G Kergon <agk@redhat.com>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Neil Brown <neilb@suse.de>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agohwmon: (it87) Fix VID reading on IT8718F/IT8720F
Jean Delvare [Sat, 24 Oct 2009 11:28:47 +0000 (13:28 +0200)]
hwmon: (it87) Fix VID reading on IT8718F/IT8720F

Comparing apples to bananas doesn't seem right. Consistently use the
chips enum for chip type comparisons, to avoid such bugs in the
future.

The bug has been there since support for the IT8718F was added, so
VID never worked for this chip nor for the similar IT8720F.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (dme1737) No vid attributes for SCH311x
Jean Delvare [Sat, 24 Oct 2009 11:28:46 +0000 (13:28 +0200)]
hwmon: (dme1737) No vid attributes for SCH311x

The SCH311x chips do not have VID inputs, so the cpu0_vid and vrm
attributes shouldn't be created for them.

This fixes lm-sensors ticket #2353:
http://www.lm-sensors.org/ticket/2353

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Udo van den Heuvel <udovdh@xs4all.nl>
Cc: Juerg Haefliger <juergh@gmail.com>
14 years agohwmon: (fschmd) Fix check on unsigned in watchdog_write()
Roel Kluin [Sat, 24 Oct 2009 11:28:45 +0000 (13:28 +0200)]
hwmon: (fschmd) Fix check on unsigned in watchdog_write()

If unsigned the watchdog_trigger() return value will not be
checked correctly.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agohwmon: (coretemp) Maintainer update
Huaxu Wan [Sat, 24 Oct 2009 11:28:45 +0000 (13:28 +0200)]
hwmon: (coretemp) Maintainer update

Intel will help maintaining the coretemp driver.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
14 years agoNFSv4: Fix a bug when the server returns NFS4ERR_RESOURCE
Trond Myklebust [Fri, 23 Oct 2009 18:46:42 +0000 (14:46 -0400)]
NFSv4: Fix a bug when the server returns NFS4ERR_RESOURCE

RFC 3530 states that when we recieve the error NFS4ERR_RESOURCE, we are not
supposed to bump the sequence number on OPEN, LOCK, LOCKU, CLOSE, etc
operations. The problem is that we map that error into EREMOTEIO in the XDR
layer, and so the NFSv4 middle-layer routines like seqid_mutating_err(),
and nfs_increment_seqid() don't recognise it.

The fix is to defer the mapping until after the middle layers have
processed the error.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agonfs: Panic when commit fails
Terry Loftin [Fri, 23 Oct 2009 01:36:01 +0000 (21:36 -0400)]
nfs: Panic when commit fails

Actually pass the NFS_FILE_SYNC option to the server to avoid a
Panic in nfs_direct_write_complete() when a commit fails.

At the end of an nfs write, if the nfs commit fails, all the writes
will be rescheduled.  They are supposed to be rescheduled as NFS_FILE_SYNC
writes, but the rpc_task structure is not completely intialized and so
the option is not passed.  When the rescheduled writes complete, the
return indicates that they are NFS_UNSTABLE and we try to do another
commit.  This leads to a Panic because the commit data structure pointer
was set to null in the initial (failed) commit attempt.

Signed-off-by: Terry Loftin <terry.loftin@hp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agoomap4: Fix UART4 platform data on omap4
Santosh Shilimkar [Thu, 22 Oct 2009 21:48:14 +0000 (14:48 -0700)]
omap4: Fix UART4 platform data on omap4

This patch removes the unnecessary UART4 platform which is under
data is wrong because of this

There is a separate platform structure for UART4

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-By: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap4: Allow omap_serial_early_init() for OMAP4430 board
Santosh Shilimkar [Thu, 22 Oct 2009 21:48:14 +0000 (14:48 -0700)]
omap4: Allow omap_serial_early_init() for OMAP4430 board

This patch enables omap_serial_early_init() function for OMAP4430
SDP. Without this the bootup would throw oops in omap_serial_init().

Note that the ifndef CONFIG_ARCH_OMAP4 is split into two sections
to enable omap_serial_early_init(). This ifndef cannot be removed
until omap4 clock framework is implemented.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-By: Tony Lindgren <tony@atomide.com>
Reviewed-By: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap3: PM: enable UART3 module wakeups
Kevin Hilman [Thu, 22 Oct 2009 21:48:13 +0000 (14:48 -0700)]
omap3: PM: enable UART3 module wakeups

UART3 is in the PER powerdomain.  If PER goes idle/inactive
independently of CORE, for UART3 to wakeup it must have its wakeup
enable bits setup in PM_WKEN_PER.  This patch enables these bits.

The reason it works when PER and CORE work together is because when
CORE goes inactive/retention, the IOPAD wakeups are enabled and
trigger UART3 wakeup.

Without this patch, when the UART inactivity timer fires for UART3,
its clocks are disabled and it's unable to wakeup so will be unusable
until PER is awoken by another source.

Another way of testing is by keeping CORE on during suspend but
allowing PER to hit retention

  # echo 3 > /debug/pm_debug/core_pwrdm/suspend

then enter suspend

  # echo mem > /sys/power/state

Without this patch, UART3 will be unable to wakeup the system.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap2: Fix console serial port number for n8x0
Tony Lindgren [Thu, 22 Oct 2009 21:48:13 +0000 (14:48 -0700)]
omap2: Fix console serial port number for n8x0

With the recent changes omap serial ports match the physical
numbering like they should. Fix the kernel CMDLINE accordingly
so console works.

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
Linus Torvalds [Thu, 22 Oct 2009 22:35:16 +0000 (07:35 +0900)]
Merge git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  move virtrng_remove to .devexit.text
  move virtballoon_remove to .devexit.text
  virtio_blk: Revert serial number support
  virtio: let header files include virtio_ids.h
  virtio_blk: revert QUEUE_FLAG_VIRT addition

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Thu, 22 Oct 2009 22:34:23 +0000 (07:34 +0900)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (21 commits)
  niu: VLAN_ETH_HLEN should be used to make sure that the whole MAC header was copied to the head buffer in the Vlan packets case
  KS8851: Fix ks8851_set_rx_mode() for IFF_MULTICAST
  KS8851: Fix MAC address write order
  KS8851: Add soft reset at probe time
  net: fix section mismatch in fec.c
  net: Fix struct inet_timewait_sock bitfield annotation
  tcp: Try to catch MSG_PEEK bug
  net: Fix IP_MULTICAST_IF
  bluetooth: static lock key fix
  bluetooth: scheduling while atomic bug fix
  tcp: fix TCP_DEFER_ACCEPT retrans calculation
  tcp: reduce SYN-ACK retrans for TCP_DEFER_ACCEPT
  tcp: accept socket after TCP_DEFER_ACCEPT period
  Revert "tcp: fix tcp_defer_accept to consider the timeout"
  AF_UNIX: Fix deadlock on connecting to shutdown socket
  ethoc: clear only pending irqs
  ethoc: inline regs access
  vmxnet3: use dev_dbg, fix build for CONFIG_BLOCK=n
  virtio_net: use dev_kfree_skb_any() in free_old_xmit_skbs()
  be2net: fix support for PCI hot plug
  ...

14 years agoomap2: Fix detection of n8x0
Tony Lindgren [Thu, 22 Oct 2009 21:48:13 +0000 (14:48 -0700)]
omap2: Fix detection of n8x0

Otherwise the machine_is_nokia_n8*() does not work.

Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap1: Fix DSP public peripherals support for ams-delta
Janusz Krzysztofik [Thu, 22 Oct 2009 21:47:42 +0000 (14:47 -0700)]
omap1: Fix DSP public peripherals support for ams-delta

DSP public peripherals used to work on OMAP1510 based (or all OMAP1 class?)
machines as long as old dspgateway code were present in the l-o tree. For
several months it is no longer included, breaking support for McBSP1 based
audio on Amstrad Delta, for example.

This patch, derived from the old dspgateway code, corrects the problem for the
board by simply taking the DSP out of reset state, I guess. That way, things
should not break when a new dsp code is added to the tree, and the change can
be reverted then.

If there are any reports on McBSP1 or other DSP public peripherals not working
for other OMAP1 machines (I've not heard of any for now), I can prepare a more
general patch providing an extra include file with a helper function defined.

Created and tested against linux-2.6.32-rc5

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap1: Fix redundant UARTs pin muxing that can break other hardware support
Janusz Krzysztofik [Thu, 22 Oct 2009 21:47:42 +0000 (14:47 -0700)]
omap1: Fix redundant UARTs pin muxing that can break other hardware support

Commit 15ac408ee5a509053a765b816e9179515329369f removed enabled_uart
and OMAP_TAG_UART. This works for mach-omap2, but causes issues on
mach-omap1 for some boards as the mach-omap1 serial.c was muxing
pins based on the enabled_uart flag for 15xx.

Fix this by muxing pins in board-*.c files for the 15xx boards for
the uart ports that had enabled_uart flag set before the commit
above.

Tested on Amsdtrad Delta only.

Note that in the future we should add support for powering down
the uarts with a timer like mach-omap2/serial.c does. Otherwise
the enabled uarts will be blocking retention-while-idle.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: iommu: fix wrong condition check for SUPERSECTION
Hiroshi DOYU [Thu, 22 Oct 2009 21:46:32 +0000 (14:46 -0700)]
omap: iommu: fix wrong condition check for SUPERSECTION

A bit (2 << 0) is set both on SECTION and SUPERSECTION. To identify
SUPERSECTION correctly, other bits should be compared too.

Reported-by: "Srinivas Pulukuru" <srinivas.pulukuru@ti.com>
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: SDMA: Fix omap_stop_dma() API for channel linking
Santosh Shilimkar [Thu, 22 Oct 2009 21:46:31 +0000 (14:46 -0700)]
omap: SDMA: Fix omap_stop_dma() API for channel linking

OMAP sDMA driver API omap_stop_dma() doesn't really stop the dma when used
in linking scenario.

The DMA channel needs to be disabled before resetting the chain.
Also fix clearing of the OMAP_DMA_ACTIVE status in the linked case.

Cc: Hari n <hari.zoom@gmail.com>
Cc: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agoomap: Fix omap-keypad by restoring old keypad.h without breaking omap2 boards that...
Janusz Krzysztofik [Thu, 22 Oct 2009 21:43:17 +0000 (14:43 -0700)]
omap: Fix omap-keypad by restoring old keypad.h without breaking omap2 boards that use matrix_keypad

Only mach-omap2 boards are currently using matrix_keypad. Allow
mach-omap1 boards to use the old style keypad.h without breaking.

Created against linux-2.6.32-rc5.
Compile tested with omap_3430sdp_defconfig and rx51_defconfig.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>
14 years agomove virtrng_remove to .devexit.text
Uwe Kleine-König [Thu, 1 Oct 2009 08:28:35 +0000 (10:28 +0200)]
move virtrng_remove to .devexit.text

The function virtrng_remove is used only wrapped by __devexit_p so define
it using __devexit.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agomove virtballoon_remove to .devexit.text
Uwe Kleine-König [Thu, 1 Oct 2009 08:28:33 +0000 (10:28 +0200)]
move virtballoon_remove to .devexit.text

The function virtballoon_remove is used only wrapped by __devexit_p so
define it using __devexit.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agovirtio_blk: Revert serial number support
Rusty Russell [Thu, 22 Oct 2009 22:39:28 +0000 (16:39 -0600)]
virtio_blk: Revert serial number support

This reverts "Add serial number support for virtio_blk, V4a".

Turns out that virtio_pci, lguest and s/390 all have an 8 bit limit
on virtio config space, so noone could ever use this.

This is coming back later in a cleaner form.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: john cooper <john.cooper@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
14 years agovirtio: let header files include virtio_ids.h
Christian Borntraeger [Wed, 30 Sep 2009 09:17:21 +0000 (11:17 +0200)]
virtio: let header files include virtio_ids.h

Rusty,

commit 3ca4f5ca73057a617f9444a91022d7127041970a
    virtio: add virtio IDs file
moved all device IDs into a single file. While the change itself is
a very good one, it can break userspace applications. For example
if a userspace tool wanted to get the ID of virtio_net it used to
include virtio_net.h. This does no longer work, since virtio_net.h
does not include virtio_ids.h.
This patch moves all "#include <linux/virtio_ids.h>" from the C
files into the header files, making the header files compatible with
the old ones.

In addition, this patch exports virtio_ids.h to userspace.

CC: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years agovirtio_blk: revert QUEUE_FLAG_VIRT addition
Christoph Hellwig [Fri, 4 Sep 2009 20:44:42 +0000 (22:44 +0200)]
virtio_blk: revert QUEUE_FLAG_VIRT addition

It seems like the addition of QUEUE_FLAG_VIRT caueses major performance
regressions for Fedora users:

https://bugzilla.redhat.com/show_bug.cgi?id=509383
https://bugzilla.redhat.com/show_bug.cgi?id=505695

while I can't reproduce those extreme regressions myself I think the flag
is wrong.

Rationale:

  QUEUE_FLAG_VIRT expands to QUEUE_FLAG_NONROT which casus the queue
  unplugged immediately.  This is not a good behaviour for at least
  qemu and kvm where we do have significant overhead for every
  I/O operations.  Even with all the latested speeups (native AIO,
  MSI support, zero copy) we can only get native speed for up to 128kb
  I/O requests we already are down to 66% of native performance for 4kb
  requests even on my laptop running the Intel X25-M SSD for which the
  QUEUE_FLAG_NONROT was designed.
  If we ever get virtio-blk overhead low enough that this flag makes
  sense it should only be set based on a feature flag set by the host.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 years ago[SCSI] zfcp: Flush SCSI registration work when adding unit
Christof Schmitt [Tue, 13 Oct 2009 08:44:11 +0000 (10:44 +0200)]
[SCSI] zfcp: Flush SCSI registration work when adding unit

When configuring a LUN for use in zfcp, flush the SCSI work to ensure
the SCSI device has been created before returning. This means that a
configuration procedure can run these commands in a script and the
SCSI device is available immediately after the unit_add:

echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.181d/online
echo 0x401040C300000000 > \
        /sys/bus/ccw/drivers/zfcp/0.0.181d/0x500507630313c562/unit_add
lsscsi

Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] zfcp: Fix timer initialization for ct and els requests
Christof Schmitt [Tue, 13 Oct 2009 08:44:10 +0000 (10:44 +0200)]
[SCSI] zfcp: Fix timer initialization for ct and els requests

Add HZ since the start_timer function expects jiffies, not seconds.

Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] zfcp: Warn about storage devices with broken PLOGI data
Christof Schmitt [Tue, 13 Oct 2009 08:44:09 +0000 (10:44 +0200)]
[SCSI] zfcp: Warn about storage devices with broken PLOGI data

After opening a remote port zfcp checks if the WWPN returned in the
PLOGI maches the WWPN of the port that should have been opened. On a
mismatch zfcp assumes that the DID just changed, queries the FC
nameserver and tries again. If the situation persists the erp will
give up.

With this strategy, if the remote port always returns the wrong PLOGI
data, the remote port will not be opened. Introduce a warning, so that
the system administrator knows why the remote port is not being opened
and to have a pointer to investigate the problem on the storage
system.

Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] zfcp: Handle WWPN mismatch in PLOGI payload
Christof Schmitt [Wed, 14 Oct 2009 09:00:43 +0000 (11:00 +0200)]
[SCSI] zfcp: Handle WWPN mismatch in PLOGI payload

For ports, zfcp gets the DID from the FC nameserver and tries to open
the port. If the open succeeds, zfcp compares the WWPN from the
nameserver with the WWPN in the PLOGI payload. In case of a mismatch,
zfcp assumes that the DID of the port just changed and we opened the
wrong port. This means that zfcp has to forget the DID, lookup the DID
again and retry.

This error case had a problem that zfcp forgets the DID, but never
looks up a new one, stalling the ERP in this case. Fix this by
triggering the DID lookup and properly exit from the ERP. The DID
lookup will trigger a new ERP action.

Also ensure when trying to open the port again with the new DID, first
close the open port, even in the NOESC case.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years ago[SCSI] zfcp: fix kfree handling in zfcp_init_device_setup
Heiko Carstens [Tue, 13 Oct 2009 08:44:07 +0000 (10:44 +0200)]
[SCSI] zfcp: fix kfree handling in zfcp_init_device_setup

The pointer that is allocated with kmalloc() is passed to strsep()
which modifies it. Later on the modified pointer value will be passed
to kfree. Save the original pointer and pass that one to kfree
instead.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14 years agoniu: VLAN_ETH_HLEN should be used to make sure that the whole MAC header was copied...
Joyce Yu [Thu, 22 Oct 2009 00:21:10 +0000 (17:21 -0700)]
niu: VLAN_ETH_HLEN should be used to make sure that the whole MAC header was copied to the head buffer in the Vlan packets case

Signed-off-by: Joyce Yu <joyce.yu@sun.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'for-linus' of git://git.infradead.org/users/eparis/notify
Linus Torvalds [Wed, 21 Oct 2009 23:28:28 +0000 (08:28 +0900)]
Merge branch 'for-linus' of git://git.infradead.org/users/eparis/notify

* 'for-linus' of git://git.infradead.org/users/eparis/notify:
  dnotify: ignore FS_EVENT_ON_CHILD
  inotify: fix coalesce duplicate events into a single event in special case
  inotify: deprecate the inotify kernel interface
  fsnotify: do not set group for a mark before it is on the i_list

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Wed, 21 Oct 2009 23:27:12 +0000 (08:27 +0900)]
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: hp_sdc_rtc - fix test in hp_sdc_rtc_read_rt()
  Input: atkbd - consolidate force release quirks for volume keys
  Input: logips2pp - model 73 is actually TrackMan FX
  Input: i8042 - add Sony Vaio VGN-FZ240E to the nomux list
  Input: fix locking issue in /proc/bus/input/ handlers
  Input: atkbd - postpone restoring LED/repeat rate at resume
  Input: atkbd - restore resetting LED state at startup
  Input: i8042 - make pnp_data_busted variable boolean instead of int
  Input: synaptics - add another Protege M300 to rate blacklist

14 years agoMerge branch 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Wed, 21 Oct 2009 23:26:15 +0000 (08:26 +0900)]
Merge branch 'kvm-updates/2.6.32' of git://git./virt/kvm/kvm

* 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: Prevent kvm_init from corrupting debugfs structures
  KVM: MMU: fix pointer cast
  KVM: use proper hrtimer function to retrieve expiration time

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
Linus Torvalds [Wed, 21 Oct 2009 23:25:36 +0000 (08:25 +0900)]
Merge git://git./linux/kernel/git/agk/linux-2.6-dm

* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
  dm snapshot: allow chunk size to be less than page size
  dm snapshot: use unsigned integer chunk size
  dm snapshot: lock snapshot while supplying status
  dm exception store: fix failed set_chunk_size error path
  dm snapshot: require non zero chunk size by end of ctr
  dm: dec_pending needs locking to save error value
  dm: add missing del_gendisk to alloc_dev error path
  dm log: userspace fix incorrect luid cast in userspace_ctr
  dm snapshot: free exception store on init failure
  dm snapshot: sort by chunk size to fix race

14 years agoPM: Make warning in suspend_test_finish() less likely to happen
Rafael J. Wysocki [Tue, 20 Oct 2009 04:45:02 +0000 (06:45 +0200)]
PM: Make warning in suspend_test_finish() less likely to happen

Increase TEST_SUSPEND_SECONDS to 10 so the warning in
suspend_test_finish() doesn't annoy the users of slower systems so much.

Also, make the warning print the suspend-resume cycle time, so that we
know why the warning actually triggered.

Patch prepared during the hacking session at the Kernel Summit in Tokyo.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agommc: at91_mci: Don't include asm/mach/mmc.h
Uwe Kleine-König [Wed, 21 Oct 2009 07:46:59 +0000 (09:46 +0200)]
mmc: at91_mci: Don't include asm/mach/mmc.h

This fixes a compile bug introduced in

6ef297f (ARM: 5720/1: Move MMCI header to amba include dir)

That commit moved arch/arm/include/asm/mach/mmc.h to
include/linux/amba/mmci.h.  Just removing the include was enough.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Bill Gatliff <bgat@billgatliff.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Pierre Ossman <drzeus@drzeus.cx>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge branch 'sh/for-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal...
Linus Torvalds [Wed, 21 Oct 2009 23:17:15 +0000 (08:17 +0900)]
Merge branch 'sh/for-2.6.32' of git://git./linux/kernel/git/lethal/sh-2.6

* 'sh/for-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Kill off stray HAVE_FTRACE_SYSCALLS reference.
  sh: Remove BKL from landisk gio.
  sh: disabled cache handling fix.
  sh: Fix up single page flushing to use PAGE_SIZE.

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Wed, 21 Oct 2009 23:16:01 +0000 (08:16 +0900)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: aesni-intel - Fix irq_fpu_usable usage
  crypto: padlock-sha - Fix stack alignment

14 years agonfs: Fix nfs_parse_mount_options() kfree() leak
Yinghai Lu [Tue, 20 Oct 2009 05:13:46 +0000 (14:13 +0900)]
nfs: Fix nfs_parse_mount_options() kfree() leak

Fix a (small) memory leak in one of the error paths of the NFS mount
options parsing code.

Regression introduced in 2.6.30 by commit a67d18f (NFS: load the
rpc/rdma transport module automatically).

Reported-by: Yinghai Lu <yinghai@kernel.org>
Reported-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agofs: pipe.c null pointer dereference
Earl Chew [Mon, 19 Oct 2009 22:55:41 +0000 (15:55 -0700)]
fs: pipe.c null pointer dereference

This patch fixes a null pointer exception in pipe_rdwr_open() which
generates the stack trace:

> Unable to handle kernel NULL pointer dereference at 0000000000000028 RIP:
>  [<ffffffff802899a5>] pipe_rdwr_open+0x35/0x70
>  [<ffffffff8028125c>] __dentry_open+0x13c/0x230
>  [<ffffffff8028143d>] do_filp_open+0x2d/0x40
>  [<ffffffff802814aa>] do_sys_open+0x5a/0x100
>  [<ffffffff8021faf3>] sysenter_do_call+0x1b/0x67

The failure mode is triggered by an attempt to open an anonymous
pipe via /proc/pid/fd/* as exemplified by this script:

=============================================================
while : ; do
   { echo y ; sleep 1 ; } | { while read ; do echo z$REPLY; done ; } &
   PID=$!
   OUT=$(ps -efl | grep 'sleep 1' | grep -v grep |
        { read PID REST ; echo $PID; } )
   OUT="${OUT%% *}"
   DELAY=$((RANDOM * 1000 / 32768))
   usleep $((DELAY * 1000 + RANDOM % 1000 ))
   echo n > /proc/$OUT/fd/1                 # Trigger defect
done
=============================================================

Note that the failure window is quite small and I could only
reliably reproduce the defect by inserting a small delay
in pipe_rdwr_open(). For example:

 static int
 pipe_rdwr_open(struct inode *inode, struct file *filp)
 {
       msleep(100);
       mutex_lock(&inode->i_mutex);

Although the defect was observed in pipe_rdwr_open(), I think it
makes sense to replicate the change through all the pipe_*_open()
functions.

The core of the change is to verify that inode->i_pipe has not
been released before attempting to manipulate it. If inode->i_pipe
is no longer present, return ENOENT to indicate so.

The comment about potentially using atomic_t for i_pipe->readers
and i_pipe->writers has also been removed because it is no longer
relevant in this context. The inode->i_mutex lock must be used so
that inode->i_pipe can be dealt with correctly.

Signed-off-by: Earl Chew <earl_chew@agilent.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoARM: Fix lubbock defconfig build
Russell King [Wed, 21 Oct 2009 12:20:32 +0000 (13:20 +0100)]
ARM: Fix lubbock defconfig build

drivers/built-in.o: In function `pxa25x_udc_probe':
drivers/usb/gadget/pxa25x_udc.c:2195: undefined reference to `otg_get_transceiver'
drivers/usb/gadget/pxa25x_udc.c:2300: undefined reference to `otg_put_transceiver'

pxa25x_udc.c unconditionally uses these two functions, so we need to
ensure that the object providing them is also built.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoARM: 5769/1: CPU_ARM920T: remove dead Maverick EP9312 URL
Hartley Sweeten [Wed, 21 Oct 2009 01:27:01 +0000 (02:27 +0100)]
ARM: 5769/1: CPU_ARM920T: remove dead Maverick EP9312 URL

Remove the URL listed for Maverick EP9312 since it is not available
and modify the help text appropriately.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoARM: 5768/1: ep93xx: remove dead code in ep93xx_gpio_ab_irq_handler()
Hartley Sweeten [Wed, 21 Oct 2009 01:21:20 +0000 (02:21 +0100)]
ARM: 5768/1: ep93xx: remove dead code in ep93xx_gpio_ab_irq_handler()

Remove unnecessary code in ep93xx_gpio_ab_irq_handler().

The desc calculation for gpio port B was left in when the following
commit was merged.

commit d8aa0251f12546e9bd1e9ee1d9782d6492819a04
Author: Dmitry Baryshkov <dbaryshkov@gmail.com>
Date:   Thu Oct 9 13:36:24 2008 +0100

    [ARM] 5298/1: Drop desc_handle_irq()

It's not needed so remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoARM: 5767/1: ep93xx: remove ep93xx_init_time() prototype
Hartley Sweeten [Wed, 21 Oct 2009 01:17:22 +0000 (02:17 +0100)]
ARM: 5767/1: ep93xx: remove ep93xx_init_time() prototype

Remove unused prototype for ep93xx_init_time().  This function
is not defined in the kernel.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoARM: 5765/1: Updated U300 defconfig
Linus Walleij [Mon, 19 Oct 2009 20:29:28 +0000 (21:29 +0100)]
ARM: 5765/1: Updated U300 defconfig

This updates the U300 to use all the drivers merged in during the
2.6.32 merge window.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoARM: 5766/1: Fix watchdog enabling for AT91SAM9G45
Yegor Yefremov [Tue, 20 Oct 2009 07:39:41 +0000 (08:39 +0100)]
ARM: 5766/1: Fix watchdog enabling for AT91SAM9G45

The macro for the watchdog has been changed from CONFIG_AT91SAM9_WATCHDOG
to CONFIG_AT91SAM9X_WATCHDOG due to AT91CAP9 chips support

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agox86, UV: Set DELIVERY_MODE=4 for vector=NMI_VECTOR in uv_hub_send_ipi()
Robin Holt [Tue, 20 Oct 2009 19:36:15 +0000 (14:36 -0500)]
x86, UV: Set DELIVERY_MODE=4 for vector=NMI_VECTOR in uv_hub_send_ipi()

When sending a NMI_VECTOR IPI using the UV_HUB_IPI_INT register,
we need to ensure the delivery mode field of that register has
NMI delivery selected.

This makes those IPIs true NMIs, instead of flat IPIs. It
matters to reboot sequences and KGDB, both of which use NMI
IPIs.

Signed-off-by: Robin Holt <holt@sgi.com>
Acked-by: Jack Steiner <steiner@sgi.com>
Cc: Martin Hicks <mort@sgi.com>
Cc: <stable@kernel.org>
LKML-Reference: <20091020193620.877322000@alcatraz.americas.sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoKS8851: Fix ks8851_set_rx_mode() for IFF_MULTICAST
Ben Dooks [Mon, 19 Oct 2009 23:49:05 +0000 (23:49 +0000)]
KS8851: Fix ks8851_set_rx_mode() for IFF_MULTICAST

In ks8851_set_rx_mode() the case handling IFF_MULTICAST was also setting
the RXCR1_AE bit by accident. This meant that all unicast frames where
being accepted by the device. Remove RXCR1_AE from this case.

Note, RXCR1_AE was also masking a problem with setting the MAC address
properly, so needs to be applied after fixing the MAC write order.

Fixes a bug reported by Doong, Ping of Micrel. This version of the
patch avoids setting RXCR1_ME for all cases.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoKS8851: Fix MAC address write order
Ben Dooks [Mon, 19 Oct 2009 23:49:04 +0000 (23:49 +0000)]
KS8851: Fix MAC address write order

The MAC address register was being written in the wrong order, so add
a new address macro to convert mac-address byte to register address and
a ks8851_wrreg8() function to write each byte without having to worry
about any difficult byte swapping.

Fixes a bug reported by Doong, Ping of Micrel.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoKS8851: Add soft reset at probe time
Ben Dooks [Mon, 19 Oct 2009 23:49:03 +0000 (23:49 +0000)]
KS8851: Add soft reset at probe time

Issue a full soft reset at probe time.

This was reported by Doong Ping of Micrel, but no explanation of why this
is necessary or what bug it is fixing. Add it as it does not seem to hurt
the current driver and ensures that the device is in a known state when we
start setting it up.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: fix section mismatch in fec.c
Steven King [Wed, 21 Oct 2009 01:51:37 +0000 (18:51 -0700)]
net: fix section mismatch in fec.c

fec_enet_init is called by both fec_probe and fec_resume, so it
shouldn't be marked as __init.

Signed-off-by: Steven King <sfking@fdwdc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodnotify: ignore FS_EVENT_ON_CHILD
Andreas Gruenbacher [Wed, 14 Oct 2009 22:13:23 +0000 (00:13 +0200)]
dnotify: ignore FS_EVENT_ON_CHILD

Mask off FS_EVENT_ON_CHILD in dnotify_handle_event().  Otherwise, when there
is more than one watch on a directory and dnotify_should_send_event()
succeeds, events with FS_EVENT_ON_CHILD set will trigger all watches and cause
spurious events.

This case was overlooked in commit e42e2773.

#define _GNU_SOURCE

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>

static void create_event(int s, siginfo_t* si, void* p)
{
printf("create\n");
}

static void delete_event(int s, siginfo_t* si, void* p)
{
printf("delete\n");
}

int main (void) {
struct sigaction action;
char *tmpdir, *file;
int fd1, fd2;

sigemptyset (&action.sa_mask);
action.sa_flags = SA_SIGINFO;

action.sa_sigaction = create_event;
sigaction (SIGRTMIN + 0, &action, NULL);

action.sa_sigaction = delete_event;
sigaction (SIGRTMIN + 1, &action, NULL);

# define TMPDIR "/tmp/test.XXXXXX"
tmpdir = malloc(strlen(TMPDIR) + 1);
strcpy(tmpdir, TMPDIR);
mkdtemp(tmpdir);

# define TMPFILE "/file"
file = malloc(strlen(tmpdir) + strlen(TMPFILE) + 1);
sprintf(file, "%s/%s", tmpdir, TMPFILE);

fd1 = open (tmpdir, O_RDONLY);
fcntl(fd1, F_SETSIG, SIGRTMIN);
fcntl(fd1, F_NOTIFY, DN_MULTISHOT | DN_CREATE);

fd2 = open (tmpdir, O_RDONLY);
fcntl(fd2, F_SETSIG, SIGRTMIN + 1);
fcntl(fd2, F_NOTIFY, DN_MULTISHOT | DN_DELETE);

if (fork()) {
/* This triggers a create event */
creat(file, 0600);
/* This triggers a create and delete event (!) */
unlink(file);
} else {
sleep(1);
rmdir(tmpdir);
}

return 0;
}

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
14 years agopcmcia: Fix possible printk format warnings
Wolfram Sang [Mon, 19 Oct 2009 09:42:13 +0000 (11:42 +0200)]
pcmcia: Fix possible printk format warnings

Fix more possible warnings introduced by my commit
1d80766554322236aee50d6023693b3210b9cf38 as fixed by the previous patch from
Randy Dunlap. Not tested due to no hardware.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
14 years agonet: Fix struct inet_timewait_sock bitfield annotation
Eric Dumazet [Sun, 18 Oct 2009 22:48:51 +0000 (22:48 +0000)]
net: Fix struct inet_timewait_sock bitfield annotation

commit 9e337b0f (net: annotate inet_timewait_sock bitfields)
added 4/8 bytes in struct inet_timewait_sock.

Fix this by declaring tw_ipv6_offset in the 'flags' bitfield
The 14 bits hole is named tw_pad to make it cleary apparent.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotcp: Try to catch MSG_PEEK bug
Herbert Xu [Mon, 19 Oct 2009 19:41:06 +0000 (19:41 +0000)]
tcp: Try to catch MSG_PEEK bug

This patch tries to print out more information when we hit the
MSG_PEEK bug in tcp_recvmsg.  It's been around since at least
2005 and it's about time that we finally fix it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocrypto: aesni-intel - Fix irq_fpu_usable usage
Huang Ying [Tue, 20 Oct 2009 07:20:47 +0000 (16:20 +0900)]
crypto: aesni-intel - Fix irq_fpu_usable usage

When renaming kernel_fpu_using to irq_fpu_usable, the semantics of the
function is changed too, from mesuring whether kernel is using FPU,
that is, the FPU is NOT available, to measuring whether FPU is usable,
that is, the FPU is available.

But the usage of irq_fpu_usable in aesni-intel_glue.c is not changed
accordingly. This patch fixes this.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
14 years agoUBI: fix check on unsigned long
Roel Kluin [Fri, 16 Oct 2009 12:00:17 +0000 (14:00 +0200)]
UBI: fix check on unsigned long

result is unsigned, the wrong check was used.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
14 years agoUBI: fix backward compatibility
Artem Bityutskiy [Wed, 30 Sep 2009 07:01:28 +0000 (10:01 +0300)]
UBI: fix backward compatibility

Commit 32bc4820287a1a03982979515949e8ea56eac641 did not fully fix
the backward compatibility issues. We still fail to properly handle
situations when the first PEB contains non-zero image sequence
number, but one of the following PEBs contains zero image sequence
number. For example, this may happen if we mount a new image with
an old kernel, and then try to mount it in the new kernel.

This patch should fix the issue.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
14 years agonet: Fix IP_MULTICAST_IF
Eric Dumazet [Mon, 19 Oct 2009 06:41:58 +0000 (06:41 +0000)]
net: Fix IP_MULTICAST_IF

ipv4/ipv6 setsockopt(IP_MULTICAST_IF) have dubious __dev_get_by_index() calls.

This function should be called only with RTNL or dev_base_lock held, or reader
could see a corrupt hash chain and eventually enter an endless loop.

Fix is to call dev_get_by_index()/dev_put().

If this happens to be performance critical, we could define a new dev_exist_by_index()
function to avoid touching dev refcount.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobluetooth: static lock key fix
Dave Young [Sun, 18 Oct 2009 20:28:30 +0000 (20:28 +0000)]
bluetooth: static lock key fix

When shutdown ppp connection, lockdep waring about non-static key
will happen, it is caused by the lock is not initialized properly
at that time.

Fix with tuning the lock/skb_queue_head init order

[   94.339261] INFO: trying to register non-static key.
[   94.342509] the code is fine but needs lockdep annotation.
[   94.342509] turning off the locking correctness validator.
[   94.342509] Pid: 0, comm: swapper Not tainted 2.6.31-mm1 #2
[   94.342509] Call Trace:
[   94.342509]  [<c0248fbe>] register_lock_class+0x58/0x241
[   94.342509]  [<c024b5df>] ? __lock_acquire+0xb57/0xb73
[   94.342509]  [<c024ab34>] __lock_acquire+0xac/0xb73
[   94.342509]  [<c024b7fa>] ? lock_release_non_nested+0x17b/0x1de
[   94.342509]  [<c024b662>] lock_acquire+0x67/0x84
[   94.342509]  [<c04cd1eb>] ? skb_dequeue+0x15/0x41
[   94.342509]  [<c054a857>] _spin_lock_irqsave+0x2f/0x3f
[   94.342509]  [<c04cd1eb>] ? skb_dequeue+0x15/0x41
[   94.342509]  [<c04cd1eb>] skb_dequeue+0x15/0x41
[   94.342509]  [<c054a648>] ? _read_unlock+0x1d/0x20
[   94.342509]  [<c04cd641>] skb_queue_purge+0x14/0x1b
[   94.342509]  [<fab94fdc>] l2cap_recv_frame+0xea1/0x115a [l2cap]
[   94.342509]  [<c024b5df>] ? __lock_acquire+0xb57/0xb73
[   94.342509]  [<c0249c04>] ? mark_lock+0x1e/0x1c7
[   94.342509]  [<f8364963>] ? hci_rx_task+0xd2/0x1bc [bluetooth]
[   94.342509]  [<fab95346>] l2cap_recv_acldata+0xb1/0x1c6 [l2cap]
[   94.342509]  [<f8364997>] hci_rx_task+0x106/0x1bc [bluetooth]
[   94.342509]  [<fab95295>] ? l2cap_recv_acldata+0x0/0x1c6 [l2cap]
[   94.342509]  [<c02302c4>] tasklet_action+0x69/0xc1
[   94.342509]  [<c022fbef>] __do_softirq+0x94/0x11e
[   94.342509]  [<c022fcaf>] do_softirq+0x36/0x5a
[   94.342509]  [<c022fe14>] irq_exit+0x35/0x68
[   94.342509]  [<c0204ced>] do_IRQ+0x72/0x89
[   94.342509]  [<c02038ee>] common_interrupt+0x2e/0x34
[   94.342509]  [<c024007b>] ? pm_qos_add_requirement+0x63/0x9d
[   94.342509]  [<c038e8a5>] ? acpi_idle_enter_bm+0x209/0x238
[   94.342509]  [<c049d238>] cpuidle_idle_call+0x5c/0x94
[   94.342509]  [<c02023f8>] cpu_idle+0x4e/0x6f
[   94.342509]  [<c0534153>] rest_init+0x53/0x55
[   94.342509]  [<c0781894>] start_kernel+0x2f0/0x2f5
[   94.342509]  [<c0781091>] i386_start_kernel+0x91/0x96

Reported-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Tested-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobluetooth: scheduling while atomic bug fix
Dave Young [Sun, 18 Oct 2009 20:24:41 +0000 (20:24 +0000)]
bluetooth: scheduling while atomic bug fix

Due to driver core changes dev_set_drvdata will call kzalloc which should be
in might_sleep context, but hci_conn_add will be called in atomic context

Like dev_set_name move dev_set_drvdata to work queue function.

oops as following:

Oct  2 17:41:59 darkstar kernel: [  438.001341] BUG: sleeping function called from invalid context at mm/slqb.c:1546
Oct  2 17:41:59 darkstar kernel: [  438.001345] in_atomic(): 1, irqs_disabled(): 0, pid: 2133, name: sdptool
Oct  2 17:41:59 darkstar kernel: [  438.001348] 2 locks held by sdptool/2133:
Oct  2 17:41:59 darkstar kernel: [  438.001350]  #0:  (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+.+.}, at: [<faa1d2f5>] lock_sock+0xa/0xc [l2cap]
Oct  2 17:41:59 darkstar kernel: [  438.001360]  #1:  (&hdev->lock){+.-.+.}, at: [<faa20e16>] l2cap_sock_connect+0x103/0x26b [l2cap]
Oct  2 17:41:59 darkstar kernel: [  438.001371] Pid: 2133, comm: sdptool Not tainted 2.6.31-mm1 #2
Oct  2 17:41:59 darkstar kernel: [  438.001373] Call Trace:
Oct  2 17:41:59 darkstar kernel: [  438.001381]  [<c022433f>] __might_sleep+0xde/0xe5
Oct  2 17:41:59 darkstar kernel: [  438.001386]  [<c0298843>] __kmalloc+0x4a/0x15a
Oct  2 17:41:59 darkstar kernel: [  438.001392]  [<c03f0065>] ? kzalloc+0xb/0xd
Oct  2 17:41:59 darkstar kernel: [  438.001396]  [<c03f0065>] kzalloc+0xb/0xd
Oct  2 17:41:59 darkstar kernel: [  438.001400]  [<c03f04ff>] device_private_init+0x15/0x3d
Oct  2 17:41:59 darkstar kernel: [  438.001405]  [<c03f24c5>] dev_set_drvdata+0x18/0x26
Oct  2 17:41:59 darkstar kernel: [  438.001414]  [<fa51fff7>] hci_conn_init_sysfs+0x40/0xd9 [bluetooth]
Oct  2 17:41:59 darkstar kernel: [  438.001422]  [<fa51cdc0>] ? hci_conn_add+0x128/0x186 [bluetooth]
Oct  2 17:41:59 darkstar kernel: [  438.001429]  [<fa51ce0f>] hci_conn_add+0x177/0x186 [bluetooth]
Oct  2 17:41:59 darkstar kernel: [  438.001437]  [<fa51cf8a>] hci_connect+0x3c/0xfb [bluetooth]
Oct  2 17:41:59 darkstar kernel: [  438.001442]  [<faa20e87>] l2cap_sock_connect+0x174/0x26b [l2cap]
Oct  2 17:41:59 darkstar kernel: [  438.001448]  [<c04c8df5>] sys_connect+0x60/0x7a
Oct  2 17:41:59 darkstar kernel: [  438.001453]  [<c024b703>] ? lock_release_non_nested+0x84/0x1de
Oct  2 17:41:59 darkstar kernel: [  438.001458]  [<c028804b>] ? might_fault+0x47/0x81
Oct  2 17:41:59 darkstar kernel: [  438.001462]  [<c028804b>] ? might_fault+0x47/0x81
Oct  2 17:41:59 darkstar kernel: [  438.001468]  [<c033361f>] ? __copy_from_user_ll+0x11/0xce
Oct  2 17:41:59 darkstar kernel: [  438.001472]  [<c04c9419>] sys_socketcall+0x82/0x17b
Oct  2 17:41:59 darkstar kernel: [  438.001477]  [<c020329d>] syscall_call+0x7/0xb

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotcp: fix TCP_DEFER_ACCEPT retrans calculation
Julian Anastasov [Mon, 19 Oct 2009 10:10:40 +0000 (10:10 +0000)]
tcp: fix TCP_DEFER_ACCEPT retrans calculation

Fix TCP_DEFER_ACCEPT conversion between seconds and
retransmission to match the TCP SYN-ACK retransmission periods
because the time is converted to such retransmissions. The old
algorithm selects one more retransmission in some cases. Allow
up to 255 retransmissions.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotcp: reduce SYN-ACK retrans for TCP_DEFER_ACCEPT
Julian Anastasov [Mon, 19 Oct 2009 10:03:58 +0000 (10:03 +0000)]
tcp: reduce SYN-ACK retrans for TCP_DEFER_ACCEPT

Change SYN-ACK retransmitting code for the TCP_DEFER_ACCEPT
users to not retransmit SYN-ACKs during the deferring period if
ACK from client was received. The goal is to reduce traffic
during the deferring period. When the period is finished
we continue with sending SYN-ACKs (at least one) but this time
any traffic from client will change the request to established
socket allowing application to terminate it properly.
Also, do not drop acked request if sending of SYN-ACK fails.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotcp: accept socket after TCP_DEFER_ACCEPT period
Julian Anastasov [Mon, 19 Oct 2009 10:01:56 +0000 (10:01 +0000)]
tcp: accept socket after TCP_DEFER_ACCEPT period

Willy Tarreau and many other folks in recent years
were concerned what happens when the TCP_DEFER_ACCEPT period
expires for clients which sent ACK packet. They prefer clients
that actively resend ACK on our SYN-ACK retransmissions to be
converted from open requests to sockets and queued to the
listener for accepting after the deferring period is finished.
Then application server can decide to wait longer for data
or to properly terminate the connection with FIN if read()
returns EAGAIN which is an indication for accepting after
the deferring period. This change still can have side effects
for applications that expect always to see data on the accepted
socket. Others can be prepared to work in both modes (with or
without TCP_DEFER_ACCEPT period) and their data processing can
ignore the read=EAGAIN notification and to allocate resources for
clients which proved to have no data to send during the deferring
period. OTOH, servers that use TCP_DEFER_ACCEPT=1 as flag (not
as a timeout) to wait for data will notice clients that didn't
send data for 3 seconds but that still resend ACKs.
Thanks to Willy Tarreau for the initial idea and to
Eric Dumazet for the review and testing the change.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRevert "tcp: fix tcp_defer_accept to consider the timeout"
David S. Miller [Tue, 20 Oct 2009 02:12:36 +0000 (19:12 -0700)]
Revert "tcp: fix tcp_defer_accept to consider the timeout"

This reverts commit 6d01a026b7d3009a418326bdcf313503a314f1ea.

Julian Anastasov, Willy Tarreau and Eric Dumazet have come up
with a more correct way to deal with this.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoperf timechart: Improve the visual appearance of scheduler delays
Arjan van de Ven [Mon, 19 Oct 2009 21:47:31 +0000 (06:47 +0900)]
perf timechart: Improve the visual appearance of scheduler delays

[from KS feedback]

Currently, scheduler delays are shown in a mostly transparent,
light yellow color. This color is rather hard to see on several
screens, especially projectors.

This patch changes the color of the scheduler delays to be a
much more "hard" yellow that survived the kernel summit
projector.

Reported-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091020064731.20ae126a@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf timechart: Fix the wakeup-arrows that point to non-visible processes
Arjan van de Ven [Mon, 19 Oct 2009 21:46:49 +0000 (06:46 +0900)]
perf timechart: Fix the wakeup-arrows that point to non-visible processes

The timechart wakeup arrows currently show no process
information when the waker/wakee are processes that are not
actually chosen to be shown on the timechart.

This patch fixes this oversight, by looking through all
processes (after giving preference to visible processes) as well
as falling back to just showing the PID if no name for the
process can be resolved.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20091020064649.0e4959b2@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoperf top: Fix --delay_secs 0 division by zero
Tim Blechmann [Sat, 17 Oct 2009 16:08:29 +0000 (18:08 +0200)]
perf top: Fix --delay_secs 0 division by zero

Add delay_secs sanity check to handle_keypress,
this fixes a division by zero crash.

Signed-off-by: Tim Blechmann <tim@klingt.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4AD9EBFD.106@klingt.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoAF_UNIX: Fix deadlock on connecting to shutdown socket
Tomoki Sekiyama [Mon, 19 Oct 2009 06:17:37 +0000 (23:17 -0700)]
AF_UNIX: Fix deadlock on connecting to shutdown socket

I found a deadlock bug in UNIX domain socket, which makes able to DoS
attack against the local machine by non-root users.

How to reproduce:
1. Make a listening AF_UNIX/SOCK_STREAM socket with an abstruct
    namespace(*), and shutdown(2) it.
 2. Repeat connect(2)ing to the listening socket from the other sockets
    until the connection backlog is full-filled.
 3. connect(2) takes the CPU forever. If every core is taken, the
    system hangs.

PoC code: (Run as many times as cores on SMP machines.)

int main(void)
{
int ret;
int csd;
int lsd;
struct sockaddr_un sun;

/* make an abstruct name address (*) */
memset(&sun, 0, sizeof(sun));
sun.sun_family = PF_UNIX;
sprintf(&sun.sun_path[1], "%d", getpid());

/* create the listening socket and shutdown */
lsd = socket(AF_UNIX, SOCK_STREAM, 0);
bind(lsd, (struct sockaddr *)&sun, sizeof(sun));
listen(lsd, 1);
shutdown(lsd, SHUT_RDWR);

/* connect loop */
alarm(15); /* forcely exit the loop after 15 sec */
for (;;) {
csd = socket(AF_UNIX, SOCK_STREAM, 0);
ret = connect(csd, (struct sockaddr *)&sun, sizeof(sun));
if (-1 == ret) {
perror("connect()");
break;
}
puts("Connection OK");
}
return 0;
}

(*) Make sun_path[0] = 0 to use the abstruct namespace.
    If a file-based socket is used, the system doesn't deadlock because
    of context switches in the file system layer.

Why this happens:
 Error checks between unix_socket_connect() and unix_wait_for_peer() are
 inconsistent. The former calls the latter to wait until the backlog is
 processed. Despite the latter returns without doing anything when the
 socket is shutdown, the former doesn't check the shutdown state and
 just retries calling the latter forever.

Patch:
 The patch below adds shutdown check into unix_socket_connect(), so
 connect(2) to the shutdown socket will return -ECONREFUSED.

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>
Signed-off-by: Masanori Yoshida <masanori.yoshida.tv@hitachi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoHWPOISON: fix invalid page count in printk output
Wu Fengguang [Mon, 19 Oct 2009 06:15:01 +0000 (08:15 +0200)]
HWPOISON: fix invalid page count in printk output

The madvise injector already holds a reference when passing in a page
to the memory-failure code. The code corrects for this additional reference
for its checks, but the final printk output didn't. Fix that.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
14 years agoHWPOISON: Allow schedule_on_each_cpu() from keventd
Andi Kleen [Wed, 14 Oct 2009 04:22:47 +0000 (06:22 +0200)]
HWPOISON: Allow schedule_on_each_cpu() from keventd

Right now when calling schedule_on_each_cpu() from keventd there
is a deadlock because it tries to schedule a work item on the current CPU
too. This happens via lru_add_drain_all() in hwpoison.

Just call the function for the current CPU in this case. This is actually
faster too.

Debugging with Fengguang Wu & Max Asbock

Signed-off-by: Andi Kleen <ak@linux.intel.com>
14 years agoHWPOISON: fix/proc/meminfo alignment
Hugh Dickins [Tue, 13 Oct 2009 14:03:59 +0000 (15:03 +0100)]
HWPOISON: fix/proc/meminfo alignment

Given such a long name, the kB count in /proc/meminfo's HardwareCorrupted
line is being shown too far right (it does align with x86_64's VmallocChunk
above, but I hope nobody will ever have that much corrupted!).  Align it.

Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
14 years agoHWPOISON: fix oops on ksm pages
Hugh Dickins [Tue, 13 Oct 2009 14:02:11 +0000 (15:02 +0100)]
HWPOISON: fix oops on ksm pages

Memory failure on a KSM page currently oopses on its NULL anon_vma in
page_lock_anon_vma(): that may not be much worse than the consequence
of ignoring it, but it is better to be consistent with how ZERO_PAGE
and hugetlb pages and other awkward cases are treated.  Just skip it.

Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
14 years agoHWPOISON: Fix page count leak in hwpoison late kill in do_swap_page
Andi Kleen [Tue, 13 Oct 2009 23:51:41 +0000 (01:51 +0200)]
HWPOISON: Fix page count leak in hwpoison late kill in do_swap_page

When returning due to a poisoned page drop the page count.

It wasn't a fatal problem because noone cares about the page count
on a poisoned page (except when it wraps), but it's cleaner to fix it.

Pointed out by Linus.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
14 years agoHWPOISON: return early on non-LRU pages
Wu Fengguang [Tue, 29 Sep 2009 05:16:20 +0000 (13:16 +0800)]
HWPOISON: return early on non-LRU pages

Right now we have some trouble with non atomic access
to page flags when locking the page. To plug this hole
for now, limit error recovery to LRU pages for now.

This could be better fixed by defining a suitable protocol,
but let's go this simple way for now

This avoids unnecessary races with __set_page_locked() and
__SetPageSlab*() and maybe more non-atomic page flag operations.

This loses isolated pages which are currently in page reclaim, but these
are relatively limited compared to the total memory.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
[AK: new description, bug fixes, cleanups]

14 years agoethoc: clear only pending irqs
Thomas Chou [Wed, 7 Oct 2009 14:16:43 +0000 (14:16 +0000)]
ethoc: clear only pending irqs

This patch fixed the problem of dropped packets due to lost of
interrupt requests. We should only clear what was pending at the
moment we read the irq source reg.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethoc: inline regs access
Thomas Chou [Wed, 7 Oct 2009 14:16:42 +0000 (14:16 +0000)]
ethoc: inline regs access

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopcmcia: do not try to store more than 4 version strings
Dominik Brodowski [Sun, 18 Oct 2009 22:04:25 +0000 (00:04 +0200)]
pcmcia: do not try to store more than 4 version strings

... for struct pcmcia_device only provides for 4 anyway.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
14 years agopcmcia: pccard_read_tuple and TUPLE_RETURN_COMMON cleanup
Dominik Brodowski [Sun, 18 Oct 2009 21:51:09 +0000 (23:51 +0200)]
pcmcia: pccard_read_tuple and TUPLE_RETURN_COMMON cleanup

pccard_read_tuple(), which is only used by the PCMCIA core, should
handle TUPLE_RETURN_COMMON more sensibly: If a specific function (which
may be 0) is requested, set tuple.Attributes = 0 as was done in all
PCMCIA drivers. If, however, BIND_FN_ALL is requested, return the
"common" tuple. As to the callers of pccard_read_tuple():

- All calls to pcmcia_validate_cis() had set the "function" parameter to
  BIND_FN_ALL. Therefore, remove the "function" parameter and make the
  parameter to pccard_read_tuple explicit.

- Calls to CISTPL_VERS_1 and CISTPL_MANFID now set BIND_FN_ALL. This was
  already the case for calls to CISTPL_LONGLINK_MFC.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
14 years agoinotify: fix coalesce duplicate events into a single event in special case
Wei Yongjun [Wed, 14 Oct 2009 12:54:03 +0000 (20:54 +0800)]
inotify: fix coalesce duplicate events into a single event in special case

If we do rename a dir entry, like this:

  rename("/tmp/ino7UrgoJ.rename1", "/tmp/ino7UrgoJ.rename2")
  rename("/tmp/ino7UrgoJ.rename2", "/tmp/ino7UrgoJ")

The duplicate events should be coalesced into a single event. But those two
events do not be coalesced into a single event, due to some bad check in
event_compare(). It can not match the two NULL inodes as the same event.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
14 years agoinotify: deprecate the inotify kernel interface
Eric Paris [Mon, 29 Jun 2009 15:13:30 +0000 (11:13 -0400)]
inotify: deprecate the inotify kernel interface

In 2.6.33 there will be no users of the inotify interface.  Mark it for
removal as fsnotify is more generic and is easier to use.

Signed-off-by: Eric Paris <eparis@redhat.com>
14 years agofsnotify: do not set group for a mark before it is on the i_list
Eric Paris [Fri, 11 Sep 2009 17:03:19 +0000 (13:03 -0400)]
fsnotify: do not set group for a mark before it is on the i_list

fsnotify_add_mark is supposed to add a mark to the g_list and i_list and to
set the group and inode for the mark.  fsnotify_destroy_mark_by_entry uses
the fact that ->group != NULL to know if this group should be destroyed or
if it's already been done.

But fsnotify_add_mark sets the group and inode before it actually adds the
mark to the i_list and g_list.  This can result in a race in inotify, it
requires 3 threads.

sys_inotify_add_watch("file") sys_inotify_add_watch("file") sys_inotify_rm_watch([a])
inotify_update_watch()
inotify_new_watch()
inotify_add_to_idr()
   ^--- returns wd = [a]
inotfiy_update_watch()
inotify_new_watch()
inotify_add_to_idr()
fsnotify_add_mark()
   ^--- returns wd = [b]
returns to userspace;
inotify_idr_find([a])
   ^--- gives us the pointer from task 1
fsnotify_add_mark()
   ^--- this is going to set the mark->group and mark->inode fields, but will
return -EEXIST because of the race with [b].
fsnotify_destroy_mark()
   ^--- since ->group != NULL we call back
into inotify_freeing_mark() which calls
inotify_remove_from_idr([a])

since fsnotify_add_mark() failed we call:
inotify_remove_from_idr([a])     <------WHOOPS it's not in the idr, this could
have been any entry added later!

The fix is to make sure we don't set mark->group until we are sure the mark is
on the inode and fsnotify_add_mark will return success.

Signed-off-by: Eric Paris <eparis@redhat.com>
14 years agoInput: hp_sdc_rtc - fix test in hp_sdc_rtc_read_rt()
Roel Kluin [Sun, 18 Oct 2009 07:17:15 +0000 (00:17 -0700)]
Input: hp_sdc_rtc - fix test in hp_sdc_rtc_read_rt()

If left unsigned the hp_sdc_rtc_read_i8042timer() return value will not
be checked correctly.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: atkbd - consolidate force release quirks for volume keys
Herton Ronaldo Krzesinski [Fri, 16 Oct 2009 23:13:59 +0000 (16:13 -0700)]
Input: atkbd - consolidate force release quirks for volume keys

Some machines share same key list for volume up/down release key quirks,
use only one key list.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: logips2pp - model 73 is actually TrackMan FX
Dmitry Torokhov [Thu, 15 Oct 2009 16:46:48 +0000 (09:46 -0700)]
Input: logips2pp - model 73 is actually TrackMan FX

Reported-and-tested-by: Harald Dunkel <harald.dunkel@t-online.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoInput: i8042 - add Sony Vaio VGN-FZ240E to the nomux list
Dmitry Torokhov [Thu, 15 Oct 2009 16:46:48 +0000 (09:46 -0700)]
Input: i8042 - add Sony Vaio VGN-FZ240E to the nomux list

On this model, when KBD is in active multiplexing mode, acknowledgements
to reset and get ID commands issued on KBD port sometimes are delivered
to AUX3 port (touchpad) which messes up device detection. Legacy KBC
mode works fine and since there are no external PS/2 ports on this laptop
and no support for docking station we can safely disable active MUX mode.

Tested-by: Carlos R. Mafra <crmafra2@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
14 years agoARM: 5764/1: bcmring: add oprofile pmu support
Leo Chen [Thu, 15 Oct 2009 21:45:41 +0000 (22:45 +0100)]
ARM: 5764/1: bcmring: add oprofile pmu support

add oprofile pmu support for bcmring.

Signed-off-by: Leo Hao Chen <leochen@broadcom.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoMerge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6
Russell King [Sat, 17 Oct 2009 15:29:01 +0000 (16:29 +0100)]
Merge branch 'fix' of git://git./linux/kernel/git/ycmiao/pxa-linux-2.6

14 years ago[ARM] pxa/spitz: add gpio button support (fixes regression)
Stanislav Brabec [Fri, 16 Oct 2009 18:50:05 +0000 (20:50 +0200)]
[ARM] pxa/spitz: add gpio button support (fixes regression)

Updating desc for lid keys and resending patch with proper comments:
Define Spitz buttons as GPIO keys in a way compatible with the old driver:

On/Off: As Suspend EV_PWR key
Raw values of lid sensors SWA and SWB: As EV_SW switches
SWA: Display Down
SWB: Lid Closed
Recommended user space decoding:
SWA==0 & SWB==0: lid opened (landscape mode)
SWA==1 & SWB==0: invalid (or mechanic race condition)
SWA==0 & SWB==1: lid closed with display up (portrait mode or mechanic
                 race condition while closing to display-less mode)
SWA==1 & SWB==1: lid closed with display down (display-less mode)

AK_INT remote trigger is not mapped as input event. Without complete
remote driver and remote pull-up control it has no useful
interpretation.

Signed-off-by: Stanislav Brabec <utx@penguin.cz>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
14 years ago[ARM] pxa/cm-x300: fix mmc numbering
Mike Rapoport [Thu, 15 Oct 2009 08:11:09 +0000 (10:11 +0200)]
[ARM] pxa/cm-x300: fix mmc numbering

CM-X300 has libertas on mmc2 and  SD card slot on mmc1.
This patch fixes wrong MMC ports assignment.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
14 years agopcmcia: properly close previous dev_printk if kzalloc fails in do_io_probe
Frans Pop [Sat, 17 Oct 2009 11:35:30 +0000 (13:35 +0200)]
pcmcia: properly close previous dev_printk if kzalloc fails in do_io_probe

Signed-off-by: Frans Pop <elendil@planet.nl>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>