]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Mar 2019 02:29:36 +0000 (11:29 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Mar 2019 02:29:36 +0000 (11:29 +0900)
added patches:
power-supply-charger-manager-fix-incorrect-return-value.patch
pwm-backlight-enable-disable-the-pwm-before-after-lcd-enable-toggle.patch
rtc-fix-overflow-when-converting-time64_t-to-rtc_time.patch
scsi-ufs-fix-wrong-command-type-of-utrd-for-ufshci-v2.1.patch

queue-4.9/power-supply-charger-manager-fix-incorrect-return-value.patch [new file with mode: 0644]
queue-4.9/pwm-backlight-enable-disable-the-pwm-before-after-lcd-enable-toggle.patch [new file with mode: 0644]
queue-4.9/rtc-fix-overflow-when-converting-time64_t-to-rtc_time.patch [new file with mode: 0644]
queue-4.9/scsi-ufs-fix-wrong-command-type-of-utrd-for-ufshci-v2.1.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/power-supply-charger-manager-fix-incorrect-return-value.patch b/queue-4.9/power-supply-charger-manager-fix-incorrect-return-value.patch
new file mode 100644 (file)
index 0000000..adeffc5
--- /dev/null
@@ -0,0 +1,38 @@
+From f25a646fbe2051527ad9721853e892d13a99199e Mon Sep 17 00:00:00 2001
+From: Baolin Wang <baolin.wang@linaro.org>
+Date: Fri, 16 Nov 2018 19:01:10 +0800
+Subject: power: supply: charger-manager: Fix incorrect return value
+
+From: Baolin Wang <baolin.wang@linaro.org>
+
+commit f25a646fbe2051527ad9721853e892d13a99199e upstream.
+
+Fix incorrect return value.
+
+Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/power/supply/charger-manager.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/power/supply/charger-manager.c
++++ b/drivers/power/supply/charger-manager.c
+@@ -1212,7 +1212,6 @@ static int charger_extcon_init(struct ch
+       if (ret < 0) {
+               pr_info("Cannot register extcon_dev for %s(cable: %s)\n",
+                       cable->extcon_name, cable->name);
+-              ret = -EINVAL;
+       }
+       return ret;
+@@ -1634,7 +1633,7 @@ static int charger_manager_probe(struct
+       if (IS_ERR(desc)) {
+               dev_err(&pdev->dev, "No platform data (desc) found\n");
+-              return -ENODEV;
++              return PTR_ERR(desc);
+       }
+       cm = devm_kzalloc(&pdev->dev,
diff --git a/queue-4.9/pwm-backlight-enable-disable-the-pwm-before-after-lcd-enable-toggle.patch b/queue-4.9/pwm-backlight-enable-disable-the-pwm-before-after-lcd-enable-toggle.patch
new file mode 100644 (file)
index 0000000..a68336c
--- /dev/null
@@ -0,0 +1,66 @@
+From 5fb5caee92ba35a4a3baa61d45a78eb057e2c031 Mon Sep 17 00:00:00 2001
+From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
+Date: Wed, 28 Mar 2018 19:03:23 +0200
+Subject: pwm-backlight: Enable/disable the PWM before/after LCD enable toggle.
+
+From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
+
+commit 5fb5caee92ba35a4a3baa61d45a78eb057e2c031 upstream.
+
+Before this patch the enable signal was set before the PWM signal and
+vice-versa on power off. This sequence is wrong, at least, it is on
+the different panels datasheets that I checked, so I inverted the sequence
+to follow the specs.
+
+For reference the following panels have the mentioned sequence:
+  - N133HSE-EA1 (Innolux)
+  - N116BGE (Innolux)
+  - N156BGE-L21 (Innolux)
+  - B101EAN0 (Auo)
+  - B101AW03 (Auo)
+  - LTN101NT05 (Samsung)
+  - CLAA101WA01A (Chunghwa)
+
+Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
+Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
+Acked-by: Jingoo Han <jingoohan1@gmail.com>
+Acked-by: Thierry Reding <thierry.reding@gmail.com>
+Signed-off-by: Lee Jones <lee.jones@linaro.org>
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/video/backlight/pwm_bl.c |    9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+--- a/drivers/video/backlight/pwm_bl.c
++++ b/drivers/video/backlight/pwm_bl.c
+@@ -54,10 +54,11 @@ static void pwm_backlight_power_on(struc
+       if (err < 0)
+               dev_err(pb->dev, "failed to enable power supply\n");
++      pwm_enable(pb->pwm);
++
+       if (pb->enable_gpio)
+               gpiod_set_value_cansleep(pb->enable_gpio, 1);
+-      pwm_enable(pb->pwm);
+       pb->enabled = true;
+ }
+@@ -66,12 +67,12 @@ static void pwm_backlight_power_off(stru
+       if (!pb->enabled)
+               return;
+-      pwm_config(pb->pwm, 0, pb->period);
+-      pwm_disable(pb->pwm);
+-
+       if (pb->enable_gpio)
+               gpiod_set_value_cansleep(pb->enable_gpio, 0);
++      pwm_config(pb->pwm, 0, pb->period);
++      pwm_disable(pb->pwm);
++
+       regulator_disable(pb->power_supply);
+       pb->enabled = false;
+ }
diff --git a/queue-4.9/rtc-fix-overflow-when-converting-time64_t-to-rtc_time.patch b/queue-4.9/rtc-fix-overflow-when-converting-time64_t-to-rtc_time.patch
new file mode 100644 (file)
index 0000000..6b99e7c
--- /dev/null
@@ -0,0 +1,42 @@
+From 36d46cdb43efea74043e29e2a62b13e9aca31452 Mon Sep 17 00:00:00 2001
+From: Baolin Wang <baolin.wang@linaro.org>
+Date: Mon, 25 Dec 2017 19:10:37 +0800
+Subject: rtc: Fix overflow when converting time64_t to rtc_time
+
+From: Baolin Wang <baolin.wang@linaro.org>
+
+commit 36d46cdb43efea74043e29e2a62b13e9aca31452 upstream.
+
+If we convert one large time values to rtc_time, in the original formula
+'days * 86400' can be overflowed in 'unsigned int' type to make the formula
+get one incorrect remain seconds value. Thus we can use div_s64_rem()
+function to avoid this situation.
+
+Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/rtc/rtc-lib.c |    6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/drivers/rtc/rtc-lib.c
++++ b/drivers/rtc/rtc-lib.c
+@@ -52,13 +52,11 @@ EXPORT_SYMBOL(rtc_year_days);
+  */
+ void rtc_time64_to_tm(time64_t time, struct rtc_time *tm)
+ {
+-      unsigned int month, year;
+-      unsigned long secs;
++      unsigned int month, year, secs;
+       int days;
+       /* time must be positive */
+-      days = div_s64(time, 86400);
+-      secs = time - (unsigned int) days * 86400;
++      days = div_s64_rem(time, 86400, &secs);
+       /* day of the week, 1970-01-01 was a Thursday */
+       tm->tm_wday = (days + 4) % 7;
diff --git a/queue-4.9/scsi-ufs-fix-wrong-command-type-of-utrd-for-ufshci-v2.1.patch b/queue-4.9/scsi-ufs-fix-wrong-command-type-of-utrd-for-ufshci-v2.1.patch
new file mode 100644 (file)
index 0000000..255bcd1
--- /dev/null
@@ -0,0 +1,55 @@
+From 83dc7e3dea76b77b6bcc289eb86c5b5c145e8dff Mon Sep 17 00:00:00 2001
+From: kehuanlin <chgokhl@gmail.com>
+Date: Wed, 6 Sep 2017 17:58:39 +0800
+Subject: scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1
+
+From: kehuanlin <chgokhl@gmail.com>
+
+commit 83dc7e3dea76b77b6bcc289eb86c5b5c145e8dff upstream.
+
+Since the command type of UTRD in UFS 2.1 specification is the same with
+UFS 2.0. And it assumes the future UFS specification will follow the
+same definition.
+
+Signed-off-by: kehuanlin <kehuanlin@pinecone.net>
+Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/ufs/ufshcd.c |   14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+--- a/drivers/scsi/ufs/ufshcd.c
++++ b/drivers/scsi/ufs/ufshcd.c
+@@ -1348,10 +1348,11 @@ static int ufshcd_comp_devman_upiu(struc
+       u32 upiu_flags;
+       int ret = 0;
+-      if (hba->ufs_version == UFSHCI_VERSION_20)
+-              lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
+-      else
++      if ((hba->ufs_version == UFSHCI_VERSION_10) ||
++          (hba->ufs_version == UFSHCI_VERSION_11))
+               lrbp->command_type = UTP_CMD_TYPE_DEV_MANAGE;
++      else
++              lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
+       ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, DMA_NONE);
+       if (hba->dev_cmd.type == DEV_CMD_TYPE_QUERY)
+@@ -1375,10 +1376,11 @@ static int ufshcd_comp_scsi_upiu(struct
+       u32 upiu_flags;
+       int ret = 0;
+-      if (hba->ufs_version == UFSHCI_VERSION_20)
+-              lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
+-      else
++      if ((hba->ufs_version == UFSHCI_VERSION_10) ||
++          (hba->ufs_version == UFSHCI_VERSION_11))
+               lrbp->command_type = UTP_CMD_TYPE_SCSI;
++      else
++              lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
+       if (likely(lrbp->cmd)) {
+               ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags,
index 13480b0b6b67bf03bce09ccadc7849829d7dc79b..3fec0fb0f2c8949a9b16412801b49015124cbd13 100644 (file)
@@ -23,3 +23,7 @@ arm64-traps-disable-irq-in-die.patch
 serial-sprd-clear-timeout-interrupt-only-rather-than-all-interrupts.patch
 lib-int_sqrt-optimize-small-argument.patch
 usb-core-only-clean-up-what-we-allocated.patch
+scsi-ufs-fix-wrong-command-type-of-utrd-for-ufshci-v2.1.patch
+rtc-fix-overflow-when-converting-time64_t-to-rtc_time.patch
+pwm-backlight-enable-disable-the-pwm-before-after-lcd-enable-toggle.patch
+power-supply-charger-manager-fix-incorrect-return-value.patch