]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Jun 2018 11:17:50 +0000 (19:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Jun 2018 11:17:50 +0000 (19:17 +0800)
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
w1-mxc_w1-enable-clock-before-calling-clk_get_rate-on-it.patch

queue-4.4/cpufreq-fix-new-policy-initialization-during-limits-updates-via-sysfs.patch [new file with mode: 0644]
queue-4.4/libata-drop-sandisk-sd7ub3q-g1001-nolpm-quirk.patch [new file with mode: 0644]
queue-4.4/libata-zpodd-make-arrays-cdb-static-reduces-object-code-size.patch [new file with mode: 0644]
queue-4.4/libata-zpodd-small-read-overflow-in-eject_tray.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/w1-mxc_w1-enable-clock-before-calling-clk_get_rate-on-it.patch [new file with mode: 0644]

diff --git a/queue-4.4/cpufreq-fix-new-policy-initialization-during-limits-updates-via-sysfs.patch b/queue-4.4/cpufreq-fix-new-policy-initialization-during-limits-updates-via-sysfs.patch
new file mode 100644 (file)
index 0000000..a855d11
--- /dev/null
@@ -0,0 +1,50 @@
+From c7d1f119c48f64bebf0fa1e326af577c6152fe30 Mon Sep 17 00:00:00 2001
+From: Tao Wang <kevin.wangtao@hisilicon.com>
+Date: Sat, 26 May 2018 15:16:48 +0800
+Subject: cpufreq: Fix new policy initialization during limits updates via sysfs
+
+From: Tao Wang <kevin.wangtao@hisilicon.com>
+
+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 <kevin.wangtao@hisilicon.com>
+Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
+[ rjw: Subject & changelog ]
+Cc: All applicable <stable@vger.kernel.org>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/cpufreq.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/cpufreq/cpufreq.c
++++ b/drivers/cpufreq/cpufreq.c
+@@ -603,6 +603,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.4/libata-drop-sandisk-sd7ub3q-g1001-nolpm-quirk.patch b/queue-4.4/libata-drop-sandisk-sd7ub3q-g1001-nolpm-quirk.patch
new file mode 100644 (file)
index 0000000..6c0499e
--- /dev/null
@@ -0,0 +1,56 @@
+From 2cfce3a86b64b53f0a70e92a6a659c720c319b45 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Thu, 31 May 2018 13:21:07 +0200
+Subject: libata: Drop SanDisk SD7UB3Q*G1001 NOLPM quirk
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+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 <rjones@redhat.com>
+Cc: Lorenzo Dalrio <lorenzo.dalrio@gmail.com>
+Reported-by: Lorenzo Dalrio <lorenzo.dalrio@gmail.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Acked-by: "Richard W.M. Jones" <rjones@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/ata/libata-core.c |    3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -4247,9 +4247,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.4/libata-zpodd-make-arrays-cdb-static-reduces-object-code-size.patch b/queue-4.4/libata-zpodd-make-arrays-cdb-static-reduces-object-code-size.patch
new file mode 100644 (file)
index 0000000..4884d0f
--- /dev/null
@@ -0,0 +1,48 @@
+From 795ef788145ed2fa023efdf11e8d5d7bedc21462 Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.king@canonical.com>
+Date: Wed, 6 Sep 2017 09:56:29 +0100
+Subject: libata: zpodd: make arrays cdb static, reduces object code size
+
+From: Colin Ian King <colin.king@canonical.com>
+
+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 <colin.king@canonical.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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.4/libata-zpodd-small-read-overflow-in-eject_tray.patch b/queue-4.4/libata-zpodd-small-read-overflow-in-eject_tray.patch
new file mode 100644 (file)
index 0000000..ead3eb9
--- /dev/null
@@ -0,0 +1,33 @@
+From 18c9a99bce2a57dfd7e881658703b5d7469cc7b9 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Tue, 29 May 2018 12:13:24 +0300
+Subject: libata: zpodd: small read overflow in eject_tray()
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+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 <dan.carpenter@oracle.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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,
index ac7c020c93474140af6b7ff52eee1b4f96423a3e..ba9907ab05f9a17da3fbb014bb9c6b254f588ac8 100644 (file)
@@ -17,3 +17,8 @@ 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
+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.4/w1-mxc_w1-enable-clock-before-calling-clk_get_rate-on-it.patch b/queue-4.4/w1-mxc_w1-enable-clock-before-calling-clk_get_rate-on-it.patch
new file mode 100644 (file)
index 0000000..3e5443c
--- /dev/null
@@ -0,0 +1,68 @@
+From 955bc61328dc0a297fb3baccd84e9d3aee501ed8 Mon Sep 17 00:00:00 2001
+From: Stefan Potyra <Stefan.Potyra@elektrobit.com>
+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 <Stefan.Potyra@elektrobit.com>
+
+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 <Stefan.Potyra@elektrobit.com>
+Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
+ }