From: Greg Kroah-Hartman Date: Mon, 5 Mar 2012 23:40:34 +0000 (-0800) Subject: 3.0-stable patches X-Git-Tag: v3.0.24~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c967e7d461c9f237348ecc935fb0619d83e8add8;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: alsa-hda-add-a-fake-mute-feature.patch alsa-hda-always-set-hp-pin-in-unsol-handler-for-stac-idt-codecs.patch mfd-fix-acpi-conflict-check.patch regset-prevent-null-pointer-reference-on-readonly-regsets.patch regset-return-efault-not-eio-on-host-side-memory-fault.patch --- diff --git a/queue-3.0/alsa-hda-add-a-fake-mute-feature.patch b/queue-3.0/alsa-hda-add-a-fake-mute-feature.patch new file mode 100644 index 00000000000..7be791525ea --- /dev/null +++ b/queue-3.0/alsa-hda-add-a-fake-mute-feature.patch @@ -0,0 +1,113 @@ +From 3868137ea41866773e75d9ac4b9988dcc361ff1d Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 27 Feb 2012 15:00:58 +0100 +Subject: ALSA: hda - Add a fake mute feature + +From: Takashi Iwai + +commit 3868137ea41866773e75d9ac4b9988dcc361ff1d upstream. + +Some codecs don't supply the mute amp-capabilities although the lowest +volume gives the mute. It'd be handy if the parser provides the mute +mixers in such a case. + +This patch adds an extension amp-cap bit (which is used only in the +driver) to represent the min volume = mute state. Also modified the +amp cache code to support the fake mute feature when this bit is set +but the real mute bit is unset. + +In addition, conexant cx5051 parser uses this new feature to implement +the missing mute controls. + +Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42825 + +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/hda_codec.c | 8 ++++++-- + sound/pci/hda/hda_codec.h | 3 +++ + sound/pci/hda/patch_conexant.c | 22 +++++++++++++++++++++- + 3 files changed, 30 insertions(+), 3 deletions(-) + +--- a/sound/pci/hda/hda_codec.c ++++ b/sound/pci/hda/hda_codec.c +@@ -1651,7 +1651,11 @@ static void put_vol_mute(struct hda_code + parm = ch ? AC_AMP_SET_RIGHT : AC_AMP_SET_LEFT; + parm |= direction == HDA_OUTPUT ? AC_AMP_SET_OUTPUT : AC_AMP_SET_INPUT; + parm |= index << AC_AMP_SET_INDEX_SHIFT; +- parm |= val; ++ if ((val & HDA_AMP_MUTE) && !(info->amp_caps & AC_AMPCAP_MUTE) && ++ (info->amp_caps & AC_AMPCAP_MIN_MUTE)) ++ ; /* set the zero value as a fake mute */ ++ else ++ parm |= val; + snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, parm); + info->vol[ch] = val; + } +@@ -1918,7 +1922,7 @@ int snd_hda_mixer_amp_tlv(struct snd_kco + val1 = -((caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT); + val1 += ofs; + val1 = ((int)val1) * ((int)val2); +- if (min_mute) ++ if (min_mute || (caps & AC_AMPCAP_MIN_MUTE)) + val2 |= TLV_DB_SCALE_MUTE; + if (put_user(SNDRV_CTL_TLVT_DB_SCALE, _tlv)) + return -EFAULT; +--- a/sound/pci/hda/hda_codec.h ++++ b/sound/pci/hda/hda_codec.h +@@ -302,6 +302,9 @@ enum { + #define AC_AMPCAP_MUTE (1<<31) /* mute capable */ + #define AC_AMPCAP_MUTE_SHIFT 31 + ++/* driver-specific amp-caps: using bits 24-30 */ ++#define AC_AMPCAP_MIN_MUTE (1 << 30) /* min-volume = mute */ ++ + /* Connection list */ + #define AC_CLIST_LENGTH (0x7f<<0) + #define AC_CLIST_LONG (1<<7) +--- a/sound/pci/hda/patch_conexant.c ++++ b/sound/pci/hda/patch_conexant.c +@@ -4127,7 +4127,8 @@ static int cx_auto_add_volume_idx(struct + err = snd_hda_ctl_add(codec, nid, kctl); + if (err < 0) + return err; +- if (!(query_amp_caps(codec, nid, hda_dir) & AC_AMPCAP_MUTE)) ++ if (!(query_amp_caps(codec, nid, hda_dir) & ++ (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE))) + break; + } + return 0; +@@ -4372,6 +4373,22 @@ static const struct hda_codec_ops cx_aut + .reboot_notify = snd_hda_shutup_pins, + }; + ++/* add "fake" mute amp-caps to DACs on cx5051 so that mixer mute switches ++ * can be created (bko#42825) ++ */ ++static void add_cx5051_fake_mutes(struct hda_codec *codec) ++{ ++ static hda_nid_t out_nids[] = { ++ 0x10, 0x11, 0 ++ }; ++ hda_nid_t *p; ++ ++ for (p = out_nids; *p; p++) ++ snd_hda_override_amp_caps(codec, *p, HDA_OUTPUT, ++ AC_AMPCAP_MIN_MUTE | ++ query_amp_caps(codec, *p, HDA_OUTPUT)); ++} ++ + static int patch_conexant_auto(struct hda_codec *codec) + { + struct conexant_spec *spec; +@@ -4390,6 +4407,9 @@ static int patch_conexant_auto(struct hd + case 0x14f15045: + spec->single_adc_amp = 1; + break; ++ case 0x14f15051: ++ add_cx5051_fake_mutes(codec); ++ break; + } + + err = cx_auto_search_adcs(codec); diff --git a/queue-3.0/alsa-hda-always-set-hp-pin-in-unsol-handler-for-stac-idt-codecs.patch b/queue-3.0/alsa-hda-always-set-hp-pin-in-unsol-handler-for-stac-idt-codecs.patch new file mode 100644 index 00000000000..b8aa489aadb --- /dev/null +++ b/queue-3.0/alsa-hda-always-set-hp-pin-in-unsol-handler-for-stac-idt-codecs.patch @@ -0,0 +1,31 @@ +From 7bff172a352a2fbe9856bba517d71a2072aab041 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 29 Feb 2012 09:41:17 +0100 +Subject: ALSA: hda - Always set HP pin in unsol handler for STAC/IDT codecs + +From: Takashi Iwai + +commit 7bff172a352a2fbe9856bba517d71a2072aab041 upstream. + +A bug report with an old Sony laptop showed that we can't rely on BIOS +setting the pins of headphones but the driver should set always by +itself. + +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_sigmatel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -4589,7 +4589,7 @@ static void stac92xx_hp_detect(struct hd + unsigned int val = AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN; + if (no_hp_sensing(spec, i)) + continue; +- if (presence) ++ if (1 /*presence*/) + stac92xx_set_pinctl(codec, cfg->hp_pins[i], val); + #if 0 /* FIXME */ + /* Resetting the pinctl like below may lead to (a sort of) regressions diff --git a/queue-3.0/mfd-fix-acpi-conflict-check.patch b/queue-3.0/mfd-fix-acpi-conflict-check.patch new file mode 100644 index 00000000000..3265400cda2 --- /dev/null +++ b/queue-3.0/mfd-fix-acpi-conflict-check.patch @@ -0,0 +1,35 @@ +From 81b5482c32769abb6dfb979560dab2f952ba86fa Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Sat, 18 Feb 2012 17:54:23 +0100 +Subject: mfd: Fix ACPI conflict check + +From: Jean Delvare + +commit 81b5482c32769abb6dfb979560dab2f952ba86fa upstream. + +The code is currently always checking the first resource of every +device only (several times.) This has been broken since the ACPI check +was added in February 2010 in commit +91fedede0338eb6203cdd618d8ece873fdb7c22c. + +Fix the check to run on each resource individually, once. + +Signed-off-by: Jean Delvare +Signed-off-by: Samuel Ortiz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/mfd-core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mfd/mfd-core.c ++++ b/drivers/mfd/mfd-core.c +@@ -122,7 +122,7 @@ static int mfd_add_device(struct device + } + + if (!cell->ignore_resource_conflicts) { +- ret = acpi_check_resource_conflict(res); ++ ret = acpi_check_resource_conflict(&res[r]); + if (ret) + goto fail_res; + } diff --git a/queue-3.0/regset-prevent-null-pointer-reference-on-readonly-regsets.patch b/queue-3.0/regset-prevent-null-pointer-reference-on-readonly-regsets.patch new file mode 100644 index 00000000000..27eb23c0db0 --- /dev/null +++ b/queue-3.0/regset-prevent-null-pointer-reference-on-readonly-regsets.patch @@ -0,0 +1,60 @@ +From c8e252586f8d5de906385d8cf6385fee289a825e Mon Sep 17 00:00:00 2001 +From: "H. Peter Anvin" +Date: Fri, 2 Mar 2012 10:43:48 -0800 +Subject: regset: Prevent null pointer reference on readonly regsets + +From: "H. Peter Anvin" + +commit c8e252586f8d5de906385d8cf6385fee289a825e upstream. + +The regset common infrastructure assumed that regsets would always +have .get and .set methods, but not necessarily .active methods. +Unfortunately people have since written regsets without .set methods. + +Rather than putting in stub functions everywhere, handle regsets with +null .get or .set methods explicitly. + +Signed-off-by: H. Peter Anvin +Reviewed-by: Oleg Nesterov +Acked-by: Roland McGrath +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/binfmt_elf.c | 2 +- + include/linux/regset.h | 6 ++++++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +--- a/fs/binfmt_elf.c ++++ b/fs/binfmt_elf.c +@@ -1422,7 +1422,7 @@ static int fill_thread_core_info(struct + for (i = 1; i < view->n; ++i) { + const struct user_regset *regset = &view->regsets[i]; + do_thread_regset_writeback(t->task, regset); +- if (regset->core_note_type && ++ if (regset->core_note_type && regset->get && + (!regset->active || regset->active(t->task, regset))) { + int ret; + size_t size = regset->n * regset->size; +--- a/include/linux/regset.h ++++ b/include/linux/regset.h +@@ -335,6 +335,9 @@ static inline int copy_regset_to_user(st + { + const struct user_regset *regset = &view->regsets[setno]; + ++ if (!regset->get) ++ return -EOPNOTSUPP; ++ + if (!access_ok(VERIFY_WRITE, data, size)) + return -EIO; + +@@ -358,6 +361,9 @@ static inline int copy_regset_from_user( + { + const struct user_regset *regset = &view->regsets[setno]; + ++ if (!regset->set) ++ return -EOPNOTSUPP; ++ + if (!access_ok(VERIFY_READ, data, size)) + return -EIO; + diff --git a/queue-3.0/regset-return-efault-not-eio-on-host-side-memory-fault.patch b/queue-3.0/regset-return-efault-not-eio-on-host-side-memory-fault.patch new file mode 100644 index 00000000000..de318f410ec --- /dev/null +++ b/queue-3.0/regset-return-efault-not-eio-on-host-side-memory-fault.patch @@ -0,0 +1,45 @@ +From 5189fa19a4b2b4c3bec37c3a019d446148827717 Mon Sep 17 00:00:00 2001 +From: "H. Peter Anvin" +Date: Fri, 2 Mar 2012 10:43:49 -0800 +Subject: regset: Return -EFAULT, not -EIO, on host-side memory fault + +From: "H. Peter Anvin" + +commit 5189fa19a4b2b4c3bec37c3a019d446148827717 upstream. + +There is only one error code to return for a bad user-space buffer +pointer passed to a system call in the same address space as the +system call is executed, and that is EFAULT. Furthermore, the +low-level access routines, which catch most of the faults, return +EFAULT already. + +Signed-off-by: H. Peter Anvin +Reviewed-by: Oleg Nesterov +Acked-by: Roland McGrath +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/regset.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/include/linux/regset.h ++++ b/include/linux/regset.h +@@ -339,7 +339,7 @@ static inline int copy_regset_to_user(st + return -EOPNOTSUPP; + + if (!access_ok(VERIFY_WRITE, data, size)) +- return -EIO; ++ return -EFAULT; + + return regset->get(target, regset, offset, size, NULL, data); + } +@@ -365,7 +365,7 @@ static inline int copy_regset_from_user( + return -EOPNOTSUPP; + + if (!access_ok(VERIFY_READ, data, size)) +- return -EIO; ++ return -EFAULT; + + return regset->set(target, regset, offset, size, NULL, data); + } diff --git a/queue-3.0/series b/queue-3.0/series index 4fea4972727..d90ed1ecad5 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -11,3 +11,8 @@ watchdog-hpwdt-clean-up-set_memory_x-call-for-32-bit.patch i2c-mxs-only-flag-completion-when-queue-is-completely-done.patch regulator-fix-the-ldo-configure-according-to-88pm860x-spec.patch s390-keys-enable-the-compat-keyctl-wrapper-on-s390x.patch +alsa-hda-add-a-fake-mute-feature.patch +alsa-hda-always-set-hp-pin-in-unsol-handler-for-stac-idt-codecs.patch +regset-prevent-null-pointer-reference-on-readonly-regsets.patch +regset-return-efault-not-eio-on-host-side-memory-fault.patch +mfd-fix-acpi-conflict-check.patch