From: Greg Kroah-Hartman Date: Sun, 24 Jun 2018 11:18:27 +0000 (+0800) Subject: 4.9-stable patches X-Git-Tag: v4.17.3~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=86c116630fe25a5b7f85fe8ccdd54dd618f8af2c;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: cpufreq-fix-new-policy-initialization-during-limits-updates-via-sysfs.patch libata-drop-sandisk-sd7ub3q-g1001-nolpm-quirk.patch libata-zpodd-make-arrays-cdb-static-reduces-object-code-size.patch libata-zpodd-small-read-overflow-in-eject_tray.patch smb3-on-reconnect-set-previoussessionid-field.patch w1-mxc_w1-enable-clock-before-calling-clk_get_rate-on-it.patch --- diff --git a/queue-4.9/cpufreq-fix-new-policy-initialization-during-limits-updates-via-sysfs.patch b/queue-4.9/cpufreq-fix-new-policy-initialization-during-limits-updates-via-sysfs.patch new file mode 100644 index 00000000000..53070e67308 --- /dev/null +++ b/queue-4.9/cpufreq-fix-new-policy-initialization-during-limits-updates-via-sysfs.patch @@ -0,0 +1,50 @@ +From c7d1f119c48f64bebf0fa1e326af577c6152fe30 Mon Sep 17 00:00:00 2001 +From: Tao Wang +Date: Sat, 26 May 2018 15:16:48 +0800 +Subject: cpufreq: Fix new policy initialization during limits updates via sysfs + +From: Tao Wang + +commit c7d1f119c48f64bebf0fa1e326af577c6152fe30 upstream. + +If the policy limits are updated via cpufreq_update_policy() and +subsequently via sysfs, the limits stored in user_policy may be +set incorrectly. + +For example, if both min and max are set via sysfs to the maximum +available frequency, user_policy.min and user_policy.max will also +be the maximum. If a policy notifier triggered by +cpufreq_update_policy() lowers both the min and the max at this +point, that change is not reflected by the user_policy limits, so +if the max is updated again via sysfs to the same lower value, +then user_policy.max will be lower than user_policy.min which +shouldn't happen. In particular, if one of the policy CPUs is +then taken offline and back online, cpufreq_set_policy() will +fail for it due to a failing limits check. + +To prevent that from happening, initialize the min and max fields +of the new_policy object to the ones stored in user_policy that +were previously set via sysfs. + +Signed-off-by: Kevin Wangtao +Acked-by: Viresh Kumar +[ rjw: Subject & changelog ] +Cc: All applicable +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/cpufreq/cpufreq.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/cpufreq/cpufreq.c ++++ b/drivers/cpufreq/cpufreq.c +@@ -657,6 +657,8 @@ static ssize_t store_##file_name \ + struct cpufreq_policy new_policy; \ + \ + memcpy(&new_policy, policy, sizeof(*policy)); \ ++ new_policy.min = policy->user_policy.min; \ ++ new_policy.max = policy->user_policy.max; \ + \ + ret = sscanf(buf, "%u", &new_policy.object); \ + if (ret != 1) \ diff --git a/queue-4.9/libata-drop-sandisk-sd7ub3q-g1001-nolpm-quirk.patch b/queue-4.9/libata-drop-sandisk-sd7ub3q-g1001-nolpm-quirk.patch new file mode 100644 index 00000000000..baf5a668080 --- /dev/null +++ b/queue-4.9/libata-drop-sandisk-sd7ub3q-g1001-nolpm-quirk.patch @@ -0,0 +1,56 @@ +From 2cfce3a86b64b53f0a70e92a6a659c720c319b45 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 31 May 2018 13:21:07 +0200 +Subject: libata: Drop SanDisk SD7UB3Q*G1001 NOLPM quirk + +From: Hans de Goede + +commit 2cfce3a86b64b53f0a70e92a6a659c720c319b45 upstream. + +Commit 184add2ca23c ("libata: Apply NOLPM quirk for SanDisk +SD7UB3Q*G1001 SSDs") disabled LPM for SanDisk SD7UB3Q*G1001 SSDs. + +This has lead to several reports of users of that SSD where LPM +was working fine and who know have a significantly increased idle +power consumption on their laptops. + +Likely there is another problem on the T450s from the original +reporter which gets exposed by the uncore reaching deeper sleep +states (higher PC-states) due to LPM being enabled. The problem as +reported, a hardfreeze about once a day, already did not sound like +it would be caused by LPM and the reports of the SSD working fine +confirm this. The original reporter is ok with dropping the quirk. + +A X250 user has reported the same hard freeze problem and for him +the problem went away after unrelated updates, I suspect some GPU +driver stack changes fixed things. + +TL;DR: The original reporters problem were triggered by LPM but not +an LPM issue, so drop the quirk for the SSD in question. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1583207 +Cc: stable@vger.kernel.org +Cc: Richard W.M. Jones +Cc: Lorenzo Dalrio +Reported-by: Lorenzo Dalrio +Signed-off-by: Hans de Goede +Signed-off-by: Tejun Heo +Acked-by: "Richard W.M. Jones" +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/libata-core.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/drivers/ata/libata-core.c ++++ b/drivers/ata/libata-core.c +@@ -4426,9 +4426,6 @@ static const struct ata_blacklist_entry + ATA_HORKAGE_ZERO_AFTER_TRIM | + ATA_HORKAGE_NOLPM, }, + +- /* Sandisk devices which are known to not handle LPM well */ +- { "SanDisk SD7UB3Q*G1001", NULL, ATA_HORKAGE_NOLPM, }, +- + /* devices that don't properly handle queued TRIM commands */ + { "Micron_M500IT_*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM | + ATA_HORKAGE_ZERO_AFTER_TRIM, }, diff --git a/queue-4.9/libata-zpodd-make-arrays-cdb-static-reduces-object-code-size.patch b/queue-4.9/libata-zpodd-make-arrays-cdb-static-reduces-object-code-size.patch new file mode 100644 index 00000000000..4884d0faf2b --- /dev/null +++ b/queue-4.9/libata-zpodd-make-arrays-cdb-static-reduces-object-code-size.patch @@ -0,0 +1,48 @@ +From 795ef788145ed2fa023efdf11e8d5d7bedc21462 Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Wed, 6 Sep 2017 09:56:29 +0100 +Subject: libata: zpodd: make arrays cdb static, reduces object code size + +From: Colin Ian King + +commit 795ef788145ed2fa023efdf11e8d5d7bedc21462 upstream. + +Don't populate the arrays cdb on the stack, instead make them static. +Makes the object code smaller by 230 bytes: + +Before: + text data bss dec hex filename + 3797 240 0 4037 fc5 drivers/ata/libata-zpodd.o + +After: + text data bss dec hex filename + 3407 400 0 3807 edf drivers/ata/libata-zpodd.o + +Signed-off-by: Colin Ian King +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/libata-zpodd.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/ata/libata-zpodd.c ++++ b/drivers/ata/libata-zpodd.c +@@ -34,7 +34,7 @@ struct zpodd { + static int eject_tray(struct ata_device *dev) + { + struct ata_taskfile tf; +- const char cdb[] = { GPCMD_START_STOP_UNIT, ++ static const char cdb[] = { GPCMD_START_STOP_UNIT, + 0, 0, 0, + 0x02, /* LoEj */ + 0, 0, 0, 0, 0, 0, 0, +@@ -55,7 +55,7 @@ static enum odd_mech_type zpodd_get_mech + unsigned int ret; + struct rm_feature_desc *desc = (void *)(buf + 8); + struct ata_taskfile tf; +- char cdb[] = { GPCMD_GET_CONFIGURATION, ++ static const char cdb[] = { GPCMD_GET_CONFIGURATION, + 2, /* only 1 feature descriptor requested */ + 0, 3, /* 3, removable medium feature */ + 0, 0, 0,/* reserved */ diff --git a/queue-4.9/libata-zpodd-small-read-overflow-in-eject_tray.patch b/queue-4.9/libata-zpodd-small-read-overflow-in-eject_tray.patch new file mode 100644 index 00000000000..ead3eb943f1 --- /dev/null +++ b/queue-4.9/libata-zpodd-small-read-overflow-in-eject_tray.patch @@ -0,0 +1,33 @@ +From 18c9a99bce2a57dfd7e881658703b5d7469cc7b9 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Tue, 29 May 2018 12:13:24 +0300 +Subject: libata: zpodd: small read overflow in eject_tray() + +From: Dan Carpenter + +commit 18c9a99bce2a57dfd7e881658703b5d7469cc7b9 upstream. + +We read from the cdb[] buffer in ata_exec_internal_sg(). It has to be +ATAPI_CDB_LEN (16) bytes long, but this buffer is only 12 bytes. + +Fixes: 213342053db5 ("libata: handle power transition of ODD") +Signed-off-by: Dan Carpenter +Signed-off-by: Tejun Heo +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/libata-zpodd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/ata/libata-zpodd.c ++++ b/drivers/ata/libata-zpodd.c +@@ -34,7 +34,7 @@ struct zpodd { + static int eject_tray(struct ata_device *dev) + { + struct ata_taskfile tf; +- static const char cdb[] = { GPCMD_START_STOP_UNIT, ++ static const char cdb[ATAPI_CDB_LEN] = { GPCMD_START_STOP_UNIT, + 0, 0, 0, + 0x02, /* LoEj */ + 0, 0, 0, 0, 0, 0, 0, diff --git a/queue-4.9/series b/queue-4.9/series index 27814347d51..f7aac71bd8a 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -27,3 +27,9 @@ btrfs-scrub-don-t-use-inode-pages-for-device-replace.patch alsa-hda-handle-kzalloc-failure-in-snd_hda_attach_pcm_stream.patch alsa-hda-add-dock-and-led-support-for-hp-elitebook-830-g5.patch alsa-hda-add-dock-and-led-support-for-hp-probook-640-g4.patch +smb3-on-reconnect-set-previoussessionid-field.patch +cpufreq-fix-new-policy-initialization-during-limits-updates-via-sysfs.patch +libata-zpodd-make-arrays-cdb-static-reduces-object-code-size.patch +libata-zpodd-small-read-overflow-in-eject_tray.patch +libata-drop-sandisk-sd7ub3q-g1001-nolpm-quirk.patch +w1-mxc_w1-enable-clock-before-calling-clk_get_rate-on-it.patch diff --git a/queue-4.9/smb3-on-reconnect-set-previoussessionid-field.patch b/queue-4.9/smb3-on-reconnect-set-previoussessionid-field.patch new file mode 100644 index 00000000000..1a70ea51603 --- /dev/null +++ b/queue-4.9/smb3-on-reconnect-set-previoussessionid-field.patch @@ -0,0 +1,34 @@ +From b2adf22fdfba85a6701c481faccdbbb3a418ccfc Mon Sep 17 00:00:00 2001 +From: Steve French +Date: Thu, 31 May 2018 15:19:25 -0500 +Subject: smb3: on reconnect set PreviousSessionId field + +From: Steve French + +commit b2adf22fdfba85a6701c481faccdbbb3a418ccfc upstream. + +The server detects reconnect by the (non-zero) value in PreviousSessionId +of SMB2/SMB3 SessionSetup request, but this behavior regressed due +to commit 166cea4dc3a4f66f020cfb9286225ecd228ab61d +("SMB2: Separate RawNTLMSSP authentication from SMB2_sess_setup") + +CC: Stable +CC: Sachin Prabhu +Signed-off-by: Steve French +Reviewed-by: Ronnie Sahlberg +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/smb2pdu.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/fs/cifs/smb2pdu.c ++++ b/fs/cifs/smb2pdu.c +@@ -1004,6 +1004,7 @@ SMB2_sess_setup(const unsigned int xid, + sess_data->ses = ses; + sess_data->buf0_type = CIFS_NO_BUFFER; + sess_data->nls_cp = (struct nls_table *) nls_cp; ++ sess_data->previous_session = ses->Suid; + + while (sess_data->func) + sess_data->func(sess_data); diff --git a/queue-4.9/w1-mxc_w1-enable-clock-before-calling-clk_get_rate-on-it.patch b/queue-4.9/w1-mxc_w1-enable-clock-before-calling-clk_get_rate-on-it.patch new file mode 100644 index 00000000000..3e5443cdf8d --- /dev/null +++ b/queue-4.9/w1-mxc_w1-enable-clock-before-calling-clk_get_rate-on-it.patch @@ -0,0 +1,68 @@ +From 955bc61328dc0a297fb3baccd84e9d3aee501ed8 Mon Sep 17 00:00:00 2001 +From: Stefan Potyra +Date: Wed, 2 May 2018 10:55:31 +0200 +Subject: w1: mxc_w1: Enable clock before calling clk_get_rate() on it + +From: Stefan Potyra + +commit 955bc61328dc0a297fb3baccd84e9d3aee501ed8 upstream. + +According to the API, you may only call clk_get_rate() after actually +enabling it. + +Found by Linux Driver Verification project (linuxtesting.org). + +Fixes: a5fd9139f74c ("w1: add 1-wire master driver for i.MX27 / i.MX31") +Signed-off-by: Stefan Potyra +Acked-by: Evgeniy Polyakov +Cc: stable +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/w1/masters/mxc_w1.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +--- a/drivers/w1/masters/mxc_w1.c ++++ b/drivers/w1/masters/mxc_w1.c +@@ -113,6 +113,10 @@ static int mxc_w1_probe(struct platform_ + if (IS_ERR(mdev->clk)) + return PTR_ERR(mdev->clk); + ++ err = clk_prepare_enable(mdev->clk); ++ if (err) ++ return err; ++ + clkrate = clk_get_rate(mdev->clk); + if (clkrate < 10000000) + dev_warn(&pdev->dev, +@@ -126,12 +130,10 @@ static int mxc_w1_probe(struct platform_ + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + mdev->regs = devm_ioremap_resource(&pdev->dev, res); +- if (IS_ERR(mdev->regs)) +- return PTR_ERR(mdev->regs); +- +- err = clk_prepare_enable(mdev->clk); +- if (err) +- return err; ++ if (IS_ERR(mdev->regs)) { ++ err = PTR_ERR(mdev->regs); ++ goto out_disable_clk; ++ } + + /* Software reset 1-Wire module */ + writeb(MXC_W1_RESET_RST, mdev->regs + MXC_W1_RESET); +@@ -147,8 +149,12 @@ static int mxc_w1_probe(struct platform_ + + err = w1_add_master_device(&mdev->bus_master); + if (err) +- clk_disable_unprepare(mdev->clk); ++ goto out_disable_clk; ++ ++ return 0; + ++out_disable_clk: ++ clk_disable_unprepare(mdev->clk); + return err; + } +