From: Greg Kroah-Hartman Date: Tue, 26 Mar 2019 02:29:36 +0000 (+0900) Subject: 4.9-stable patches X-Git-Tag: v4.9.166~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6fd19fb6ad74833a0aa2a4e32d5a73c4d43d420b;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches 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 --- 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 index 00000000000..adeffc5c42e --- /dev/null +++ b/queue-4.9/power-supply-charger-manager-fix-incorrect-return-value.patch @@ -0,0 +1,38 @@ +From f25a646fbe2051527ad9721853e892d13a99199e Mon Sep 17 00:00:00 2001 +From: Baolin Wang +Date: Fri, 16 Nov 2018 19:01:10 +0800 +Subject: power: supply: charger-manager: Fix incorrect return value + +From: Baolin Wang + +commit f25a646fbe2051527ad9721853e892d13a99199e upstream. + +Fix incorrect return value. + +Signed-off-by: Baolin Wang +Signed-off-by: Sebastian Reichel +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..a68336ca35a --- /dev/null +++ b/queue-4.9/pwm-backlight-enable-disable-the-pwm-before-after-lcd-enable-toggle.patch @@ -0,0 +1,66 @@ +From 5fb5caee92ba35a4a3baa61d45a78eb057e2c031 Mon Sep 17 00:00:00 2001 +From: Enric Balletbo i Serra +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 + +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 +Acked-by: Daniel Thompson +Acked-by: Jingoo Han +Acked-by: Thierry Reding +Signed-off-by: Lee Jones +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..6b99e7cc1f6 --- /dev/null +++ b/queue-4.9/rtc-fix-overflow-when-converting-time64_t-to-rtc_time.patch @@ -0,0 +1,42 @@ +From 36d46cdb43efea74043e29e2a62b13e9aca31452 Mon Sep 17 00:00:00 2001 +From: Baolin Wang +Date: Mon, 25 Dec 2017 19:10:37 +0800 +Subject: rtc: Fix overflow when converting time64_t to rtc_time + +From: Baolin Wang + +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 +Acked-by: Arnd Bergmann +Signed-off-by: Alexandre Belloni +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..255bcd1ca03 --- /dev/null +++ b/queue-4.9/scsi-ufs-fix-wrong-command-type-of-utrd-for-ufshci-v2.1.patch @@ -0,0 +1,55 @@ +From 83dc7e3dea76b77b6bcc289eb86c5b5c145e8dff Mon Sep 17 00:00:00 2001 +From: kehuanlin +Date: Wed, 6 Sep 2017 17:58:39 +0800 +Subject: scsi: ufs: fix wrong command type of UTRD for UFSHCI v2.1 + +From: kehuanlin + +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 +Reviewed-by: Subhash Jadavani +Signed-off-by: Martin K. Petersen +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + 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, diff --git a/queue-4.9/series b/queue-4.9/series index 13480b0b6b6..3fec0fb0f2c 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -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