]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
13 years agoMerge branch 'topic/asoc' into for-next
Takashi Iwai [Fri, 10 Jun 2011 12:08:18 +0000 (14:08 +0200)]
Merge branch 'topic/asoc' into for-next

13 years agoMerge branch 'fix/asoc' into for-next
Takashi Iwai [Fri, 10 Jun 2011 11:28:50 +0000 (13:28 +0200)]
Merge branch 'fix/asoc' into for-next

13 years agoASoC: SMDKV310: Enable SPDIF device
Naveen Krishna Chatradhi [Fri, 10 Jun 2011 06:34:27 +0000 (12:04 +0530)]
ASoC: SMDKV310: Enable SPDIF device

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'for-3.0' into for-3.1
Mark Brown [Fri, 10 Jun 2011 10:03:54 +0000 (11:03 +0100)]
Merge branch 'for-3.0' into for-3.1

13 years agosound/atmel_ssc_dai: add a missing space to an error message
Uwe Kleine-König [Thu, 9 Jun 2011 22:41:48 +0000 (00:41 +0200)]
sound/atmel_ssc_dai: add a missing space to an error message

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: SAMSUNG: Fix the incorrect referencing of I2SCON register
Sangbeom Kim [Fri, 10 Jun 2011 01:36:54 +0000 (10:36 +0900)]
ASoC: SAMSUNG: Fix the incorrect referencing of I2SCON register

If DMA active status should be checked, I2SCON register should be referenced.
In this patch, Fix the incorrect referencing of I2SCON register.

Reported-by : Lakkyung Jung <lakkyung.jung@samsung.com>
Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
13 years agoASoC: pcm - rename snd_codec_close() to snd_pcm_close().
Liam Girdwood [Thu, 9 Jun 2011 16:04:59 +0000 (17:04 +0100)]
ASoC: pcm - rename snd_codec_close() to snd_pcm_close().

Make sure we follow naming convention for all PCM ops.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: core - PCM mutex per rtd
Liam Girdwood [Thu, 9 Jun 2011 16:04:39 +0000 (17:04 +0100)]
ASoC: core - PCM mutex per rtd

In preparation for the new ASoC Dynamic PCM support (AKA DSP support).

The new ASoC Dynamic PCM core allows DAIs to be dynamically re-routed
at runtime between the PCM device end (or Frontend - FE) and the physical DAI
(Backend - BE) using regular kcontrols (just like a hardware CODEC routes
audio in the analog domain). The Dynamic PCM core therefore must be
able to call PCM operations for both the Frontend and Backend(s) DAIs at
the same time.

Currently we have a global pcm_mutex that is used to serialise
the ASoC PCM operations. This patch removes the global mutex
and adds a mutex per RTD allowing the PCM operations to be reentrant and
allow control of more than one DAI at at time. e.g. a frontend PCM hw_params()
could configure multiple backend DAI hw_params() with similar or different
hw parameters at the same time.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'for-3.0' into for-3.1
Mark Brown [Thu, 9 Jun 2011 14:07:42 +0000 (15:07 +0100)]
Merge branch 'for-3.0' into for-3.1

13 years agoASoC: core - Separate out PCM operations into new file.
Liam Girdwood [Thu, 9 Jun 2011 13:45:53 +0000 (14:45 +0100)]
ASoC: core - Separate out PCM operations into new file.

In preparation for Dynamic PCM support (AKA DSP support).

There will be future patches that add support to allow PCMs to be dynamically
routed to multiple DAIs at startup and also during stream runtime. This patch
moves the ASoC core PCM operaitions into a new file called soc-pcm.c.  This will
in simplify the ASoC core features into distinct files.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: snd_soc_new_{mixer,mux,pga} make sure to use right DAPM context
Lars-Peter Clausen [Thu, 9 Jun 2011 11:22:36 +0000 (13:22 +0200)]
ASoC: snd_soc_new_{mixer,mux,pga} make sure to use right DAPM context

Currently it is possible that snd_soc_new_{mixer,mux,pga} is called with a
DAPM context not matching the widgets context. This can lead to a wrong
prefix_len calculation, which will result in undefined behaviour. To avoid
this always use the DAPM context from the widget itself.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
13 years agoMerge branch 'for-3.0' into for-3.1
Mark Brown [Thu, 9 Jun 2011 11:02:26 +0000 (12:02 +0100)]
Merge branch 'for-3.0' into for-3.1

13 years agoASoC: p1022ds: fix incorrect referencing of device tree properties
Timur Tabi [Wed, 8 Jun 2011 20:02:55 +0000 (15:02 -0500)]
ASoC: p1022ds: fix incorrect referencing of device tree properties

Device tree integer properties are encoded in big-endian format, but some of
the Freescale ASoC drivers were assuming that the host is in big-endian format
as well.  Although this is true, it's better to use endian-safe accessors.

Also add a check for a failed ioremap() call in the SSI driver.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: fsl: fix initialization of DMA buffers
Timur Tabi [Wed, 8 Jun 2011 20:02:56 +0000 (15:02 -0500)]
ASoC: fsl: fix initialization of DMA buffers

The DMA (PCM) driver used by some Freescale PowerPC supports separate DAIs
for playback and capture, so DMA buffers should be allocated only for the
initialized streams.  Instead of checking for the number of active channels,
which apparently is not reliable, check to see if the actual stream object
exists.

Also provide a better name for the DMA interrupt.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: WM8804 does not support sample rates below 32kHz
Mark Brown [Wed, 8 Jun 2011 17:07:49 +0000 (18:07 +0100)]
ASoC: WM8804 does not support sample rates below 32kHz

Reported-by: Kieran O'Leary <Kieran.O'Leary@wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@kernel.org
13 years agoASoC: Fix mismerge of Speyside set_bias_level_post()
Mark Brown [Wed, 8 Jun 2011 15:11:18 +0000 (16:11 +0100)]
ASoC: Fix mismerge of Speyside set_bias_level_post()

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoMerge branch 'for-3.0' into for-3.1
Mark Brown [Wed, 8 Jun 2011 14:25:07 +0000 (15:25 +0100)]
Merge branch 'for-3.0' into for-3.1

13 years agoASoC: Support Speyside build variants with WM8962 fitted
Mark Brown [Mon, 25 Apr 2011 17:30:45 +0000 (18:30 +0100)]
ASoC: Support Speyside build variants with WM8962 fitted

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Defer all WM8962 clocking configuration until power up
Mark Brown [Wed, 8 Jun 2011 13:44:06 +0000 (14:44 +0100)]
ASoC: Defer all WM8962 clocking configuration until power up

Don't require an audio rate SYSCLK in hw_params() in order to better
support microphone detection use cases.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Implement base 5 band EQ control for WM8962
Mark Brown [Tue, 7 Jun 2011 22:14:37 +0000 (23:14 +0100)]
ASoC: Implement base 5 band EQ control for WM8962

ReTune Mobile modes are not currently supported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Report errors when we have a WM8962 IRQ and don't get FLL lock
Mark Brown [Tue, 7 Jun 2011 22:16:29 +0000 (23:16 +0100)]
ASoC: Report errors when we have a WM8962 IRQ and don't get FLL lock

We really should be getting the interrupt - if we don't get one it's very
likely that the configuration is incorrect and audio will fail. Also
increase the timeout substantially in this case for safety.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Factor out I2C usage in WM8962 driver
Mark Brown [Tue, 7 Jun 2011 22:13:53 +0000 (23:13 +0100)]
ASoC: Factor out I2C usage in WM8962 driver

The chip can actually support SPI so we shouldn't assume we've got an I2C
device even though that's the most common configuration.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Suppress restore of default register values for rbtree cache sync
Mark Brown [Fri, 3 Jun 2011 15:36:30 +0000 (16:36 +0100)]
ASoC: Suppress restore of default register values for rbtree cache sync

Currently the rbtree code will write out the entire register map when
doing a cache sync which is wasteful and will slow things down. Check
to see if the value we're about to write is the default and don't bother
restoring it if it is, either the value will have been retained or the
device will have been reset and holds the value already.

We should really store the defaults in the nodes but this resolves the
immediate issue.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Fix WM8962 headphone volume update for use of advanced caches
Mark Brown [Tue, 7 Jun 2011 22:42:04 +0000 (23:42 +0100)]
ASoC: Fix WM8962 headphone volume update for use of advanced caches

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@kernel.org
13 years agoASoC: core - Allow components to probe/remove in sequence.
Liam Girdwood [Tue, 7 Jun 2011 15:08:05 +0000 (16:08 +0100)]
ASoC: core - Allow components to probe/remove in sequence.

Some ASoC components depend on other ASoC components to provide clocks and
power resources in order to probe() and vice versa for remove().

Allow components to be ordered so that components can be probed() and removed()
in sequences that conform to their dependencies.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: core - Optimise and refactor pcm_new() to pass only rtd
Liam Girdwood [Tue, 7 Jun 2011 15:08:33 +0000 (16:08 +0100)]
ASoC: core - Optimise and refactor pcm_new() to pass only rtd

Currently pcm_new() passes in 3 arguments :- card, pcm and DAI.

Refactor this to only pass in 1 argument (i.e. the rtd) since struct rtd contains
card, pcm and DAI along with other members too that are useful too.

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'topic/hda' into for-next
Takashi Iwai [Tue, 7 Jun 2011 10:28:47 +0000 (12:28 +0200)]
Merge branch 'topic/hda' into for-next

13 years agoALSA: hda - Judge playback stream from stream id in azx_via_get_position()
Takashi Iwai [Tue, 7 Jun 2011 10:26:56 +0000 (12:26 +0200)]
ALSA: hda - Judge playback stream from stream id in azx_via_get_position()

Instead of checking the azx_dev index with a fixed number (4), check
the stream direction of the assigned substream.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: hda - Handle -1 as invalid position, too
Takashi Iwai [Tue, 7 Jun 2011 10:23:23 +0000 (12:23 +0200)]
ALSA: hda - Handle -1 as invalid position, too

When reading from the position-buffer results in -1, handle as it's
invalid and falls back to LPIB mode as well as 0.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'for-3.0' into for-3.1
Mark Brown [Tue, 7 Jun 2011 08:49:47 +0000 (09:49 +0100)]
Merge branch 'for-3.0' into for-3.1

13 years agoASoC: Blackfin: bf5xx-ad1836: Fix codec device name
Lars-Peter Clausen [Tue, 7 Jun 2011 08:24:46 +0000 (10:24 +0200)]
ASoC: Blackfin: bf5xx-ad1836: Fix codec device name

Fix the codec_name field of the dai_link to match the actual device name
of the codec. Otherwise the card won't be instantiated.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
13 years agoASoC: AD1836: Fix build error
Lars-Peter Clausen [Tue, 7 Jun 2011 05:02:59 +0000 (07:02 +0200)]
ASoC: AD1836: Fix build error

Commit f97d0c6d5f94 ("ASoC: AD1836: Add input gain control for ADC2") contained
a typo in the register name, causing a build error. This patch fixes it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: wm8940: remove unnecessary if statements
Greg Dietsche [Mon, 6 Jun 2011 20:53:01 +0000 (15:53 -0500)]
ASoC: wm8940: remove unnecessary if statements

removing unnecessary if(ret) checks

This updated patch corrects a minor spelling problem in the commit message
and resolves two other (similar) issues found in wm8940.c by Jonathan Cameron.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'fix/hda' into for-next
Takashi Iwai [Tue, 7 Jun 2011 05:26:25 +0000 (07:26 +0200)]
Merge branch 'fix/hda' into for-next

13 years agoALSA: hda: Fix quirk for Dell Inspiron 910
Daniel T Chen [Mon, 6 Jun 2011 22:55:34 +0000 (18:55 -0400)]
ALSA: hda: Fix quirk for Dell Inspiron 910

BugLink: https://launchpad.net/bugs/792712
The original reporter states that sound from the internal speakers is
inaudible until using the model=auto quirk. This symptom is due to an
existing quirk mask for 0x102802b* that uses the model=dell quirk. To
limit the possible regressions, leave the existing quirk mask but add
a higher priority specific mask for the reporter's PCI SSID.

Reported-and-tested-by: rodni hipp
Cc: <stable@kernel.org> [2.6.38+]
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'for-3.0' into for-3.1
Mark Brown [Mon, 6 Jun 2011 20:57:54 +0000 (21:57 +0100)]
Merge branch 'for-3.0' into for-3.1

13 years agoASoC: AD1836: Fix setting the PCM format
Lars-Peter Clausen [Mon, 6 Jun 2011 11:38:35 +0000 (13:38 +0200)]
ASoC: AD1836: Fix setting the PCM format

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
13 years agoASoC: AD1836: Add input gain control for ADC2
Lars-Peter Clausen [Mon, 6 Jun 2011 11:38:40 +0000 (13:38 +0200)]
ASoC: AD1836: Add input gain control for ADC2

The AD1836 has a PGA for its second ADC. This patch adds a control for
adjusting the the gain of the PGA.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: AD1836: Remove unused fields from private struct
Lars-Peter Clausen [Mon, 6 Jun 2011 11:38:39 +0000 (13:38 +0200)]
ASoC: AD1836: Remove unused fields from private struct

The control_type field is never used, so it can be removed.  The
control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: AD1836: Add AD1835/AD1837/AD1838/AD1839 support
Lars-Peter Clausen [Mon, 6 Jun 2011 11:38:38 +0000 (13:38 +0200)]
ASoC: AD1836: Add AD1835/AD1837/AD1838/AD1839 support

The AD183X codec devices are mostly register compatible and can easily be
supported by the same driver.  The main difference between those devices
is the number of DACs and ADCs.

This patch adjusts the driver to allocate the controls, DAPM widgets and
routes for the DACs and ADCs dynamically based on the chip type.

The AD1836 is a bit special in that it supports different modes for its second
ADC, so it needs some special handling. Right now the driver hardcodes the mode
to the differential PGA mode.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: AD1836: Use snd_soc_update_bits for read-modify-write
Lars-Peter Clausen [Mon, 6 Jun 2011 11:38:37 +0000 (13:38 +0200)]
ASoC: AD1836: Use snd_soc_update_bits for read-modify-write

Use snd_soc_update_bits for read-modify-write register access instead of
open-coding it using snd_soc_read and snd_soc_write.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: AD1836: Add ADC/DAC controls helper macros
Lars-Peter Clausen [Mon, 6 Jun 2011 11:38:36 +0000 (13:38 +0200)]
ASoC: AD1836: Add ADC/DAC controls helper macros

The different ADC and DAC controls follow the same scheme, so add some helper
macros for declaring them.
This should make the code a bit more readable and also decreases the code size
a bit.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Manage Speyside system clocking only in bias management
Mark Brown [Mon, 6 Jun 2011 18:12:44 +0000 (19:12 +0100)]
ASoC: Manage Speyside system clocking only in bias management

Now that the CODEC driver supports it defer configuration of the system
clock until bias management which is a much more idiomatic place to do
system power control and makes things a lot more happy when we're using
both interfaces.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Only provide a default bias level update for CODEC contexts
Mark Brown [Mon, 6 Jun 2011 18:03:34 +0000 (19:03 +0100)]
ASoC: Only provide a default bias level update for CODEC contexts

This allows the card driver to use the bias level variable more easily in
multi component systems.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Add context parameter to card DAPM callbacks
Mark Brown [Mon, 6 Jun 2011 18:13:23 +0000 (19:13 +0100)]
ASoC: Add context parameter to card DAPM callbacks

The card callback will get called for each DAPM context in the card so it
can be useful for it to know which device is currently undergoing a
transition.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Simplify logic in snd_soc_dapm_set_bias_level()
Mark Brown [Mon, 6 Jun 2011 17:15:19 +0000 (18:15 +0100)]
ASoC: Simplify logic in snd_soc_dapm_set_bias_level()

No functional changes but much less indentation.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Remove trace for DAPM bias level logging
Mark Brown [Mon, 6 Jun 2011 15:15:53 +0000 (16:15 +0100)]
ASoC: Remove trace for DAPM bias level logging

It's redundant now thanks to the use of the generic trace infrastructure.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Indentation fix for null loop operation
Mark Brown [Mon, 6 Jun 2011 15:16:34 +0000 (16:16 +0100)]
ASoC: Indentation fix for null loop operation

More with the legibility.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Don't bring the CODEC up to full power for supplies and biases
Mark Brown [Sat, 4 Jun 2011 10:34:43 +0000 (11:34 +0100)]
ASoC: Don't bring the CODEC up to full power for supplies and biases

If the only widgets active within a CODEC are supplies and micbiases we
are not passing audio, we are probably just doing microphone detection.
This will not generally require either fully accurate reference voltages
or much power so

If this turns out to be unsuitable for some systems we can provide a
facility to override this decision.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Specify target bias state directly as a bias state
Mark Brown [Sat, 4 Jun 2011 10:25:10 +0000 (11:25 +0100)]
ASoC: Specify target bias state directly as a bias state

Rather than a simple flag to say if we want the DAPM context to be at full
power specify the target bias state. This should have no current effect
but is a bit more direct and so makes it easier to change our decisions
about the which bias state to go into in future.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Allow WM8915 BCLK calculation outside hw_params()
Mark Brown [Mon, 6 Jun 2011 15:05:13 +0000 (16:05 +0100)]
ASoC: Allow WM8915 BCLK calculation outside hw_params()

Allow more dynamic management of the device clocking by allowing BCLK to
be calculated when we set SYSCLK. This means that if the system is idle
when hw_params() runs then we don't try to use the SYSCLK used in that case
to set up the BCLK dividers, we can instead wait until a later point such
as bias level configuration. This makes it easier to manage low power modes.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoMerge branch 'for-3.0' into for-3.1
Mark Brown [Mon, 6 Jun 2011 18:34:58 +0000 (19:34 +0100)]
Merge branch 'for-3.0' into for-3.1

13 years agoASoC: Check for NULL register bank in snd_soc_get_cache_val()
Mark Brown [Mon, 6 Jun 2011 10:26:15 +0000 (11:26 +0100)]
ASoC: Check for NULL register bank in snd_soc_get_cache_val()

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Enforce the mask in snd_soc_update_bits()
Mark Brown [Fri, 3 Jun 2011 16:09:14 +0000 (17:09 +0100)]
ASoC: Enforce the mask in snd_soc_update_bits()

Avoids issues if someone does a read followed by restore and doesn't mask
out only the bits being updated.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Error out when FLL lock interrupt is not delivered on WM8915
Mark Brown [Fri, 3 Jun 2011 16:49:46 +0000 (17:49 +0100)]
ASoC: Error out when FLL lock interrupt is not delivered on WM8915

When the FLL locks on the WM8915 an interrupt is generated.  For safety
error out if we don't get that interrupt when the IRQ output of the
WM8915 is hooked up.  Since we *really* expect an interrupt but the
threaded IRQ handler may take a bit longer than expected to get
scheduled also dramatically increase the delay in this case.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Suppress noop SYSCLK updates in WM8915
Mark Brown [Fri, 3 Jun 2011 16:09:49 +0000 (17:09 +0100)]
ASoC: Suppress noop SYSCLK updates in WM8915

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoMerge branch 'for-3.0' into for-3.1
Mark Brown [Mon, 6 Jun 2011 11:47:06 +0000 (12:47 +0100)]
Merge branch 'for-3.0' into for-3.1

13 years agoASoC: Add missing break in WM8915 FLL source selection
Mark Brown [Fri, 3 Jun 2011 17:20:50 +0000 (18:20 +0100)]
ASoC: Add missing break in WM8915 FLL source selection

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Only update SYSCLK_ENA when pausing WM8915 SYSCLK
Mark Brown [Fri, 3 Jun 2011 16:13:57 +0000 (17:13 +0100)]
ASoC: Only update SYSCLK_ENA when pausing WM8915 SYSCLK

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoMerge branch 'for-3.0' into for-3.1
Mark Brown [Mon, 6 Jun 2011 11:26:02 +0000 (12:26 +0100)]
Merge branch 'for-3.0' into for-3.1

13 years agoMerge branch 'topic/hda' into for-next
Takashi Iwai [Mon, 6 Jun 2011 10:59:11 +0000 (12:59 +0200)]
Merge branch 'topic/hda' into for-next

13 years agoALSA: hda: HDMI: Support codecs with fewer cvts than pins
Stephen Warren [Wed, 1 Jun 2011 17:14:21 +0000 (11:14 -0600)]
ALSA: hda: HDMI: Support codecs with fewer cvts than pins

The general concept of this change is to create a PCM device for each
pin widget instead of each converter widget. Whenever a PCM is opened,
a converter is dynamically selected to drive that pin based on those
available for muxing into the pin.

The one thing this model doesn't support is a single PCM/converter
sending audio to multiple pin widgets at once.

Note that this means that a struct hda_pcm_stream's nid variable is
set to 0 except between a stream's open and cleanup calls. The dynamic
de-assignment of converters to PCMs occurs within cleanup, not close,
in order for it to co-incide with when controller stream IDs are
cleaned up from converters.

While the PCM for a pin is not open, the pin is disabled (its widget
control's PIN_OUT bit is cleared) so that if the currently routed
converter is used to drive a different PCM/pin, that audio does not
leak out over a disabled pin.

We use the recently added SPDIF virtualization feature in order to
create SPDIF controls for each pin widget instead of each converter
widget, so that state is specific to a PCM.

In order to support this, a number of more mechanical changes are made:

* s/nid/pin_nid/ or s/nid/cvt_nid/ in many places in order to make it
  clear exactly what the code is dealing with.

* We now have per_pin and per_cvt arrays in hdmi_spec to store relevant
  data. In particular, we store a converter's capabilities in the per_cvt
  entry, rather than relying on a combination of codec_pcm_pars and
  the struct hda_pcm_stream.

* ELD-related workarounds were removed from hdmi_channel_allocation
  into hdmi_instrinsic in order to simplifiy infoframe calculations and
  remove HW dependencies.

* Various functions only apply to a single pin, since there is now
  only 1 pin per PCM. For example, hdmi_setup_infoframe,
  hdmi_setup_stream.

* hdmi_add_pin and hdmi_add_cvt are more oriented at pure codec parsing
  and data retrieval, rather than determining which pins/converters
  are to be used for creating PCMs.

This is quite a large change; it may be appropriate to simply read the
result of the patch rather than the diffs. Some small parts of the change
might be separable into different patches, but I think the bulk of the
change will probably always be one large patch. Hopefully the change
isn't too opaque!

This has been tested on:

* NVIDIA GeForce 400 series discrete graphics card. This model has the
  classical 1:1:1 codec:converter:pcm widget model. Tested stereo PCM
  audio to a PC monitor that supports audio.

* NVIDIA GeForce 520 discrete graphics card. This model is the new
  1 codec n converters m pins m>n model. Tested stereo PCM audio to a
  PC monitor that supports audio.

* NVIDIA GeForce 400 series laptop graphics chip. This model has the
  classical 1:1:1 codec:converter:pcm widget model. Tested stereo PCM,
  multi-channel PCM, and AC3 pass-through to an AV receiver.

* Intel Ibex Peak laptop. This model is the new 1 codec n converters m
  pins m>n model. Tested stereo PCM, multi-channel PCM, and AC3 pass-
  through to an AV receiver.

Note that I'm not familiar at all with AC3 pass-through. Hence, I may
not have covered all possible mechanisms that are applicable here. I do
know that my receiver definitely received AC3, not decoded PCM. I tested
with mplayer's "-afm hwac3" and/or "-af lavcac3enc" options, and alsa a
WAV file that I believe has AC3 content rather than PCM.

I also tested:
* Play a stream
* Mute while playing
* Stop stream
* Play some other streams to re-assign the converter to a different
  pin, PCM, set of SPDIF controls, ... hence hopefully triggering
  cleanup for the original PCM.
* Unmute original stream while not playing
* Play a stream on the original pin/PCM.

This was to test SPDIF control virtualization.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: hda: hdmi_eld_update_pcm_info: update a stream in place
Stephen Warren [Wed, 1 Jun 2011 17:14:20 +0000 (11:14 -0600)]
ALSA: hda: hdmi_eld_update_pcm_info: update a stream in place

A future change won't store an entire hda_pcm_stream just to represent
the capabilities of a codec; a custom data-structure will be used. To
ease that transition, modify hdmi_eld_update_pcm_info to expect the
hda_pcm_stream to be pre-initialized with the codec's capabilities, and
to update those capabilities in-place based on the ELD.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: hda: Separate generic and non-generic implementations
Stephen Warren [Wed, 1 Jun 2011 17:14:19 +0000 (11:14 -0600)]
ALSA: hda: Separate generic and non-generic implementations

A future change will significantly rework the generic implementation
in order to support codecs with a different number of pins and
converters. Isolate the more custom codec variants from this change by
duplicating the small portions of generic code they share. This
simplifies the later rework of that previously shared code, since we
don't have to consider the more custom codecs, and also prevents
support for those codecs from regressing.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: hda: Virtualize SPDIF out controls
Stephen Warren [Wed, 1 Jun 2011 17:14:18 +0000 (11:14 -0600)]
ALSA: hda: Virtualize SPDIF out controls

The SPDIF output controls apply to converter widgets. A future change
will create a PCM device per pin widget, and hence a set of SPDIF output
controls per pin widget, for certain HDMI codecs. To support this, we
need the ability to virtualize the SPDIF output controls. Specifically:

* Controls can be "unassigned" from real hardware when a converter is
  not used for the PCM the control was created for.
* Control puts only write to hardware when they are assigned.
* Controls can be "assigned" to real hardware when a converter is picked
  to support output for a particular PCM.
* When a converter is assigned, the hardware is updated to the cached
  configuration.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: hda: Allow multple SPDIF controls per codec
Stephen Warren [Wed, 1 Jun 2011 17:14:17 +0000 (11:14 -0600)]
ALSA: hda: Allow multple SPDIF controls per codec

Currently, the data that backs the kcontrols created by
snd_hda_create_spdif_out_ctls is stored directly in struct hda_codec. When
multiple sets of these controls are stored, they will all manipulate the
same data, causing confusion. Instead, store an array of this data, one
copy per converter, to isolate the controls.

This patch would cause a behavioural change in the case where
snd_hda_create_spdif_out_ctls was called multiple times for a single codec.
As best I can tell, this is never the case for any codec.

This will be relevant at least for some HDMI audio codecs, such as the
NVIDIA GeForce 520 and Intel Ibex Peak. A future change will modify the
driver's handling of those codecs to create multiple PCMs per codec. Note
that this issue isn't affected by whether one creates a PCM-per-converter
or PCM-per-pin; there are multiple of both within a single codec in both
of those codecs.

Note that those codecs don't currently create multiple PCMs for the codec
due to the default HW mux state of all pins being to point at the same
converter, hence there is only a single converter routed to any pin, and
hence only a single PCM.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: hda: Gate ELD usage only by whether ELD is valid
Stephen Warren [Wed, 1 Jun 2011 17:14:16 +0000 (11:14 -0600)]
ALSA: hda: Gate ELD usage only by whether ELD is valid

It's perfectly valid for an ELD to contain no SADs. This simply means that
only basic audio is supoprted.

In this case, we still want to limit a PCM's capabilities based on the ELD.

History:

* Originally, ELD application was limited solely by sad_count>0, which
  was used to check that an ELD had been read.
* Later, eld_valid was added to the conditions to satisfy.

This change removes the original sad_count>0 check, which when squashed
with the above two changes ends up replacing if (sad_count) with
if (eld_valid).

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoMerge branch 'for-3.0' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound...
Mark Brown [Mon, 6 Jun 2011 09:38:23 +0000 (10:38 +0100)]
Merge branch 'for-3.0' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into for-3.0

13 years agoLinux 3.0-rc2 v3.0-rc2
Linus Torvalds [Mon, 6 Jun 2011 09:06:33 +0000 (18:06 +0900)]
Linux 3.0-rc2

13 years agomm: fix ENOSPC returned by handle_mm_fault()
Hugh Dickins [Mon, 6 Jun 2011 05:03:13 +0000 (22:03 -0700)]
mm: fix ENOSPC returned by handle_mm_fault()

Al Viro observes that in the hugetlb case, handle_mm_fault() may return
a value of the kind ENOSPC when its caller is expecting a value of the
kind VM_FAULT_SIGBUS: fix alloc_huge_page()'s failure returns.

Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Mon, 6 Jun 2011 08:51:28 +0000 (17:51 +0900)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: usb - turn off de-emphasis in s/pdif for cm6206
  ALSA: asihpi: Use angle brackets for system includes
  ALSA: fm801: add error handling if auto-detect fails
  ALSA: hda - Check pin support EAPD in ad198x_power_eapd_write
  ALSA: hda - Fix HP and Front pins of ad1988/ad1989 in ad198x_power_eapd()
  ALSA: 6fire: Don't leak firmware in error path
  ASoC: Fix wm_hubs input PGA ZC bits
  ASoC: Fix dapm_is_shared_kcontrol so everything isn't shared

13 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
Linus Torvalds [Mon, 6 Jun 2011 08:48:02 +0000 (17:48 +0900)]
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging:
  hwmon: (max6642): Better chip detection schema
  hwmon: (coretemp) Further relax temperature range checks
  hwmon: (coretemp) Fix TjMax detection for older CPUs
  hwmon: (coretemp) Relax target temperature range check
  hwmon: (max6642) Rename temp_fault sysfs attribute to temp2_fault

13 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Mon, 6 Jun 2011 07:28:49 +0000 (09:28 +0200)]
Merge branch 'fix/asoc' into for-linus

13 years agoMerge branch 'for-linus' of git://android.git.kernel.org/kernel/tegra
Linus Torvalds [Sat, 4 Jun 2011 23:11:11 +0000 (08:11 +0900)]
Merge branch 'for-linus' of git://android.git.kernel.org/kernel/tegra

* 'for-linus' of git://android.git.kernel.org/kernel/tegra:
  ARM: Tegra: Harmony: Fix conflicting GPIO numbering

13 years agoARM: Tegra: Harmony: Fix conflicting GPIO numbering
Stephen Warren [Tue, 31 May 2011 21:14:07 +0000 (15:14 -0600)]
ARM: Tegra: Harmony: Fix conflicting GPIO numbering

Currently, both the WM8903 and TPS6586x chips attempt to register with
gpiolib using the same GPIO numbers. This causes the audio driver to
fail to initialize.

To solve this, add a define to board-harmony.h for the TPS6586x, and make
board-harmony-power.c use this define, instead of directly referencing
TEGRA_NR_GPIOS.

This fixes a regression introduced by commit
6f168f2fa60f87e85e0df25e87e2372f22f5eb7c.
ARM: tegra: harmony: initialize the TPS65862 PMIC

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
Linus Torvalds [Sat, 4 Jun 2011 21:17:23 +0000 (06:17 +0900)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (25 commits)
  btrfs: fix uninitialized variable warning
  btrfs: add helper for fs_info->closing
  Btrfs: add mount -o inode_cache
  btrfs: scrub: add explicit plugging
  btrfs: use btrfs_ino to access inode number
  Btrfs: don't save the inode cache if we are deleting this root
  btrfs: false BUG_ON when degraded
  Btrfs: don't save the inode cache in non-FS roots
  Btrfs: make sure we don't overflow the free space cache crc page
  Btrfs: fix uninit variable in the delayed inode code
  btrfs: scrub: don't reuse bios and pages
  Btrfs: leave spinning on lookup and map the leaf
  Btrfs: check for duplicate entries in the free space cache
  Btrfs: don't try to allocate from a block group that doesn't have enough space
  Btrfs: don't always do readahead
  Btrfs: try not to sleep as much when doing slow caching
  Btrfs: kill BTRFS_I(inode)->block_group
  Btrfs: don't look at the extent buffer level 3 times in a row
  Btrfs: map the node block when looking for readahead targets
  Btrfs: set range_start to the right start in count_range_bits
  ...

13 years agohwmon: (max6642): Better chip detection schema
Per Dalén [Thu, 26 May 2011 13:08:53 +0000 (09:08 -0400)]
hwmon: (max6642): Better chip detection schema

Improve detection of MAX6642 by reading non existing registers (0x04, 0x06
and 0xff). Reading those registers returns the previously read value.

Signed-off-by: Per Dalen <per.dalen@appeartv.com>
[guenter.roeck@ericsson.com: added second set of register reads]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Linus Torvalds [Sat, 4 Jun 2011 14:19:51 +0000 (23:19 +0900)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] Fix oops caused by queue refcounting failure

13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Sat, 4 Jun 2011 14:16:00 +0000 (23:16 +0900)]
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: (40 commits)
  tg3: Fix tg3_skb_error_unmap()
  net: tracepoint of net_dev_xmit sees freed skb and causes panic
  drivers/net/can/flexcan.c: add missing clk_put
  net: dm9000: Get the chip in a known good state before enabling interrupts
  drivers/net/davinci_emac.c: add missing clk_put
  af-packet: Add flag to distinguish VID 0 from no-vlan.
  caif: Fix race when conditionally taking rtnl lock
  usbnet/cdc_ncm: add missing .reset_resume hook
  vlan: fix typo in vlan_dev_hard_start_xmit()
  net/ipv4: Check for mistakenly passed in non-IPv4 address
  iwl4965: correctly validate temperature value
  bluetooth l2cap: fix locking in l2cap_global_chan_by_psm
  ath9k: fix two more bugs in tx power
  cfg80211: don't drop p2p probe responses
  Revert "net: fix section mismatches"
  drivers/net/usb/catc.c: Fix potential deadlock in catc_ctrl_run()
  sctp: stop pending timers and purge queues when peer restart asoc
  drivers/net: ks8842 Fix crash on received packet when in PIO mode.
  ip_options_compile: properly handle unaligned pointer
  iwlagn: fix incorrect PCI subsystem id for 6150 devices
  ...

13 years agobtrfs: fix uninitialized variable warning
David Sterba [Fri, 3 Jun 2011 14:29:08 +0000 (16:29 +0200)]
btrfs: fix uninitialized variable warning

With Linus' tree, today's linux-next build (powercp ppc64_defconfig)
produced this warning:

fs/btrfs/delayed-inode.c: In function 'btrfs_delayed_update_inode':
fs/btrfs/delayed-inode.c:1598:6: warning: 'ret' may be used
uninitialized in this function

Introduced by commit 16cdcec736cd ("btrfs: implement delayed inode items
operation").

This fixes a bug in btrfs_update_inode(): if the returned value from
btrfs_delayed_update_inode is a nonzero garbage, inode stat data are not
updated and several call paths may hit a BUG_ON or fail with strange
code.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David Sterba <dsterba@suse.cz>
13 years agobtrfs: add helper for fs_info->closing
David Sterba [Tue, 31 May 2011 16:07:27 +0000 (18:07 +0200)]
btrfs: add helper for fs_info->closing

wrap checking of filesystem 'closing' flag and fix a few missing memory
barriers.

Signed-off-by: David Sterba <dsterba@suse.cz>
13 years agoBtrfs: add mount -o inode_cache
Chris Mason [Fri, 3 Jun 2011 13:36:29 +0000 (09:36 -0400)]
Btrfs: add mount -o inode_cache

This makes the inode map cache default to off until we
fix the overflow problem when the free space crcs don't fit
inside a single page.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agobtrfs: scrub: add explicit plugging
Arne Jansen [Sat, 28 May 2011 20:58:38 +0000 (20:58 +0000)]
btrfs: scrub: add explicit plugging

With the removal of the implicit plugging scrub ends up doing more and
smaller I/O than necessary. This patch adds explicit plugging per chunk.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agobtrfs: use btrfs_ino to access inode number
David Sterba [Tue, 31 May 2011 17:08:14 +0000 (17:08 +0000)]
btrfs: use btrfs_ino to access inode number

commit 4cb5300bc ("Btrfs: add mount -o auto_defrag") accesses inode
number directly while it should use the helper with the new inode
number allocator.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: don't save the inode cache if we are deleting this root
Josef Bacik [Tue, 31 May 2011 19:33:33 +0000 (19:33 +0000)]
Btrfs: don't save the inode cache if we are deleting this root

With xfstest 254 I can panic the box every time with the inode number caching
stuff on.  This is because we clean the inodes out when we delete the subvolume,
but then we write out the inode cache which adds an inode to the subvolume inode
tree, and then when it gets evicted again the root gets added back on the dead
roots list and is deleted again, so we have a double free.  To stop this from
happening just return 0 if refs is 0 (and we're not the tree root since tree
root always has refs of 0).  With this fix 254 no longer panics.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Tested-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agobtrfs: false BUG_ON when degraded
Arne Jansen [Mon, 30 May 2011 08:36:16 +0000 (08:36 +0000)]
btrfs: false BUG_ON when degraded

In degraded mode the struct btrfs_device of missing devs don't have
device->name set. A kstrdup of NULL correctly returns NULL. Don't
BUG in this case.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: don't save the inode cache in non-FS roots
liubo [Wed, 1 Jun 2011 09:42:49 +0000 (09:42 +0000)]
Btrfs: don't save the inode cache in non-FS roots

This adds extra checks to make sure the inode map we are caching really
belongs to a FS root instead of a special relocation tree.  It
prevents crashes during balancing operations.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: make sure we don't overflow the free space cache crc page
Chris Mason [Fri, 3 Jun 2011 05:26:53 +0000 (01:26 -0400)]
Btrfs: make sure we don't overflow the free space cache crc page

The free space cache uses only one page for crcs right now,
which means we can't have a cache file bigger than the
crcs we can fit in the first page.  This adds a check to
enforce that restriction.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: fix uninit variable in the delayed inode code
Chris Mason [Fri, 3 Jun 2011 05:13:45 +0000 (01:13 -0400)]
Btrfs: fix uninit variable in the delayed inode code

The nitems counter needs to start at zero

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agobtrfs: scrub: don't reuse bios and pages
Arne Jansen [Sat, 28 May 2011 19:57:55 +0000 (21:57 +0200)]
btrfs: scrub: don't reuse bios and pages

The current scrub implementation reuses bios and pages as often as possible,
allocating them only on start and releasing them when finished. This leads
to more problems with the block layer than it's worth. The elevator gets
confused when there are more pages added to the bio than bi_size suggests.
This patch completely rips out the reuse of bios and pages and allocates
them freshly for each submit.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Chris Maosn <chris.mason@oracle.com>
13 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Fri, 3 Jun 2011 23:11:26 +0000 (08:11 +0900)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

* 'for-linus' of git://git.kernel.dk/linux-block:
  block: Use hlist_entry() for io_context.cic_list.first
  cfq-iosched: Remove bogus check in queue_fail path
  xen/blkback: potential null dereference in error handling
  xen/blkback: don't call vbd_size() if bd_disk is NULL
  block: blkdev_get() should access ->bd_disk only after success
  CFQ: Fix typo and remove unnecessary semicolon
  block: remove unwanted semicolons
  Revert "block: Remove extra discard_alignment from hd_struct."
  nbd: adjust 'max_part' according to part_shift
  nbd: limit module parameters to a sane value
  nbd: pass MSG_* flags to kernel_recvmsg()
  block: improve the bio_add_page() and bio_add_pc_page() descriptions

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier...
Linus Torvalds [Fri, 3 Jun 2011 23:04:10 +0000 (08:04 +0900)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin:
  Blackfin: strncpy: fix handling of zero lengths

13 years agoMerge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux...
Linus Torvalds [Fri, 3 Jun 2011 23:03:16 +0000 (08:03 +0900)]
Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile

* 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  asm-generic/unistd.h: support sendmmsg syscall
  tile: enable CONFIG_BUGVERBOSE

13 years agoMerge branch 'linux-next' of git://git.infradead.org/ubifs-2.6
Linus Torvalds [Fri, 3 Jun 2011 22:59:32 +0000 (07:59 +0900)]
Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6

* 'linux-next' of git://git.infradead.org/ubifs-2.6:
  UBIFS: fix-up free space earlier
  UBIFS: intialize LPT earlier
  UBIFS: assert no fixup when writing a node
  UBIFS: fix clean znode counter corruption in error cases
  UBIFS: fix memory leak on error path
  UBIFS: fix shrinker object count reports
  UBIFS: fix recovery broken by the previous recovery fix
  UBIFS: amend ubifs_recover_leb interface
  UBIFS: introduce a "grouped" journal head flag
  UBIFS: supress false error messages

13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
Linus Torvalds [Fri, 3 Jun 2011 22:58:48 +0000 (07:58 +0900)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-ktest

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-ktest:
  ktest: Ignore unset values of the minconfig in config_bisect
  ktest: Fix result of rebooting the kernel
  ktest: Fix off-by-one in config bisect result

13 years agoMerge branch 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 3 Jun 2011 22:53:23 +0000 (07:53 +0900)]
Merge branch 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  ARM: mach-shmobile: add DMAC clock definitions on SH7372
  ARM: arch-shmobile: support SDHI card detection on mackerel, using a GPIO
  sh_mobile_meram: MERAM platform data for LCDC

13 years agoMerge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 3 Jun 2011 22:04:25 +0000 (07:04 +0900)]
Merge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  dmaengine: shdma: fix a regression: initialise DMA channels for memcpy
  dmaengine: shdma: Fix up fallout from runtime PM changes.
  Revert "clocksource: sh_cmt: Runtime PM support"
  Revert "clocksource: sh_tmu: Runtime PM support"
  sh: Fix up asm-generic/ptrace.h fallout.
  sh64: Move from P1SEG to CAC_ADDR for consistent sync.
  sh64: asm/pgtable.h needs asm/mmu.h
  sh: asm/tlb.h needs linux/swap.h
  sh: mark DMA slave ID 0 as invalid
  sh: Update shmin to reflect PIO dependency.
  sh: arch/sh/kernel/process_32.c needs linux/prefetch.h.
  sh: add MMCIF runtime PM support on ecovec
  sh: switch ap325rxa to dynamically manage the platform camera

13 years agoRevert "ASoC: Update cx20442 for TTY API change"
Linus Torvalds [Fri, 3 Jun 2011 22:00:50 +0000 (07:00 +0900)]
Revert "ASoC: Update cx20442 for TTY API change"

This reverts commit ed0bd2333cffc3d856db9beb829543c1dfc00982.

Since we reverted the TTY API change, we should revert the ASoC update
to it too.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoRevert "tty: make receive_buf() return the amout of bytes received"
Linus Torvalds [Fri, 3 Jun 2011 21:33:24 +0000 (06:33 +0900)]
Revert "tty: make receive_buf() return the amout of bytes received"

This reverts commit b1c43f82c5aa265442f82dba31ce985ebb7aa71c.

It was broken in so many ways, and results in random odd pty issues.

It re-introduced the buggy schedule_work() in flush_to_ldisc() that can
cause endless work-loops (see commit a5660b41af6a: "tty: fix endless
work loop when the buffer fills up").

It also used an "unsigned int" return value fo the ->receive_buf()
function, but then made multiple functions return a negative error code,
and didn't actually check for the error in the caller.

And it didn't actually work at all.  BenH bisected down odd tty behavior
to it:
  "It looks like the patch is causing some major malfunctions of the X
   server for me, possibly related to PTYs.  For example, cat'ing a
   large file in a gnome terminal hangs the kernel for -minutes- in a
   loop of what looks like flush_to_ldisc/workqueue code, (some ftrace
   data in the quoted bits further down).

   ...

   Some more data: It -looks- like what happens is that the
   flush_to_ldisc work queue entry constantly re-queues itself (because
   the PTY is full ?) and the workqueue thread will basically loop
   forver calling it without ever scheduling, thus starving the consumer
   process that could have emptied the PTY."

which is pretty much exactly the problem we fixed in a5660b41af6a.

Milton Miller pointed out the 'unsigned int' issue.

Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reported-by: Milton Miller <miltonm@bga.com>
Cc: Stefan Bigler <stefan.bigler@keymile.com>
Cc: Toby Gray <toby.gray@realvnc.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Fri, 3 Jun 2011 18:31:50 +0000 (14:31 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into for-davem