From 5c184a26fa86af5809c92d2cf46e59a98fa1c4b0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 16 Jan 2020 11:13:31 +0100 Subject: [PATCH] 4.4-stable patches added patches: platform-x86-asus-wmi-fix-keyboard-brightness-cannot-be-set-to-0.patch scsi-enclosure-fix-stale-device-oops-with-hot-replug.patch scsi-sd-clear-sdkp-protection_type-if-disk-is-reformatted-without-pi.patch --- ...yboard-brightness-cannot-be-set-to-0.patch | 40 +++++++++++++++++ ...ix-stale-device-oops-with-hot-replug.patch | 45 +++++++++++++++++++ ...pe-if-disk-is-reformatted-without-pi.patch | 42 +++++++++++++++++ queue-4.4/series | 3 ++ 4 files changed, 130 insertions(+) create mode 100644 queue-4.4/platform-x86-asus-wmi-fix-keyboard-brightness-cannot-be-set-to-0.patch create mode 100644 queue-4.4/scsi-enclosure-fix-stale-device-oops-with-hot-replug.patch create mode 100644 queue-4.4/scsi-sd-clear-sdkp-protection_type-if-disk-is-reformatted-without-pi.patch diff --git a/queue-4.4/platform-x86-asus-wmi-fix-keyboard-brightness-cannot-be-set-to-0.patch b/queue-4.4/platform-x86-asus-wmi-fix-keyboard-brightness-cannot-be-set-to-0.patch new file mode 100644 index 00000000000..3e3ae86e8de --- /dev/null +++ b/queue-4.4/platform-x86-asus-wmi-fix-keyboard-brightness-cannot-be-set-to-0.patch @@ -0,0 +1,40 @@ +From 176a7fca81c5090a7240664e3002c106d296bf31 Mon Sep 17 00:00:00 2001 +From: Jian-Hong Pan +Date: Mon, 30 Dec 2019 16:30:45 +0800 +Subject: platform/x86: asus-wmi: Fix keyboard brightness cannot be set to 0 + +From: Jian-Hong Pan + +commit 176a7fca81c5090a7240664e3002c106d296bf31 upstream. + +Some of ASUS laptops like UX431FL keyboard backlight cannot be set to +brightness 0. According to ASUS' information, the brightness should be +0x80 ~ 0x83. This patch fixes it by following the logic. + +Fixes: e9809c0b9670 ("asus-wmi: add keyboard backlight support") +Signed-off-by: Jian-Hong Pan +Reviewed-by: Daniel Drake +Signed-off-by: Andy Shevchenko +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/platform/x86/asus-wmi.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/drivers/platform/x86/asus-wmi.c ++++ b/drivers/platform/x86/asus-wmi.c +@@ -452,13 +452,7 @@ static void kbd_led_update(struct work_s + + asus = container_of(work, struct asus_wmi, kbd_led_work); + +- /* +- * bits 0-2: level +- * bit 7: light on/off +- */ +- if (asus->kbd_led_wk > 0) +- ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F); +- ++ ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F); + asus_wmi_set_devstate(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param, NULL); + } + diff --git a/queue-4.4/scsi-enclosure-fix-stale-device-oops-with-hot-replug.patch b/queue-4.4/scsi-enclosure-fix-stale-device-oops-with-hot-replug.patch new file mode 100644 index 00000000000..5e6261b3dfd --- /dev/null +++ b/queue-4.4/scsi-enclosure-fix-stale-device-oops-with-hot-replug.patch @@ -0,0 +1,45 @@ +From 529244bd1afc102ab164429d338d310d5d65e60d Mon Sep 17 00:00:00 2001 +From: James Bottomley +Date: Wed, 8 Jan 2020 17:21:32 -0800 +Subject: scsi: enclosure: Fix stale device oops with hot replug + +From: James Bottomley + +commit 529244bd1afc102ab164429d338d310d5d65e60d upstream. + +Doing an add/remove/add on a SCSI device in an enclosure leads to an oops +caused by poisoned values in the enclosure device list pointers. The +reason is because we are keeping the enclosure device across the enclosed +device add/remove/add but the current code is doing a +device_add/device_del/device_add on it. This is the wrong thing to do in +sysfs, so fix it by not doing a device_del on the enclosure device simply +because of a hot remove of the drive in the slot. + +[mkp: added missing email addresses] + +Fixes: 43d8eb9cfd0a ("[SCSI] ses: add support for enclosure component hot removal") +Link: https://lore.kernel.org/r/1578532892.3852.10.camel@HansenPartnership.com +Signed-off-by: James Bottomley +Reported-by: Luo Jiaxing +Tested-by: John Garry +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/enclosure.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/misc/enclosure.c ++++ b/drivers/misc/enclosure.c +@@ -419,10 +419,9 @@ int enclosure_remove_device(struct enclo + cdev = &edev->component[i]; + if (cdev->dev == dev) { + enclosure_remove_links(cdev); +- device_del(&cdev->cdev); + put_device(dev); + cdev->dev = NULL; +- return device_add(&cdev->cdev); ++ return 0; + } + } + return -ENODEV; diff --git a/queue-4.4/scsi-sd-clear-sdkp-protection_type-if-disk-is-reformatted-without-pi.patch b/queue-4.4/scsi-sd-clear-sdkp-protection_type-if-disk-is-reformatted-without-pi.patch new file mode 100644 index 00000000000..5920eaa5e0f --- /dev/null +++ b/queue-4.4/scsi-sd-clear-sdkp-protection_type-if-disk-is-reformatted-without-pi.patch @@ -0,0 +1,42 @@ +From 465f4edaecc6c37f81349233e84d46246bcac11a Mon Sep 17 00:00:00 2001 +From: Xiang Chen +Date: Thu, 9 Jan 2020 09:12:24 +0800 +Subject: scsi: sd: Clear sdkp->protection_type if disk is reformatted without PI + +From: Xiang Chen + +commit 465f4edaecc6c37f81349233e84d46246bcac11a upstream. + +If an attached disk with protection information enabled is reformatted +to Type 0 the revalidation code does not clear the original protection +type and subsequent accesses will keep setting RDPROTECT/WRPROTECT. + +Set the protection type to 0 if the disk reports PROT_EN=0 in READ +CAPACITY(16). + +[mkp: commit desc] + +Fixes: fe542396da73 ("[SCSI] sd: Ensure we correctly disable devices with unknown protection type") +Link: https://lore.kernel.org/r/1578532344-101668-1-git-send-email-chenxiang66@hisilicon.com +Signed-off-by: Xiang Chen +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/sd.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -1998,8 +1998,10 @@ static int sd_read_protection_type(struc + u8 type; + int ret = 0; + +- if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0) ++ if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0) { ++ sdkp->protection_type = 0; + return ret; ++ } + + type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */ + diff --git a/queue-4.4/series b/queue-4.4/series index e72a66130b7..7751251a161 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -21,3 +21,6 @@ gpio-fix-error-message-on-out-of-range-gpio-in-lookup-table.patch hsr-reset-network-header-when-supervision-frame-is-created.patch cifs-adjust-indentation-in-smb2_open_file.patch rdma-srpt-report-the-scsi-residual-to-the-initiator.patch +scsi-enclosure-fix-stale-device-oops-with-hot-replug.patch +scsi-sd-clear-sdkp-protection_type-if-disk-is-reformatted-without-pi.patch +platform-x86-asus-wmi-fix-keyboard-brightness-cannot-be-set-to-0.patch -- 2.47.3