]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
13 years agoMerge branch 'fix/misc' into for-next
Takashi Iwai [Mon, 22 Nov 2010 07:59:31 +0000 (08:59 +0100)]
Merge branch 'fix/misc' into for-next

13 years agoALSA: atmel - Fix the return value in error path
Takashi Iwai [Mon, 22 Nov 2010 07:58:13 +0000 (08:58 +0100)]
ALSA: atmel - Fix the return value in error path

In the commit 5ad57d20c91bdaf743bd8e3015df5a388314df8d
    ALSA: snd-atmel-abdac: test wrong variable
the return value via PTR_ERR() had to be fixed as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'topic/misc' into for-next
Takashi Iwai [Mon, 22 Nov 2010 07:16:08 +0000 (08:16 +0100)]
Merge branch 'topic/misc' into for-next

13 years agoALSA: timer: automatically load the high-resolution timer
Clemens Ladisch [Thu, 18 Nov 2010 08:53:54 +0000 (09:53 +0100)]
ALSA: timer: automatically load the high-resolution timer

Increase the default timer limit so that snd-hrtimer.ko can be
automatically loaded when needed, e.g., when used as the default
sequencer timer.  This replaces the check for the obsolete
CONFIG_SND_HPET.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: pcm: optimize xrun detection in no-period-wakeup mode
Clemens Ladisch [Thu, 18 Nov 2010 08:53:07 +0000 (09:53 +0100)]
ALSA: pcm: optimize xrun detection in no-period-wakeup mode

Add a lightweight condition on top of the xrun checking so that we can
avoid the division when the application is calling the update function
often enough.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: pcm: detect xruns in no-period-wakeup mode
Clemens Ladisch [Thu, 18 Nov 2010 08:43:52 +0000 (09:43 +0100)]
ALSA: pcm: detect xruns in no-period-wakeup mode

When period wakeups are disabled, successive calls to the pointer update
function do not have a maximum allowed distance, so xruns cannot be
detected with the pointer value only.

To detect xruns, compare the actually elapsed time with the time that
should have theoretically elapsed since the last update.  When the
hardware pointer has wrapped around due to an xrun, the actually elapsed
time will be too big by about hw_ptr_buffer_jiffies.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: oxygen: support for period wakeup disabling
Clemens Ladisch [Mon, 15 Nov 2010 09:50:37 +0000 (10:50 +0100)]
ALSA: oxygen: support for period wakeup disabling

Allow disabling period wakeup interrupts for all PCM streams.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: hda-intel: support for period wakeup disabling
Clemens Ladisch [Mon, 15 Nov 2010 09:49:47 +0000 (10:49 +0100)]
ALSA: hda-intel: support for period wakeup disabling

Allow disabling period wakeup interrupts for HDA PCM streams.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: pcm: support for period wakeup disabling
Clemens Ladisch [Mon, 15 Nov 2010 09:46:23 +0000 (10:46 +0100)]
ALSA: pcm: support for period wakeup disabling

This patch allows to disable period interrupts which are
not needed when the application relies on a system timer
to wake-up and refill the ring buffer. The behavior of
the driver is left unchanged, and interrupts are only
disabled if the application requests this configuration.
The behavior in case of underruns is slightly different,
instead of being detected during the period interrupts the
underruns are detected when the application calls
snd_pcm_update_avail, which in turns forces a refresh of the
hw pointer and shows the buffer is empty.

More specifically this patch makes a lot of sense when
PulseAudio relies on timer-based scheduling to access audio
devices such as HDAudio or Intel SST. Disabling interrupts
removes two unwanted wake-ups due to period elapsed events
in low-power playback modes. It also simplifies PulseAudio
voice modules used for speech calls.

To quote Lennart "This patch looks very interesting and
desirable. This is something have long been waiting for."

Support for this in hardware drivers is optional.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'fix/misc' into topic/misc
Takashi Iwai [Mon, 22 Nov 2010 07:11:10 +0000 (08:11 +0100)]
Merge branch 'fix/misc' into topic/misc

13 years agoMerge branch 'fix/misc' into for-next
Takashi Iwai [Mon, 22 Nov 2010 07:03:27 +0000 (08:03 +0100)]
Merge branch 'fix/misc' into for-next

13 years agoALSA: hda: Use hp-laptop quirk to enable headphones automute for Asus A52J
Daniel T Chen [Sun, 21 Nov 2010 19:01:14 +0000 (14:01 -0500)]
ALSA: hda: Use hp-laptop quirk to enable headphones automute for Asus A52J

BugLink: https://launchpad.net/bugs/677652
The original reporter states that, in 2.6.35, headphones do not appear
to work, nor does inserting them mute the A52J's onboard speakers.  Upon
inspecting the codec dump, it appears that the newly committed hp-laptop
quirk will suffice to enable this basic functionality.  Testing was done
with an alsa-driver build from 2010-11-21.

Reported-and-tested-by: Joan Creus
Cc: <stable@kernel.org> [2.6.35+]
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: snd-atmel-abdac: test wrong variable
Vasiliy Kulikov [Sun, 21 Nov 2010 17:40:07 +0000 (20:40 +0300)]
ALSA: snd-atmel-abdac: test wrong variable

After clk_get() pclk is checked second time instead of sample_clk check.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: azt3328: period bug fix (for PA), add missing ACK on stop timer
Andreas Mohr [Sun, 21 Nov 2010 11:09:32 +0000 (12:09 +0100)]
ALSA: azt3328: period bug fix (for PA), add missing ACK on stop timer

. Fix PulseAudio "ALSA driver bug" issue
  (if we have two alternated areas within a 64k DMA buffer, then max
  period size should obviously be 32k only).
  Back references:
   http://pulseaudio.org/wiki/AlsaIssues
   http://fedoraproject.org/wiki/Features/GlitchFreeAudio
. In stop timer function, need to supply ACK in the timer control byte.
. Minor log output correction

When I did my first PA testing recently, the period size bug resulted
in quite precisely observeable half-period-based playback distortion.

PA-based operation is quite a bit more underrun-prone (despite its
zero-copy optimizations etc.) than raw ALSA with this rather spartan
sound hardware implementation on my puny Athlon.

Note that even with this patch, azt3328 still doesn't work for both
cases yet, PA tsched=0 and tsched
(on tsched=0 it will playback tiny fragments of periods, leading to tiny
stuttering sounds with some pauses in between, whereas with
timer-scheduled operation playback works fine - minus some quite increased
underrun trouble on PA vs. ALSA, that is).

Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: hda: Add Samsung R720 SSID for subwoofer pin fixup
Daniel T Chen [Sat, 20 Nov 2010 15:20:35 +0000 (10:20 -0500)]
ALSA: hda: Add Samsung R720 SSID for subwoofer pin fixup

BugLink: https://launchpad.net/bugs/677830
The original reporter states that the subwoofer does not mute when
inserting headphones.  We need an entry for his machine's SSID in the
subwoofer pin fixup list, so add it there (verified using hda_analyzer).

Reported-and-tested-by: i-NoD
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: HDA: Create mixers on ALC887
David Henningsson [Tue, 9 Nov 2010 13:35:30 +0000 (14:35 +0100)]
ALSA: HDA: Create mixers on ALC887

BugLink: http://launchpad.net/bugs/669092
ALC887 does not have any volume control ability on the mixer NIDs,
so put the volume controls on the dac NIDs instead. Without this
patch, ALC887 users cannot use alsamixer at all.

Cc: stable@kernel.org
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: sound/pci/asihpi/hpioctl.c: Remove unnecessary casts of pci_get_drvdata
Joe Perches [Mon, 15 Nov 2010 20:14:02 +0000 (12:14 -0800)]
ALSA: sound/pci/asihpi/hpioctl.c: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: sound/core/pcm_lib.c: Remove unnecessary semicolons
Joe Perches [Mon, 15 Nov 2010 03:05:02 +0000 (19:05 -0800)]
ALSA: sound/core/pcm_lib.c: Remove unnecessary semicolons

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: sound/ppc: Use printf extension %pR for struct resource
Joe Perches [Fri, 12 Nov 2010 21:38:04 +0000 (13:38 -0800)]
ALSA: sound/ppc: Use printf extension %pR for struct resource

Using %pR standardizes the struct resource output.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: ac97: Apply quirk for Dell Latitude D610 binding Master and Headphone controls
Daniel T Chen [Mon, 1 Nov 2010 05:14:51 +0000 (01:14 -0400)]
ALSA: ac97: Apply quirk for Dell Latitude D610 binding Master and Headphone controls

BugLink: https://launchpad.net/bugs/669279
The original reporter states: "The Master mixer does not change the
volume from the headphone output (which is affected by the headphone
mixer). Instead it only seems to control the on-board speaker volume.
This confuses PulseAudio greatly as the Master channel is merged into
the volume mix."

Fix this symptom by applying the hp_only quirk for the reporter's SSID.
The fix is applicable to all stable kernels.

Reported-and-tested-by: Ben Gamari <bgamari@gmail.com>
Cc: <stable@kernel.org> [2.6.32+]
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'fix/misc' into for-next
Takashi Iwai [Thu, 11 Nov 2010 01:03:52 +0000 (02:03 +0100)]
Merge branch 'fix/misc' into for-next

13 years agoALSA: AT73C213: Rectify misleading comment.
Peter Rosin [Wed, 10 Nov 2010 14:55:05 +0000 (15:55 +0100)]
ALSA: AT73C213: Rectify misleading comment.

The Atmel SSC can divide by even numbers, not only powers of two.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: sound/pci/ctxfi/ctpcm.c: Remove potential for use after free
Julia Lawall [Tue, 9 Nov 2010 22:00:41 +0000 (23:00 +0100)]
ALSA: sound/pci/ctxfi/ctpcm.c: Remove potential for use after free

In each function, the value apcm is stored in the private_data field of
runtime.  At the same time the function ct_atc_pcm_free_substream is stored
in the private_free field of the same structure.  ct_atc_pcm_free_substream
dereferences and ultimately frees the value in the private_data field.  But
each function can exit in an error case with apcm having been freed, in
which case a subsequent call to the private_free function would perform a
dereference after free.  On the other hand, if the private_free field is
not initialized, it is NULL, and not invoked (see snd_pcm_detach_substream
in sound/core/pcm.c).  To avoid the introduction of a dangling pointer, the
initializations of the private_data and private_free fields are moved to
the end of the function, past any possible free of apcm.  This is safe
because the previous calls to snd_pcm_hw_constraint_integer and
snd_pcm_hw_constraint_minmax, which take runtime as an argument, do not
refer to either of these fields.

In each function, there is one error case where apcm needs to be freed, and
a call to kfree is added.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e,e1,e2,e3;
identifier f,free1,free2;
expression a;
@@

*e->f = a
... when != e->f = e1
    when any
if (...) {
  ... when != free1(...,e,...)
      when != e->f = e2
* kfree(a)
  ... when != free2(...,e,...)
      when != e->f = e3
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: sound/mixart: avoid redefining {readl,write}_{le,be} accessors
Florian Fainelli [Tue, 9 Nov 2010 17:29:08 +0000 (18:29 +0100)]
ALSA: sound/mixart: avoid redefining {readl,write}_{le,be} accessors

If the platform already provides a definition for these accessors
do not redefine them. The warning was caught on MIPS.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: HDA: Enable digital mic on IDT 92HD87B
David Henningsson [Wed, 13 Oct 2010 13:48:24 +0000 (15:48 +0200)]
ALSA: HDA: Enable digital mic on IDT 92HD87B

BugLink: http://launchpad.net/bugs/673075
According to the datasheet of 92HD87B, there is a digital mic
at nid 0x11, so enable it in order to be able to use the mic.

Cc: stable@kernel.org
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agosound/oss: Remove unnecessary casts of void ptr
Jesper Juhl [Mon, 8 Nov 2010 23:11:03 +0000 (00:11 +0100)]
sound/oss: Remove unnecessary casts of void ptr

The [vk][cmz]alloc(_node) family of functions return void pointers which
it's completely unnecessary/pointless to cast to other pointer types since
that happens implicitly.

This patch removes such casts from sound/oss/

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agosound/oss/dev_table.c: Use vzalloc
Joe Perches [Fri, 5 Nov 2010 03:08:12 +0000 (20:08 -0700)]
sound/oss/dev_table.c: Use vzalloc

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'for-linus' into for-next
Takashi Iwai [Wed, 3 Nov 2010 14:55:44 +0000 (15:55 +0100)]
Merge branch 'for-linus' into for-next

13 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Wed, 3 Nov 2010 14:51:26 +0000 (15:51 +0100)]
Merge branch 'fix/asoc' into for-linus

13 years agoMerge branch 'fix/asoc' into for-next
Takashi Iwai [Wed, 3 Nov 2010 14:51:08 +0000 (15:51 +0100)]
Merge branch 'fix/asoc' into for-next

13 years agoASoC: tpa6130a2: Get rid of compile warning from tpa6130a2_power
Jarkko Nikula [Wed, 3 Nov 2010 14:39:00 +0000 (16:39 +0200)]
ASoC: tpa6130a2: Get rid of compile warning from tpa6130a2_power

Patch "ASoC: tpa6130a2: Fix unbalanced regulator disables" introduced a
compiler warning "‘ret’ may be used uninitialized in this function".
Initialize ret to zero to get rid of it and making sure that the function
does not return any random error code when the code is falling through.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'topic/misc' into for-next
Takashi Iwai [Wed, 3 Nov 2010 13:58:11 +0000 (14:58 +0100)]
Merge branch 'topic/misc' into for-next

13 years agoALSA: oxygen: add HiFier Serenade support
Clemens Ladisch [Wed, 3 Nov 2010 11:26:35 +0000 (12:26 +0100)]
ALSA: oxygen: add HiFier Serenade support

Add support for the TempoTec/MediaTek HiFier Serenade sound card.

The PCI ID was already there, but the driver handled it like the
Fantasia model, which resulted in a dummy recording device.  As
a stereo output-only card, this model is to be handled exactly
like the HG2PCI.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: oxygen: reorganize PCI IDs
Clemens Ladisch [Wed, 3 Nov 2010 10:36:33 +0000 (11:36 +0100)]
ALSA: oxygen: reorganize PCI IDs

Sort the PCI IDs so that they make logical sense.  Also move the card
name comments into this list because the model symbols should be (more)
self-explanationary.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'fix/asoc' into for-next
Takashi Iwai [Wed, 3 Nov 2010 12:56:24 +0000 (13:56 +0100)]
Merge branch 'fix/asoc' into for-next

13 years agoMerge branch 'for-2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc...
Takashi Iwai [Wed, 3 Nov 2010 12:56:08 +0000 (13:56 +0100)]
Merge branch 'for-2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into fix/asoc

13 years agoMerge branch 'topic/misc' into for-next
Takashi Iwai [Wed, 3 Nov 2010 07:27:50 +0000 (08:27 +0100)]
Merge branch 'topic/misc' into for-next

13 years agoALSA: oxygen: add Kuroutoshikou CMI8787-HG2PCI support
Clemens Ladisch [Tue, 2 Nov 2010 16:18:23 +0000 (17:18 +0100)]
ALSA: oxygen: add Kuroutoshikou CMI8787-HG2PCI support

Add support for the Kuroutoshikou CMI8787-HG2PCI sound card.

[replaced non-latin letters in the patch by tiwai]

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: oxygen: merge HiFier driver into snd-oxygen
Clemens Ladisch [Tue, 2 Nov 2010 16:08:37 +0000 (17:08 +0100)]
ALSA: oxygen: merge HiFier driver into snd-oxygen

The snd-hifier driver contains more duplicated code than model-specific
code, so it does not make sense for it to be a separate driver.
Handling the two-channel output restriction can be easily done in the
generic driver.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'fix/misc' into topic/misc
Takashi Iwai [Wed, 3 Nov 2010 07:17:18 +0000 (08:17 +0100)]
Merge branch 'fix/misc' into topic/misc

13 years agoMerge branch 'fix/misc' into for-next
Takashi Iwai [Wed, 3 Nov 2010 07:16:16 +0000 (08:16 +0100)]
Merge branch 'fix/misc' into for-next

13 years agoALSA: hda - MacBookAir3,1(3,2) alsa support
Edgar (gimli) Hucek [Wed, 3 Nov 2010 07:14:10 +0000 (08:14 +0100)]
ALSA: hda - MacBookAir3,1(3,2) alsa support

This patch add support for the MacBookAir3,1 and MacBookAir3,2 to the alsa
sound system.

Signed-off-by: Edgar (gimli) Hucek <gimli@dark-green.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'topic/asoc' into for-next
Takashi Iwai [Tue, 2 Nov 2010 15:05:11 +0000 (16:05 +0100)]
Merge branch 'topic/asoc' into for-next

13 years agoMerge branch 'fix/asoc' into for-next
Takashi Iwai [Tue, 2 Nov 2010 15:04:53 +0000 (16:04 +0100)]
Merge branch 'fix/asoc' into for-next

13 years agoMerge branch 'for-2.6.37' into HEAD
Mark Brown [Tue, 2 Nov 2010 13:58:49 +0000 (09:58 -0400)]
Merge branch 'for-2.6.37' into HEAD

WARN() fix from Joe moved.

Conflicts:
sound/soc/codecs/wm_hubs.c

13 years agoMerge commit 'v2.6.37-rc1' into for-2.6.37
Mark Brown [Tue, 2 Nov 2010 13:41:56 +0000 (09:41 -0400)]
Merge commit 'v2.6.37-rc1' into for-2.6.37

13 years agoMerge branch 'fix/asoc' into for-next
Takashi Iwai [Tue, 2 Nov 2010 13:34:30 +0000 (14:34 +0100)]
Merge branch 'fix/asoc' into for-next

13 years agoASoC: fix the building issue of missing codec field in 'struct snd_soc_card'
Eric Miao [Mon, 1 Nov 2010 21:10:07 +0000 (05:10 +0800)]
ASoC: fix the building issue of missing codec field in 'struct snd_soc_card'

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'fix/misc' into for-next
Takashi Iwai [Tue, 2 Nov 2010 11:41:16 +0000 (12:41 +0100)]
Merge branch 'fix/misc' into for-next

13 years agoALSA: usb-audio - Support for Power/Status LED on Creative USB X-Fi S51
Mandar Joshi [Tue, 2 Nov 2010 14:43:19 +0000 (14:43 +0000)]
ALSA: usb-audio - Support for Power/Status LED on Creative USB X-Fi S51

This patch adds support for Power/Status LED on Creative USB X-Fi S51.
There is just one LED on the device. The LED can either be On or it
can be set to Blink. There doesn't seem to be a way to switch it off.
The control message to change LED status is similar to that of
audigy2nx except that the index is to be set to 0 and value is 1 for
Blink and 0 for On.

The 'Power LED' control in alsamixer when muted will cause the LED to
Blink continuously. When unmuted  the LED will stay On. The Creative
driver under Windows sets the LED to blink whenever audio is muted.
This LED can be treated as the CMSS LED but I figured since there is
just one LED, it should be treated as the Power LED. Is that alright?

I've also changed the comment "Usb X-Fi" to "Usb X-Fi S51" as there
are other external X-Fi devices from Creative like Usb X-Fi Go and
Xmod. The volume knob and LED support patch doesn't apply to them.

Signed-off-by: Mandar Joshi <emailmandar@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'fix/misc' into for-next
Takashi Iwai [Tue, 2 Nov 2010 06:38:46 +0000 (07:38 +0100)]
Merge branch 'fix/misc' into for-next

13 years agoALSA: asihpi - Unsafe memory management when allocating control cache
Jesper Juhl [Fri, 29 Oct 2010 19:35:25 +0000 (21:35 +0200)]
ALSA: asihpi - Unsafe memory management when allocating control cache

I noticed that sound/pci/asihpi/hpicmn.c::hpi_alloc_control_cache() does
not check the return value from kmalloc(), which may fail.
If kmalloc() fails we'll dereference a null pointer and things will go bad
fast.
There are two memory allocations in that function and there's also the
problem that the first may succeed and the second may fail and nothing is
done about that either which will also go wrong down the line.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Eliot Blennerhassett <linux@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoASoC: Update WARN uses in wm_hubs
Joe Perches [Sat, 30 Oct 2010 21:08:56 +0000 (14:08 -0700)]
ASoC: Update WARN uses in wm_hubs

Add missing newlines.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Fix SND_SOC_ALL_CODECS typo for alc5623
Jarkko Nikula [Fri, 29 Oct 2010 13:47:44 +0000 (16:47 +0300)]
ASoC: Fix SND_SOC_ALL_CODECS typo for alc5623

Include alc5623.c in SND_SOC_ALL_CODECS when dependencies are met.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'for-2.6.37' into for-2.6.38
Mark Brown [Mon, 1 Nov 2010 17:58:18 +0000 (13:58 -0400)]
Merge branch 'for-2.6.37' into for-2.6.38

13 years agoASoC: Include cx20442 to SND_SOC_ALL_CODECS
Jarkko Nikula [Fri, 29 Oct 2010 13:47:45 +0000 (16:47 +0300)]
ASoC: Include cx20442 to SND_SOC_ALL_CODECS

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Fix SND_SOC_ALL_CODECS typo for jz4740
Jarkko Nikula [Fri, 29 Oct 2010 13:47:44 +0000 (16:47 +0300)]
ASoC: Fix SND_SOC_ALL_CODECS typo for jz4740

Include jz4740.c to SND_SOC_ALL_CODECS when the dependencies are met.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Remove volatility from WM8900 POWER1 register
Mark Brown [Fri, 29 Oct 2010 22:41:17 +0000 (15:41 -0700)]
ASoC: Remove volatility from WM8900 POWER1 register

Not all bits can be read back from POWER1 so avoid corruption when using
a read/modify/write cycle by marking it non-volatile - the only thing we
read back from it is the chip revision which has diagnostic value only.
We can re-add later but that's a more invasive change than is suitable
for a bugfix.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
13 years agoLinux 2.6.37-rc1 v2.6.37-rc1
Linus Torvalds [Mon, 1 Nov 2010 11:54:12 +0000 (07:54 -0400)]
Linux 2.6.37-rc1

13 years agoMerge branch 'for-linus' of git://www.jni.nu/cris
Linus Torvalds [Mon, 1 Nov 2010 11:53:19 +0000 (07:53 -0400)]
Merge branch 'for-linus' of git://www.jni.nu/cris

* 'for-linus' of git://www.jni.nu/cris:
  CRIS: Add paths for CRISv10 serial driver
  CRIS: Fix RS485 delay handling.
  Add missing "struct" to in sizeof.

13 years agoMerge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Mon, 1 Nov 2010 11:50:43 +0000 (07:50 -0400)]
Merge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6

* 'next-spi' of git://git.secretlab.ca/git/linux-2.6:
  spi/pl022: fix erroneous platform data in U300
  spi: fixed odd static string conventions in core code
  spi/bfin_spi: only request GPIO on first load
  spi/bfin_spi: handle error/status changes after data interrupts
  spi: enable spi_board_info to be registered after spi_master

13 years agoCRIS: Add paths for CRISv10 serial driver
Jesper Nilsson [Mon, 1 Nov 2010 10:01:14 +0000 (11:01 +0100)]
CRIS: Add paths for CRISv10 serial driver

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
13 years agoMerge branch 'topic/misc' into for-next
Takashi Iwai [Mon, 1 Nov 2010 09:42:57 +0000 (10:42 +0100)]
Merge branch 'topic/misc' into for-next

13 years agoALSA: lx6464es - make 1 bit signed bitfield unsigned
Tim Blechmann [Sun, 31 Oct 2010 18:46:19 +0000 (19:46 +0100)]
ALSA: lx6464es - make 1 bit signed bitfield unsigned

converts a 1 bit signed bitfield to an unsigned.

Reported-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: cs46xx memory management fixes for cs46xx_dsp_spos_create()
Jesper Juhl [Fri, 29 Oct 2010 20:54:45 +0000 (22:54 +0200)]
ALSA: cs46xx memory management fixes for cs46xx_dsp_spos_create()

When reading through sound/pci/cs46xx/dsp_spos.c I noticed a couple of
things in cs46xx_dsp_spos_create().

It seems to me that we don't always free the various memory buffers we
allocate and we also do some work (structure member assignment) early,
that is completely pointless if some of the memory allocations fail and
we end up just aborting the whole thing.

I don't have hardware to test, so the patch below is compile tested only,
but it makes the following changes:

- Make sure we always free all allocated memory on failures.
- Don't do pointless work assigning to structure members before we know
  all memory allocations, that may abort progress, have completed
  successfully.
- Remove some trailing whitespace.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: usb - driver neglects kmalloc return value check and may deref NULL
Jesper Juhl [Fri, 29 Oct 2010 18:40:23 +0000 (20:40 +0200)]
ALSA: usb - driver neglects kmalloc return value check and may deref NULL

sound/usb/pcm.c::snd_usb_pcm_check_knot() fails to check the return value
from kmalloc() and may end up dereferencing a null pointer.
The patch below (compile tested only) should take care of that little
problem.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agospi/pl022: fix erroneous platform data in U300
Linus Walleij [Thu, 21 Oct 2010 19:05:25 +0000 (21:05 +0200)]
spi/pl022: fix erroneous platform data in U300

This fixes an erroneous use of LSB first in the U300 machine, the
PL022 used in U300 is a standard ARM core that doesn't support this
bit so it should never have been set.

Cc: Kevin Wells <wellsk40@gmail.com>OA
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
13 years agoInput: ir-keytable - fix uninitialized variable warning
Dmitry Torokhov [Sun, 31 Oct 2010 22:18:42 +0000 (15:18 -0700)]
Input: ir-keytable - fix uninitialized variable warning

We were forgetting to set up proper return value in success path causing
ir_getkeycode() to fail intermittently:

drivers/media/IR/ir-keytable.c: In function 'ir_getkeycode':
drivers/media/IR/ir-keytable.c:363: warning: 'retval' may be used
uninitialized in this function

Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
Linus Torvalds [Mon, 1 Nov 2010 01:03:23 +0000 (21:03 -0400)]
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c-i801: Add PCI idents for Patsburg 'IDF' SMBus controllers
  i2c-i801: Handle multiple instances instead of keeping global state
  i2c-i801: Add Intel Patsburg device ID
  i2c: Drop unused I2C_CLASS_TV flags

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Mon, 1 Nov 2010 01:02:39 +0000 (21:02 -0400)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: appletouch - remove extra KERN_DEBUG use from dprintk
  Input: bu21013_ts - fix null dereference in error handling
  Input: ad7879 - prevent invalid finger data reports

13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
Linus Torvalds [Mon, 1 Nov 2010 00:43:12 +0000 (20:43 -0400)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (70 commits)
  [SCSI] pmcraid: add support for set timestamp command and other fixes
  [SCSI] pmcraid: remove duplicate struct member
  [SCSI] qla4xxx: Fix cmd check in qla4xxx_cmd_wait
  [SCSI] megaraid_sas: Version and documentation update
  [SCSI] megaraid_sas: Add three times Online controller reset
  [SCSI] megaraid_sas: Add input parameter for max_sectors
  [SCSI] megaraid_sas: support devices update flag
  [SCSI] libosd: write/read_sg_kern API
  [SCSI] libosd: Support for scatter gather write/read commands
  [SCSI] libosd: Free resources in reverse order of allocation
  [SCSI] libosd: Fix bug in attr_page handling
  [SCSI] lpfc 8.3.18: Update lpfc driver version to 8.3.18
  [SCSI] lpfc 8.3.18: Add new WQE support
  [SCSI] lpfc 8.3.18: Fix critical errors
  [SCSI] lpfc 8.3.18: Adapter Shutdown and Unregistration cleanup
  [SCSI] lpfc 8.3.18: Add logic to detect last devloss timeout
  [SCSI] lpfc 8.3.18: Add support of received ELS commands
  [SCSI] lpfc 8.3.18: FC/FCoE Discovery fixes
  [SCSI] ipr: add definitions for a new adapter
  [SCSI] bfa: fix comments for c files
  ...

13 years agoMerge branches 'irq-core-for-linus' and 'core-locking-for-linus' of git://git.kernel...
Linus Torvalds [Mon, 1 Nov 2010 00:40:24 +0000 (20:40 -0400)]
Merge branches 'irq-core-for-linus' and 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  genirq: Fix up irq_node() for irq_data changes.
  genirq: Add single IRQ reservation helper
  genirq: Warn if enable_irq is called before irq is set up

* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  semaphore: Remove mutex emulation
  staging: Final semaphore cleanup
  jbd2: Convert jbd2_slab_create_sem to mutex
  hpfs: Convert sbi->hpfs_creation_de to mutex

Fix up trivial change/delete conflicts with deleted 'dream' drivers
(drivers/staging/dream/camera/{mt9d112.c,mt9p012_fox.c,mt9t013.c,s5k3e2fx.c})

13 years agoi2c-i801: Add PCI idents for Patsburg 'IDF' SMBus controllers
David Woodhouse [Sun, 31 Oct 2010 20:07:00 +0000 (21:07 +0100)]
i2c-i801: Add PCI idents for Patsburg 'IDF' SMBus controllers

These are the extra 'Integrated Device Function' SMBus controllers found
on the Patsburg chipset. Mention the absence of slave mode support.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
13 years agoi2c-i801: Handle multiple instances instead of keeping global state
David Woodhouse [Sun, 31 Oct 2010 20:06:59 +0000 (21:06 +0100)]
i2c-i801: Handle multiple instances instead of keeping global state

It's poor form to keep driver state in global variables rather than
per-instance. It never really mattered in practice when there was only
one controller on the chipset, but the latest chipsets do have more
than one controller, so now we care.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
13 years agoi2c-i801: Add Intel Patsburg device ID
Seth Heasley [Sun, 31 Oct 2010 20:06:59 +0000 (21:06 +0100)]
i2c-i801: Add Intel Patsburg device ID

Add support for the Intel Patsburg PCH SMBus Controller.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
13 years agoi2c: Drop unused I2C_CLASS_TV flags
Jean Delvare [Sun, 31 Oct 2010 20:06:59 +0000 (21:06 +0100)]
i2c: Drop unused I2C_CLASS_TV flags

There are no users left for I2C_CLASS_TV_ANALOG and
I2C_CLASS_TV_DIGITAL, so we can get rid of them.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
13 years agoInput: appletouch - remove extra KERN_DEBUG use from dprintk
Joe Perches [Sun, 31 Oct 2010 00:19:49 +0000 (17:19 -0700)]
Input: appletouch - remove extra KERN_DEBUG use from dprintk

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
13 years agolocks: remove fl_copy_lock lock_manager operation
Christoph Hellwig [Sun, 31 Oct 2010 12:35:31 +0000 (08:35 -0400)]
locks: remove fl_copy_lock lock_manager operation

This one was only used for a nasty hack in nfsd, which has recently
been removed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolocks: let the caller free file_lock on ->setlease failure
Christoph Hellwig [Sun, 31 Oct 2010 12:35:10 +0000 (08:35 -0400)]
locks: let the caller free file_lock on ->setlease failure

The caller allocated it, the caller should free it.

The only issue so far is that we could change the flp pointer even on an
error return if the fl_change callback failed.  But we can simply move
the flp assignment after the fl_change invocation, as the callers don't
care about the flp return value if the setlease call failed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoinitramfs: Fix initramfs size for 32-bit arches
Geert Uytterhoeven [Sun, 31 Oct 2010 09:56:23 +0000 (10:56 +0100)]
initramfs: Fix initramfs size for 32-bit arches

Commit ffe8018c3424 ("initramfs: fix initramfs size calculation") broke
32-bit big-endian arches like (on ARAnyM):

    VFS: Cannot open root device "hda1" or unknown-block(3,1)
    Please append a correct "root=" boot option; here are the available partitions:
    fe80         1059408 nfhd8  (driver?)
      fe81          921600 nfhd8p1 00000000-0000-0000-0000-000000000nfhd8p1
      fe82          137807 nfhd8p2 00000000-0000-0000-0000-000000000nfhd8p2
    0200            3280 fd0  (driver?)
    0201            3280 fd1  (driver?)
    0300         1059408 hda  driver: ide-gd
      0301          921600 hda1 00000000-0000-0000-0000-000000000hda1
      0302          137807 hda2 00000000-0000-0000-0000-000000000hda2
    Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(3,1)

As pointed out by Kerstin Jonsson <kerstin.jonsson@ericsson.com>, this
is due to CONFIG_32BIT not being defined, so the initramfs size field is
done as a 64-bit quad.  On little-endian (like x86) this doesn matter,
but on a big-endian machine the 32-bit reads will see the (zero) high
bits.

Only mips, s390, and score set CONFIG_32BIT for 32-bit builds, so fix it for
all other 32-bit arches by inverting the logic and testing for CONFIG_64BIT,
which should be defined on all 64-bit arches.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
[ I think we should just make it "u64" on all architectures and get
  rid of the whole #ifdef CONFIG_xxBIT   - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Sun, 31 Oct 2010 01:42:58 +0000 (18:42 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  isdn: mISDN: socket: fix information leak to userland
  netdev: can: Change mail address of Hans J. Koch
  pcnet_cs: add new_id
  net: Truncate recvfrom and sendto length to INT_MAX.
  RDS: Let rds_message_alloc_sgs() return NULL
  RDS: Copy rds_iovecs into kernel memory instead of rereading from userspace
  RDS: Clean up error handling in rds_cmsg_rdma_args
  RDS: Return -EINVAL if rds_rdma_pages returns an error
  net: fix rds_iovec page count overflow
  can: pch_can: fix section mismatch warning by using a whitelisted name
  can: pch_can: fix sparse warning
  netxen_nic: Fix the tx queue manipulation bug in netxen_nic_probe
  ip_gre: fix fallback tunnel setup
  vmxnet: trivial annotation of protocol constant
  vmxnet3: remove unnecessary byteswapping in BAR writing macros
  ipv6/udp: report SndbufErrors and RcvbufErrors
  phy/marvell: rename 88ec048 to 88e1318s and fix mscr1 addr

13 years agonfsd4: initialize delegation pointer to lease
J. Bruce Fields [Sat, 30 Oct 2010 21:31:16 +0000 (17:31 -0400)]
nfsd4: initialize delegation pointer to lease

The NFSv4 server was initializing the dp->dl_flock pointer by the
somewhat ridiculous method of a locks_copy_lock callback.

Now that setlease uses the passed-in lock instead of doing a copy,
dl_flock no longer gets set, resulting in the lock leaking on delegation
release, and later possible hangs (among other problems).

So, initialize dl_flock and get rid of the callback.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolocks: fix setlease methods to free passed-in lock
J. Bruce Fields [Sat, 30 Oct 2010 21:31:15 +0000 (17:31 -0400)]
locks: fix setlease methods to free passed-in lock

We modified setlease to require the caller to allocate the new lease in
the case of creating a new lease, but forgot to fix up the filesystem
methods.

Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Steve French <sfrench@samba.org>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolocks: fix leaks on setlease errors
J. Bruce Fields [Sat, 30 Oct 2010 21:31:14 +0000 (17:31 -0400)]
locks: fix leaks on setlease errors

We're depending on setlease to free the passed-in lease on failure.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agolocks: prevent ENOMEM on lease unlock
J. Bruce Fields [Sat, 30 Oct 2010 21:31:13 +0000 (17:31 -0400)]
locks: prevent ENOMEM on lease unlock

Removing a lock shouldn't require any allocations; a failure due to
ENOMEM leaves the caller with a choice between retrying or giving up and
leaking an unused lease.

Next we should split the other lease calls into add and delete cases.
I wanted to start with just the bugfix.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agodrivers/media/IR/ir-keytable.c: fix binary search
David Härdeman [Sat, 30 Oct 2010 20:17:44 +0000 (22:17 +0200)]
drivers/media/IR/ir-keytable.c: fix binary search

The input-large-scancode patches changed the binary search in
drivers/media/IR/ir-keytable.c to use unsigned integers, but
signed integers are actually necessary for the algorithm to work.

Signed-off-by: David Härdeman <david@hardeman.nu>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoisdn: mISDN: socket: fix information leak to userland
Kulikov Vasiliy [Fri, 29 Oct 2010 23:04:33 +0000 (23:04 +0000)]
isdn: mISDN: socket: fix information leak to userland

Structure mISDN_devinfo is copied to userland with the field "name"
that has the last elements unitialized.  It leads to leaking of
contents of kernel stack memory.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetdev: can: Change mail address of Hans J. Koch
Hans J. Koch [Fri, 29 Oct 2010 12:33:57 +0000 (12:33 +0000)]
netdev: can: Change mail address of Hans J. Koch

My old mail address doesn't exist anymore. This changes all occurrences
to my new address.

Signed-off-by: Hans J. Koch <hjk@hansjkoch.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agopcnet_cs: add new_id
Ken Kawasaki [Fri, 29 Oct 2010 12:17:51 +0000 (12:17 +0000)]
pcnet_cs: add new_id

pcnet_cs:
    add new_id: "corega Ether CF-TD" 10Base-T PCMCIA card.

Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Truncate recvfrom and sendto length to INT_MAX.
Linus Torvalds [Sat, 30 Oct 2010 23:43:10 +0000 (16:43 -0700)]
net: Truncate recvfrom and sendto length to INT_MAX.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoRDS: Let rds_message_alloc_sgs() return NULL
Andy Grover [Thu, 28 Oct 2010 15:40:59 +0000 (15:40 +0000)]
RDS: Let rds_message_alloc_sgs() return NULL

Even with the previous fix, we still are reading the iovecs once
to determine SGs needed, and then again later on. Preallocating
space for sg lists as part of rds_message seemed like a good idea
but it might be better to not do this. While working to redo that
code, this patch attempts to protect against userspace rewriting
the rds_iovec array between the first and second accesses.

The consequences of this would be either a too-small or too-large
sg list array. Too large is not an issue. This patch changes all
callers of message_alloc_sgs to handle running out of preallocated
sgs, and fail gracefully.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoRDS: Copy rds_iovecs into kernel memory instead of rereading from userspace
Andy Grover [Thu, 28 Oct 2010 15:40:58 +0000 (15:40 +0000)]
RDS: Copy rds_iovecs into kernel memory instead of rereading from userspace

Change rds_rdma_pages to take a passed-in rds_iovec array instead
of doing copy_from_user itself.

Change rds_cmsg_rdma_args to copy rds_iovec array once only. This
eliminates the possibility of userspace changing it after our
sanity checks.

Implement stack-based storage for small numbers of iovecs, based
on net/socket.c, to save an alloc in the extremely common case.

Although this patch reduces iovec copies in cmsg_rdma_args to 1,
we still do another one in rds_rdma_extra_size. Getting rid of
that one will be trickier, so it'll be a separate patch.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoRDS: Clean up error handling in rds_cmsg_rdma_args
Andy Grover [Thu, 28 Oct 2010 15:40:57 +0000 (15:40 +0000)]
RDS: Clean up error handling in rds_cmsg_rdma_args

We don't need to set ret = 0 at the end -- it's initialized to 0.

Also, don't increment s_send_rdma stat if we're exiting with an
error.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoRDS: Return -EINVAL if rds_rdma_pages returns an error
Andy Grover [Thu, 28 Oct 2010 15:40:56 +0000 (15:40 +0000)]
RDS: Return -EINVAL if rds_rdma_pages returns an error

rds_cmsg_rdma_args would still return success even if rds_rdma_pages
returned an error (or overflowed).

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: fix rds_iovec page count overflow
Linus Torvalds [Thu, 28 Oct 2010 15:40:55 +0000 (15:40 +0000)]
net: fix rds_iovec page count overflow

As reported by Thomas Pollet, the rdma page counting can overflow.  We
get the rdma sizes in 64-bit unsigned entities, but then limit it to
UINT_MAX bytes and shift them down to pages (so with a possible "+1" for
an unaligned address).

So each individual page count fits comfortably in an 'unsigned int' (not
even close to overflowing into signed), but as they are added up, they
might end up resulting in a signed return value. Which would be wrong.

Catch the case of tot_pages turning negative, and return the appropriate
error code.

Reported-by: Thomas Pollet <thomas.pollet@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocan: pch_can: fix section mismatch warning by using a whitelisted name
Marc Kleine-Budde [Sat, 30 Oct 2010 23:28:16 +0000 (16:28 -0700)]
can: pch_can: fix section mismatch warning by using a whitelisted name

This patch fixes the following section mismatch warning:

WARNING: drivers/net/can/pch_can.o(.data+0x18):
Section mismatch in reference from the variable pch_can_pcidev
to the variable .devinit.rodata:pch_pci_tbl
The variable pch_can_pcidev references
the variable __devinitconst pch_pci_tbl

This is actually a false positive which is fixed by giving the offending
variable a whitelisted name, it's renamed to "pch_can_pci_driver".
This makes sense because the variable is of the type "struct pci_driver".

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocan: pch_can: fix sparse warning
Marc Kleine-Budde [Sat, 30 Oct 2010 23:27:48 +0000 (16:27 -0700)]
can: pch_can: fix sparse warning

This patch fixes the following sparse warning:

drivers/net/can/pch_can.c:231:26: warning: incorrect type in argument 1 (different address spaces)
drivers/net/can/pch_can.c:231:26:    expected unsigned int [usertype] *addr
drivers/net/can/pch_can.c:231:26:    got unsigned int [noderef] <asn:2>*<noident>

Let pch_can_bit_{set,clear} first parameter be a void __iomem pointer.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetxen_nic: Fix the tx queue manipulation bug in netxen_nic_probe
Denis Kirjanov [Sat, 30 Oct 2010 23:24:25 +0000 (16:24 -0700)]
netxen_nic: Fix the tx queue manipulation bug in netxen_nic_probe

We should not stop the egress queue during probe because it is wrong.

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoip_gre: fix fallback tunnel setup
Eric Dumazet [Sat, 30 Oct 2010 23:21:28 +0000 (16:21 -0700)]
ip_gre: fix fallback tunnel setup

Before making the fallback tunnel visible to lookups, we should make
sure it is completely setup, once ipgre_tunnel_init() had been called
and tstats per_cpu pointer allocated.

move rcu_assign_pointer(ign->tunnels_wc[0], tunnel); from
ipgre_fb_tunnel_init() to ipgre_init_net()

Based on a patch from Pavel Emelyanov

Reported-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agovmxnet: trivial annotation of protocol constant
Harvey Harrison [Sat, 30 Oct 2010 23:19:45 +0000 (16:19 -0700)]
vmxnet: trivial annotation of protocol constant

Noticed by sparse:
drivers/net/vmxnet3/vmxnet3_drv.c:876:38: warning: cast from restricted __be16
drivers/net/vmxnet3/vmxnet3_drv.c:876:38: warning: cast from restricted __be16
drivers/net/vmxnet3/vmxnet3_drv.c:876:24: warning: restricted __be16 degrades to integer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>