From: Greg Kroah-Hartman Date: Wed, 22 Feb 2012 21:36:09 +0000 (-0800) Subject: 3.0-stable patches X-Git-Tag: v3.2.8~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6e11c84310866a0765eddf32c7a4bfc28e835cd1;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: alsa-hda-fix-redundant-jack-creations-for-cx5051.patch mmc-core-check-for-zero-length-ioctl-data.patch nfsv4-ensure-we-throw-out-bad-delegation-stateids-on-nfs4err_bad_stateid.patch --- diff --git a/queue-3.0/alsa-hda-fix-redundant-jack-creations-for-cx5051.patch b/queue-3.0/alsa-hda-fix-redundant-jack-creations-for-cx5051.patch new file mode 100644 index 00000000000..7c2eafcf439 --- /dev/null +++ b/queue-3.0/alsa-hda-fix-redundant-jack-creations-for-cx5051.patch @@ -0,0 +1,68 @@ +From tiwai@suse.de Wed Feb 22 13:27:25 2012 +From: Takashi Iwai +Date: Wed, 22 Feb 2012 17:02:38 +0100 +Subject: ALSA: hda - Fix redundant jack creations for cx5051 +To: stable@vger.kernel.org +Message-ID: + +From: Takashi Iwai + +[Note that since the patch isn't applicable (and unnecessary) to +3.3-rc, there is no corresponding upstream fix.] + +The cx5051 parser calls snd_hda_input_jack_add() in the init callback +to create and initialize the jack detection instances. Since the init +callback is called at each time when the device gets woken up after +suspend or power-saving mode, the duplicated instances are accumulated +at each call. This ends up with the kernel warnings with the too +large array size. + +The fix is simply to move the calls of snd_hda_input_jack_add() into +the parser section instead of the init callback. + +The fix is needed only up to 3.2 kernel, since the HD-audio jack layer +was redesigned in the 3.3 kernel. + +Reported-by: Russell King +Tested-by: Russell King +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/hda/patch_conexant.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/sound/pci/hda/patch_conexant.c ++++ b/sound/pci/hda/patch_conexant.c +@@ -1917,6 +1917,10 @@ static void cxt5051_init_mic_port(struct + snd_hda_codec_write(codec, nid, 0, + AC_VERB_SET_UNSOLICITED_ENABLE, + AC_USRSP_EN | event); ++} ++ ++static void cxt5051_init_mic_jack(struct hda_codec *codec, hda_nid_t nid) ++{ + snd_hda_input_jack_add(codec, nid, SND_JACK_MICROPHONE, NULL); + snd_hda_input_jack_report(codec, nid); + } +@@ -1934,7 +1938,6 @@ static int cxt5051_init(struct hda_codec + struct conexant_spec *spec = codec->spec; + + conexant_init(codec); +- conexant_init_jacks(codec); + + if (spec->auto_mic & AUTO_MIC_PORTB) + cxt5051_init_mic_port(codec, 0x17, CXT5051_PORTB_EVENT); +@@ -2067,6 +2070,12 @@ static int patch_cxt5051(struct hda_code + if (spec->beep_amp) + snd_hda_attach_beep_device(codec, spec->beep_amp); + ++ conexant_init_jacks(codec); ++ if (spec->auto_mic & AUTO_MIC_PORTB) ++ cxt5051_init_mic_jack(codec, 0x17); ++ if (spec->auto_mic & AUTO_MIC_PORTC) ++ cxt5051_init_mic_jack(codec, 0x18); ++ + return 0; + } + diff --git a/queue-3.0/mmc-core-check-for-zero-length-ioctl-data.patch b/queue-3.0/mmc-core-check-for-zero-length-ioctl-data.patch new file mode 100644 index 00000000000..f9d4c18ef21 --- /dev/null +++ b/queue-3.0/mmc-core-check-for-zero-length-ioctl-data.patch @@ -0,0 +1,135 @@ +From 4d6144de8ba263eb3691a737c547e5b2fdc45287 Mon Sep 17 00:00:00 2001 +From: Johan Rudholm +Date: Wed, 23 Nov 2011 09:05:58 +0100 +Subject: mmc: core: check for zero length ioctl data + +From: Johan Rudholm + +commit 4d6144de8ba263eb3691a737c547e5b2fdc45287 upstream. + +If the read or write buffer size associated with the command sent +through the mmc_blk_ioctl is zero, do not prepare data buffer. + +This enables a ioctl(2) call to for instance send a MMC_SWITCH to set +a byte in the ext_csd. + +Signed-off-by: Johan Rudholm +Signed-off-by: Chris Ball +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/card/block.c | 82 +++++++++++++++++++++++++---------------------- + 1 file changed, 45 insertions(+), 37 deletions(-) + +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -251,6 +251,9 @@ static struct mmc_blk_ioc_data *mmc_blk_ + goto idata_err; + } + ++ if (!idata->buf_bytes) ++ return idata; ++ + idata->buf = kzalloc(idata->buf_bytes, GFP_KERNEL); + if (!idata->buf) { + err = -ENOMEM; +@@ -297,25 +300,6 @@ static int mmc_blk_ioctl_cmd(struct bloc + if (IS_ERR(idata)) + return PTR_ERR(idata); + +- cmd.opcode = idata->ic.opcode; +- cmd.arg = idata->ic.arg; +- cmd.flags = idata->ic.flags; +- +- data.sg = &sg; +- data.sg_len = 1; +- data.blksz = idata->ic.blksz; +- data.blocks = idata->ic.blocks; +- +- sg_init_one(data.sg, idata->buf, idata->buf_bytes); +- +- if (idata->ic.write_flag) +- data.flags = MMC_DATA_WRITE; +- else +- data.flags = MMC_DATA_READ; +- +- mrq.cmd = &cmd; +- mrq.data = &data; +- + md = mmc_blk_get(bdev->bd_disk); + if (!md) { + err = -EINVAL; +@@ -328,6 +312,48 @@ static int mmc_blk_ioctl_cmd(struct bloc + goto cmd_done; + } + ++ cmd.opcode = idata->ic.opcode; ++ cmd.arg = idata->ic.arg; ++ cmd.flags = idata->ic.flags; ++ ++ if (idata->buf_bytes) { ++ data.sg = &sg; ++ data.sg_len = 1; ++ data.blksz = idata->ic.blksz; ++ data.blocks = idata->ic.blocks; ++ ++ sg_init_one(data.sg, idata->buf, idata->buf_bytes); ++ ++ if (idata->ic.write_flag) ++ data.flags = MMC_DATA_WRITE; ++ else ++ data.flags = MMC_DATA_READ; ++ ++ /* data.flags must already be set before doing this. */ ++ mmc_set_data_timeout(&data, card); ++ ++ /* Allow overriding the timeout_ns for empirical tuning. */ ++ if (idata->ic.data_timeout_ns) ++ data.timeout_ns = idata->ic.data_timeout_ns; ++ ++ if ((cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) { ++ /* ++ * Pretend this is a data transfer and rely on the ++ * host driver to compute timeout. When all host ++ * drivers support cmd.cmd_timeout for R1B, this ++ * can be changed to: ++ * ++ * mrq.data = NULL; ++ * cmd.cmd_timeout = idata->ic.cmd_timeout_ms; ++ */ ++ data.timeout_ns = idata->ic.cmd_timeout_ms * 1000000; ++ } ++ ++ mrq.data = &data; ++ } ++ ++ mrq.cmd = &cmd; ++ + mmc_claim_host(card->host); + + if (idata->ic.is_acmd) { +@@ -336,24 +362,6 @@ static int mmc_blk_ioctl_cmd(struct bloc + goto cmd_rel_host; + } + +- /* data.flags must already be set before doing this. */ +- mmc_set_data_timeout(&data, card); +- /* Allow overriding the timeout_ns for empirical tuning. */ +- if (idata->ic.data_timeout_ns) +- data.timeout_ns = idata->ic.data_timeout_ns; +- +- if ((cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) { +- /* +- * Pretend this is a data transfer and rely on the host driver +- * to compute timeout. When all host drivers support +- * cmd.cmd_timeout for R1B, this can be changed to: +- * +- * mrq.data = NULL; +- * cmd.cmd_timeout = idata->ic.cmd_timeout_ms; +- */ +- data.timeout_ns = idata->ic.cmd_timeout_ms * 1000000; +- } +- + mmc_wait_for_req(card->host, &mrq); + + if (cmd.error) { diff --git a/queue-3.0/nfsv4-ensure-we-throw-out-bad-delegation-stateids-on-nfs4err_bad_stateid.patch b/queue-3.0/nfsv4-ensure-we-throw-out-bad-delegation-stateids-on-nfs4err_bad_stateid.patch new file mode 100644 index 00000000000..977d40fb333 --- /dev/null +++ b/queue-3.0/nfsv4-ensure-we-throw-out-bad-delegation-stateids-on-nfs4err_bad_stateid.patch @@ -0,0 +1,30 @@ +From b9f9a03150969e4bd9967c20bce67c4de769058f Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Thu, 9 Feb 2012 15:31:36 -0500 +Subject: NFSv4: Ensure we throw out bad delegation stateids on NFS4ERR_BAD_STATEID + +From: Trond Myklebust + +commit b9f9a03150969e4bd9967c20bce67c4de769058f upstream. + +To ensure that we don't just reuse the bad delegation when we attempt to +recover the nfs4_state that received the bad stateid error. + +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/nfs4state.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/nfs/nfs4state.c ++++ b/fs/nfs/nfs4state.c +@@ -1065,6 +1065,8 @@ void nfs4_schedule_stateid_recovery(cons + { + struct nfs_client *clp = server->nfs_client; + ++ if (test_and_clear_bit(NFS_DELEGATED_STATE, &state->flags)) ++ nfs_async_inode_return_delegation(state->inode, &state->stateid); + nfs4_state_mark_reclaim_nograce(clp, state); + nfs4_schedule_state_manager(clp); + } diff --git a/queue-3.0/series b/queue-3.0/series index 82016e6e3dd..51194efe9d0 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -4,3 +4,6 @@ pci-workaround-hard-wired-bus-number-v2.patch mac80211-fix-a-rwlock-bad-magic-bug.patch ipheth-add-iphone-4s.patch ecryptfs-copy-up-lower-inode-attrs-after-setting-lower-xattr.patch +alsa-hda-fix-redundant-jack-creations-for-cx5051.patch +mmc-core-check-for-zero-length-ioctl-data.patch +nfsv4-ensure-we-throw-out-bad-delegation-stateids-on-nfs4err_bad_stateid.patch