10 years agoMerge branch 'master' of ssh://infradead/~/public_git/wireless into for-davem
John W. Linville [Tue, 20 Sep 2011 13:19:14 +0000 (09:19 -0400)]
Merge branch 'master' of ssh://infradead/~/public_git/wireless into for-davem

10 years agoMerge branch 'irq-fixes-for-linus' of git://
Linus Torvalds [Tue, 20 Sep 2011 00:23:41 +0000 (17:23 -0700)]
Merge branch 'irq-fixes-for-linus' of git://

* 'irq-fixes-for-linus' of git://
  x86, iommu: Mark DMAR IRQ as non-threaded
  genirq: Make irq_shutdown() symmetric vs. irq_startup again

10 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Tue, 20 Sep 2011 00:17:32 +0000 (17:17 -0700)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  Btrfs: only clear the need lookup flag after the dentry is setup
  BTRFS: Fix lseek return value for error
  Btrfs: don't change inode flag of the dest clone file
  Btrfs: don't make a file partly checksummed through file clone
  Btrfs: fix pages truncation in btrfs_ioctl_clone()
  btrfs: fix d_off in the first dirent

10 years agoUSB: xHCI: prevent infinite loop when processing MSE event
Andiry Xu [Mon, 19 Sep 2011 23:05:12 +0000 (16:05 -0700)]
USB: xHCI: prevent infinite loop when processing MSE event

When a xHC host is unable to handle isochronous transfer in the
interval, it reports a Missed Service Error event and skips some tds.

Currently xhci driver handles MSE event in the following ways:

1. When encounter a MSE event, set ep->skip flag, update event ring
   dequeue pointer and return.

2. When encounter the next event on this ep, the driver will run the
   do-while loop, fetch td from ep's td_list to find the td
   corresponding to this event.  All tds missed are marked as short

The do-while loop will end in two ways:

1. If the td pointed by the event trb is found;

2. If the ep ring's td_list is empty.

However, if a buggy HW reports some unpredicted event (for example, an
overrun event following a MSE event while the ep ring is actually not
empty), the driver will never find the td, and it will loop until the
td_list is empty.

Unfortunately, the spinlock is dropped when give back a urb in the
do-while loop.  During the spinlock released period, the class driver
may still submit urbs and add tds to the td_list.  This may cause
disaster, since the td_list will never be empty and the loop never ends,
and the system hangs.

To fix this, count the number of TDs on the ep ring before skipping TDs,
and quit the loop when skipped that number of tds.  This guarantees the
do-while loop will end after certain number of cycles, and driver will
not be trapped in an infinite loop.

Signed-off-by: Andiry Xu <>
Signed-off-by: Sarah Sharp <>
Signed-off-by: Greg Kroah-Hartman <>
Signed-off-by: Linus Torvalds <>
10 years agoUSB: xhci: Set change bit when warm reset change is set.
Greg KH [Mon, 19 Sep 2011 23:05:11 +0000 (16:05 -0700)]
USB: xhci: Set change bit when warm reset change is set.

Sometimes, when a USB 3.0 device is disconnected, the Intel Panther
Point xHCI host controller will report a link state change with the
state set to "SS.Inactive".  This causes the xHCI host controller to
issue a warm port reset, which doesn't finish before the USB core times
out while waiting for it to complete.

When the warm port reset does complete, and the xHC gives back a port
status change event, the xHCI driver kicks khubd.  However, it fails to
set the bit indicating there is a change event for that port because the
logic in xhci-hub.c doesn't check for the warm port reset bit.

After that, the warm port status change bit is never cleared by the USB
core, and the xHC stops reporting port status change bits.  (The xHCI
spec says it shouldn't report more port events until all change bits are
cleared.) This means any port changes when a new device is connected
will never be reported, and the port will seem "dead" until the xHCI
driver is unloaded and reloaded, or the computer is rebooted.  Fix this
by making the xHCI driver set the port change bit when a warm port reset
change bit is set.

A better solution would be to make the USB core handle warm port reset
in differently, merging the current code with the standard port reset
code that does an incremental backoff on the timeout, and tries to
complete the port reset two more times before giving up.  That more
complicated fix will be merged next window, and this fix will be
backported to stable.

This should be backported to kernels as old as 3.0, since that was the
first kernel with commit a11496ebf375 ("xHCI: warm reset support").

Signed-off-by: Sarah Sharp <>
Signed-off-by: Greg Kroah-Hartman <>
Signed-off-by: Linus Torvalds <>
10 years agostaging: fix comedi build when ISA_DMA_API is enabled but COMEDI_PCI is not enabled
Randy Dunlap [Mon, 19 Sep 2011 23:05:10 +0000 (16:05 -0700)]
staging: fix comedi build when ISA_DMA_API is enabled but COMEDI_PCI is not enabled

Fix build when CONFIG_ISA_DMA_API is enabled but

Fixes these build errors:

  drivers/staging/comedi/drivers/ni_labpc.c: In function 'labpc_ai_cmd':
  drivers/staging/comedi/drivers/ni_labpc.c:1351: error: implicit declaration of function 'labpc_suggest_transfer_size'
  drivers/staging/comedi/drivers/ni_labpc.c: At top level:
  drivers/staging/comedi/drivers/ni_labpc.c:1802: error: conflicting types for 'labpc_suggest_transfer_size'
  drivers/staging/comedi/drivers/ni_labpc.c:1351: note: previous implicit declaration of 'labpc_suggest_transfer_size' was here

Signed-off-by: Randy Dunlap <>
Signed-off-by: Greg Kroah-Hartman <>
Signed-off-by: Linus Torvalds <>
10 years agoMake taskstats round statistics down to nearest 1k bytes/events
Linus Torvalds [Tue, 20 Sep 2011 00:10:57 +0000 (17:10 -0700)]
Make taskstats round statistics down to nearest 1k bytes/events

Even with just the interface limited to admin, there really is little to
reason to give byte-per-byte counts for taskstats.  So round it down to
something less intrusive.

Acked-by: Balbir Singh <>
Signed-off-by: Linus Torvalds <>
10 years agoMake TASKSTATS require root access
Linus Torvalds [Tue, 20 Sep 2011 00:04:37 +0000 (17:04 -0700)]
Make TASKSTATS require root access

Ok, this isn't optimal, since it means that 'iotop' needs admin
capabilities, and we may have to work on this some more.  But at the
same time it is very much not acceptable to let anybody just read
anybody elses IO statistics quite at this level.

Use of the GENL_ADMIN_PERM suggested by Johannes Berg as an alternative
to checking the capabilities by hand.

Reported-by: Vasiliy Kulikov <>
Cc: Johannes Berg <>
Acked-by: Balbir Singh <>
Signed-off-by: Linus Torvalds <>
10 years agob43: Fix beacon problem in ad-hoc mode
Manual Munz [Sun, 18 Sep 2011 23:24:03 +0000 (18:24 -0500)]
b43: Fix beacon problem in ad-hoc mode

In ad-hoc mode, driver b43 does not issue beacons.

Signed-off-by: Manual Munz <>
Tested-by: Larry Finger <>
Signed-off-by: Larry Finger <>
Cc: Stable <>
Signed-off-by: John W. Linville <>
10 years agoMerge branch 'for-3.1' of git://
John W. Linville [Mon, 19 Sep 2011 18:47:29 +0000 (14:47 -0400)]
Merge branch 'for-3.1' of git://

10 years agoMerge branch 'slab/urgent' of git://
Linus Torvalds [Mon, 19 Sep 2011 15:02:41 +0000 (08:02 -0700)]
Merge branch 'slab/urgent' of git://

* 'slab/urgent' of git://
  slub: add slab with one free object to partial list tail

10 years agoMerge branch 'drm-fixes' of git://
Linus Torvalds [Mon, 19 Sep 2011 14:55:43 +0000 (07:55 -0700)]
Merge branch 'drm-fixes' of git://

* 'drm-fixes' of git://
  drm/radeon/kms: Make GPU/CPU page size handling consistent in blit code (v2)
  drm/radeon/kms: fix typo in r100_blit_copy
  drm/radeon: Unreference GEM object outside of spinlock in page flip error path.
  drm/radeon: Don't read from CP ring write pointer registers.
  drm/ttm: request zeroed system memory pages for new TT buffer objects

10 years agoMerge git://
Linus Torvalds [Mon, 19 Sep 2011 14:48:04 +0000 (07:48 -0700)]
Merge git://

* git://
  tcp: fix validation of D-SACK
  tcp: fix build error if !CONFIG_SYN_COOKIES

10 years agotcp: fix validation of D-SACK
Zheng Yan [Mon, 19 Sep 2011 02:37:34 +0000 (22:37 -0400)]
tcp: fix validation of D-SACK

D-SACK is allowed to reside below snd_una. But the corresponding check
in tcp_is_sackblock_valid() is the exact opposite. It looks like a typo.

Signed-off-by: Zheng Yan <>
Acked-by: Eric Dumazet <>
Signed-off-by: David S. Miller <>
10 years agotcp: fix build error if !CONFIG_SYN_COOKIES
Eric Dumazet [Mon, 19 Sep 2011 01:02:55 +0000 (21:02 -0400)]
tcp: fix build error if !CONFIG_SYN_COOKIES

commit 946cedccbd7387 (tcp: Change possible SYN flooding messages)
added a build error if CONFIG_SYN_COOKIES=n

Reported-by: Markus Trippelsdorf <>
Signed-off-by: Eric Dumazet <>
Signed-off-by: David S. Miller <>
10 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Mon, 19 Sep 2011 01:18:55 +0000 (18:18 -0700)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  mfd: Fix omap-usb-host build failure
  mfd: Make omap-usb-host TLL mode work again
  mfd: Set MAX8997 irq pointer
  mfd: Fix initialisation of tps65910 interrupts
  mfd: Check for twl4030-madc NULL pointer
  mfd: Copy the device pointer to the twl4030-madc structure
  mfd: Rename wm8350 static gpio_set_debounce()
  mfd: Fix value of WM8994_CONFIGURE_GPIO

10 years agodrm/radeon/kms: Make GPU/CPU page size handling consistent in blit code (v2)
Alex Deucher [Fri, 16 Sep 2011 16:04:08 +0000 (12:04 -0400)]
drm/radeon/kms: Make GPU/CPU page size handling consistent in blit code (v2)

The BO blit code inconsistenly handled the page size.  This wasn't
an issue on system with 4k pages since the GPU's page size is 4k as
well.  Switch the driver blit callbacks to take num pages in GPU
page units.

Fixes lemote mipsel systems using AMD rs780/rs880 chipsets.

v2: incorporate suggestions from Michel.

Signed-off-by: Alex Deucher <>
Reviewed-by: Michel Dänzer <>
Signed-off-by: Dave Airlie <>
10 years agodrm/radeon/kms: fix typo in r100_blit_copy
Alex Deucher [Fri, 16 Sep 2011 16:04:07 +0000 (12:04 -0400)]
drm/radeon/kms: fix typo in r100_blit_copy

cur_pages is the number of pages per loop iteration.

Signed-off-by: Alex Deucher <>
Reviewed-by: Michel Dänzer <>
Signed-off-by: Dave Airlie <>
10 years agoMerge git://
Linus Torvalds [Sun, 18 Sep 2011 18:02:26 +0000 (11:02 -0700)]
Merge git://

* git:// (62 commits)
  ipv6: don't use inetpeer to store metrics for routes.
  can: ti_hecc: include linux/io.h
  IRDA: Fix global type conflicts in net/irda/irsysctl.c v2
  net: Handle different key sizes between address families in flow cache
  net: Align AF-specific flowi structs to long
  ipv4: Fix fib_info->fib_metrics leak
  caif: fix a potential NULL dereference
  sctp: deal with multiple COOKIE_ECHO chunks
  ibmveth: Fix checksum offload failure handling
  ibmveth: Checksum offload is always disabled
  ibmveth: Fix issue with DMA mapping failure
  ibmveth: Fix DMA unmap error
  pch_gbe: support ML7831 IOH
  pch_gbe: added the process of FIFO over run error
  pch_gbe: fixed the issue which receives an unnecessary packet.
  sfc: Use 64-bit writes for TX push where possible
  Revert "sfc: Use write-combining to reduce TX latency" and follow-ups
  bnx2x: Fix ethtool advertisement
  bnx2x: Fix 578xx link LED
  bnx2x: Fix XMAC loopback test

10 years agoBtrfs: only clear the need lookup flag after the dentry is setup
Josef Bacik [Sun, 18 Sep 2011 14:34:03 +0000 (10:34 -0400)]
Btrfs: only clear the need lookup flag after the dentry is setup

We can race with readdir and the RCU path walking stuff.  This is because we
clear the need lookup flag before actually instantiating the inode.  This will
lead the RCU path walk stuff to find a dentry it thinks is valid without a
d_inode attached.  So instead unhash the dentry when we first start the lookup,
and then clear the flag after we've instantiated the dentry so we're garunteed
to either try the slow lookup, or have the d_inode set properly.

Signed-off-by: Josef Bacik <>
Signed-off-by: Chris Mason <>
10 years agoBTRFS: Fix lseek return value for error
Jeff Liu [Sun, 18 Sep 2011 14:34:02 +0000 (10:34 -0400)]
BTRFS: Fix lseek return value for error

The recent reworking of btrfs' lseek lead to incorrect
values being returned.  This adds checks for seeking
beyond EOF in SEEK_HOLE and makes sure the error
values come back correct.

Andi Kleen also sent in similar patches.

Signed-off-by: Jie Liu <>
Reported-by: Andi Kleen <>
Signed-off-by: Chris Mason <>
10 years agoMerge branch 'btrfs-3.0' into for-linus
Chris Mason [Sun, 18 Sep 2011 14:31:44 +0000 (10:31 -0400)]
Merge branch 'btrfs-3.0' into for-linus

10 years agoBtrfs: don't change inode flag of the dest clone file
Li Zefan [Sun, 18 Sep 2011 14:20:46 +0000 (10:20 -0400)]
Btrfs: don't change inode flag of the dest clone file

The dst file will have the same inode flags with dst file after
file clone, and I think it's unexpected.

For example, the dst file will suddenly become immutable after
getting some share of data with src file, if the src is immutable.

Signed-off-by: Li Zefan <>
Signed-off-by: Chris Mason <>
10 years agoBtrfs: don't make a file partly checksummed through file clone
Li Zefan [Sun, 18 Sep 2011 14:20:46 +0000 (10:20 -0400)]
Btrfs: don't make a file partly checksummed through file clone

To reproduce the bug:

  # mount /dev/sda7 /mnt
  # dd if=/dev/zero of=/mnt/src bs=4K count=1
  # umount /mnt

  # mount -o nodatasum /dev/sda7 /mnt
  # dd if=/dev/zero of=/mnt/dst bs=4K count=1
  # clone_range -s 4K -l 4K /mnt/src /mnt/dst

  # echo 3 > /proc/sys/vm/drop_caches
  # cat /mnt/dst
  # dmesg
  btrfs no csum found for inode 258 start 0
  btrfs csum failed ino 258 off 0 csum 2566472073 private 0

It's because part of the file is checksummed and the other part is not,
and then btrfs will complain checksum is not found when we read the file.

Disallow file clone if src and dst file have different checksum flag,
so we ensure a file is completely checksummed or unchecksummed.

Signed-off-by: Li Zefan <>
Signed-off-by: Chris Mason <>
10 years agoBtrfs: fix pages truncation in btrfs_ioctl_clone()
Li Zefan [Sun, 18 Sep 2011 14:20:46 +0000 (10:20 -0400)]
Btrfs: fix pages truncation in btrfs_ioctl_clone()

It's a bug in commit f81c9cdc567cd3160ff9e64868d9a1a7ee226480
(Btrfs: truncate pages from clone ioctl target range)

We should pass the dest range to the truncate function, but not the
src range.

Also move the function before locking extent state.

Signed-off-by: Li Zefan <>
Signed-off-by: Chris Mason <>
10 years agobtrfs: fix d_off in the first dirent
Hidetoshi Seto [Sun, 18 Sep 2011 14:20:46 +0000 (10:20 -0400)]
btrfs: fix d_off in the first dirent

Since the d_off in the first dirent for "." (that originates from
the 4th argument "offset" of filldir() for the 2nd dirent for "..")
is wrongly assigned in btrfs_real_readdir(), telldir returns same
offset for different locations.

 | # mkfs.btrfs /dev/sdb1
 | # mount /dev/sdb1 fs0
 | # cd fs0
 | # touch file0 file1
 | # ../test
 | telldir: 0
 | readdir: d_off = 2, d_name = "."
 | telldir: 2
 | readdir: d_off = 2, d_name = ".."
 | telldir: 2
 | readdir: d_off = 3, d_name = "file0"
 | telldir: 3
 | readdir: d_off = 2147483647, d_name = "file1"
 | telldir: 2147483647

To fix this problem, pass filp->f_pos (which is loff_t) instead.

 | # ../test
 | telldir: 0
 | readdir: d_off = 1, d_name = "."
 | telldir: 1
 | readdir: d_off = 2, d_name = ".."
 | telldir: 2
 | readdir: d_off = 3, d_name = "file0"

At the moment the "offset" for "." is unused because there is no
preceding dirent, however it is better to pass filp->f_pos to follow
grammatical usage.

Signed-off-by: Hidetoshi Seto <>
Signed-off-by: Chris Mason <>
10 years agoMerge branch 'fixes' of git://
Linus Torvalds [Sat, 17 Sep 2011 23:54:41 +0000 (16:54 -0700)]
Merge branch 'fixes' of git://

* 'fixes' of git://
  firewire: ohci: add no MSI quirk for O2Micro controller

10 years agoMerge branch '3.1-rc-fixes' of git://
Linus Torvalds [Sat, 17 Sep 2011 23:52:13 +0000 (16:52 -0700)]
Merge branch '3.1-rc-fixes' of git://

* '3.1-rc-fixes' of git://
  iscsi-target: Fix sendpage breakage with proper padding+DataDigest iovec offsets
  iscsi-target: Disable markers + remove dangerous local scope array usage
  target: Skip non hex characters for VPD=0x83 NAA IEEE Registered Extended
  tcm_fc: Work queue based approach instead of managing own thread and event based mechanism
  tcm_fc: Invalidation of DDP context for FCoE target in error conditions
  target: Fix race between multiple invocations of target_qf_do_work()

10 years agoBluetooth: add support for 2011 mac mini
Jurgen Kramer [Sun, 4 Sep 2011 16:01:42 +0000 (18:01 +0200)]
Bluetooth: add support for 2011 mac mini

Today I noticed that the usb bluetooth adapter (BCM2046B1) on my 2011
mac mini was not working. I've created a patch to get it going.

Signed-off-by: Jurgen Kramer <>
Signed-off-by: Gustavo F. Padovan <>
10 years agoBluetooth: Add MacBookAir4,1 support
Pieter-Augustijn Van Malleghem [Wed, 7 Sep 2011 06:28:10 +0000 (02:28 -0400)]
Bluetooth: Add MacBookAir4,1 support

This patch against current git adds the hardware ID for the Apple
MacBookAir4,1, released in July 2011. The device features a BCM2046
USB chip. The patch was inspired by the previous modifications adding
support for the MacBookAir3,x.

Signed-off-by: Pieter-Augustijn Van Malleghem <>
Signed-off-by: Gustavo F. Padovan <>
10 years agoBluetooth: Fixed BT ST Channel reg order
Chen Ganir [Tue, 30 Aug 2011 10:58:28 +0000 (13:58 +0300)]
Bluetooth: Fixed BT ST Channel reg order

Reordered the BT ST channel registration, to make sure that the
event channel is registered before all others. This prevents a
situation where incoming events may cause kernel panic in the ST
driver if the event channel is not yet registered to handle
incoming events.In addition, the deregistration of the channels
was also modified, to be in the reversed order of the registration,
to allow the event channel to be the last one unregistered.

Signed-off-by: Chen Ganir <>
Signed-off-by: Gustavo F. Padovan <>
10 years agoipv6: don't use inetpeer to store metrics for routes.
Yan, Zheng [Mon, 5 Sep 2011 21:34:30 +0000 (21:34 +0000)]
ipv6: don't use inetpeer to store metrics for routes.

Current IPv6 implementation uses inetpeer to store metrics for
routes. The problem of inetpeer is that it doesn't take subnet
prefix length in to consideration. If two routes have the same
address but different prefix length, they share same inetpeer.
So changing metrics of one route also affects the other. The
fix is to allocate separate metrics storage for each route.

Signed-off-by: Zheng Yan <>
Signed-off-by: David S. Miller <>
10 years agoiscsi-target: Fix sendpage breakage with proper padding+DataDigest iovec offsets
Nicholas Bellinger [Fri, 16 Sep 2011 23:55:47 +0000 (16:55 -0700)]
iscsi-target: Fix sendpage breakage with proper padding+DataDigest iovec offsets

This patch fixes a bug in the iscsit_fe_sendpage_sg() transmit codepath that
was originally introduced with the v3.1 iscsi-target merge that incorrectly
uses hardcoded cmd->iov_data_count values to determine cmd->iov_data[] offsets
for extra outgoing padding and DataDigest payload vectors.

This code is obviously incorrect for the DataDigest enabled case with sendpage
offload, and this fix ensures correct operation for padding + DataDigest,
padding only, and DataDigest only cases.  The bug was introduced during a
pre-merge change in iscsit_fe_sendpage_sg() to natively use struct scatterlist
instead of the legacy v3.0 struct se_mem logic.

Cc: Andy Grover <>
Cc: Christoph Hellwig <>
Signed-off-by: Nicholas Bellinger <>
10 years agocan: ti_hecc: include linux/io.h
Daniel Mack [Fri, 16 Sep 2011 07:57:43 +0000 (07:57 +0000)]
can: ti_hecc: include linux/io.h

This fixes a build breakage for OMAP3 boards.

Signed-off-by: Daniel Mack <>
Cc: Wolfgang Grandegger <>
Acked-by: Wolfgang Grandegger <>
Signed-off-by: David S. Miller <>
10 years agoIRDA: Fix global type conflicts in net/irda/irsysctl.c v2
Andi Kleen [Fri, 16 Sep 2011 09:09:50 +0000 (09:09 +0000)]
IRDA: Fix global type conflicts in net/irda/irsysctl.c v2

The externs here didn't agree with the declarations in qos.c.

Better would be probably to move this into a header, but since it's
common practice to have naked externs with sysctls I left it for now.

Signed-off-by: Andi Kleen <>
Signed-off-by: David S. Miller <>
10 years agonet: Handle different key sizes between address families in flow cache
dpward [Mon, 5 Sep 2011 16:47:24 +0000 (16:47 +0000)]
net: Handle different key sizes between address families in flow cache

With the conversion of struct flowi to a union of AF-specific structs, some
operations on the flow cache need to account for the exact size of the key.

Signed-off-by: David Ward <>
Signed-off-by: David S. Miller <>
10 years agonet: Align AF-specific flowi structs to long
David Ward [Mon, 5 Sep 2011 16:47:23 +0000 (16:47 +0000)]
net: Align AF-specific flowi structs to long

AF-specific flowi structs are now passed to flow_key_compare, which must
also be aligned to a long.

Signed-off-by: David Ward <>
Signed-off-by: David S. Miller <>
10 years agoipv4: Fix fib_info->fib_metrics leak
Yan, Zheng [Sun, 4 Sep 2011 20:24:20 +0000 (20:24 +0000)]
ipv4: Fix fib_info->fib_metrics leak

Commit 4670994d(net,rcu: convert call_rcu(fc_rport_free_rcu) to
kfree_rcu()) introduced a memory leak. This patch reverts it.

Signed-off-by: Zheng Yan <>
Signed-off-by: David S. Miller <>
10 years agocaif: fix a potential NULL dereference
Eric Dumazet [Fri, 2 Sep 2011 02:19:23 +0000 (02:19 +0000)]
caif: fix a potential NULL dereference

Commit bd30ce4bc0b7 (caif: Use RCU instead of spin-lock in caif_dev.c)
added a potential NULL dereference in case alloc_percpu() fails.

caif_device_alloc() can also use GFP_KERNEL instead of GFP_ATOMIC.

Signed-off-by: Eric Dumazet <>
CC: Sjur Brændeland <>
Acked-by: Sjur Brændeland <>
Signed-off-by: David S. Miller <>
10 years agosctp: deal with multiple COOKIE_ECHO chunks
Max Matveev [Mon, 29 Aug 2011 21:02:24 +0000 (21:02 +0000)]
sctp: deal with multiple COOKIE_ECHO chunks

Attempt to reduce the number of IP packets emitted in response to single
SCTP packet (2e3216cd) introduced a complication - if a packet contains
two COOKIE_ECHO chunks and nothing else then SCTP state machine corks the
socket while processing first COOKIE_ECHO and then loses the association
and forgets to uncork the socket. To deal with the issue add new SCTP
command which can be used to set association explictly. Use this new
command when processing second COOKIE_ECHO chunk to restore the context
for SCTP state machine.

Signed-off-by: Max Matveev <>
Signed-off-by: David S. Miller <>
10 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Fri, 16 Sep 2011 21:09:19 +0000 (14:09 -0700)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  Input: wacom - fix touch parsing on newer Bamboos
  Input: bcm5974 - add MacBookAir4,1 trackpad support
  Input: wacom - add POINTER and DIRECT device properties
  Input: adp5588-keys - remove incorrect modalias
  Input: cm109 - fix checking return value of usb_control_msg
  Input: wacom - advertise BTN_TOOL_PEN and BTN_STYLUS for PenPartner
  Input: wacom - remove pressure for touch devices

10 years agofirewire: ohci: add no MSI quirk for O2Micro controller
Ming Lei [Wed, 31 Aug 2011 02:45:46 +0000 (10:45 +0800)]
firewire: ohci: add no MSI quirk for O2Micro controller

This fixes .

An O2Micro PCI Express FireWire controller,
"FireWire (IEEE 1394) [0c00]: O2 Micro, Inc. Device [1217:11f7] (rev 05)"
which is a combination device together with an SDHCI controller and some
sort of storage controller, misses SBP-2 status writes from an attached
FireWire HDD.  This problem goes away if MSI is disabled for this
FireWire controller.

The device reportedly does not require QUIRK_CYCLE_TIMER.

Signed-off-by: Ming Lei <>
Signed-off-by: Stefan Richter <> (amended changelog)
Cc: <>
10 years agoiscsi-target: Disable markers + remove dangerous local scope array usage
Nicholas Bellinger [Fri, 16 Sep 2011 08:44:54 +0000 (01:44 -0700)]
iscsi-target: Disable markers + remove dangerous local scope array usage

This patch makes iscsi-target explictly disable OFMarker=Yes and IFMarker=yes
parameter key usage during iscsi login by setting IFMarkInt_Reject and
OFMarkInt_Reject values in iscsi_enforce_integrity_rules() to effectively
disable iscsi marker usage.  With this patch, an initiator proposer asking
to enable either marker parameter keys will be issued a 'No' response, and
the target sets OFMarkInt + IFMarkInt parameter key response to 'Irrelevant'.

With markers disabled during iscsi login, this patch removes the problematic
on-stack local-scope array for marker intervals in iscsit_do_rx_data() +
iscsit_do_tx_data(), and other related marker code in iscsi_target_util.c.
This fixes a potentional stack smashing scenario with small range markers
enabled and a large MRDSL as reported by DanC here:

[bug report] target: stack can be smashed

Reported-by: Dan Carpenter <>
Signed-off-by: Nicholas Bellinger <>
10 years agotarget: Skip non hex characters for VPD=0x83 NAA IEEE Registered Extended
Nicholas Bellinger [Fri, 16 Sep 2011 08:31:28 +0000 (01:31 -0700)]
target: Skip non hex characters for VPD=0x83 NAA IEEE Registered Extended

This patch adds target_parse_naa_6h_vendor_specific() to address a bug where the
conversion of PRODUCT SERIAL NUMBER to use hex2bin() in target_emulate_evpd_83()
was not doing proper isxdigit() checking.  This conversion of the vpd_unit_serial
configifs attribute is done while generating a VPD=0x83 NAA IEEE Registered
Extended DESIGNATOR format's 100 bits of unique VENDOR SPECIFIC IDENTIFIER +

This patch allows vpd_unit_serial (VPD=0x80) and the T10 Vendor ID DESIGNATOR
format (VPD=0x83) to continue to use free-form variable length ASCII values,
and now skips any non hex characters for fixed length NAA IEEE Registered Extended
DESIGNATOR format (VPD=0x83) requring the binary conversion.

This was originally reported by Martin after the v3.1-rc1 change to use hex2bin()
in commit 11650b859681e03fdbf26277fcfc5f1f62186703 where the use of non hex
characters in vpd_unit_serial generated different values than the original
v3.0 internal hex -> binary code.  This v3.1 change caused a problem with
filesystems who write a NAA DESIGNATOR onto it's ondisk metadata, and this patch
will (again) change existing values to ensure that non hex characters are not
included in the fixed length NAA DESIGNATOR.

Note this patch still expects vpd_unit_serial to be set via existing userspace
methods of uuid generation, and does not do strict formatting via configfs input.

The original bug report and thread can be found here:

NAA breakage

The v3.1-rc1 formatting of VPD=0x83 w/o this patch:

VPD INQUIRY: Device Identification page
  Designation descriptor number 1, descriptor length: 20
    designator_type: NAA,  code_set: Binary
    associated with the addressed logical unit
      NAA 6, IEEE Company_id: 0x1405
      Vendor Specific Identifier: 0xffde35ebf
      Vendor Specific Identifier Extension: 0x3092f498ffa820f9
  Designation descriptor number 2, descriptor length: 56
    designator_type: T10 vendor identification,  code_set: ASCII
    associated with the addressed logical unit
      vendor id: LIO-ORG
      vendor specific: IBLOCK:ffde35ec-3092-4980-a820-917636ca54f1

The v3.1-final formatting of VPD=0x83 w/ this patch:

VPD INQUIRY: Device Identification page
  Designation descriptor number 1, descriptor length: 20
    designator_type: NAA,  code_set: Binary
    associated with the addressed logical unit
      NAA 6, IEEE Company_id: 0x1405
      Vendor Specific Identifier: 0xffde35ec3
      Vendor Specific Identifier Extension: 0x924980a82091763
  Designation descriptor number 2, descriptor length: 56
    designator_type: T10 vendor identification,  code_set: ASCII
    associated with the addressed logical unit
      vendor id: LIO-ORG
      vendor specific: IBLOCK:ffde35ec-3092-4980-a820-917636ca54f1

(v2: Fix parsing code to dereference + check for string terminator instead
     of null pointer to ensure a zeroed payload for vpd_unit_serial less
     than 100 bits of NAA DESIGNATOR VENDOR SPECIFIC area.  Also, remove
     the unnecessary bitwise assignment)

Reported-by: Martin Svec <>
Signed-off-by: Nicholas Bellinger <>
10 years agoiwlagn: workaround bug crashing some APs
Don Fry [Thu, 15 Sep 2011 15:36:22 +0000 (08:36 -0700)]
iwlagn: workaround bug crashing some APs

This patch reverts commit 9b7688328422b88a7a15dc0dc123ad9ab1a6e22d which
was introduced in 2.6.38-rc1.  It works around a problem where the iwlagn
driver stimulates a bug crashing (requiring power cycle to recover) some
APs under heavy traffic.

CC: #2.6.39, #3.0.0 #3.1.0
Signed-off-by: Don Fry <>
SIgned-off-by: Wey-Yi Guy <>
Signed-off-by: John W. Linville <>
10 years agowireless: Fix rate mask for scan request
Rajkumar Manoharan [Thu, 15 Sep 2011 09:42:29 +0000 (15:12 +0530)]
wireless: Fix rate mask for scan request

The scan request received from cfg80211_connect do not
have proper rate mast. So the probe request sent on each
channel do not have proper the supported rates ie.

Reviewed-by: Johannes Berg <>
Signed-off-by: Rajkumar Manoharan <>
Signed-off-by: John W. Linville <>
10 years agortl2800usb: Fix incorrect storage of MAC address on big-endian platforms
Larry Finger [Wed, 14 Sep 2011 21:50:23 +0000 (16:50 -0500)]
rtl2800usb: Fix incorrect storage of MAC address on big-endian platforms

The eeprom data is stored in little-endian order in the rt2x00 library.
As it was converted to cpu order in the read routines, the data need to
be converted to LE on a big-endian platform.

Signed-off-by: Larry Finger <>
Cc: Stable <>
Signed-off-by: John W. Linville <>
10 years agort2800pci: Fix compiler error on PowerPC
Larry Finger [Wed, 14 Sep 2011 21:50:22 +0000 (16:50 -0500)]
rt2800pci: Fix compiler error on PowerPC

Using gcc 4.4.5 on a Powerbook G4 with a PPC cpu, a complicated
if statement results in incorrect flow, whereas the equivalent switch
statement works correctly.

Signed-off-by: Larry Finger <>
Cc: stable <>
Signed-off-by: John W. Linville <>
10 years agoipw2x00: fix rtnl mutex deadlock
Stanislaw Gruszka [Wed, 14 Sep 2011 14:47:50 +0000 (16:47 +0200)]
ipw2x00: fix rtnl mutex deadlock

This fix regression introduced by:

commit: ecb4433550f0620f3d1471ae7099037ede30a91e
Author: Stanislaw Gruszka <>
Date:   Fri Aug 12 14:00:59 2011 +0200

    mac80211: fix suspend/resume races with unregister hw

Above commit add rtnl_lock() into wiphy_register(), what cause deadlock
when initializing ipw2x00 driver, which itself call wiphy_register()
from register_netdev() internal callback with rtnl mutex taken.

To fix move wiphy_register() outside register_netdev(). This solution
have side effect of not creating /sys/class/net/wlanX/phy80211 link,
but that's a minor issue we can live with.

Bisected-by: Witold Baryluk <>
Bisected-by: Michael Witten <>
Tested-by: Witold Baryluk <>
Tested-by: Michael Witten <>
Signed-off-by: Stanislaw Gruszka <>
Signed-off-by: John W. Linville <>
10 years agowireless: Reset beacon_found while updating regulatory
Rajkumar Manoharan [Wed, 14 Sep 2011 08:58:17 +0000 (14:28 +0530)]
wireless: Reset beacon_found while updating regulatory

During the association, the regulatory is updated by country IE
that reaps the previously found beacons. The impact is that
after a STA disconnects *or* when for any reason a regulatory
domain change happens the beacon hint flag is not cleared
therefore preventing future beacon hints to be learned.
This is important as a regulatory domain change or a restore
of regulatory settings would set back the passive scan and no-ibss
flags on the channel. This is the right place to do this given that
it covers any regulatory domain change.

Reviewed-by: Luis R. Rodriguez <>
Signed-off-by: Rajkumar Manoharan <>
Acked-by: Luis R. Rodriguez <>
Signed-off-by: John W. Linville <>
10 years agoibmveth: Fix checksum offload failure handling
Anton Blanchard [Wed, 7 Sep 2011 14:41:06 +0000 (14:41 +0000)]
ibmveth: Fix checksum offload failure handling

Fix a number of issues in ibmveth_set_csum_offload:

- set_attr6 and clr_attr6 may be used uninitialised

- We store the result of the IPV4 checksum change in ret but overwrite
  it in a couple of places before checking it again later. Add ret4
  to make it obvious what we are doing.

- We weren't clearing the NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM flags
  if the enable of that hypervisor feature failed.

Signed-off-by: Anton Blanchard <>
Signed-off-by: David S. Miller <>
10 years agoibmveth: Checksum offload is always disabled
Anton Blanchard [Wed, 7 Sep 2011 14:41:05 +0000 (14:41 +0000)]
ibmveth: Checksum offload is always disabled

Commit b9367bf3ee6d (net: ibmveth: convert to hw_features) reversed
a check in ibmveth_set_csum_offload that results in checksum offload
never being enabled.

Signed-off-by: Anton Blanchard <>
Cc: <> # 3.0+
Signed-off-by: David S. Miller <>
10 years agoibmveth: Fix issue with DMA mapping failure
Anton Blanchard [Wed, 7 Sep 2011 14:41:04 +0000 (14:41 +0000)]
ibmveth: Fix issue with DMA mapping failure

descs[].fields.address is 32bit which truncates any dma mapping
errors so dma_mapping_error() fails to catch it.

Use a dma_addr_t to do the comparison. With this patch I was able
to transfer many gigabytes of data with IOMMU fault injection set
at 10% probability.

Signed-off-by: Anton Blanchard <>
Cc: <> # v2.6.37+
Signed-off-by: David S. Miller <>
10 years agoibmveth: Fix DMA unmap error
Brian King [Wed, 7 Sep 2011 14:41:03 +0000 (14:41 +0000)]
ibmveth: Fix DMA unmap error

Commit 6e8ab30ec677 (ibmveth: Add scatter-gather support) introduced a
DMA mapping API inconsistency resulting in dma_unmap_page getting
called on memory mapped via dma_map_single. This was seen when
CONFIG_DMA_API_DEBUG was enabled. Fix up this API usage inconsistency.

Signed-off-by: Brian King <>
Acked-by: Anton Blanchard <>
Cc: <> # v2.6.37+
Signed-off-by: David S. Miller <>
10 years agoMerge branch 'stable/bug.fixes' of git://
Linus Torvalds [Fri, 16 Sep 2011 18:28:11 +0000 (11:28 -0700)]
Merge branch 'stable/bug.fixes' of git://

* 'stable/bug.fixes' of git://
  xen/i386: follow-up to "replace order-based range checking of M2P table by linear one"
  xen/irq: Alter the locking to use a mutex instead of a spinlock.
  xen/e820: if there is no dom0_mem=, don't tweak extra_pages.
  xen: disable PV spinlocks on HVM

10 years agotcm_fc: Work queue based approach instead of managing own thread and event based...
Christoph Hellwig [Fri, 26 Aug 2011 16:25:38 +0000 (09:25 -0700)]
tcm_fc: Work queue based approach instead of managing own thread and event based mechanism

Problem: Changed from wake_up_interruptible -> wake_up_process and
wait_event_interruptible-> schedule_timeout_interruptible broke the FCoE
target.  Earlier approach of wake_up_interruptible was also looking at
'queue_cnt' which is not necessary, because it increment of 'queue_cnt'
with wake_up_inetrriptible / waker_up_process introduces race condition.

Fix: Instead of fixing the code which used wake_up_process and remove
'queue_cnt', using work_queue based approach is cleaner and acheives
same result. As well, work queue based approach has less programming
overhead and OS manages threads which processes work queues.

This patch is developed by Christoph Hellwig and reviwed+validated by
Kiran Patil.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Kiran Patil <>
Signed-off-by: Nicholas Bellinger <>
10 years agotcm_fc: Invalidation of DDP context for FCoE target in error conditions
Kiran Patil [Fri, 26 Aug 2011 16:25:25 +0000 (09:25 -0700)]
tcm_fc: Invalidation of DDP context for FCoE target in error conditions

Problem: HW DDP context wasn;t invalidated in case of ABORTS, etc...
This leads to the problem where memory pages which are used for DDP
as user descriptor could get reused for some other purpose (such as to
satisfy new memory allocation request either by kernel or user mode threads)
and since HW DDP context was not invalidated, HW continue to write to
those pages, hence causing memory corruption.

Fix: Either on incoming ABORTS or due to exchange time out, allowed the
target to cleanup HW DDP context if it was setup for respective ft_cmd.
Added new function to perform this cleanup, furthur it can be enhanced
for other cleanup activity.

Additinal Notes: To avoid calling ddp_done from multiple places, composed
the functionality in helper function "ft_invl_hw_context" and it is being
called from multiple places. Cleaned up code in function "ft_recv_write_data"
w.r.t DDP.

Signed-off-by: Kiran Patil <>
Signed-off-by: Nicholas Bellinger <>
10 years agotarget: Fix race between multiple invocations of target_qf_do_work()
Roland Dreier [Sun, 28 Aug 2011 04:33:16 +0000 (21:33 -0700)]
target: Fix race between multiple invocations of target_qf_do_work()

When work is scheduled with schedule_work(), the work can end up
running on multiple CPUs at the same time -- this happens if
the work is already running on one CPU and schedule_work() is called
on another CPU.  This leads to list corruption with target_qf_do_work(),
which is roughly doing:

list_for_each_entry_safe(...) {

// do stuff


With multiple CPUs running this code, one CPU can end up deleting the
list entry that the other CPU is about to work on.

Fix this by splicing the list entries onto a local list and then
operating on that in the work function.  This way, each invocation of
target_qf_do_work() operates on its own local list and so multiple
invocations don't corrupt each other's list.  This also avoids dropping
and reacquiring the lock for each list entry.

Signed-off-by: Roland Dreier <>
Signed-off-by: Nicholas Bellinger <>
10 years agoMerge branch 'for-linus' of git://
Linus Torvalds [Fri, 16 Sep 2011 05:13:48 +0000 (22:13 -0700)]
Merge branch 'for-linus' of git://

* 'for-linus' of git://
  ALSA: pcm - fix race condition in wait_for_avail()
  ALSA: HDA: Cirrus - fix "Surround Speaker" volume control name
  ALSA: hda - Terminate the recursive connection search properly
  ASoC: Fix trivial build regression in Kirkwood I2S
  ASoC: Blackfin: bf5xx-ad193x: Fix codec device name
  ASoC: Fix reporting of partial jack updates
  ASoC: imx: Fix build warning of unused 'card' variable
  ASoC: Fix register cache sync register_writable WARN_ONs
  ASoC: snd_soc_codec_{readable,writable}_register change default to true
  ASoC: soc-dapm: Fix parameter comment for snd_soc_dapm_free
  MAINTAINERS: Add some missed Wolfson files
  ASoC: MPC5200: replace of_device with platform_device

10 years agoMerge branch 'master' of ../netdev/
David S. Miller [Fri, 16 Sep 2011 05:09:02 +0000 (01:09 -0400)]
Merge branch 'master' of ../netdev/

10 years agopch_gbe: support ML7831 IOH
Toshiharu Okada [Thu, 1 Sep 2011 14:20:09 +0000 (14:20 +0000)]
pch_gbe: support ML7831 IOH

Support new device OKI SEMICONDUCTOR ML7831 IOH(Input/Output Hub)

ML7831 is for general purpose use.
ML7831 is companion chip for Intel Atom E6xx series.
ML7831 is completely compatible for Intel EG20T PCH.

Signed-off-by: Toshiharu Okada <>
Signed-off-by: David S. Miller <>
10 years agopch_gbe: added the process of FIFO over run error
Toshiharu Okada [Thu, 1 Sep 2011 14:20:08 +0000 (14:20 +0000)]
pch_gbe: added the process of FIFO over run error

This patch added the processing which should be done to hardware,
when a FIFO over run error occurred.

Signed-off-by: Toshiharu Okada <>
Signed-off-by: David S. Miller <>
10 years agopch_gbe: fixed the issue which receives an unnecessary packet.
Toshiharu Okada [Thu, 1 Sep 2011 14:20:07 +0000 (14:20 +0000)]
pch_gbe: fixed the issue which receives an unnecessary packet.

This patch fixed the issue which receives an unnecessary packet before link

When using PHY of GMII, an unnecessary packet is received,
And it becomes impossible to receive a packet after link up.

Signed-off-by: Toshiharu Okada <>
Signed-off-by: David S. Miller <>
10 years agosfc: Use 64-bit writes for TX push where possible
Ben Hutchings [Thu, 1 Sep 2011 12:09:59 +0000 (12:09 +0000)]
sfc: Use 64-bit writes for TX push where possible

This was originally done as part of commit
65f0b417dee94f779ce9b77102b7d73c93723b39 ("sfc: Use write-combining to
reduce TX latency"), but that had to be reverted.

Signed-off-by: Ben Hutchings <>
Signed-off-by: David S. Miller <>
10 years agoRevert "sfc: Use write-combining to reduce TX latency" and follow-ups
Ben Hutchings [Thu, 1 Sep 2011 12:09:29 +0000 (12:09 +0000)]
Revert "sfc: Use write-combining to reduce TX latency" and follow-ups

This reverts commits 65f0b417dee94f779ce9b77102b7d73c93723b39,
747df2258b1b9a2e25929ef496262c339c380009 and

Depending on the processor model, write-combining may result in
reordering that the NIC will not tolerate.  This typically results
in a DMA error event and reset by the driver, logged as:

sfc 0000:0e:00.0: eth2: TX DMA Q reports TX_EV_PKT_ERR.
sfc 0000:0e:00.0: eth2: resetting (ALL)

Signed-off-by: Ben Hutchings <>
Signed-off-by: David S. Miller <>
10 years agoMerge branch 'for-davem' of git://
David S. Miller [Thu, 15 Sep 2011 21:13:04 +0000 (17:13 -0400)]
Merge branch 'for-davem' of git://

10 years agoasm alternatives: remove incorrect alignment notes
Linus Torvalds [Thu, 15 Sep 2011 20:28:33 +0000 (13:28 -0700)]
asm alternatives: remove incorrect alignment notes

On x86-64, they were just wasteful: with the explicitly added (now
unnecessary) padding, the size of the alternatives structure was 16
bytes, and an alignment of 8 bytes didn't hurt much.

However, it was still silly, since the natural size and alignment for
the structure is actually just 12 bytes, 4-byte aligned since commit
59e97e4d6fbc ("x86: Make alternative instruction pointers relative").
So removing the padding, and removing the extra alignment is just a good

On x86-32, the alignment of 4 bytes was correct, but was incorrectly
hardcoded as 8 bytes in <asm/alternative-asm.h>.  That header file had
used to be an x86-64 only header file, but various unification efforts
have made it be used for x86-32 too (ie the unification of rwlock and

That in turn caused x86-32 boot failures, because the extra alignment
would result in random zero-filled words in the altinstructions section,
causing oopses early at boot when doing alternative instruction

So just remove all the alignment noise entirely.  It's wrong, and it's
unnecessary.  The section itself is already properly aligned by the
linker scripts, and all additions to the section had better be of the
proper 12-byte format, keeping it aligned.  So if the align directive
were to ever make a difference, that would be an indication of a serious
bug to begin with.

Reported-by: Werner Landgraf <w.landgraf@ru.r>
Acked-by: Andrew Lutomirski <>
Signed-off-by: Linus Torvalds <>
10 years agobnx2x: Fix ethtool advertisement
Yaniv Rosner [Wed, 7 Sep 2011 00:48:11 +0000 (00:48 +0000)]
bnx2x: Fix ethtool advertisement

Enable changing advertisement settings via ethtool.

Signed-off-by: Yaniv Rosner <>
Signed-off-by: Eilon Greenstein <>
Reviewed-by: Ben Hutchings <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: Fix 578xx link LED
Yaniv Rosner [Wed, 7 Sep 2011 00:48:06 +0000 (00:48 +0000)]
bnx2x: Fix 578xx link LED

Fix 1G link LED for the BCM578xx-SFI/KR.

Signed-off-by: Yaniv Rosner <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: Fix XMAC loopback test
Yaniv Rosner [Wed, 7 Sep 2011 00:48:03 +0000 (00:48 +0000)]
bnx2x: Fix XMAC loopback test

Change XMAC loopback type from CORE LOCAL to LINE LOCAL for the BCM578xx due to intermittent problem with the loopback with this configuration.

Signed-off-by: Yaniv Rosner <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: Remove fiber remote fault detection
Yaniv Rosner [Wed, 7 Sep 2011 00:47:58 +0000 (00:47 +0000)]
bnx2x: Remove fiber remote fault detection

Remove remote fault detection as a tactic retreat due to link issues involved with it.
Once issue is resolved, this feature will be restored again.

Signed-off-by: Yaniv Rosner <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: Enable FEC for 57810-KR
Yaniv Rosner [Wed, 7 Sep 2011 00:47:54 +0000 (00:47 +0000)]
bnx2x: Enable FEC for 57810-KR

Enable FEC(Forward Error Correction) for 57810-KR to reduce link errors.

Signed-off-by: Yaniv Rosner <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: Fix ETS bandwidth
Yaniv Rosner [Wed, 7 Sep 2011 00:47:49 +0000 (00:47 +0000)]
bnx2x: Fix ETS bandwidth

ETS bandwidth of 0% is not allowed by driver, so provide alternative HW configuration for this case.

Signed-off-by: Yaniv Rosner <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agoMerge branch 'master' of git:// into for...
John W. Linville [Thu, 15 Sep 2011 19:37:02 +0000 (15:37 -0400)]
Merge branch 'master' of git:// into for-davem

10 years agoMerge branch 'bugfixes' of git://
Linus Torvalds [Thu, 15 Sep 2011 19:36:01 +0000 (12:36 -0700)]
Merge branch 'bugfixes' of git://

* 'bugfixes' of git://
  nfs: Do not allow multiple mounts on same mountpoint when using -o noac
  NFS: Fix a typo in nfs_flush_multi
  NFSv4: renewd needs to be able to handle the NFS4ERR_CB_PATH_DOWN error
  NFSv4: The NFSv4.0 client must send RENEW calls if it holds a delegation
  NFSv4: nfs4_proc_renew should be declared static
  NFSv4: nfs4_proc_async_renew should use a GFP_NOFS allocation

10 years agoMerge branch 'hwmon-for-linus' of git://
Linus Torvalds [Thu, 15 Sep 2011 19:34:59 +0000 (12:34 -0700)]
Merge branch 'hwmon-for-linus' of git://

* 'hwmon-for-linus' of git://
  hwmon: (coretemp) Initialize tmin
  hwmon: (pmbus) Fix low limit temperature alarms

10 years agonet: don't clear IFF_XMIT_DST_RELEASE in ether_setup
nhorman [Wed, 14 Sep 2011 03:05:02 +0000 (03:05 +0000)]
net: don't clear IFF_XMIT_DST_RELEASE in ether_setup

d88733150 introduced the IFF_SKB_TX_SHARING flag, which I unilaterally set in
ether_setup.  In doing this I didn't realize that other flags (such as
IFF_XMIT_DST_RELEASE) might be set prior to calling the ether_setup routine.
This patch changes ether_setup to or in SKB_TX_SHARING so as not to
inadvertently clear other existing flags.  Thanks to Pekka Riikonen for pointing
out my error

Signed-off-by: Neil Horman <>
Reported-by: Pekka Riikonen <>
CC: "David S. Miller" <>
Acked-by: Eric Dumazet <>
Signed-off-by: David S. Miller <>
10 years agonet: copy userspace buffers on device forwarding
Michael S. Tsirkin [Wed, 31 Aug 2011 08:03:29 +0000 (08:03 +0000)]
net: copy userspace buffers on device forwarding

dev_forward_skb loops an skb back into host networking
stack which might hang on the memory indefinitely.
In particular, this can happen in macvtap in bridged mode.
Copy the userspace fragments to avoid blocking the
sender in that case.

As this patch makes skb_copy_ubufs extern now,
I also added some documentation and made it clear
the SKBTX_DEV_ZEROCOPY flag automatically instead
of doing it in all callers. This can be made into a separate
patch if people feel it's worth it.

Signed-off-by: Michael S. Tsirkin <>
Signed-off-by: David S. Miller <>
10 years agonet: Make flow cache namespace-aware
dpward [Wed, 31 Aug 2011 06:05:27 +0000 (06:05 +0000)]
net: Make flow cache namespace-aware

flow_cache_lookup will return a cached object (or null pointer) that the
resolver (i.e. xfrm_policy_lookup) previously found for another namespace
using the same key/family/dir.  Instead, make the namespace part of what
identifies entries in the cache.

As before, flow_entry_valid will return 0 for entries where the namespace
has been deleted, and they will be removed from the cache the next time
flow_cache_gc_task is run.

Reported-by: Andrew Dickinson <>
Signed-off-by: David Ward <>
Signed-off-by: David S. Miller <>
10 years agoipheth: iPhone 4 Verizon CDMA USB Product ID add
Kavan Smith [Wed, 31 Aug 2011 05:12:05 +0000 (05:12 +0000)]
ipheth: iPhone 4 Verizon CDMA USB Product ID add

Add USB product ID for iPhone 4 CDMA Verizon
Tested on at least 2 devices

Signed-off-by: Kavan Smith <>
Signed-off-by: David S. Miller <>
10 years agonet/can/af_can.c: Change del_timer to del_timer_sync [Tue, 30 Aug 2011 23:57:38 +0000 (23:57 +0000)]
net/can/af_can.c: Change del_timer to del_timer_sync

This is important for SMP platform to check if timer function is
executing on other CPU with deleting the timer.

Signed-off-by: Rajan Aggarwal <Rajan Aggarwal>
Acked-by: Oliver Hartkopp <>
Signed-off-by: David S. Miller <>
10 years agoDocumentation: networking: dmfe.txt: Remove the maintainer of orphan networking driver
Marcos Paulo de Souza [Tue, 30 Aug 2011 05:33:57 +0000 (05:33 +0000)]
Documentation: networking: dmfe.txt: Remove the maintainer of orphan networking driver

The dmfe module is a orphan driver, and with this was removed the maintainer
of the documentation.

Signed-off-by: Marcos Paulo de Souza <>
Signed-off-by: David S. Miller <>
10 years agotcp: Change possible SYN flooding messages
Eric Dumazet [Tue, 30 Aug 2011 03:21:44 +0000 (03:21 +0000)]
tcp: Change possible SYN flooding messages

"Possible SYN flooding on port xxxx " messages can fill logs on servers.

Change logic to log the message only once per listener, and add two new
SNMP counters to track :

TCPReqQFullDoCookies : number of times a SYNCOOKIE was replied to client

TCPReqQFullDrop : number of times a SYN request was dropped because
syncookies were not enabled.

Based on a prior patch from Tom Herbert, and suggestions from David.

Signed-off-by: Eric Dumazet <>
CC: Tom Herbert <>
Signed-off-by: David S. Miller <>
10 years agopkt_sched: cls_rsvp.h was outdated
Igor Maravić [Tue, 30 Aug 2011 03:12:55 +0000 (03:12 +0000)]
pkt_sched: cls_rsvp.h was outdated

File cls_rsvp.h in /net/sched was outdated. I'm sending you patch for this

[ tb[] array should be indexed by X not X-1 -DaveM ]

Signed-off-by: Igor Maravić <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: Fix for a host coalescing bug which impared latency.
Ariel Elior [Tue, 30 Aug 2011 00:08:46 +0000 (00:08 +0000)]
bnx2x: Fix for a host coalescing bug which impared latency.

Seperated Rx and Tx coalescing to different state machines.

Signed-off-by: Ariel Elior <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: Dmitry Kravkov <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: don't access removed registers on 57712 and above
Dmitry Kravkov [Tue, 30 Aug 2011 00:08:45 +0000 (00:08 +0000)]
bnx2x: don't access removed registers on 57712 and above

Signed-off-by: Dmitry Kravkov <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: init fw_seq after undi_unload is done
Dmitry Kravkov [Tue, 30 Aug 2011 00:08:44 +0000 (00:08 +0000)]
bnx2x: init fw_seq after undi_unload is done

Signed-off-by: Dmitry Kravkov <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: don't reset device while reading its configuration.
Dmitry Kravkov [Tue, 30 Aug 2011 00:08:43 +0000 (00:08 +0000)]
bnx2x: don't reset device while reading its configuration.

Signed-off-by: Dmitry Kravkov <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: fix MF for 4-port devices
Dmitry Kravkov [Tue, 30 Aug 2011 00:08:42 +0000 (00:08 +0000)]
bnx2x: fix MF for 4-port devices

Number of VNs for 4-port devices is 2 instead of 4

Signed-off-by: Dmitry Kravkov <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: fix rx ring size report
Vladislav Zolotarov [Tue, 30 Aug 2011 00:08:41 +0000 (00:08 +0000)]
bnx2x: fix rx ring size report

Store the size in bp, read from bp when queried.

Signed-off-by: Dmitry Kravkov <>
Signed-off-by: Vladislav Zolotarov <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: decrease print level to debug
Dmitry Kravkov [Tue, 30 Aug 2011 00:08:40 +0000 (00:08 +0000)]
bnx2x: decrease print level to debug

It may happen every link toggle.

Signed-off-by: Dmitry Kravkov <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agobnx2x: fix BRB thresholds for dropless_fc mode
Dmitry Kravkov [Tue, 30 Aug 2011 00:08:39 +0000 (00:08 +0000)]
bnx2x: fix BRB thresholds for dropless_fc mode

Fix the thresholds according to 5778x HW and increase rx_ring size
to suit new thresholds in dropless_fc mode.

Signed-off-by: Dmitry Kravkov <>
Signed-off-by: Eilon Greenstein <>
Signed-off-by: David S. Miller <>
10 years agohfsplus: fix filesystem size checks
Christoph Hellwig [Thu, 15 Sep 2011 14:48:40 +0000 (10:48 -0400)]
hfsplus: fix filesystem size checks

generic_check_addressable can't deal with hfsplus's larger than page
size allocation blocks, so simply opencode the checks that we actually
need in hfsplus_fill_super.

Signed-off-by: Christoph Hellwig <>
Reported-by: Pavel Ivanov <>
Tested-by: Pavel Ivanov <>
Signed-off-by: Linus Torvalds <>
10 years agohfsplus: Fix kfree of wrong pointers in hfsplus_fill_super() error path
Seth Forshee [Thu, 15 Sep 2011 14:48:27 +0000 (10:48 -0400)]
hfsplus: Fix kfree of wrong pointers in hfsplus_fill_super() error path

Commit 6596528e391a ("hfsplus: ensure bio requests are not smaller than
the hardware sectors") changed the pointers used for volume header
allocations but failed to free the correct pointers in the error path
path of hfsplus_fill_super() and hfsplus_read_wrapper.

The second hunk came from a separate patch by Pavel Ivanov.

Reported-by: Pavel Ivanov <>
Signed-off-by: Seth Forshee <>
Signed-off-by: Christoph Hellwig <>
Cc: <>
Signed-off-by: Linus Torvalds <>
10 years agoBluetooth: Fix timeout on scanning for the second time
Oliver Neukum [Tue, 30 Aug 2011 13:52:18 +0000 (15:52 +0200)]
Bluetooth: Fix timeout on scanning for the second time

The checks for HCI_INQUIRY and HCI_MGMT were in the wrong order,
so that second scans always failed.

Signed-off-by: Oliver Neukum <>
Signed-off-by: Gustavo F. Padovan <>
10 years agoxen/i386: follow-up to "replace order-based range checking of M2P table by linear...
Jan Beulich [Thu, 15 Sep 2011 07:52:40 +0000 (08:52 +0100)]
xen/i386: follow-up to "replace order-based range checking of M2P table by linear one"

The numbers obtained from the hypervisor really can't ever lead to an
overflow here, only the original calculation going through the order
of the range could have. This avoids the (as Jeremy points outs)
somewhat ugly NULL-based calculation here.

Signed-off-by: Jan Beulich <>
Signed-off-by: Konrad Rzeszutek Wilk <>
10 years agoxen/irq: Alter the locking to use a mutex instead of a spinlock.
Konrad Rzeszutek Wilk [Wed, 14 Sep 2011 09:10:00 +0000 (05:10 -0400)]
xen/irq: Alter the locking to use a mutex instead of a spinlock.

When we allocate/change the IRQ informations, we do not
need to use spinlocks. We can use a mutex (which is
what the generic IRQ code does for allocations/changes).
Fixes a slew of:

BUG: sleeping function called from invalid context at /linux/kernel/mutex.c:271
in_atomic(): 1, irqs_disabled(): 0, pid: 3216, name: xenstored
2 locks held by xenstored/3216:
 #0:  (&u->bind_mutex){......}, at: [<ffffffffa02e0920>] evtchn_ioctl+0x30/0x3a0 [xen_evtchn]
 #1:  (irq_mapping_update_lock){......}, at: [<ffffffff8138b274>] bind_evtchn_to_irq+0x24/0x90
Pid: 3216, comm: xenstored Not tainted 3.1.0-rc6-00021-g437a3d1 #2
Call Trace:
 [<ffffffff81088d10>] __might_sleep+0x100/0x130
 [<ffffffff81645c2f>] mutex_lock_nested+0x2f/0x50
 [<ffffffff81627529>] __irq_alloc_descs+0x49/0x200
 [<ffffffffa02e0920>] ? evtchn_ioctl+0x30/0x3a0 [xen_evtchn]
 [<ffffffff8138b214>] xen_allocate_irq_dynamic+0x34/0x70
 [<ffffffff8138b2ad>] bind_evtchn_to_irq+0x5d/0x90
 [<ffffffffa02e03c0>] ? evtchn_bind_to_user+0x60/0x60 [xen_evtchn]
 [<ffffffff8138c282>] bind_evtchn_to_irqhandler+0x32/0x80
 [<ffffffffa02e03a9>] evtchn_bind_to_user+0x49/0x60 [xen_evtchn]
 [<ffffffffa02e0a34>] evtchn_ioctl+0x144/0x3a0 [xen_evtchn]
 [<ffffffff811b4070>] ? vfsmount_lock_local_unlock+0x50/0x80
 [<ffffffff811a6a1a>] do_vfs_ioctl+0x9a/0x5e0
 [<ffffffff811b476f>] ? mntput+0x1f/0x30
 [<ffffffff81196259>] ? fput+0x199/0x240
 [<ffffffff811a7001>] sys_ioctl+0xa1/0xb0
 [<ffffffff8164ea82>] system_call_fastpath+0x16/0x1b

Reported-by: Jim Burns <>
Acked-by: Ian Campbell <>
Signed-off-by: Konrad Rzeszutek Wilk <>
10 years agoALSA: pcm - fix race condition in wait_for_avail()
Arjan van de Ven [Thu, 15 Sep 2011 06:49:25 +0000 (08:49 +0200)]
ALSA: pcm - fix race condition in wait_for_avail()

wait_for_avail() in pcm_lib.c has a race in it (observed in practice by an
Intel validation group).

The function is supposed to return once space in the buffer has become
available, or if some timeout happens.  The entity that creates space (irq
handler of sound driver and some such) will do a wake up on a waitqueue
that this function registers for.

However there are two races in the existing code

1) If space became available between the caller noticing there was no
   space and this function actually sleeping, the wakeup is missed and the
   timeout condition will happen instead

2) If a wakeup happened but not sufficient space became available, the
   code will loop again and wait for more space.  However, if the second
   wake comes in prior to hitting the schedule_timeout_interruptible(), it
   will be missed, and potentially you'll wait out until the timeout

The fix consists of using more careful setting of the current state (so
that if a wakeup happens in the main loop window, the schedule_timeout()
falls through) and by checking for available space prior to going into the
schedule_timeout() loop, but after being on the waitqueue and having the
state set to interruptible.

[tiwai: the following changes have been added to Arjan's original patch:
 - merged akpm's fix for waitqueue adding order into a single patch
 - reduction of duplicated code of avail check

Signed-off-by: Arjan van de Ven <>
Signed-off-by: Andrew Morton <>
Cc: <>
Signed-off-by: Takashi Iwai <>
10 years agomm: account skipped entries to avoid looping in find_get_pages
Shaohua Li [Thu, 15 Sep 2011 00:45:19 +0000 (08:45 +0800)]
mm: account skipped entries to avoid looping in find_get_pages

The found entries by find_get_pages() could be all swap entries.  In
this case we skip the entries, but make sure the skipped entries are
accounted, so we don't keep looping.

Using nr_found > nr_skip to simplify code as suggested by Eric.

Reported-and-tested-by: Eric Dumazet <>
Signed-off-by: Shaohua Li <>
Signed-off-by: Linus Torvalds <>
10 years agodrivers/gpio/gpio-generic.c: fix build errors
Russell King [Wed, 14 Sep 2011 23:22:29 +0000 (16:22 -0700)]
drivers/gpio/gpio-generic.c: fix build errors

Building a kernel with hotplug disabled results in a link failure:

  `bgpio_remove' referenced in section `___ksymtab_gpl+bgpio_remove' of drivers/built-in.o: defined in discarded section `.devexit.text' of drivers/built-in.o

This is because of bgpio_remove() is exported.  It is illegal to export
symbols which are discarded either at link time or as part of an
init/exit section.

Fix this by dropping the __devexit attributation from bgpio_remove().
Also drop the __devinit attributation from bgpio_init().

Signed-off-by: Russell King <>
Cc: Grant Likely <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>