linux-2.6
14 years agoBtrfs: find_free_dev_extent doesn't handle holes at the start of the device
Yan Zheng [Fri, 24 Jul 2009 15:06:53 +0000 (11:06 -0400)] 
Btrfs: find_free_dev_extent doesn't handle holes at the start of the device

find_free_dev_extent does not properly handle the case where
the device is not complete free, and there is a free extent
at the beginning of the device.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Remove code duplication in comp_keys
Diego Calleja [Fri, 24 Jul 2009 15:06:52 +0000 (11:06 -0400)] 
Btrfs: Remove code duplication in comp_keys

comp_keys is duplicating what is done in btrfs_comp_cpu_keys, so just
call it.

Signed-off-by: Diego Calleja <diegocg@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoALSA: hda - Fix mute control with some ALC262 models
Takashi Iwai [Fri, 24 Jul 2009 14:51:47 +0000 (16:51 +0200)] 
ALSA: hda - Fix mute control with some ALC262 models

The master mute switch is wrongly implemented as checking the pointer
instead of its value, thus it can be never muted.  This patch fixes
the issue.

Reference: Novell bnc#404873
https://bugzilla.novell.com/show_bug.cgi?id=404873

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
14 years agoBtrfs: async block group caching
Josef Bacik [Tue, 14 Jul 2009 01:29:25 +0000 (21:29 -0400)] 
Btrfs: async block group caching

This patch moves the caching of the block group off to a kthread in order to
allow people to allocate sooner.  Instead of blocking up behind the caching
mutex, we instead kick of the caching kthread, and then attempt to make an
allocation.  If we cannot, we wait on the block groups caching waitqueue, which
the caching kthread will wake the waiting threads up everytime it finds 2 meg
worth of space, and then again when its finished caching.  This is how I tested
the speedup from this

mkfs the disk
mount the disk
fill the disk up with fs_mark
unmount the disk
mount the disk
time touch /mnt/foo

Without my changes this took 11 seconds on my box, with these changes it now
takes 1 second.

Another change thats been put in place is we lock the super mirror's in the
pinned extent map in order to keep us from adding that stuff as free space when
caching the block group.  This doesn't really change anything else as far as the
pinned extent map is concerned, since for actual pinned extents we use
EXTENT_DIRTY, but it does mean that when we unmount we have to go in and unlock
those extents to keep from leaking memory.

I've also added a check where when we are reading block groups from disk, if the
amount of space used == the size of the block group, we go ahead and mark the
block group as cached.  This drastically reduces the amount of time it takes to
cache the block groups.  Using the same test as above, except doing a dd to a
file and then unmounting, it used to take 33 seconds to umount, now it takes 3
seconds.

This version uses the commit_root in the caching kthread, and then keeps track
of how many async caching threads are running at any given time so if one of the
async threads is still running as we cross transactions we can wait until its
finished before handling the pinned extents.  Thank you,

Signed-off-by: Josef Bacik <jbacik@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: use hybrid extents+bitmap rb tree for free space
Josef Bacik [Tue, 14 Jul 2009 01:29:25 +0000 (21:29 -0400)] 
Btrfs: use hybrid extents+bitmap rb tree for free space

Currently btrfs has a problem where it can use a ridiculous amount of RAM simply
tracking free space.  As free space gets fragmented, we end up with thousands of
entries on an rb-tree per block group, which usually spans 1 gig of area.  Since
we currently don't ever flush free space cache back to disk this gets to be a
bit unweildly on large fs's with lots of fragmentation.

This patch solves this problem by using PAGE_SIZE bitmaps for parts of the free
space cache.  Initially we calculate a threshold of extent entries we can
handle, which is however many extent entries we can cram into 16k of ram.  The
maximum amount of RAM that should ever be used to track 1 gigabyte of diskspace
will be 32k of RAM, which scales much better than we did before.

Once we pass the extent threshold, we start adding bitmaps and using those
instead for tracking the free space.  This patch also makes it so that any free
space thats less than 4 * sectorsize we go ahead and put into a bitmap.  This is
nice since we try and allocate out of the front of a block group, so if the
front of a block group is heavily fragmented and then has a huge chunk of free
space at the end, we go ahead and add the fragmented areas to bitmaps and use a
normal extent entry to track the big chunk at the back of the block group.

I've also taken the opportunity to revamp how we search for free space.
Previously we indexed free space via an offset indexed rb tree and a bytes
indexed rb tree.  I've dropped the bytes indexed rb tree and use only the offset
indexed rb tree.  This cuts the number of tree operations we were doing
previously down by half, and gives us a little bit of a better allocation
pattern since we will always start from a specific offset and search forward
from there, instead of searching for the size we need and try and get it as
close as possible to the offset we want.

I've given this a healthy amount of testing pre-new format stuff, as well as
post-new format stuff.  I've booted up my fedora box which is installed on btrfs
with this patch and ran with it for a few days without issues.  I've not seen
any performance regressions in any of my tests.

Since the last patch Yan Zheng fixed a problem where we could have overlapping
entries, so updating their offset inline would cause problems.  Thanks,

Signed-off-by: Josef Bacik <jbacik@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years ago[S390] zcrypt: fix scheduling of hrtimer ap_poll_timer
Felix Beck [Fri, 24 Jul 2009 10:39:53 +0000 (12:39 +0200)] 
[S390] zcrypt: fix scheduling of hrtimer ap_poll_timer

Every time a request is enqueued or there is some work outstanding
from the ap_tasklet, the ap_poll_timer is scheduled again.
Unfortunately it was permanently called. It looked as if it was
started in the past and thus imediately expired.
This has been changed. First it is checked if the hrtimer is already
expired. Then the expiring time is forwarded and the timer restarted.

Signed-off-by: Felix Beck <felix.beck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] vdso: clock_gettime of CLOCK_THREAD_CPUTIME_ID with noexec=on
Martin Schwidefsky [Fri, 24 Jul 2009 10:39:52 +0000 (12:39 +0200)] 
[S390] vdso: clock_gettime of CLOCK_THREAD_CPUTIME_ID with noexec=on

The combination of noexec=on and a clock_gettime call with clock id
CLOCK_THREAD_CPUTIME_ID is broken. The vdso code switches to the
access register mode to get access to the per-cpu data structure to
execute the magic ectg instruction. After the ectg instruction the
code always switches back to the primary mode but for noexec=on the
correct mode is the secondary mode. The effect of the bug is that the
user space program looses the access to all mappings without PROT_EXEC,
e.g. the stack. The problem is fixed by restoring the mode that has
been active before the switch to the access register mode.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] vdso: fix per cpu area allocation
Heiko Carstens [Fri, 24 Jul 2009 10:39:51 +0000 (12:39 +0200)] 
[S390] vdso: fix per cpu area allocation

vdso per cpu area allocation in smp_prepare_cpus() happens with GFP_KERNEL
but irqs disabled. Triggers this one:

Badness at kernel/lockdep.c:2280
Modules linked in:
CPU: 0 Not tainted 2.6.30 #2
Process swapper (pid: 1, task: 000000003fe88000, ksp: 000000003fe87eb8)
Krnl PSW : 0400c00180000000 0000000000083360 (lockdep_trace_alloc+0xec/0xf8)
[...]
Call Trace:
([<00000000000832b6>] lockdep_trace_alloc+0x42/0xf8)
 [<00000000000b1880>] __alloc_pages_internal+0x3e8/0x5c4
 [<00000000000b1b4a>] __get_free_pages+0x3a/0xb0
 [<0000000000026546>] vdso_alloc_per_cpu+0x6a/0x18c
 [<00000000005eff82>] smp_prepare_cpus+0x322/0x594
 [<00000000005e8232>] kernel_init+0x76/0x398
 [<000000000001bb1e>] kernel_thread_starter+0x6/0xc
 [<000000000001bb18>] kernel_thread_starter+0x0/0xc

Fix this by moving the allocation out of the irqs disabled section.

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] hibernation: fix register corruption on machine checks
Heiko Carstens [Fri, 24 Jul 2009 10:39:50 +0000 (12:39 +0200)] 
[S390] hibernation: fix register corruption on machine checks

swsusp_arch_suspend() actually saves all cpu register contents on
hibernation.
Machine checks must be disabled since swsusp_arch_suspend() stores
register contents to their lowcore save areas. That's the same
place where register contents on machine checks would be saved.
To avoid register corruption disable machine checks.
We must also disable machine checks in the new psw mask for
program checks, since swsusp_arch_suspend() may generate program
checks.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years ago[S390] hibernation: fix lowcore handling
Heiko Carstens [Fri, 24 Jul 2009 10:39:49 +0000 (12:39 +0200)] 
[S390] hibernation: fix lowcore handling

Our swsusp_arch_suspend() backend implementation disables prefixing
by setting the contents of the prefix register to 0.
However afterwards common code functions are called which might
access percpu data structures.
Since the lowcore contains e.g. the percpu base pointer this isn't
a good idea. So fix this by copying the hibernating cpu's lowcore to
absolute address zero.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14 years agox86: geode: Mark mfgpt irq IRQF_TIMER to prevent resume failure
Thomas Gleixner [Fri, 24 Jul 2009 06:34:59 +0000 (08:34 +0200)] 
x86: geode: Mark mfgpt irq IRQF_TIMER to prevent resume failure

Timer interrupts are excluded from being disabled during suspend. The
clock events code manages the disabling of clock events on its own
because the timer interrupt needs to be functional before the resume
code reenables the device interrupts.

The mfgpt timer request its interrupt without setting the IRQF_TIMER
flag so suspend_device_irqs() disables it as well which results in a
fatal resume failure.

Adding IRQF_TIMER to the interupt flags when requesting the mrgpt
timer interrupt solves the problem.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <new-submission>
Cc: Andres Salomon <dilinger@debian.org>
Cc: stable@kernel.org
14 years agodm table: pass correct dev area size to device_area_is_valid
Mike Snitzer [Thu, 23 Jul 2009 19:30:42 +0000 (20:30 +0100)] 
dm table: pass correct dev area size to device_area_is_valid

Incorrect device area lengths are being passed to device_area_is_valid().

The regression appeared in 2.6.31-rc1 through commit
754c5fc7ebb417b23601a6222a6005cc2e7f2913.

With the dm-stripe target, the size of the target (ti->len) was used
instead of the stripe_width (ti->len/#stripes).  An example of a
consequent incorrect error message is:

  device-mapper: table: 254:0: sdb too small for target

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
14 years agodm: remove queue next_ordered workaround for barriers
Mike Snitzer [Thu, 23 Jul 2009 19:30:40 +0000 (20:30 +0100)] 
dm: remove queue next_ordered workaround for barriers

This patch removes DM's bio-based vs request-based conditional setting
of next_ordered.  For bio-based DM the next_ordered check is no longer a
concern (as that check is now in the __make_request path).  For
request-based DM the default of QUEUE_ORDERED_NONE is now appropriate.

bio-based DM was changed to work-around the previously misplaced
next_ordered check with this commit:
99360b4c18f7675b50d283301d46d755affe75fd

request-based DM does not yet support barriers but reacted to the above
bio-based DM change with this commit:
5d67aa2366ccb8257d103d0b43df855605c3c086

The above changes are no longer needed given Neil Brown's recent fix to
put the next_ordered check in the __make_request path:
db64f680ba4b5c56c4be59f0698000df89ff0281

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: NeilBrown <neilb@suse.de>
Acked-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
14 years agodm raid1: wake kmirrord when requeueing delayed bios after remote recovery
Mikulas Patocka [Thu, 23 Jul 2009 19:30:37 +0000 (20:30 +0100)] 
dm raid1: wake kmirrord when requeueing delayed bios after remote recovery

The recent commit 7513c2a761d69d2a93f17146b3563527d3618ba0 (dm raid1:
add is_remote_recovering hook for clusters) changed do_writes() to
update the ms->writes list but forgot to wake up kmirrord to process it.

The rule is that when anything is being added on ms->reads, ms->writes
or ms->failures and the list was empty before we must call
wakeup_mirrord (for immediate processing) or delayed_wake (for delayed
processing).  Otherwise the bios could sit on the list indefinitely.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
CC: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
14 years agoixgbe: remove unnecessary call to device_init_wakeup
Andy Gospodarek [Wed, 22 Jul 2009 09:34:00 +0000 (09:34 +0000)] 
ixgbe: remove unnecessary call to device_init_wakeup

Calls to device_init_wakeup should not be necessary in drivers that use
device_set_wakeup_enable since pci_pm_init will set the can_wakeup flag
for the device when initialized.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Don't priority tag control frames in DCB mode
Lucy Liu [Wed, 22 Jul 2009 14:07:33 +0000 (14:07 +0000)] 
ixgbe: Don't priority tag control frames in DCB mode

Certain types of control packets (LLDP, LACP, etc.) are not supposed to have a
priority tag or vlan tag inserted.  Ixgbe driver is currently priority
tagging everything (if packet is not on a VLAN interface).

This patch modifies DCB mode, so that packets marked with skb priority
TC_PRIO_CONTROL are not priority tagged.  It also transmits these packets on
the highest priority traffic class.
Programs (like dcbd) can set the skb priority using a socket option.  Or, a tc
filter can be configured to set the priority value. Using the value
TC_PRIO_CONTROL (7) has the benefit that it is already defined in the kernel,
and the bonding LACP code already sets the skb->priority field to this value.

Signed-off-by: Lucy Liu <lucy.liu@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Enable FCoE offload when DCB is enabled for 82599
Yi Zou [Wed, 22 Jul 2009 14:07:12 +0000 (14:07 +0000)] 
ixgbe: Enable FCoE offload when DCB is enabled for 82599

Currently, FCoE offload feature is turned on when the kernel config has
CONFIG_FCOE or CONFIG_FCOE_MODULE set. However, we really want to turn
FCoE offload on when there is FCoE traffic passing and turn it off when
it's just LAN traffic. Since FCoE depends on a lossless network provided
by DCB, this allows us to have FCoE turned on/off when user turns on DCB
using dcbtool.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Rework mdio-ofgpio driver to use of_mdio infrastructure
Mark Ware [Thu, 23 Jul 2009 17:56:48 +0000 (10:56 -0700)] 
net: Rework mdio-ofgpio driver to use of_mdio infrastructure

Changes to the fs_enet driver aa73832c5a80d6c52c69b18af858d88fa595dd3c
("net: Rework fs_enet driver to use of_mdio infrastructure")
cause kernel crashes when using the mdio-ofgpio driver.

This patch replicates similar changes made to the fs_enet mii-bitbang
drivers.  It has been tested on a custom mpc8280 based board using an
NFS mounted root.

Signed-off-by: Mark Ware <mware@elphinstone.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agojfs: Fix early release of acl in jfs_get_acl
Stefan Bader [Thu, 23 Jul 2009 09:26:05 +0000 (11:26 +0200)] 
jfs: Fix early release of acl in jfs_get_acl

BugLink: http://bugs.launchpad.net/ubuntu/+bug/396780
Commit 073aaa1b142461d91f83da66db1184d7c1b1edea "helpers for acl
caching + switch to those" introduced new helper functions for
acl handling but seems to have introduced a regression for jfs as
the acl is released before returning it to the caller, instead of
leaving this for the caller to do.
This causes the acl object to be used after freeing it, leading
to kernel panics in completely different places.

Thanks to Christophe Dumez for reporting and bisecting into this.

Reported-by: Christophe Dumez <dchris@gmail.com>
Tested-by: Christophe Dumez <dchris@gmail.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
14 years agoALSA: snd_usb_caiaq: add support for Audio2DJ
Daniel Mack [Wed, 22 Jul 2009 12:13:35 +0000 (14:13 +0200)] 
ALSA: snd_usb_caiaq: add support for Audio2DJ

This adds support for Native Instrument's freshly announced Audio2DJ
sound device hardware. Version number bumped to 1.3.19.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: pcm - Fix hwptr buffer-size overlap bug
Takashi Iwai [Thu, 23 Jul 2009 14:21:08 +0000 (16:21 +0200)] 
ALSA: pcm - Fix hwptr buffer-size overlap bug

The fix 79452f0a28aa5a40522c487b42a5fc423647ad98 introduced another
bug due to the missing offset for the overlapped hwptr.
When the hwptr goes back to zero, the delta value has to be corrected
with the buffer size.  Otherwise this causes looping sounds.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: pcm - Fix warnings in debug loggings
Takashi Iwai [Thu, 23 Jul 2009 12:28:37 +0000 (14:28 +0200)] 
ALSA: pcm - Fix warnings in debug loggings

Add proper cast.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: pcm - Add logging of hwptr updates and interrupt updates
Takashi Iwai [Thu, 23 Jul 2009 09:04:13 +0000 (11:04 +0200)] 
ALSA: pcm - Add logging of hwptr updates and interrupt updates

Added the logging functionality to xrun_debug to record the hwptr
updates via snd_pcm_update_hw_ptr() and snd_pcm_update_hwptr_interrupt(),
corresponding to 16 and 8, respectively.

For example,
# echo 9 > /proc/asound/card0/pcm0p/xrun_debug
will record the position and other parameters at each period interrupt
together with the normal XRUN debugging.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoASoC: tlv320aic3x: Enable PLL when not bypassed
Chaithrika U S [Wed, 22 Jul 2009 11:45:04 +0000 (07:45 -0400)] 
ASoC: tlv320aic3x: Enable PLL when not bypassed

PLL was not being enabled when it was not bypassed. This patch
enables the PLL when it is used. Additionally, it disables the PLL
when it is bypassed.

Without this patch, the audio on TI DM646x EVM and DM355 EVM
does not work properly. The bit clocks and the frame sync signals
from the codec are not correct and hence the playback/record are faster
than usual for most sample rates. The reason for this was that the PLL
was not enabled when it was not bypassed.

Tested on DM6467 EVM, playback tested on DM355 EVM.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
14 years agoLinux 2.6.31-rc4 v2.6.31-rc4
Linus Torvalds [Thu, 23 Jul 2009 02:32:59 +0000 (19:32 -0700)] 
Linux 2.6.31-rc4

14 years agoMerge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 22 Jul 2009 23:44:33 +0000 (16:44 -0700)] 
Merge branch 'irq-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  genirq: Fix UP compile failure caused by irq_thread_check_affinity

14 years agoMerge branch 'lockdep-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 22 Jul 2009 23:44:18 +0000 (16:44 -0700)] 
Merge branch 'lockdep-for-linus' of git://git./linux/kernel/git/peterz/linux-2.6-lockdep

* 'lockdep-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep:
  lockdep: Fix lockdep annotation for pipe_double_lock()

14 years ago[CIFS] fix sparse warning
Steve French [Wed, 22 Jul 2009 23:13:01 +0000 (23:13 +0000)] 
[CIFS] fix sparse warning

Signed-off-by: Steve French <sfrench@us.ibm.com>
14 years agogenirq: Fix UP compile failure caused by irq_thread_check_affinity
Bruno Premont [Wed, 22 Jul 2009 20:22:32 +0000 (22:22 +0200)] 
genirq: Fix UP compile failure caused by irq_thread_check_affinity

Since genirq: Delegate irq affinity setting to the irq thread
(591d2fb02ea80472d846c0b8507007806bdd69cc) compilation with
CONFIG_SMP=n fails with following error:

/usr/src/linux-2.6/kernel/irq/manage.c:
   In function 'irq_thread_check_affinity':
/usr/src/linux-2.6/kernel/irq/manage.c:475:
   error: 'struct irq_desc' has no member named 'affinity'
make[4]: *** [kernel/irq/manage.o] Error 1

That commit adds a new function irq_thread_check_affinity() which
uses struct irq_desc.affinity which is only available for CONFIG_SMP=y.
Move that function under #ifdef CONFIG_SMP.

[ tglx@brownpaperbag: compile and boot tested on UP and SMP ]

Signed-off-by: Bruno Premont <bonbons@linux-vserver.org>
LKML-Reference: <20090722222232.2eb3e1c4@neptune.home>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
14 years agocifs: fix sb->s_maxbytes so that it casts properly to a signed value
Jeff Layton [Tue, 21 Jul 2009 23:42:03 +0000 (19:42 -0400)] 
cifs: fix sb->s_maxbytes so that it casts properly to a signed value

This off-by-one bug causes sendfile() to not work properly. When a task
calls sendfile() on a file on a CIFS filesystem, the syscall returns -1
and sets errno to EOVERFLOW.

do_sendfile uses s_maxbytes to verify the returned offset of the file.
The problem there is that this value is cast to a signed value (loff_t).
When this is done on the s_maxbytes value that cifs uses, it becomes
negative and the comparisons against it fail.

Even though s_maxbytes is an unsigned value, it seems that it's not OK
to set it in such a way that it'll end up negative when it's cast to a
signed value. These casts happen in other codepaths besides sendfile
too, but the VFS is a little hard to follow in this area and I can't
be sure if there are other bugs that this will fix.

It's not clear to me why s_maxbytes isn't just declared as loff_t in the
first place, but either way we still need to fix these values to make
sendfile work properly. This is also an opportunity to replace the magic
bit-shift values here with the standard #defines for this.

This fixes the reproducer program I have that does a sendfile and
will probably also fix the situation where apache is serving from a
CIFS share.

Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
14 years agocifs: disable serverino if server doesn't support it
Jeff Layton [Wed, 22 Jul 2009 19:08:58 +0000 (15:08 -0400)] 
cifs: disable serverino if server doesn't support it

A recent regression when dealing with older servers. This bug was
introduced when we made serverino the default...

When the server can't provide inode numbers, disable it for the mount.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
14 years agoBtrfs: Fix crash on read failures at mount
David Woodhouse [Wed, 22 Jul 2009 20:52:13 +0000 (16:52 -0400)] 
Btrfs: Fix crash on read failures at mount

If the tree roots hit read errors during mount, btrfs is not properly
erroring out.  We need to check the uptodate bits after
reading in the tree root node.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: remove of redundant btrfs_header_level
Daniel Cadete [Wed, 22 Jul 2009 20:52:13 +0000 (16:52 -0400)] 
Btrfs: remove of redundant btrfs_header_level

This removes the continues call's of btrfs_header_level. One call of
btrfs_header_level(c) its enough.

Signed-off-by Daniel Cadete <danielncadete10@gmail.com>

Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: adjust NULL test
Julia Lawall [Wed, 22 Jul 2009 20:49:01 +0000 (16:49 -0400)] 
Btrfs: adjust NULL test

Move the call to BUG_ON to before the dereference of the tested value.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: Remove broken sanity check from btrfs_rmap_block()
David Woodhouse [Wed, 22 Jul 2009 20:49:01 +0000 (16:49 -0400)] 
Btrfs: Remove broken sanity check from btrfs_rmap_block()

It was never actually doing anything anyway (see the loop condition),
and it would be difficult to make it work for RAID[56].

Even if it was actually working, it's checking for the wrong thing
anyway. Instead of checking whether we list a block which _doesn't_ land
at the relevant physical location, it should be checking that we _have_
listed all the logical blocks which refer to the required physical
location on all devices.

This function is only called from remove_sb_from_cache() to ensure that
we reserve the logical blocks which would reside at the same physical
location as the superblock copies. So listing more blocks than we need
is actually OK.

With RAID[56] we're going to throw away an entire stripe for each block
we have to ignore, so we _are_ going to list blocks other than the
ones which actually contain the superblock.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: convert nested spin_lock_irqsave to spin_lock
Julia Lawall [Wed, 22 Jul 2009 20:49:00 +0000 (16:49 -0400)] 
Btrfs: convert nested spin_lock_irqsave to spin_lock

If spin_lock_irqsave is called twice in a row with the same second
argument, the interrupt state at the point of the second call overwrites
the value saved by the first call.  Indeed, the second call does not need
to save the interrupt state, so it is changed to a simple spin_lock.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agolockdep: Fix lockdep annotation for pipe_double_lock()
Peter Zijlstra [Tue, 21 Jul 2009 08:09:23 +0000 (10:09 +0200)] 
lockdep: Fix lockdep annotation for pipe_double_lock()

The presumed use of the pipe_double_lock() routine is to lock 2 locks in
a deadlock free way by ordering the locks by their address. However it
fails to keep the specified lock classes in order and explicitly
annotates a deadlock.

Rectify this.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Miklos Szeredi <mszeredi@suse.cz>
LKML-Reference: <1248163763.15751.11098.camel@twins>

14 years agoMerge branch 'perf-counters-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 22 Jul 2009 18:41:56 +0000 (11:41 -0700)] 
Merge branch 'perf-counters-for-linus' of git://git./linux/kernel/git/peterz/linux-2.6-perf

* 'perf-counters-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-perf: (31 commits)
  perf_counter tools: Give perf top inherit option
  perf_counter tools: Fix vmlinux symbol generation breakage
  perf_counter: Detect debugfs location
  perf_counter: Add tracepoint support to perf list, perf stat
  perf symbol: C++ demangling
  perf: avoid structure size confusion by using a fixed size
  perf_counter: Fix throttle/unthrottle event logging
  perf_counter: Improve perf stat and perf record option parsing
  perf_counter: PERF_SAMPLE_ID and inherited counters
  perf_counter: Plug more stack leaks
  perf: Fix stack data leak
  perf_counter: Remove unused variables
  perf_counter: Make call graph option consistent
  perf_counter: Add perf record option to log addresses
  perf_counter: Log vfork as a fork event
  perf_counter: Synthesize VDSO mmap event
  perf_counter: Make sure we dont leak kernel memory to userspace
  perf_counter tools: Fix index boundary check
  perf_counter: Fix the tracepoint channel to perfcounters
  perf_counter, x86: Extend perf_counter Pentium M support
  ...

14 years agoregister at91_ether using platform_driver_probe
Uwe Kleine-König [Tue, 21 Jul 2009 10:11:39 +0000 (10:11 +0000)] 
register at91_ether using platform_driver_probe

at91ether_probe lives in .init.text, so using platform_driver_register
to register it is wrong because binding a device after the init memory
is discarded (e.g. via sysfs) results in an oops.

As requested by David Brownell platform_driver_probe is used instead of
moving the probe function to .devinit.text as proposed initially.
This saves some memory, but devices registered after the driver is
probed are not bound (probably there are none) and binding via sysfs
isn't possible.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoskge: Enable WoL by default if supported
Rafael J. Wysocki [Wed, 22 Jul 2009 02:58:55 +0000 (02:58 +0000)] 
skge: Enable WoL by default if supported

If skge hardware is capable of waking up the system from sleep,
enable magic packet WoL during driver initialisation.

This makes WoL work without calling 'ethtool -s ethX wol g'
for each adapter.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: Michael Guntsche <mike@it-loops.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Wed, 22 Jul 2009 18:18:40 +0000 (11:18 -0700)] 
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

14 years agoMerge branch 'core-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 22 Jul 2009 17:12:18 +0000 (10:12 -0700)] 
Merge branch 'core-fixes-for-linus-2' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  softirq: introduce tasklet_hrtimer infrastructure

14 years agoMerge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 22 Jul 2009 17:11:47 +0000 (10:11 -0700)] 
Merge branch 'timers-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  clocksource: Prevent NULL pointer dereference
  timer: Avoid reading uninitialized data

14 years agoMerge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 22 Jul 2009 17:11:24 +0000 (10:11 -0700)] 
Merge branch 'irq-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  genirq: Delegate irq affinity setting to the irq thread

14 years agoMerge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 22 Jul 2009 17:10:36 +0000 (10:10 -0700)] 
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: fix nr_uninterruptible accounting of frozen tasks really
  sched: fix load average accounting vs. cpu hotplug
  sched: Account for vruntime wrapping

14 years agox86, amd: Don't probe for extended APIC ID if APICs are disabled
Jeremy Fitzhardinge [Wed, 22 Jul 2009 16:59:35 +0000 (09:59 -0700)] 
x86, amd: Don't probe for extended APIC ID if APICs are disabled

If we've logically disabled apics, don't probe the PCI space for the
AMD extended APIC ID.

[ Impact: prevent boot crash under Xen. ]

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Reported-by: Bastian Blank <bastian@waldi.eu.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agoMerge branch 'tj-block-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 22 Jul 2009 17:06:33 +0000 (10:06 -0700)] 
Merge branch 'tj-block-for-linus' of git://git./linux/kernel/git/tj/misc

* 'tj-block-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc:
  virtio_blk: mark virtio_blk with __refdata to kill spurious section mismatch
  block: sysfs fix mismatched queue_var_{store,show} in 64bit kernel
  ataflop: adjust NULL test
  block: fix failfast merge testing in elv_rq_merge_ok()
  z2ram: Small cleanup for z2ram.c

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke...
Linus Torvalds [Wed, 22 Jul 2009 17:05:00 +0000 (10:05 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/ryusuke/nilfs2

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
  fs/Kconfig: move nilfs2 out

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6
Linus Torvalds [Wed, 22 Jul 2009 16:50:18 +0000 (09:50 -0700)] 
Merge git://git./linux/kernel/git/davem/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6:
  ide-tape: Don't leak kernel stack information
  ide: fix memory leak when flush command is issued

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Wed, 22 Jul 2009 16:49:58 +0000 (09:49 -0700)] 
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (37 commits)
  sky2: Avoid races in sky2_down
  drivers/net/mlx4: Adjust constant
  drivers/net: Move a dereference below a NULL test
  drivers/net: Move a dereference below a NULL test
  connector: maintainer/mail update.
  USB host CDC Phonet network interface driver
  macsonic, jazzsonic: fix oops on module unload
  macsonic: move probe function to .devinit.text
  can: switch carrier on if device was stopped while in bus-off state
  can: restart device even if dev_alloc_skb() fails
  can: sja1000: remove duplicated includes
  New device ID for sc92031 [1088:2031]
  3c589_cs: re-initialize the multicast in the tc589_reset
  Fix error return for setsockopt(SO_TIMESTAMPING)
  netxen: fix thermal check and shutdown
  netxen: fix deadlock on dev close
  netxen: fix context deletion sequence
  net: Micrel KS8851 SPI network driver
  tcp: Use correct peer adr when copying MD5 keys
  tcp: Fix MD5 signature checking on IPv4 mapped sockets
  ...

14 years agoMerge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
Linus Torvalds [Wed, 22 Jul 2009 16:47:49 +0000 (09:47 -0700)] 
Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  NFSv4: Fix a problem whereby a buggy server can oops the kernel
  NFSv4: Fix an NFSv4 mount regression
  NFSv4: Fix an Oops in nfs4_free_lock_state

14 years agonet: KS8851 needs to depend on MII
Alexander Beregalov [Wed, 22 Jul 2009 01:16:51 +0000 (01:16 +0000)] 
net: KS8851 needs to depend on MII

fix this build error when CONFIG_MII is not set
drivers/net/ks8851.c:999: undefined reference to `generic_mii_ioctl'
drivers/net/ks8851.c:1050: undefined reference to `mii_link_ok'
drivers/net/ks8851.c:1056: undefined reference to `mii_nway_restart'
drivers/net/ks8851.c:1044: undefined reference to `mii_ethtool_sset'
drivers/net/ks8851.c:1038: undefined reference to `mii_ethtool_gset'

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Acked-by: Ben Dooks <ben@simtec.co.uk>
14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Wed, 22 Jul 2009 16:32:12 +0000 (09:32 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: ctxfi: Swapped SURROUND-SIDE channels on emu20k2
  ALSA: ca0106 - Fix the max capture buffer size
  ALSA: hda - Fix pin-setup for Sony VAIO with STAC9872 codecs
  ALSA: hda - Add quirk for Gateway T6834c laptop
  ALSA: OSS sequencer should be initialized after snd_seq_system_client_init
  ALSA: sound/isa: convert nested spin_lock_irqsave to spin_lock
  ALSA: hda_codec: Check for invalid zero connections

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Wed, 22 Jul 2009 16:30:07 +0000 (09:30 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/hid

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: Move dereferences below a NULL test
  HID: hiddev, fix lock imbalance

14 years agoperf: fix stack data leak
Arjan van de Ven [Tue, 21 Jul 2009 07:55:05 +0000 (00:55 -0700)] 
perf: fix stack data leak

the "reserved" field was not initialized to zero, resulting in 4 bytes
of stack data leaking to userspace....

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agobe2net: Bug fix in the non-lro path. Size of received packet was not updated in stati...
Ajit Khaparde [Wed, 22 Jul 2009 16:28:55 +0000 (09:28 -0700)] 
be2net: Bug fix in the non-lro path. Size of received packet was not updated in statistics properly.

This patch fixes a bug in the non-lro path.  Wrong size of received
packet was being passed for updating receive statistics.  This patch
is against the net-2.6 git.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoucc_geth: Revive fixed link support
Anton Vorontsov [Thu, 16 Jul 2009 21:31:47 +0000 (21:31 +0000)] 
ucc_geth: Revive fixed link support

Since commit 0b9da337dca972e7a4144e298ec3adb8f244d4a4 ("Rework
ucc_geth driver to use of_mdio infrastructure") the fixed-link
support is broken.

This patch fixes the support by removing !ug_info->phy_node check,
and adds a call to of_phy_connect_fixed_link() if a phy is not attached
to the MAC.

Also, remove an old fixed-link code that we don't use any longer.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogianfar: Revive fixed link support
Anton Vorontsov [Thu, 16 Jul 2009 21:31:42 +0000 (21:31 +0000)] 
gianfar: Revive fixed link support

Since commit fe192a49118f5b1272317d60c7930ece4e13ae49 ("Rework gianfar
driver to use of_mdio infrastructure") the fixed-link support is
broken, the driver oopses at init_phy():

  Unable to handle kernel paging request for data at address 0x000000e4
  Faulting instruction address: 0xc01cf298
  Oops: Kernel access of bad area, sig: 11 [#1]
  [...]
  NIP [c01cf298] init_phy+0x80/0xdc
  LR [c01cf250] init_phy+0x38/0xdc
  Call Trace:
  [cf81fe80] [c01d1cf8] gfar_enet_open+0x6c/0x19c
  [cf81fea0] [c024494c] dev_open+0xfc/0x134
  [cf81fec0] [c0242edc] dev_change_flags+0x84/0x1ac
  [cf81fee0] [c0399ee0] ic_open_devs+0x168/0x2d8
  [cf81ff20] [c039b2e8] ip_auto_config+0x90/0x2a4
  [cf81ff60] [c0003884] do_one_initcall+0x34/0x1a8

This patch fixes the oops, and removes phy_node checks, and adds a call
to of_phy_connect_fixed_link() if a phy isn't attached..

Also, remove an old fixed-link code that we don't use any longer.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agofs_enet: Revive fixed link support
Anton Vorontsov [Thu, 16 Jul 2009 21:31:36 +0000 (21:31 +0000)] 
fs_enet: Revive fixed link support

Since commit aa73832c5a80d6c52c69b18af858d88fa595dd3c ("Rework
fs_enet driver to use of_mdio infrastructure") the fixed-link support
is broken in the fs_enet driver.

This patch fixes the support by removing a check for phy_node, and adding
a call to of_phy_connect_fixed_link().

Also set netdev parent device via SET_NETDEV_DEV() call, this is needed
so that OF MDIO core could find a node pointer for a device.

Plus, fix "if (IS_ERR(phydev))" check, in case of errors,
of_phy_connect() returns NULL, not ERR_PTR as phy_connect().

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoof/mdio: Add support function for Ethernet fixed-link property
Anton Vorontsov [Thu, 16 Jul 2009 21:31:31 +0000 (21:31 +0000)] 
of/mdio: Add support function for Ethernet fixed-link property

Fixed-link support is broken for the ucc_eth, gianfar, and fs_enet
device drivers.  The "OF MDIO rework" patches removed most of the
support. Instead of re-adding fixed-link stuff to the drivers, this
patch adds a support function for parsing the fixed-link property
and obtaining a dummy phy to match.

Note: the dummy phy handling in arch/powerpc is a bit of a hack and
needs to be reworked.  This function is being added now to solve the
regression in the Ethernet drivers, but it should be considered a
temporary measure until the fixed link handling can be reworked.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'linux-next' of git://git.infradead.org/ubi-2.6
Linus Torvalds [Wed, 22 Jul 2009 16:26:13 +0000 (09:26 -0700)] 
Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6

* 'linux-next' of git://git.infradead.org/ubi-2.6:
  UBI: fix bug in image sequence number handling
  UBI: gluebi: initialize ubi_num field

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Wed, 22 Jul 2009 16:25:31 +0000 (09:25 -0700)] 
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: atkbd - add force relese key quirk for Soltech TA12
  Input: fix EVIOCGNAME/JSIOCGNAME regression
  Input: atkbd - add forced release keys quirk for FSC Amilo Pi 3525
  Input: pcspkr - switch driver to dev_pm_ops
  Input: xpad - don't resend successfully sent outgoing requests
  Input: wistron_btns - recognize Maxdata Pro 7000 notebooks

14 years agoALSA: hda - Restore GPIO1 properly at resume with AD1984A
Takashi Iwai [Wed, 22 Jul 2009 16:15:10 +0000 (18:15 +0200)] 
ALSA: hda - Restore GPIO1 properly at resume with AD1984A

The commit 099db17e66294b02814dee01c81d9abbbeece93e introduced a
regression at suspend/resume where the GPIO1 bit isn't properly
restored, thus the speaker output gets muted initially after resume.

The fix is simple, use the cached write for storing GPIO data.

Reference: Novell bnc#522764
https://bugzilla.novell.com/show_bug.cgi?id=522764

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoperf_counter tools: Give perf top inherit option
Mike Galbraith [Tue, 21 Jul 2009 08:30:36 +0000 (10:30 +0200)] 
perf_counter tools: Give perf top inherit option

Currently, perf top -p only tracks the pid provided, which isn't very useful
for watching forky loads, so give it an inherit option.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1248165036.9795.10.camel@marge.simson.net>

14 years agoperf_counter tools: Fix vmlinux symbol generation breakage
Mike Galbraith [Mon, 20 Jul 2009 12:01:38 +0000 (14:01 +0200)] 
perf_counter tools: Fix vmlinux symbol generation breakage

vmlinux meets the criteria for symbol adjustment, which breaks vmlinux generated symbols.
Fix this by exempting vmlinux.  This is a bit fragile in that someone could change the
kernel dso's name, but currently that name is also hardwired.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1248091298.18702.18.camel@marge.simson.net>

14 years agoperf_counter: Detect debugfs location
Jason Baron [Tue, 21 Jul 2009 18:16:29 +0000 (14:16 -0400)] 
perf_counter: Detect debugfs location

If "/sys/kernel/debug" is not a debugfs mount point, search for the debugfs
filesystem in /proc/mounts, but also allows the user to specify
'--debugfs-dir=blah' or set the environment variable: 'PERF_DEBUGFS_DIR'

Signed-off-by: Jason Baron <jbaron@redhat.com>
[ also made it probe "/debug" by default ]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090721181629.GA3094@redhat.com>

14 years agoperf_counter: Add tracepoint support to perf list, perf stat
Jason Baron [Tue, 21 Jul 2009 16:20:22 +0000 (12:20 -0400)] 
perf_counter: Add tracepoint support to perf list, perf stat

Add support to 'perf list' and 'perf stat' for kernel tracepoints. The
implementation creates a 'for_each_subsystem' and 'for_each_event' for
easy iteration over the tracepoints.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <426129bf9fcc8ee63bb094cf736e7316a7dcd77a.1248190728.git.jbaron@redhat.com>

14 years agoperf symbol: C++ demangling
Arnaldo Carvalho de Melo [Mon, 20 Jul 2009 17:14:12 +0000 (14:14 -0300)] 
perf symbol: C++ demangling

[acme@doppio ~]$ perf report -s comm,dso,symbol -C firefox -d /usr/lib64/xulrunner-1.9.1/libxul.so | grep :: | head
     2.21%  [.] nsDeque::Push(void*)
     1.78%  [.] GraphWalker::DoWalk(nsDeque&)
     1.30%  [.] GCGraphBuilder::AddNode(void*, nsCycleCollectionParticipant*)
     1.27%  [.] XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode)
     1.18%  [.] imgContainer::DrawFrameTo(gfxIImageFrame*, gfxIImageFrame*, nsRect&)
     1.13%  [.] nsDeque::PopFront()
     1.11%  [.] nsGlobalWindow::RunTimeout(nsTimeout*)
     0.97%  [.] nsXPConnect::Traverse(void*, nsCycleCollectionTraversalCallback&)
     0.95%  [.] nsJSEventListener::cycleCollection::Traverse(void*, nsCycleCollectionTraversalCallback&)
     0.95%  [.] nsCOMPtr_base::~nsCOMPtr_base()
[acme@doppio ~]$

Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Suggested-by: Clark Williams <williams@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090720171412.GB10410@ghostprotocols.net>

14 years agoperf: avoid structure size confusion by using a fixed size
Arjan van de Ven [Tue, 21 Jul 2009 05:54:26 +0000 (22:54 -0700)] 
perf: avoid structure size confusion by using a fixed size

for some reason, this structure gets compiled as 36 bytes in some files
(the ones that alloacte it) but 40 bytes in others (the ones that use it).
The cause is an off_t type that gets a different size in different
compilation units for some yet-to-be-explained reason.

But the effect is disasterous; the size/offset members of the struct
are at different offsets, and result in mostly complete garbage.
The parser in perf is so robust that this all gets hidden, and after
skipping an certain amount of samples, it recovers.... so this bug
is not normally noticed.

.... except when you want every sample to be exact.

Fix this by just using an explicitly sized type.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <4A655917.9080504@linux.intel.com>

14 years agoperf_counter: Fix throttle/unthrottle event logging
Anton Blanchard [Wed, 22 Jul 2009 13:05:46 +0000 (23:05 +1000)] 
perf_counter: Fix throttle/unthrottle event logging

Right now we only print PERF_EVENT_THROTTLE + 1 (ie PERF_EVENT_UNTHROTTLE).
Fix this to print both a throttle and unthrottle event.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090722130546.GE9029@kryten>

14 years agoperf_counter: Improve perf stat and perf record option parsing
Anton Blanchard [Wed, 22 Jul 2009 13:04:12 +0000 (23:04 +1000)] 
perf_counter: Improve perf stat and perf record option parsing

perf stat and perf record currently look for all options on the command
line. This can lead to some confusion:

# perf stat ls -l
  Error: unknown switch `l'

While we can work around this by adding '--' before the command, the git
option parsing code can stop at the first non option:

# perf stat ls -l
 Performance counter stats for 'ls -l':
....

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090722130412.GD9029@kryten>

14 years agoperf_counter: PERF_SAMPLE_ID and inherited counters
Peter Zijlstra [Tue, 21 Jul 2009 11:19:40 +0000 (13:19 +0200)] 
perf_counter: PERF_SAMPLE_ID and inherited counters

Anton noted that for inherited counters the counter-id as provided by
PERF_SAMPLE_ID isn't mappable to the id found through PERF_RECORD_ID
because each inherited counter gets its own id.

His suggestion was to always return the parent counter id, since that
is the primary counter id as exposed. However, these inherited
counters have a unique identifier so that events like
PERF_EVENT_PERIOD and PERF_EVENT_THROTTLE can be specific about which
counter gets modified, which is important when trying to normalize the
sample streams.

This patch removes PERF_EVENT_PERIOD in favour of PERF_SAMPLE_PERIOD,
which is more useful anyway, since changing periods became a lot more
common than initially thought -- rendering PERF_EVENT_PERIOD the less
useful solution (also, PERF_SAMPLE_PERIOD reports the more accurate
value, since it reports the value used to trigger the overflow,
whereas PERF_EVENT_PERIOD simply reports the requested period changed,
which might only take effect on the next cycle).

This still leaves us PERF_EVENT_THROTTLE to consider, but since that
_should_ be a rare occurrence, and linking it to a primary id is the
most useful bit to diagnose the problem, we introduce a
PERF_SAMPLE_STREAM_ID, for those few cases where the full
reconstruction is important.

[Does change the ABI a little, but I see no other way out]

Suggested-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1248095846.15751.8781.camel@twins>

14 years agoperf_counter: Plug more stack leaks
Peter Zijlstra [Wed, 22 Jul 2009 09:13:50 +0000 (11:13 +0200)] 
perf_counter: Plug more stack leaks

Per example of Arjan's patch, I went through and found a few more.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
14 years agoperf: Fix stack data leak
Arjan van de Ven [Tue, 21 Jul 2009 07:55:05 +0000 (00:55 -0700)] 
perf: Fix stack data leak

the "reserved" field was not initialized to zero, resulting in 4 bytes
of stack data leaking to userspace....

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
14 years agoperf_counter: Remove unused variables
Peter Zijlstra [Wed, 22 Jul 2009 14:31:36 +0000 (16:31 +0200)] 
perf_counter: Remove unused variables

Fix a gcc unused variables warning.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
14 years agoMerge commit 'tip/perfcounters/core' into perf-counters-for-linus
Peter Zijlstra [Wed, 22 Jul 2009 16:05:48 +0000 (18:05 +0200)] 
Merge commit 'tip/perfcounters/core' into perf-counters-for-linus

14 years agofbmon: work around compiler bug in gcc-2.4.2
Linus Torvalds [Wed, 22 Jul 2009 15:49:22 +0000 (08:49 -0700)] 
fbmon: work around compiler bug in gcc-2.4.2

There's some odd bug in gcc-4.2 where it miscompiles a simple loop whent
he loop counter is of type 'unsigned char' and it should count to 128.

The compiler will incorrectly decide that a trivial loop like this:

unsigned char i, ...

for (i = 0; i < 128; i++) {
..

is endless, and will compile it to a single instruction that just
branches to itself.

This was triggered by the addition of '-fno-strict-overflow', and we
could play games with compiler versions and go back to '-fwrapv'
instead, but the trivial way to avoid it is to just make the loop
induction variable be an 'int' instead.

Thanks to Krzysztof Oledzki for reporting and testing and to Troy Moure
for digging through assembler differences and finding it.

Reported-and-tested-by: Krzysztof Oledzki <olel@ans.pl>
Found-by: Troy Moure <twmoure@szypr.net>
Gcc-bug-acked-by: Ian Lance Taylor <iant@google.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoALSA: ctxfi - Fix uninitialized error checks
Takashi Iwai [Wed, 22 Jul 2009 15:05:15 +0000 (17:05 +0200)] 
ALSA: ctxfi - Fix uninitialized error checks

Fix a few uninitialized error checks that were introduced recently
mistakenlly during the clean-up:
  sound/pci/ctxfi/ctamixer.c: In function ‘get_amixer_rsc’:
  sound/pci/ctxfi/ctamixer.c:261: warning: ‘err’ may be used uninitialized in this function
  sound/pci/ctxfi/ctamixer.c: In function ‘get_sum_rsc’:
  sound/pci/ctxfi/ctamixer.c:415: warning: ‘err’ may be used uninitialized in this function
  sound/pci/ctxfi/ctsrc.c: In function ‘get_srcimp_rsc’:
  sound/pci/ctxfi/ctsrc.c:742: warning: ‘err’ may be used uninitialized in this function

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agosoftirq: introduce tasklet_hrtimer infrastructure
Peter Zijlstra [Wed, 22 Jul 2009 12:18:35 +0000 (14:18 +0200)] 
softirq: introduce tasklet_hrtimer infrastructure

commit ca109491f (hrtimer: removing all ur callback modes) moved all
hrtimer callbacks into hard interrupt context when high resolution
timers are active. That breaks code which relied on the assumption
that the callback happens in softirq context.

Provide a generic infrastructure which combines tasklets and hrtimers
together to provide an in-softirq hrtimer experience.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: torvalds@linux-foundation.org
Cc: kaber@trash.net
Cc: David Miller <davem@davemloft.net>
LKML-Reference: <1248265724.27058.1366.camel@twins>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
14 years agoBtrfs: make sure all dirty blocks are written at commit time
Yan Zheng [Wed, 22 Jul 2009 14:07:05 +0000 (10:07 -0400)] 
Btrfs: make sure all dirty blocks are written at commit time

Write dirty block groups may allocate new block, and so may add new delayed
back ref. btrfs_run_delayed_refs may make some block groups dirty.

commit_cowonly_roots does not handle the recursion properly, and some dirty
blocks can be left unwritten at commit time. This patch moves
btrfs_run_delayed_refs into the loop that writes dirty block groups, and makes
the code not break out of the loop until there are no dirty block groups or
delayed back refs.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoALSA: hda - Use snprintf() to be safer
Takashi Iwai [Wed, 22 Jul 2009 14:02:46 +0000 (16:02 +0200)] 
ALSA: hda - Use snprintf() to be safer

Use snprint() for creating the jack name string instead of sprintf()
in patch_sigmatel.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoBtrfs: fix locking issue in btrfs_find_next_key
Yan Zheng [Wed, 22 Jul 2009 13:59:00 +0000 (09:59 -0400)] 
Btrfs: fix locking issue in btrfs_find_next_key

When walking up the tree, btrfs_find_next_key assumes the upper level tree
block is properly locked. This isn't always true even path->keep_locks is 1.
This is because btrfs_find_next_key may advance path->slots[] several times
instead of only once.

When 'path->slots[level] >= btrfs_header_nritems(path->nodes[level])' is found,
we can't guarantee the original value of 'path->slots[level]' is
'btrfs_header_nritems(path->nodes[level]) - 1'. If it's not, the tree block at
'level + 1' isn't locked.

This patch fixes the issue by explicitly checking the locking state,
re-searching the tree if it's not locked.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: fix double increment of path->slots[0] in btrfs_next_leaf
Yan Zheng [Wed, 22 Jul 2009 13:59:00 +0000 (09:59 -0400)] 
Btrfs: fix double increment of path->slots[0] in btrfs_next_leaf

if 1 is returned by btrfs_search_slot, the path already points to the
first item with 'key > searching key'. So increasing path->slots[0] by
one is superfluous in that case.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: properly update space information after shrinking device.
Yan Zheng [Wed, 22 Jul 2009 13:59:00 +0000 (09:59 -0400)] 
Btrfs: properly update space information after shrinking device.

Change 'goto done' to 'break' for the case of all device extents have
been freed, so that the code updates space information will be execute.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: fix definition of struct btrfs_extent_inline_ref
Yan Zheng [Wed, 22 Jul 2009 13:59:00 +0000 (09:59 -0400)] 
Btrfs: fix definition of struct btrfs_extent_inline_ref

use __le64 instead of u64 in on-disk structure definition.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoALSA: usb-audio - Volume control quirk for QuickCam E 3500
Alexey Fisher [Wed, 22 Jul 2009 12:57:54 +0000 (14:57 +0200)] 
ALSA: usb-audio - Volume control quirk for QuickCam E 3500

- E3500 report cval->max more than it actually can handel, so if you
set 95% capture level it will be silently muted.
- Betwen cval->min and cval-max(real) is 2940 control units,
but real are only 7 with cval->res = 384.
- Alsa can't handel less than 10 controls, so make it more
and set cval->res = 192.

Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoALSA: pcm - Fix regressions with VMware
Takashi Iwai [Wed, 22 Jul 2009 10:51:51 +0000 (12:51 +0200)] 
ALSA: pcm - Fix regressions with VMware

VMware tends to report PCM positions and period updates at utterly
wrong timing.  This screws up the recent PCM core code that tries
to correct the position based on the irq timing.

Now, when a backward irq position is detected, skip the update
instead of rebasing.  (This is almost the old behavior before
2.6.30.)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agox86, mce: Rename incorrect macro name "CONFIG_X86_THRESHOLD"
Hidehiro Kawai [Wed, 22 Jul 2009 02:56:20 +0000 (11:56 +0900)] 
x86, mce: Rename incorrect macro name "CONFIG_X86_THRESHOLD"

CONFIG_X86_THRESHOLD used in arch/x86/kernel/irqinit.c is always
undefined.  Rename it to the correct name "CONFIG_X86_MCE_THRESHOLD".

Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Reviewed-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Andi Kleen <andi@firstfloor.org>
LKML-Reference: <4A667FD4.3010509@hitachi.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
14 years agosky2: Avoid races in sky2_down
Mike McCormack [Wed, 22 Jul 2009 03:57:56 +0000 (20:57 -0700)] 
sky2: Avoid races in sky2_down

Reset rx chain before trying to drain it.
Shut interrupts off last, incase there's something to report.

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoide-tape: Don't leak kernel stack information
Michael Buesch [Sun, 19 Jul 2009 09:15:19 +0000 (09:15 +0000)] 
ide-tape: Don't leak kernel stack information

Don't leak kernel stack information through uninitialized structure members.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Borislav Petkov <petkovbb@gmail.com>.
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoide: fix memory leak when flush command is issued
Maxime Bizon [Thu, 16 Jul 2009 06:32:52 +0000 (06:32 +0000)] 
ide: fix memory leak when flush command is issued

I'm using ide on 2.6.30.1 with xfs filesystem. I noticed a kernel memory
leak after writing lots of data, the kmalloc-96 slab cache keeps
growing. It seems the struct ide_cmd kmalloced by idedisk_prepare_flush
is never kfreed.

Commit a09485df9cda49fbde2766c86eb18a9cae585162 ("ide: move request
type specific code from ide_end_drive_cmd() to callers (v3)") and
f505d49ffd25ed062e76ffd17568d3937fcd338c ("ide: fix barriers support")
cause this regression, cmd->rq must now be set for ide_complete_cmd to
honor the IDE_TFLAG_DYN flag.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoNFSv4: Fix a problem whereby a buggy server can oops the kernel
Trond Myklebust [Tue, 21 Jul 2009 23:22:38 +0000 (19:22 -0400)] 
NFSv4: Fix a problem whereby a buggy server can oops the kernel

We just had a case in which a buggy server occasionally returns the wrong
attributes during an OPEN call. While the client does catch this sort of
condition in nfs4_open_done(), and causes the nfs4_atomic_open() to return
-EISDIR, the logic in nfs_atomic_lookup() is broken, since it causes a
fallback to an ordinary lookup instead of just returning the error.

When the buggy server then returns a regular file for the fallback lookup,
the VFS allows the open, and bad things start to happen, since the open
file doesn't have any associated NFSv4 state.

The fix is firstly to return the EISDIR/ENOTDIR errors immediately, and
secondly to ensure that we are always careful when dereferencing the
nfs_open_context state pointer.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agox86-64: Fix bad_srat() to clear all state
Andi Kleen [Sat, 18 Jul 2009 06:56:57 +0000 (08:56 +0200)] 
x86-64: Fix bad_srat() to clear all state

Need to clear both nodes and nodes_add state for start/end.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <20090718065657.GA2898@basil.fritz.box>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: stable@kernel.org
14 years agoNFSv4: Fix an NFSv4 mount regression
Trond Myklebust [Tue, 21 Jul 2009 20:48:07 +0000 (16:48 -0400)] 
NFSv4: Fix an NFSv4 mount regression

Commit 008f55d0e019943323c20a03493a2ba5672a4cc8 (nfs41: recover lease in
_nfs4_lookup_root) forces the state manager to always run on mount. This is
a bug in the case of NFSv4.0, which doesn't require us to send a
setclientid until we want to grab file state.

In any case, this is completely the wrong place to be doing state
management. Moving that code into nfs4_init_session...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agoNFSv4: Fix an Oops in nfs4_free_lock_state
Trond Myklebust [Tue, 21 Jul 2009 20:47:46 +0000 (16:47 -0400)] 
NFSv4: Fix an Oops in nfs4_free_lock_state

The oops http://www.kerneloops.org/raw.php?rawid=537858&msgid= appears to
be due to the nfs4_lock_state->ls_state field being uninitialised. This
happens if the call to nfs4_free_lock_state() is triggered at the end of
nfs4_get_lock_state().

The fix is to move the initialisation of ls_state into the allocator.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agodrivers/net/mlx4: Adjust constant
Julia Lawall [Sun, 19 Jul 2009 06:09:25 +0000 (06:09 +0000)] 
drivers/net/mlx4: Adjust constant

The values in the advertising field are typically ADVERTISED_xxx, not
SUPPORTED_xxx.  Both SUPPORTED_10000baseT_Full and
ADVERTISED_1000baseT_Full have the same value.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
struct ethtool_cmd E;
@@
*E.advertising = SUPPORTED_10000baseT_Full
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net: Move a dereference below a NULL test
Julia Lawall [Sun, 19 Jul 2009 05:26:35 +0000 (05:26 +0000)] 
drivers/net: Move a dereference below a NULL test

If the NULL test is necessary, then the dereference should be moved below
the NULL test.

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

// <smpl>
@@
type T;
expression E,E1;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E=E1
      when != i
  if (E == NULL||...) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net: Move a dereference below a NULL test
Julia Lawall [Sun, 19 Jul 2009 06:13:04 +0000 (06:13 +0000)] 
drivers/net: Move a dereference below a NULL test

If the NULL test is necessary, then the dereferences should be moved below
the NULL test.

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

// <smpl>
@@
type T;
expression E,E1;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E=E1
      when != i
  BUG_ON (E == NULL||...);
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agolibertas: Fix problem with broken V4 firmware on CF8381
Marek Vasut [Thu, 16 Jul 2009 17:19:53 +0000 (19:19 +0200)] 
libertas: Fix problem with broken V4 firmware on CF8381

Firmware V4 on CF8381 reports region code shifted by 1 byte to left.
The following patch checks for this and handles it properly.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath: add support for special 0x8000 regulatory domain
Luis R. Rodriguez [Mon, 20 Jul 2009 15:32:47 +0000 (08:32 -0700)] 
ath: add support for special 0x8000 regulatory domain

Two users of ar9170 devices have now reported their cards
have been programmed with a regulatory domain of 0x8000.
This is not a valid regulatory domain as such these users were
unable to use these devices. Since this doesn't seem to be
a device EEPROM corruption we must treat it specially. It
may have been possible the manufacturer intended to use 0x0
as the regulatory domain and that would ultimately yield
to US but since we cannot get confirmationf or this we
default this special case to one of our world regulatory
domains, specifically 0x64.

Reported-by: DavidFreeman on #linux-wireless
Reported-by: Joerg Albert <jal2@gmx.de>
Cc: Christian Lamparter <chunkeey@web.de>,
Cc: Stephen Chen <stephen.chen@atheros.com>
Cc: David Quan <david.quan@atheros.com>
Cc: Tony Yang <tony.yang@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>