profile/ivi/kernel-x86-ivi.git
11 years agoALSA: hda - Dynamically turn on/off EAPD in generic codec driver
Takashi Iwai [Thu, 20 Dec 2012 14:36:30 +0000 (15:36 +0100)]
ALSA: hda - Dynamically turn on/off EAPD in generic codec driver

When spec->own_eapd_ctl isn't set, try to turn on/off EAPD on demand
for each pin.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Fix initialization of primary outputs in hda_generic.c
Takashi Iwai [Thu, 20 Dec 2012 14:29:21 +0000 (15:29 +0100)]
ALSA: hda - Fix initialization of primary outputs in hda_generic.c

There were some old codes that look not stable enough, which was
derived from the old Realtek code.  The initialization for primary
output in init_multi_out() needs to consider the case of shared DAC.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Refactor init_extra_out() in hda_generic.c
Takashi Iwai [Thu, 20 Dec 2012 14:27:24 +0000 (15:27 +0100)]
ALSA: hda - Refactor init_extra_out() in hda_generic.c

Just a small clean up by splitting a function.
No functional changes at all.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Clear unsol enable bits on unused pins in generic parser
Takashi Iwai [Thu, 20 Dec 2012 14:16:09 +0000 (15:16 +0100)]
ALSA: hda - Clear unsol enable bits on unused pins in generic parser

For preliminary works to migrate the generic parser for Conexant
codecs: the same function is ported to hda_generic.c.
But now it looks through the jack detect table so that it can cover
better.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Add spec->vmaster_mute_enum flag to generic parser
Takashi Iwai [Thu, 20 Dec 2012 13:57:18 +0000 (14:57 +0100)]
ALSA: hda - Add spec->vmaster_mute_enum flag to generic parser

Add a flag to indicate whether the vmaster mute hook enum is exposed
or not.  Conexant codecs may want not to expose the control depending
on the model.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Begin HDA_GEN_* event tag from 1
Takashi Iwai [Thu, 20 Dec 2012 13:46:57 +0000 (14:46 +0100)]
ALSA: hda - Begin HDA_GEN_* event tag from 1

... to distinguish from the invalid event type.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Increase the max depth of widget connections
Takashi Iwai [Thu, 20 Dec 2012 13:42:42 +0000 (14:42 +0100)]
ALSA: hda - Increase the max depth of widget connections

Old codecs like AD1986A tend to have long paths as they were just made
to be the way like AC97.  The current max depth 5 can be too short for
such devices.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Avoid access of amp cache element outside mutex
Takashi Iwai [Thu, 20 Dec 2012 11:58:12 +0000 (12:58 +0100)]
ALSA: hda - Avoid access of amp cache element outside mutex

The access to a cache array element could be invalid outside the
mutex, so copy locally for the later references.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Fix wrong dirty check in snd_hda_codec_resume_amp()
Takashi Iwai [Thu, 20 Dec 2012 11:54:18 +0000 (12:54 +0100)]
ALSA: hda - Fix wrong dirty check in snd_hda_codec_resume_amp()

The dirty entry has to be checked at the beginning in the loop, not in
the inner loop for channels.  This caused a regression that the right
channel isn't properly written.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Do sequential writes in snd_hda_gen_init()
Takashi Iwai [Thu, 20 Dec 2012 10:50:58 +0000 (11:50 +0100)]
ALSA: hda - Do sequential writes in snd_hda_gen_init()

This would reduce the number of actually executed verbs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Add / fix comments about capture vol/sw controls in hda_generic.c
Takashi Iwai [Thu, 20 Dec 2012 10:48:54 +0000 (11:48 +0100)]
ALSA: hda - Add / fix comments about capture vol/sw controls in hda_generic.c

A bit of details won't hurt.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Add missing amp cache flush for bound capture vol/sw ctls
Takashi Iwai [Thu, 20 Dec 2012 10:43:47 +0000 (11:43 +0100)]
ALSA: hda - Add missing amp cache flush for bound capture vol/sw ctls

The bound capture volume and switch controls use the cached amp
updates, but it's missing the flushing at the end.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Add snd_hda_codec_flush_*_cache() aliases
Takashi Iwai [Thu, 20 Dec 2012 10:41:54 +0000 (11:41 +0100)]
ALSA: hda - Add snd_hda_codec_flush_*_cache() aliases

It makes easier to understand although these are identical with
snd_hda_codec_resume_*() functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Flush dirty amp caches before writing inv_dmic fix
Takashi Iwai [Thu, 20 Dec 2012 10:33:20 +0000 (11:33 +0100)]
ALSA: hda - Flush dirty amp caches before writing inv_dmic fix

The inverted dmic fix overwrites the right channel amp value, but it
would work only when the amp values have been already actually
written.  Put snd_hda_codec_resume_amp() before the amp write for
flushing caches.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Check CORB overflow
Takashi Iwai [Thu, 20 Dec 2012 10:17:17 +0000 (11:17 +0100)]
ALSA: hda - Check CORB overflow

Add an overflow check of CORB in HD-audio controller and codec drivers
so that flood of sequential writes would work properly.
In the controller side, add a check of CORB read-pointer to make
returning -EAGAIN when it's full.  Meanwhile in the codec side, when
-EAGAIN error is received, it retries the write after flushing the
pending verbs (calling get_response() essentially does it).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Clear cached_write flag in snd_hda_codec_resume_*()
Takashi Iwai [Thu, 20 Dec 2012 10:02:00 +0000 (11:02 +0100)]
ALSA: hda - Clear cached_write flag in snd_hda_codec_resume_*()

These functions are supposed to be called at finishing the cached
sequential writes, so clear the flag properly for lazy developers who
often forget details.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Clear dirty flag upon cache write
Takashi Iwai [Thu, 20 Dec 2012 10:00:21 +0000 (11:00 +0100)]
ALSA: hda - Clear dirty flag upon cache write

When verbs or amps are actually written to the hardware, we can clear
dirty flag so that the later snd_hda_codec_resume_*() calls can skip
these verbs / amps.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Allow one chance for zero NID in connection list
Takashi Iwai [Thu, 20 Dec 2012 09:45:55 +0000 (10:45 +0100)]
ALSA: hda - Allow one chance for zero NID in connection list

The commit [2e9bf24: ALSA: hda_codec: Check for invalid zero
connections] trims the whole connection list when an invalid value is
reported by the hardware.  But some codecs (at least AD1986A) may give
a zero NID in the middle of the connection list, so dropping the whole
list isn't good for such cases.

In this patch, as a workaround, allow a single zero NID in the read
connection list.  If it hits zero twice, it's handled as an error, so
that we can avoid "too many connections" errors.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Use "Capture Source" for single sources
Takashi Iwai [Wed, 19 Dec 2012 16:41:52 +0000 (17:41 +0100)]
ALSA: hda - Use "Capture Source" for single sources

In general we prefer "Capture Source" to "Input Source".
The latter was chosen in many places just because "Capture Source"
label doesn't work well with the current alsa-lib mixer abstraction
when multiple instances are present.  But when we know that there is a
single input-source element, we can safely choose "Capture Source"
label.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Use generic parser codes for Realtek driver
Takashi Iwai [Wed, 19 Dec 2012 14:22:24 +0000 (15:22 +0100)]
ALSA: hda - Use generic parser codes for Realtek driver

The next migration step is to use the common code in generic driver
for Realtek driver.  This is no drastic change and there should be no
real functional changes, as the generic parser code comes from Realtek
driver originally.

As Realtek driver requires the generic parser code, it needs a
reverse-selection of CONFIG_SND_HDA_GENERIC kconfig.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Export standard jack event handlers for generic parser
Takashi Iwai [Wed, 19 Dec 2012 14:16:44 +0000 (15:16 +0100)]
ALSA: hda - Export standard jack event handlers for generic parser

These handlers are supposed to be called externally from the codec
drivers once when they need to handle own jack events.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Fix NULL dereference in snd_hda_gen_build_controls()
Takashi Iwai [Wed, 19 Dec 2012 14:15:10 +0000 (15:15 +0100)]
ALSA: hda - Fix NULL dereference in snd_hda_gen_build_controls()

When no controls are assigned in the parser (e.g. no analog path),
spec->kctls.list is still NULL.  We need to check it before passing to
snd_hda_add_new_ctls().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Move the call of snd_hda_parse_pin_defcfg() from snd_hda_gen_parse_auto_c...
Takashi Iwai [Wed, 19 Dec 2012 13:41:21 +0000 (14:41 +0100)]
ALSA: hda - Move the call of snd_hda_parse_pin_defcfg() from snd_hda_gen_parse_auto_config()

In some cases, we want to manipulate the auto_pin_cfg table before
passing to snd_hda_gen_parse_auto_config() (e.g. Realtek SSID check
code fiddles with the headphone pin).   Also passing ignore_pins just
for snd_hda_parse_pin_defcfg() isn't good.

In this patch, snd_hda_gen_parse_auto_config() is changed to receive
the auto_pin_cfg table to be parsed.  The passed auto_pin_cfg table
must have been initialized (typically by calling
snd_hda_gen_parse_auto_config()) beforehand by the caller.

Also together with this change, spec->parse_flags is also removed.
Since this was referred only at the place calling
snd_hda_parse_pin_defcfg(), no longer needed to be kept in spec.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Export snd_hda_gen_add_kctl()
Takashi Iwai [Wed, 19 Dec 2012 13:38:33 +0000 (14:38 +0100)]
ALSA: hda - Export snd_hda_gen_add_kctl()

It may be used in other codec drivers, so let it free.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Add EAPD control to generic parser
Takashi Iwai [Wed, 19 Dec 2012 12:01:54 +0000 (13:01 +0100)]
ALSA: hda - Add EAPD control to generic parser

Enable EAPD in output path initializations automatically unless the
new flag spec->own_eapd_ctl is set.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Merge Realtek parser code to generic parser
Takashi Iwai [Wed, 19 Dec 2012 11:52:06 +0000 (12:52 +0100)]
ALSA: hda - Merge Realtek parser code to generic parser

Finally the whole generic parser code in Realtek driver is moved into
hda_generic.c so that it can be used for generic codec driver.
The old dumb generic driver is replaced.  Yay.

The future plan is to adapt this generic parser for other codecs,
i.e. the codec driver calls the exported functions in generic driver
but adds some codec-specific fixes and setups.

As of this commit, the complete driver code is still duplicated in
Realtek codec driver.  The big code reduction will come from now on.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Remove redundant argument from alc_mux_select()
Takashi Iwai [Wed, 19 Dec 2012 11:24:03 +0000 (12:24 +0100)]
ALSA: hda/realtek - Remove redundant argument from alc_mux_select()

The argument "force" is always false in the recent code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - More generic auto-mic switching for Realtek codecs
Takashi Iwai [Thu, 29 Nov 2012 08:56:50 +0000 (09:56 +0100)]
ALSA: hda - More generic auto-mic switching for Realtek codecs

This patch extends the capability of the auto-mic feature.
Instead of limiting the automatic input-source selection only to the
mics (internal, external and dock mics), allow it for generic inputs,
e.g. switching between the rear line-in and the front mic.

The logic is to check the attribute and location of input pins, and
enable the automatic selection feature only if all such pins are in
different locations (e.g. internal, front, rear, etc) and line-in or
mic pins.  That is, if multiple input pins are assigned to a single
location, the feature isn't enabled because we don't know the
priority.

(You may wonder why this restriction doesn't exist for the headphone
 automute.  The reason is that the output case is different from the
 input: the input source is an exclusive selection while the output
 can be multiplexed.)

Note that, for avoiding regressions, the line-in auto switching
feature isn't activated as default.  It has to be set explicitly via
spec->line_in_auto_switch flag in a fixup code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Rearrange INPUT_PIN_ATTR_*
Takashi Iwai [Wed, 28 Nov 2012 17:11:59 +0000 (18:11 +0100)]
ALSA: hda - Rearrange INPUT_PIN_ATTR_*

Put INPUT_PIN_ATTR_FRONT after INPUT_PIN_ATTR_REAR, and define
INPUT_PIN_ATTR_LAST to point to the last element.

This is a preliminary work for cleaning up Realtek auto-mic parser.
In the auto-mic implementation, the front panel is preferred over the
rear panel.  By arranging the attr definitions like in this commit, we
can simply use sort() for figuring out the priority order.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Fix split stereo dmic code
Takashi Iwai [Wed, 19 Dec 2012 10:39:00 +0000 (11:39 +0100)]
ALSA: hda/realtek - Fix split stereo dmic code

The previous commit passed an utterly wrong value for checking the
split inv dmic pin.  This patch fixes it and also tries to remove
inv_dmic_split_idx field.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Move fixup code into struct hda_codec
Takashi Iwai [Tue, 18 Dec 2012 17:12:44 +0000 (18:12 +0100)]
ALSA: hda - Move fixup code into struct hda_codec

Since the fixup code is used commonly, it's worth to move it to the
common place, struct hda_codec, instead of keeping in hda_gen_spec.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Add conexant-style inverted dmic handling
Takashi Iwai [Tue, 18 Dec 2012 16:24:25 +0000 (17:24 +0100)]
ALSA: hda/realtek - Add conexant-style inverted dmic handling

To make the parser more generic, a few codes to handle the inverted
stereo dmic in a way Conexant parser does is added in this patch.

The caller should set spec->inv_dmic_split flag appropriately.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Allow multiple individual capture volume/switch controls
Takashi Iwai [Tue, 18 Dec 2012 16:18:21 +0000 (17:18 +0100)]
ALSA: hda/realtek - Allow multiple individual capture volume/switch controls

So far we create only "Capture Volume" and "Capture Switch" controls
for binding all possible amps, but we'd prefer creating individual
capture volume and switch controls per input in some cases
(e.g. conexant parser does it).

Add a new flag, spec->multi_cap_vol, to follow that policy.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Allow passing name=NULL to alc_kcontrol_new()
Takashi Iwai [Tue, 18 Dec 2012 14:35:11 +0000 (15:35 +0100)]
ALSA: hda/realtek - Allow passing name=NULL to alc_kcontrol_new()

This prevents stupid typos.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Merge a few split functions
Takashi Iwai [Tue, 18 Dec 2012 14:30:41 +0000 (15:30 +0100)]
ALSA: hda/realtek - Merge a few split functions

Merge a few functions that have been split due to historical reasons
to single functions.  Splitting too much (and placing too far away)
actually worsens the readability.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Assign Master mixer when possible
Takashi Iwai [Tue, 18 Dec 2012 16:33:04 +0000 (17:33 +0100)]
ALSA: hda/realtek - Assign Master mixer when possible

There are a few more cases where we can assign "Master" mixer element
safely, e.g. when a single DAC is used in the whole output paths.

Also, when vmaster hook is present, avoid "Master" but assign "PCM"
instead.  Otherwise vmaster hook won't work properly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Handle vmaster hook in the parser side
Takashi Iwai [Tue, 18 Dec 2012 13:57:09 +0000 (14:57 +0100)]
ALSA: hda/realtek - Handle vmaster hook in the parser side

... so that the fixup just needs to set the hook function in
FIXUP_ACT_PROBE.  This will make easier to port for other codecs,
too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Remove unused fields and macro definitions
Takashi Iwai [Tue, 18 Dec 2012 13:33:21 +0000 (14:33 +0100)]
ALSA: hda/realtek - Remove unused fields and macro definitions

Also arranged alc_spec definitions to optimize bit fields.
Use a bit field for spec->need_dac_fix, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Drop auto_mic_valid_imux flag
Takashi Iwai [Tue, 18 Dec 2012 13:29:52 +0000 (14:29 +0100)]
ALSA: hda/realtek - Drop auto_mic_valid_imux flag

This flag is superfluous now and it's always as same as
spec->auto_mic.  Let's drop.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Allow different pins for shared hp/mic vref check
Takashi Iwai [Tue, 18 Dec 2012 13:22:45 +0000 (14:22 +0100)]
ALSA: hda/realtek - Allow different pins for shared hp/mic vref check

Add a new field to indicate the possible pin NID for alternative vref
setup for the shared hp/mic.  Although 0x18 is valid for all Realtek
codecs, it'll be different on other vendor's codecs.

Also, drop the sanity check in update_shared_mic_hp() since the
reference pin is set explicitly in the caller side.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Parse digital input path
Takashi Iwai [Tue, 18 Dec 2012 10:55:53 +0000 (11:55 +0100)]
ALSA: hda/realtek - Parse digital input path

This was the last forgotten path.  Now it's parsed via the same path
parser.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Rename add_new_out_path() with add_new_nid_path()
Takashi Iwai [Tue, 18 Dec 2012 10:46:37 +0000 (11:46 +0100)]
ALSA: hda/realtek - Rename add_new_out_path() with add_new_nid_path()

Make the function more generic for both input and output directions,
and returns the assigned path pointer.  The argument order is changed
to follow the standard (from, to) way.

Now this new function is used for analog input and loopback path
parser codes, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Remove superfluous input amp init
Takashi Iwai [Tue, 18 Dec 2012 08:06:01 +0000 (09:06 +0100)]
ALSA: hda/realtek - Remove superfluous input amp init

The amps will be initialized via activate_path(), thus it's
superfluous to set in alc_auto_init_analog_input().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Clean up some spec fields
Takashi Iwai [Tue, 18 Dec 2012 07:57:05 +0000 (08:57 +0100)]
ALSA: hda/realtek - Clean up some spec fields

Remove some fields from struct alc_spec, and clean up the usage.
Namely,
- spec->input_mux becomes a single element, private_imux[] is removed
- spec->adc_nids becomes an array by itself, and private_adc_nids[]
  gets removed, too

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Make input path parser more generic
Takashi Iwai [Mon, 17 Dec 2012 19:29:29 +0000 (20:29 +0100)]
ALSA: hda/realtek - Make input path parser more generic

Now we reached to the final big piece of parser rewrite: the input
paths.  While the old parser code assumes the more-or-less direct and
similar connections from input pin to ADC, the new code handles the
complete input paths.  The capture source is switched by simple calls
of activate_path() function.

The parsing of capture volume and capture switches is, however, not
fully generalized.  It assumes that amps are available in the vicinity
of ADCs (in three depth).  This isn't perfect but it should cover all
codecs I know of.

Also, this commit removes some NID mapping of capture-related controls
temporarily for simplicity.  It'll be restored in later commits.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Don't change connection at path deactivation
Takashi Iwai [Mon, 17 Dec 2012 17:00:02 +0000 (18:00 +0100)]
ALSA: hda/realtek - Don't change connection at path deactivation

The widget connection selection must be changed only when the path is
enabled.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Initialize loopback paths properly
Takashi Iwai [Fri, 14 Dec 2012 17:26:02 +0000 (18:26 +0100)]
ALSA: hda/realtek - Initialize loopback paths properly

Now we have a complete list of loopback paths, thus we can initialize
the paths more completely based on it, instead of assuming a direct
connection from pin to mixer.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Add boost volumes to path list
Takashi Iwai [Fri, 14 Dec 2012 17:19:04 +0000 (18:19 +0100)]
ALSA: hda/realtek - Add boost volumes to path list

Don't forget to take boost volumes into account in the managed path
list.  Since it's an additional volume, we need to extend the ctls[]
array.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Add missing initialization of multi-io routes
Takashi Iwai [Fri, 14 Dec 2012 17:04:37 +0000 (18:04 +0100)]
ALSA: hda/realtek - Add missing initialization of multi-io routes

The paths used for multi-io haven't been initialized properly, so
far.  It's usually no big matter because the pins are set to input as
default, but it's still cleaner to initialize the paths properly.

Now with the path active/inactive check, we can do it easily.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Fix the initialization of pin amp-in
Takashi Iwai [Fri, 14 Dec 2012 16:53:29 +0000 (17:53 +0100)]
ALSA: hda/realtek - Fix the initialization of pin amp-in

The pin widget has only a single amp value for the input even if it
has multiple "sources".  Handle the situation in activate_path().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Rename get_out_path() to get_nid_path()
Takashi Iwai [Fri, 14 Dec 2012 16:34:51 +0000 (17:34 +0100)]
ALSA: hda/realtek - Rename get_out_path() to get_nid_path()

The function can be used not only for output paths but generically.
Also swap the argument order.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Use path-based parser for digital outputs
Takashi Iwai [Fri, 14 Dec 2012 15:54:44 +0000 (16:54 +0100)]
ALSA: hda/realtek - Use path-based parser for digital outputs

Similar like analog output paths, use the path list for parsing and
initializing digital outputs as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Consolidate to a single path list
Takashi Iwai [Fri, 14 Dec 2012 15:39:22 +0000 (16:39 +0100)]
ALSA: hda/realtek - Consolidate to a single path list

We don't have to keep three individual path lists for input, output
and loopback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Consolidate is_reachable_path()
Takashi Iwai [Fri, 14 Dec 2012 15:15:56 +0000 (16:15 +0100)]
ALSA: hda/realtek - Consolidate is_reachable_path()

alc_auto_is_dac_reachable() can be replaced fully with
is_reachable_path().  The only difference is the order of arguments.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Add path active flag
Takashi Iwai [Fri, 14 Dec 2012 15:09:29 +0000 (16:09 +0100)]
ALSA: hda/realtek - Add path active flag

... and rewrite the initialization of output paths as a generic
function that is applicable for both i/o directions.

The new flag, active, is introduced to each nid_path entry.  This
indicates whether the given path is active, and it's used for checking
whether a certain widget can be turned off or changed when a path is
no longer used or newly enabled.

It's still used only in the output paths.  More wider adaption for
input and loopback paths will be achieved in the later patch.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Remove non-standard automute mode
Takashi Iwai [Fri, 14 Dec 2012 13:20:34 +0000 (14:20 +0100)]
ALSA: hda/realtek - Remove non-standard automute mode

We are using only AUTOMUTE_MODE_PIN in patch_realtek.c and all others
have been already dropped.  Let's remove the old superfluous codes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Introduce snd_hda_codec_amp_init*()
Takashi Iwai [Fri, 14 Dec 2012 09:32:21 +0000 (10:32 +0100)]
ALSA: hda - Introduce snd_hda_codec_amp_init*()

The new function snd_hda_codec_amp_init() (and the stereo variant)
initializes the amp value only once at the first access.  If the amp
was already initialized or updated, this won't do anything more.

It's useful for initializing the input amps that are in the part of
the path but never used.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Introduce cache & flush cmd / amp writes
Takashi Iwai [Thu, 13 Dec 2012 17:30:04 +0000 (18:30 +0100)]
ALSA: hda - Introduce cache & flush cmd / amp writes

For optimizing the verb executions, a new mechanism to cache the verbs
and amp update commands is introduced.  With the new "write to cache
and flush" way, you can reduce the same verbs that have been written
multiple times.

When codec->cached_write flag is set, the further
snd_hda_codec_write_cache() and snd_hda_codec_amp_stereo() calls will
be performed only on the command or amp cache table, but not sent to
the hardware yet.  Once after you call all commands and update amps,
call snd_hda_codec_resume_amp() and snd_hda_codec_resume_cache().
Then all cached writes and amp updates will be written to the
hardware, and the dirty flags are cleared.

In this implementation, the existing cache table is reused, so
actually no big code change is seen here.  Each cache entry has a new
dirty flag now (so the cache key is now reduced to 31bit).

As a good side-effect by this change, snd_hda_codec_resume_*() will no
longer execute verbs that have been already issued during the resume
phase by checking the dirty flags.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Remove snd_hda_codec_amp_update() call from patch_*.c
Takashi Iwai [Thu, 13 Dec 2012 16:03:30 +0000 (17:03 +0100)]
ALSA: hda - Remove snd_hda_codec_amp_update() call from patch_*.c

It's used only in one place in patch_analog.c, and it can be replaced
with others better.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Fix initialization of input amps in output paths
Takashi Iwai [Thu, 13 Dec 2012 15:43:52 +0000 (16:43 +0100)]
ALSA: hda/realtek - Fix initialization of input amps in output paths

When initializing the output paths, we assumed the input amps have
almost two inputs blindly.  It's not only generic but even incorrect
for some codecs like ALC268 & co.  Also, the same assumption (two
sources) exists for the bind input-amp controls.

This patch changes the codes in these places to handle the input
connections in a more generic way.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Check amp capabilities of aa-mixer widget
Takashi Iwai [Wed, 12 Dec 2012 17:08:52 +0000 (18:08 +0100)]
ALSA: hda/realtek - Check amp capabilities of aa-mixer widget

For handling the analog-loopback paths more generically, check the amp
capabilities of the aa-mixer widget, and create only the appropriate
mixer elements.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Parse analog loopback paths more generically
Takashi Iwai [Wed, 12 Dec 2012 17:02:41 +0000 (18:02 +0100)]
ALSA: hda/realtek - Parse analog loopback paths more generically

Improve the parser of analog loopback paths and handle in a more
generic way.  The following changes are included in this patch:

- Instead of assuming direct connections between pins and
  the mixer widget, track the whole path between them.  This fixes
  some missing connections like ALC660.

- Introduce the path list for loopback paths like input and output
  path lists.  Currently it's not used for any real purposes, yet.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Parse input paths
Takashi Iwai [Wed, 12 Dec 2012 16:25:00 +0000 (17:25 +0100)]
ALSA: hda/realtek - Parse input paths

Just like the output paths, parse the whole paths for inputs as well
and store in a path list.  For that purpose, rewrite the output parser
code to be generically usable.

The input path list is not referred at all in this patch.  It'll be
used to replace the fixed adc/capsrc array in later patches for more
flexible input path selections.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Make path->idx[] and path->multi[] consistent
Takashi Iwai [Mon, 10 Dec 2012 16:27:57 +0000 (17:27 +0100)]
ALSA: hda/realtek - Make path->idx[] and path->multi[] consistent

So far, idx[i] and multi[i] indicate the attribute of the widget
path[i - 1].  This was just for simplifying the code in
__parse_output_path(), but this is rather confusing for later use.
It's more natural if both idx[i] and multi[i] point to the same widget
of path[i].  This patch changes to that way.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Simplify the output volume initialization
Takashi Iwai [Mon, 10 Dec 2012 16:07:16 +0000 (17:07 +0100)]
ALSA: hda/realtek - Simplify the output volume initialization

Simplify the output path initialization using the existing path
information instead of assuming the topology specific to Realtek
codecs.  This is also implicitly a fix for some amp values on output
pins where the old parser missed (e.g. ALC260 output pins).

The same function alc_auto_set_output_and_unmute() can be used now for
the multi-io activation, since the output selection means nothing but
activating the given output path.

And, finally at this stage, we can get rid of alc_go_down_to_selector()
and other functions that are codec really specifically to Realtek
codecs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Reduce vol/mute ctl lookups at parsing codec
Takashi Iwai [Mon, 10 Dec 2012 15:04:30 +0000 (16:04 +0100)]
ALSA: hda/realtek - Reduce vol/mute ctl lookups at parsing codec

So far, Realtek codec driver evaluates the NIDs for volume and mute
controls twice, once while parsing the DACs and evaluating the
assignment, and another while creating the mixer elements.  This is
utterly redundant and even fragile, as it's assuming that the ctl
element evaluation is identical between both parsing DACs and creating
mixer elements.

This patch simplifies the code flow by doing the volume / mute
controls evaluation only once while parsing the DACs.  The patch ended
up in larger changes than expected because of some cleanups became
mandatory.

As a gratis bonus, this patch also fixes some cases where the stereo
channels are used wrongly for mono amps.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Fix mono amp values in proc output
Takashi Iwai [Mon, 10 Dec 2012 14:58:34 +0000 (15:58 +0100)]
ALSA: hda - Fix mono amp values in proc output

The mono widget is always connected to the left channel, thus the left
channel amp value also should be referred for mono widgets instead of
the right channel.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Manage mixer controls in out_path list
Takashi Iwai [Thu, 6 Dec 2012 17:06:23 +0000 (18:06 +0100)]
ALSA: hda/realtek - Manage mixer controls in out_path list

As we parse the output paths more precisely now, we can use this path
list for parsing the widgets for volume and mute mixer controls.
The spec->vol_ctls[] and sw_ctls[] bitmasks are replaced with the
ctls[] in each output path instance.

Interestingly, this move alone automagically fixes some bugs that the
conflicting volume or mute NIDs weren't properly detected.
Also, by parsing the whole path, there are more chances to get a free
widget for volume/mute controls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Add output path parser
Takashi Iwai [Thu, 6 Dec 2012 14:45:38 +0000 (15:45 +0100)]
ALSA: hda/realtek - Add output path parser

Add the output path parser to Realtek codec driver as we already have
in patch_via.c.  The nid_path struct represents the complete output
path from a DAC to a pin.  The alc_spec contains an array of these
paths, and a new path is added at each time when a new DAC is
assigned.

So far, this path list is used only in limited codes: namely in this
patch, only alc_is_dac_already_used() checks the list instead of dac
arrays in all possible outputs.  In the later development, the path
list will be referred from more places, such as the mixer control
assignment / check, the mute/unmute of active routes, etc.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - List up all available DACs
Takashi Iwai [Wed, 5 Dec 2012 13:17:37 +0000 (14:17 +0100)]
ALSA: hda/realtek - List up all available DACs

In the probing phase, create a list of all available DACs in the codec
and use it for checking the single DAC connections.
This list will be used in more other places in the later commits, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda/realtek - Simplify alc_auto_is_dac_reachable()
Takashi Iwai [Wed, 5 Dec 2012 13:08:45 +0000 (14:08 +0100)]
ALSA: hda/realtek - Simplify alc_auto_is_dac_reachable()

Use the helper function snd_hda_get_conn_index() instead of open
codes.  This also improves the detection of some routes to DAC on
ALC260 (although the difference doesn't influence on the end
results of the mapping).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Add support of new codec ALC284
Kailang Yang [Thu, 10 Jan 2013 09:25:48 +0000 (10:25 +0100)]
ALSA: hda - Add support of new codec ALC284

Added the support for a new codec ALC284, which is compatible with
ALC269.  Also add more codec variants to handle the SSID check
properly.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: usb-audio: Make ebox44_table static
Sachin Kamat [Thu, 10 Jan 2013 05:49:14 +0000 (11:19 +0530)]
ALSA: usb-audio: Make ebox44_table static

Fixes the following sparse warning:
sound/usb/mixer_quirks.c:1209:23: warning:
symbol 'ebox44_table' was not declared. Should it be static?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hdspm - Fix wordclock status on AES32
Andre Schramm [Wed, 9 Jan 2013 13:40:18 +0000 (14:40 +0100)]
ALSA: hdspm - Fix wordclock status on AES32

Use correct bitmask for AES32 cards to determine wordclock lock state,
add missing bitmask for sync check and make output of the corresponding
control and /proc coherent.

Signed-off-by: Andre Schramm <andre.schramm@iosono-sound.com>
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoRevert "ALSA: hda - Shut up pins at power-saving mode with Conexnat codecs"
David Henningsson [Wed, 19 Dec 2012 08:44:47 +0000 (09:44 +0100)]
Revert "ALSA: hda - Shut up pins at power-saving mode with Conexnat codecs"

This reverts commit 697c373e34613609cb5450f98b91fefb6e910588.

The original patch was meant to remove clicking, but in fact caused even
more clicking instead.

Thanks to c4pp4 for doing most of the work with this bug.

BugLink: https://bugs.launchpad.net/bugs/886975
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Disable runtime D3 for Intel CPT & co
Takashi Iwai [Tue, 8 Jan 2013 12:51:30 +0000 (13:51 +0100)]
ALSA: hda - Disable runtime D3 for Intel CPT & co

We've got a few bug reports that the runtime D3 results in the dead
HD-audio controller.  It seems that the problem is in a deeper level
than the sound driver itself, so as a temporal solution, disable the
feature for these controllers again.

Reported-and-tested-by: Vincent Blut <vincent.debian@free.fr>
Reported-and-tested-by: Maurizio Avogadro <mavoga@gmail.com>
Cc: <stable@vger.kernel.org> [v3.7]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec)
David Henningsson [Mon, 7 Jan 2013 11:03:47 +0000 (12:03 +0100)]
ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec)

The mute LED is in this case connected to the Mic1 VREF.

The machine also exposes the following string in BIOS:
"HP_Mute_LED_0_A", so if more machines are coming, it probably
makes sense to try to do something more generic, like for the
IDT codec.

Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/1096789
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: au88x0: fix incorrect left shift
Nickolai Zeldovich [Sat, 5 Jan 2013 19:14:08 +0000 (14:14 -0500)]
ALSA: au88x0: fix incorrect left shift

vortex_wt_setdsout performs bit-negation on the bit position (wt&0x1f)
rather than on the resulting bitmask.  This code is never actually
invoked (vortex_wt_setdsout is always called with en=1), so this does
not currently cause any problem, and this patch is simply cleanup.

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agosound: oss/pas2: Fix possible access out of array
Asim Kadav [Thu, 3 Jan 2013 17:47:26 +0000 (11:47 -0600)]
sound: oss/pas2: Fix possible access out of array

Added a fix for hardware dependence bug where a sound card failure
should not result in reading beyond array memory index.

Signed-off-by: Asim Kadav <kadav@cs.wisc.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: usb-audio: Fix kernel panic of Digidesign Mbox2 quirk
Damien Zammit [Fri, 4 Jan 2013 08:51:44 +0000 (09:51 +0100)]
ALSA: usb-audio: Fix kernel panic of Digidesign Mbox2 quirk

This patch is based on 3.8-rc1. It fixes two things:
1) A kernel panic caused by incorrect allocation of a u8 variable
   "bootresponse".
2) A noisy dmesg (urb status -32) caused by broken pipe to an
   invalid midi endpoint.

It is also a little cleaner because there is no need for a new
QUIRK_MIDI type as suggested by kernel developers, since the device
follows exactly the MIDIMAN protocol.

Signed-off-by: Damien Zammit <damien@zamaudio.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: usb-audio: Add support for Creative BT-D1 via usb sound quirks
Alexander Schremmer [Thu, 3 Jan 2013 11:59:07 +0000 (12:59 +0100)]
ALSA: usb-audio: Add support for Creative BT-D1 via usb sound quirks

Support the Creative BT-D1 Bluetooth USB audio device. Before this
patch, Linux had trouble finding the correct USB descriptors and bailed
out with these messages:

 no or invalid class specific endpoint descriptor

Now it still prints these messages on hotplug:

 snd-usb-audio: probe of ...:1.0 failed with error -5
 snd-usb-audio: probe of ...:1.2 failed with error -5
 snd-usb-audio: probe of ...:1.3 failed with error -5

But the device works correctly, including the HID support.

The patch is diff'ed against 3.8-rc1 but should apply to older kernels
as well.

Signed-off-by: Alexander Schremmer <alex@alexanderweb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoALSA: hda - Switch "On" and "Off" for "Mute-LED Mode" kcontrol
David Henningsson [Thu, 3 Jan 2013 13:12:29 +0000 (14:12 +0100)]
ALSA: hda - Switch "On" and "Off" for "Mute-LED Mode" kcontrol

The vmaster hook sends 1 for enabled/unmuted and 0 for disabled/muted,
but "Mute-LED Mode" being "On" refers to the LED being on, not the
volume being on.
Therefore "On" and "Off" should be switched.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 years agoLinux 3.8-rc1 v3.8-rc1
Linus Torvalds [Sat, 22 Dec 2012 01:19:00 +0000 (17:19 -0800)]
Linux 3.8-rc1

11 years agoMerge git://www.linux-watchdog.org/linux-watchdog
Linus Torvalds [Sat, 22 Dec 2012 01:10:29 +0000 (17:10 -0800)]
Merge git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:
 "This includes some fixes and code improvements (like
  clk_prepare_enable and clk_disable_unprepare), conversion from the
  omap_wdt and twl4030_wdt drivers to the watchdog framework, addition
  of the SB8x0 chipset support and the DA9055 Watchdog driver and some
  OF support for the davinci_wdt driver."

* git://www.linux-watchdog.org/linux-watchdog: (22 commits)
  watchdog: mei: avoid oops in watchdog unregister code path
  watchdog: Orion: Fix possible null-deference in orion_wdt_probe
  watchdog: sp5100_tco: Add SB8x0 chipset support
  watchdog: davinci_wdt: add OF support
  watchdog: da9052: Fix invalid free of devm_ allocated data
  watchdog: twl4030_wdt: Change TWL4030_MODULE_PM_RECEIVER to TWL_MODULE_PM_RECEIVER
  watchdog: remove depends on CONFIG_EXPERIMENTAL
  watchdog: Convert dev_printk(KERN_<LEVEL> to dev_<level>(
  watchdog: DA9055 Watchdog driver
  watchdog: omap_wdt: eliminate goto
  watchdog: omap_wdt: delete redundant platform_set_drvdata() calls
  watchdog: omap_wdt: convert to devm_ functions
  watchdog: omap_wdt: convert to new watchdog core
  watchdog: WatchDog Timer Driver Core: fix comment
  watchdog: s3c2410_wdt: use clk_prepare_enable and clk_disable_unprepare
  watchdog: imx2_wdt: Select the driver via ARCH_MXC
  watchdog: cpu5wdt.c: add missing del_timer call
  watchdog: hpwdt.c: Increase version string
  watchdog: Convert twl4030_wdt to watchdog core
  davinci_wdt: preparation for switch to common clock framework
  ...

11 years agoMerge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Sat, 22 Dec 2012 01:09:07 +0000 (17:09 -0800)]
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6

Pull CIFS fixes from Steve French:
 "Misc small cifs fixes"

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: eliminate cifsERROR variable
  cifs: don't compare uniqueids in cifs_prime_dcache unless server inode numbers are in use
  cifs: fix double-free of "string" in cifs_parse_mount_options

11 years agoMerge tag 'dm-3.8-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm
Linus Torvalds [Sat, 22 Dec 2012 01:08:06 +0000 (17:08 -0800)]
Merge tag 'dm-3.8-fixes' of git://git./linux/kernel/git/agk/linux-dm

Pull dm update from Alasdair G Kergon:
 "Miscellaneous device-mapper fixes, cleanups and performance
  improvements.

  Of particular note:
   - Disable broken WRITE SAME support in all targets except linear and
     striped.  Use it when kcopyd is zeroing blocks.
   - Remove several mempools from targets by moving the data into the
     bio's new front_pad area(which dm calls 'per_bio_data').
   - Fix a race in thin provisioning if discards are misused.
   - Prevent userspace from interfering with the ioctl parameters and
     use kmalloc for the data buffer if it's small instead of vmalloc.
   - Throttle some annoying error messages when I/O fails."

* tag 'dm-3.8-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm: (36 commits)
  dm stripe: add WRITE SAME support
  dm: remove map_info
  dm snapshot: do not use map_context
  dm thin: dont use map_context
  dm raid1: dont use map_context
  dm flakey: dont use map_context
  dm raid1: rename read_record to bio_record
  dm: move target request nr to dm_target_io
  dm snapshot: use per_bio_data
  dm verity: use per_bio_data
  dm raid1: use per_bio_data
  dm: introduce per_bio_data
  dm kcopyd: add WRITE SAME support to dm_kcopyd_zero
  dm linear: add WRITE SAME support
  dm: add WRITE SAME support
  dm: prepare to support WRITE SAME
  dm ioctl: use kmalloc if possible
  dm ioctl: remove PF_MEMALLOC
  dm persistent data: improve improve space map block alloc failure message
  dm thin: use DMERR_LIMIT for errors
  ...

11 years agoRevert "nfsd: warn on odd reply state in nfsd_vfs_read"
J. Bruce Fields [Sat, 22 Dec 2012 00:48:59 +0000 (19:48 -0500)]
Revert "nfsd: warn on odd reply state in nfsd_vfs_read"

This reverts commit 79f77bf9a4e3dd5ead006b8f17e7c4ff07d8374e.

This is obviously wrong, and I have no idea how I missed seeing the
warning in testing: I must just not have looked at the right logs.  The
caller bumps rq_resused/rq_next_page, so it will always be hit on a
large enough read.

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Sat, 22 Dec 2012 00:40:26 +0000 (16:40 -0800)]
Merge tag 'rdma-for-linus' of git://git./linux/kernel/git/roland/infiniband

Pull more infiniband changes from Roland Dreier:
 "Second batch of InfiniBand/RDMA changes for 3.8:
   - cxgb4 changes to fix lookup engine hash collisions
   - mlx4 changes to make flow steering usable
   - fix to IPoIB to avoid pinning dst reference for too long"

* tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  RDMA/cxgb4: Fix bug for active and passive LE hash collision path
  RDMA/cxgb4: Fix LE hash collision bug for passive open connection
  RDMA/cxgb4: Fix LE hash collision bug for active open connection
  mlx4_core: Allow choosing flow steering mode
  mlx4_core: Adjustments to Flow Steering activation logic for SR-IOV
  mlx4_core: Fix error flow in the flow steering wrapper
  mlx4_core: Add QPN enforcement for flow steering rules set by VFs
  cxgb4: Add LE hash collision bug fix path in LLD driver
  cxgb4: Add T4 filter support
  IPoIB: Call skb_dst_drop() once skb is enqueued for sending

11 years agoMerge tag 'asm-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm...
Linus Torvalds [Sat, 22 Dec 2012 00:39:08 +0000 (16:39 -0800)]
Merge tag 'asm-generic' of git://git./linux/kernel/git/arnd/asm-generic

Pull asm-generic cleanup from Arnd Bergmann:
 "These are a few cleanups for asm-generic:

   - a set of patches from Lars-Peter Clausen to generalize asm/mmu.h
     and use it in the architectures that don't need any special
     handling.
   - A patch from Will Deacon to remove the {read,write}s{b,w,l} as
     discussed during the arm64 review
   - A patch from James Hogan that helps with the meta architecture
     series."

* tag 'asm-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  xtensa: Use generic asm/mmu.h for nommu
  h8300: Use generic asm/mmu.h
  c6x: Use generic asm/mmu.h
  asm-generic/mmu.h: Add support for FDPIC
  asm-generic/mmu.h: Remove unused vmlist field from mm_context_t
  asm-generic: io: remove {read,write} string functions
  asm-generic/io.h: remove asm/cacheflush.h include

11 years agoARM: dts: fix duplicated build target and alphabetical sort out for exynos
Kukjin Kim [Fri, 21 Dec 2012 18:02:13 +0000 (10:02 -0800)]
ARM: dts: fix duplicated build target and alphabetical sort out for exynos

Commit db5b0ae00712 ("Merge tag 'dt' of git://git.kernel.org/.../arm-soc")
causes a duplicated build target.  This patch fixes it and sorts out the
build target alphabetically so that we can recognize something wrong
easily.

Cc: Olof Johansson <olof@lixom.net>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agodm stripe: add WRITE SAME support
Mike Snitzer [Fri, 21 Dec 2012 20:23:41 +0000 (20:23 +0000)]
dm stripe: add WRITE SAME support

Rename stripe_map_discard to stripe_map_range and reuse it for WRITE
SAME bio processing.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agodm: remove map_info
Mikulas Patocka [Fri, 21 Dec 2012 20:23:41 +0000 (20:23 +0000)]
dm: remove map_info

This patch removes map_info from bio-based device mapper targets.
map_info is still used for request-based targets.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agodm snapshot: do not use map_context
Mikulas Patocka [Fri, 21 Dec 2012 20:23:41 +0000 (20:23 +0000)]
dm snapshot: do not use map_context

Eliminate struct map_info from dm-snap.

map_info->ptr was used in dm-snap to indicate if the bio was tracked.
If map_info->ptr was non-NULL, the bio was linked in tracked_chunk_hash.

This patch removes the use of map_info->ptr. We determine if the bio was
tracked based on hlist_unhashed(&c->node). If hlist_unhashed is true,
the bio is not tracked, if it is false, the bio is tracked.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agodm thin: dont use map_context
Mikulas Patocka [Fri, 21 Dec 2012 20:23:40 +0000 (20:23 +0000)]
dm thin: dont use map_context

This patch removes endio_hook_pool from dm-thin and uses per-bio data instead.

This patch removes any use of map_info in preparation for the next patch
that removes map_info from bio-based device mapper.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agodm raid1: dont use map_context
Mikulas Patocka [Fri, 21 Dec 2012 20:23:40 +0000 (20:23 +0000)]
dm raid1: dont use map_context

Don't use map_info any more in dm-raid1.

map_info was used for writes to hold the region number. For this purpose
we add a new field dm_bio_details to dm_raid1_bio_record.

map_info was used for reads to hold a pointer to dm_raid1_bio_record (if
the pointer was non-NULL, bio details were saved; if the pointer was
NULL, bio details were not saved). We use
dm_raid1_bio_record.details->bi_bdev for this purpose. If bi_bdev is
NULL, details were not saved, if bi_bdev is non-NULL, details were
saved.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agodm flakey: dont use map_context
Mikulas Patocka [Fri, 21 Dec 2012 20:23:39 +0000 (20:23 +0000)]
dm flakey: dont use map_context

Replace map_info with a per-bio structure "struct per_bio_data" in dm-flakey.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agodm raid1: rename read_record to bio_record
Mikulas Patocka [Fri, 21 Dec 2012 20:23:39 +0000 (20:23 +0000)]
dm raid1: rename read_record to bio_record

Rename struct read_record to bio_record in dm-raid1.

In the following patch, the structure will be used for both read and
write bios, so rename it.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agodm: move target request nr to dm_target_io
Mikulas Patocka [Fri, 21 Dec 2012 20:23:39 +0000 (20:23 +0000)]
dm: move target request nr to dm_target_io

This patch moves target_request_nr from map_info to dm_target_io and
makes it accessible with dm_bio_get_target_request_nr.

This patch is a preparation for the next patch that removes map_info.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agodm snapshot: use per_bio_data
Mikulas Patocka [Fri, 21 Dec 2012 20:23:38 +0000 (20:23 +0000)]
dm snapshot: use per_bio_data

Replace tracked_chunk_pool with per_bio_data in dm-snap.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
11 years agodm verity: use per_bio_data
Mikulas Patocka [Fri, 21 Dec 2012 20:23:38 +0000 (20:23 +0000)]
dm verity: use per_bio_data

Replace io_mempool with per_bio_data in dm-verity.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>