From ca3dc041307f0c3a788115e91f45adfb455dab2f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Apr 2020 21:02:59 +0200 Subject: [PATCH] 5.6-stable patches added patches: coresight-do-not-use-the-bit-macro-in-the-uapi-header.patch extcon-axp288-add-wakeup-support.patch mei-me-add-cedar-fork-device-ids.patch misc-pci_endpoint_test-avoid-using-module-parameter-to-determine-irqtype.patch misc-pci_endpoint_test-fix-to-support-10-pci-endpoint-test-devices.patch misc-rtsx-set-correct-pcr_ops-for-rts522a.patch nvmem-check-for-null-reg_read-and-reg_write-before-dereferencing.patch nvmem-release-the-write-protect-pin.patch nvmem-sprd-fix-the-block-lock-operation.patch pci-sysfs-revert-rescan-file-renames.patch power-supply-axp288_charger-add-special-handling-for-hp-pavilion-x2-10.patch revert-alsa-uapi-drop-asound.h-inclusion-from-asoc.h.patch revert-dm-always-call-blk_queue_split-in-dm_process_bio.patch --- ...use-the-bit-macro-in-the-uapi-header.patch | 39 ++++ .../extcon-axp288-add-wakeup-support.patch | 74 ++++++++ .../mei-me-add-cedar-fork-device-ids.patch | 44 +++++ ...odule-parameter-to-determine-irqtype.patch | 109 +++++++++++ ...support-10-pci-endpoint-test-devices.patch | 38 ++++ ...rtsx-set-correct-pcr_ops-for-rts522a.patch | 32 ++++ ...d-and-reg_write-before-dereferencing.patch | 48 +++++ .../nvmem-release-the-write-protect-pin.patch | 37 ++++ ...em-sprd-fix-the-block-lock-operation.patch | 35 ++++ ...pci-sysfs-revert-rescan-file-renames.patch | 60 ++++++ ...ecial-handling-for-hp-pavilion-x2-10.patch | 178 ++++++++++++++++++ ...-drop-asound.h-inclusion-from-asoc.h.patch | 36 ++++ ...ll-blk_queue_split-in-dm_process_bio.patch | 110 +++++++++++ queue-5.6/series | 13 ++ 14 files changed, 853 insertions(+) create mode 100644 queue-5.6/coresight-do-not-use-the-bit-macro-in-the-uapi-header.patch create mode 100644 queue-5.6/extcon-axp288-add-wakeup-support.patch create mode 100644 queue-5.6/mei-me-add-cedar-fork-device-ids.patch create mode 100644 queue-5.6/misc-pci_endpoint_test-avoid-using-module-parameter-to-determine-irqtype.patch create mode 100644 queue-5.6/misc-pci_endpoint_test-fix-to-support-10-pci-endpoint-test-devices.patch create mode 100644 queue-5.6/misc-rtsx-set-correct-pcr_ops-for-rts522a.patch create mode 100644 queue-5.6/nvmem-check-for-null-reg_read-and-reg_write-before-dereferencing.patch create mode 100644 queue-5.6/nvmem-release-the-write-protect-pin.patch create mode 100644 queue-5.6/nvmem-sprd-fix-the-block-lock-operation.patch create mode 100644 queue-5.6/pci-sysfs-revert-rescan-file-renames.patch create mode 100644 queue-5.6/power-supply-axp288_charger-add-special-handling-for-hp-pavilion-x2-10.patch create mode 100644 queue-5.6/revert-alsa-uapi-drop-asound.h-inclusion-from-asoc.h.patch create mode 100644 queue-5.6/revert-dm-always-call-blk_queue_split-in-dm_process_bio.patch diff --git a/queue-5.6/coresight-do-not-use-the-bit-macro-in-the-uapi-header.patch b/queue-5.6/coresight-do-not-use-the-bit-macro-in-the-uapi-header.patch new file mode 100644 index 00000000000..5dc79dc9991 --- /dev/null +++ b/queue-5.6/coresight-do-not-use-the-bit-macro-in-the-uapi-header.patch @@ -0,0 +1,39 @@ +From 9b6eaaf3db5e5888df7bca7fed7752a90f7fd871 Mon Sep 17 00:00:00 2001 +From: Eugene Syromiatnikov +Date: Tue, 24 Mar 2020 05:22:13 +0100 +Subject: coresight: do not use the BIT() macro in the UAPI header + +From: Eugene Syromiatnikov + +commit 9b6eaaf3db5e5888df7bca7fed7752a90f7fd871 upstream. + +The BIT() macro definition is not available for the UAPI headers +(moreover, it can be defined differently in the user space); replace +its usage with the _BITUL() macro that is defined in . + +Fixes: 237483aa5cf4 ("coresight: stm: adding driver for CoreSight STM component") +Signed-off-by: Eugene Syromiatnikov +Cc: stable +Reviewed-by: Mathieu Poirier +Link: https://lore.kernel.org/r/20200324042213.GA10452@asgard.redhat.com +Signed-off-by: Greg Kroah-Hartman + +--- + include/uapi/linux/coresight-stm.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/include/uapi/linux/coresight-stm.h ++++ b/include/uapi/linux/coresight-stm.h +@@ -2,8 +2,10 @@ + #ifndef __UAPI_CORESIGHT_STM_H_ + #define __UAPI_CORESIGHT_STM_H_ + +-#define STM_FLAG_TIMESTAMPED BIT(3) +-#define STM_FLAG_GUARANTEED BIT(7) ++#include ++ ++#define STM_FLAG_TIMESTAMPED _BITUL(3) ++#define STM_FLAG_GUARANTEED _BITUL(7) + + /* + * The CoreSight STM supports guaranteed and invariant timing diff --git a/queue-5.6/extcon-axp288-add-wakeup-support.patch b/queue-5.6/extcon-axp288-add-wakeup-support.patch new file mode 100644 index 00000000000..87fb40bef78 --- /dev/null +++ b/queue-5.6/extcon-axp288-add-wakeup-support.patch @@ -0,0 +1,74 @@ +From 9c94553099efb2ba873cbdddfd416a8a09d0e5f1 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 23 Mar 2020 22:59:39 +0100 +Subject: extcon: axp288: Add wakeup support + +From: Hans de Goede + +commit 9c94553099efb2ba873cbdddfd416a8a09d0e5f1 upstream. + +On devices with an AXP288, we need to wakeup from suspend when a charger +is plugged in, so that we can do charger-type detection and so that the +axp288-charger driver, which listens for our extcon events, can configure +the input-current-limit accordingly. + +Cc: stable@vger.kernel.org +Signed-off-by: Hans de Goede +Signed-off-by: Chanwoo Choi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/extcon/extcon-axp288.c | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +--- a/drivers/extcon/extcon-axp288.c ++++ b/drivers/extcon/extcon-axp288.c +@@ -443,9 +443,40 @@ static int axp288_extcon_probe(struct pl + /* Start charger cable type detection */ + axp288_extcon_enable(info); + ++ device_init_wakeup(dev, true); ++ platform_set_drvdata(pdev, info); ++ ++ return 0; ++} ++ ++static int __maybe_unused axp288_extcon_suspend(struct device *dev) ++{ ++ struct axp288_extcon_info *info = dev_get_drvdata(dev); ++ ++ if (device_may_wakeup(dev)) ++ enable_irq_wake(info->irq[VBUS_RISING_IRQ]); ++ + return 0; + } + ++static int __maybe_unused axp288_extcon_resume(struct device *dev) ++{ ++ struct axp288_extcon_info *info = dev_get_drvdata(dev); ++ ++ /* ++ * Wakeup when a charger is connected to do charger-type ++ * connection and generate an extcon event which makes the ++ * axp288 charger driver set the input current limit. ++ */ ++ if (device_may_wakeup(dev)) ++ disable_irq_wake(info->irq[VBUS_RISING_IRQ]); ++ ++ return 0; ++} ++ ++static SIMPLE_DEV_PM_OPS(axp288_extcon_pm_ops, axp288_extcon_suspend, ++ axp288_extcon_resume); ++ + static const struct platform_device_id axp288_extcon_table[] = { + { .name = "axp288_extcon" }, + {}, +@@ -457,6 +488,7 @@ static struct platform_driver axp288_ext + .id_table = axp288_extcon_table, + .driver = { + .name = "axp288_extcon", ++ .pm = &axp288_extcon_pm_ops, + }, + }; + diff --git a/queue-5.6/mei-me-add-cedar-fork-device-ids.patch b/queue-5.6/mei-me-add-cedar-fork-device-ids.patch new file mode 100644 index 00000000000..fb38ce919b9 --- /dev/null +++ b/queue-5.6/mei-me-add-cedar-fork-device-ids.patch @@ -0,0 +1,44 @@ +From 99397d33b763dc554d118aaa38cc5abc6ce985de Mon Sep 17 00:00:00 2001 +From: Alexander Usyskin +Date: Tue, 24 Mar 2020 23:07:30 +0200 +Subject: mei: me: add cedar fork device ids + +From: Alexander Usyskin + +commit 99397d33b763dc554d118aaa38cc5abc6ce985de upstream. + +Add Cedar Fork (CDF) device ids, those belongs to the cannon point family. + +Cc: +Signed-off-by: Alexander Usyskin +Signed-off-by: Tomas Winkler +Link: https://lore.kernel.org/r/20200324210730.17672-1-tomas.winkler@intel.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/mei/hw-me-regs.h | 2 ++ + drivers/misc/mei/pci-me.c | 2 ++ + 2 files changed, 4 insertions(+) + +--- a/drivers/misc/mei/hw-me-regs.h ++++ b/drivers/misc/mei/hw-me-regs.h +@@ -87,6 +87,8 @@ + #define MEI_DEV_ID_CMP_H 0x06e0 /* Comet Lake H */ + #define MEI_DEV_ID_CMP_H_3 0x06e4 /* Comet Lake H 3 (iTouch) */ + ++#define MEI_DEV_ID_CDF 0x18D3 /* Cedar Fork */ ++ + #define MEI_DEV_ID_ICP_LP 0x34E0 /* Ice Lake Point LP */ + + #define MEI_DEV_ID_JSP_N 0x4DE0 /* Jasper Lake Point N */ +--- a/drivers/misc/mei/pci-me.c ++++ b/drivers/misc/mei/pci-me.c +@@ -111,6 +111,8 @@ static const struct pci_device_id mei_me + {MEI_PCI_DEVICE(MEI_DEV_ID_MCC, MEI_ME_PCH15_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_MCC_4, MEI_ME_PCH8_CFG)}, + ++ {MEI_PCI_DEVICE(MEI_DEV_ID_CDF, MEI_ME_PCH8_CFG)}, ++ + /* required last entry */ + {0, } + }; diff --git a/queue-5.6/misc-pci_endpoint_test-avoid-using-module-parameter-to-determine-irqtype.patch b/queue-5.6/misc-pci_endpoint_test-avoid-using-module-parameter-to-determine-irqtype.patch new file mode 100644 index 00000000000..d058f4aa681 --- /dev/null +++ b/queue-5.6/misc-pci_endpoint_test-avoid-using-module-parameter-to-determine-irqtype.patch @@ -0,0 +1,109 @@ +From b2ba9225e0313b1de631a44b7b48c109032bffec Mon Sep 17 00:00:00 2001 +From: Kishon Vijay Abraham I +Date: Tue, 17 Mar 2020 15:31:54 +0530 +Subject: misc: pci_endpoint_test: Avoid using module parameter to determine irqtype + +From: Kishon Vijay Abraham I + +commit b2ba9225e0313b1de631a44b7b48c109032bffec upstream. + +commit e03327122e2c ("pci_endpoint_test: Add 2 ioctl commands") +uses module parameter 'irqtype' in pci_endpoint_test_set_irq() +to check if IRQ vectors of a particular type (MSI or MSI-X or +LEGACY) is already allocated. However with multi-function devices, +'irqtype' will not correctly reflect the IRQ type of the PCI device. + +Fix it here by adding 'irqtype' for each PCI device to show the +IRQ type of a particular PCI device. + +Fixes: e03327122e2c ("pci_endpoint_test: Add 2 ioctl commands") +Signed-off-by: Kishon Vijay Abraham I +Signed-off-by: Lorenzo Pieralisi +Cc: stable@vger.kernel.org # v4.19+ +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/pci_endpoint_test.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +--- a/drivers/misc/pci_endpoint_test.c ++++ b/drivers/misc/pci_endpoint_test.c +@@ -98,6 +98,7 @@ struct pci_endpoint_test { + struct completion irq_raised; + int last_irq; + int num_irqs; ++ int irq_type; + /* mutex to protect the ioctls */ + struct mutex mutex; + struct miscdevice miscdev; +@@ -157,6 +158,7 @@ static void pci_endpoint_test_free_irq_v + struct pci_dev *pdev = test->pdev; + + pci_free_irq_vectors(pdev); ++ test->irq_type = IRQ_TYPE_UNDEFINED; + } + + static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test, +@@ -191,6 +193,8 @@ static bool pci_endpoint_test_alloc_irq_ + irq = 0; + res = false; + } ++ ++ test->irq_type = type; + test->num_irqs = irq; + + return res; +@@ -330,6 +334,7 @@ static bool pci_endpoint_test_copy(struc + dma_addr_t orig_dst_phys_addr; + size_t offset; + size_t alignment = test->alignment; ++ int irq_type = test->irq_type; + u32 src_crc32; + u32 dst_crc32; + +@@ -426,6 +431,7 @@ static bool pci_endpoint_test_write(stru + dma_addr_t orig_phys_addr; + size_t offset; + size_t alignment = test->alignment; ++ int irq_type = test->irq_type; + u32 crc32; + + if (size > SIZE_MAX - alignment) +@@ -494,6 +500,7 @@ static bool pci_endpoint_test_read(struc + dma_addr_t orig_phys_addr; + size_t offset; + size_t alignment = test->alignment; ++ int irq_type = test->irq_type; + u32 crc32; + + if (size > SIZE_MAX - alignment) +@@ -555,7 +562,7 @@ static bool pci_endpoint_test_set_irq(st + return false; + } + +- if (irq_type == req_irq_type) ++ if (test->irq_type == req_irq_type) + return true; + + pci_endpoint_test_release_irq(test); +@@ -567,12 +574,10 @@ static bool pci_endpoint_test_set_irq(st + if (!pci_endpoint_test_request_irq(test)) + goto err; + +- irq_type = req_irq_type; + return true; + + err: + pci_endpoint_test_free_irq_vectors(test); +- irq_type = IRQ_TYPE_UNDEFINED; + return false; + } + +@@ -652,6 +657,7 @@ static int pci_endpoint_test_probe(struc + test->test_reg_bar = 0; + test->alignment = 0; + test->pdev = pdev; ++ test->irq_type = IRQ_TYPE_UNDEFINED; + + if (no_msi) + irq_type = IRQ_TYPE_LEGACY; diff --git a/queue-5.6/misc-pci_endpoint_test-fix-to-support-10-pci-endpoint-test-devices.patch b/queue-5.6/misc-pci_endpoint_test-fix-to-support-10-pci-endpoint-test-devices.patch new file mode 100644 index 00000000000..a6547e8250a --- /dev/null +++ b/queue-5.6/misc-pci_endpoint_test-fix-to-support-10-pci-endpoint-test-devices.patch @@ -0,0 +1,38 @@ +From 6b443e5c80b67a7b8a85b33d052d655ef9064e90 Mon Sep 17 00:00:00 2001 +From: Kishon Vijay Abraham I +Date: Tue, 17 Mar 2020 15:31:57 +0530 +Subject: misc: pci_endpoint_test: Fix to support > 10 pci-endpoint-test devices + +From: Kishon Vijay Abraham I + +commit 6b443e5c80b67a7b8a85b33d052d655ef9064e90 upstream. + +Adding more than 10 pci-endpoint-test devices results in +"kobject_add_internal failed for pci-endpoint-test.1 with -EEXIST, don't +try to register things with the same name in the same directory". This +is because commit 2c156ac71c6b ("misc: Add host side PCI driver for PCI +test function device") limited the length of the "name" to 20 characters. +Change the length of the name to 24 in order to support upto 10000 +pci-endpoint-test devices. + +Fixes: 2c156ac71c6b ("misc: Add host side PCI driver for PCI test function device") +Signed-off-by: Kishon Vijay Abraham I +Signed-off-by: Lorenzo Pieralisi +Cc: stable@vger.kernel.org # v4.14+ +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/pci_endpoint_test.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/misc/pci_endpoint_test.c ++++ b/drivers/misc/pci_endpoint_test.c +@@ -633,7 +633,7 @@ static int pci_endpoint_test_probe(struc + { + int err; + int id; +- char name[20]; ++ char name[24]; + enum pci_barno bar; + void __iomem *base; + struct device *dev = &pdev->dev; diff --git a/queue-5.6/misc-rtsx-set-correct-pcr_ops-for-rts522a.patch b/queue-5.6/misc-rtsx-set-correct-pcr_ops-for-rts522a.patch new file mode 100644 index 00000000000..f4c8353ade0 --- /dev/null +++ b/queue-5.6/misc-rtsx-set-correct-pcr_ops-for-rts522a.patch @@ -0,0 +1,32 @@ +From 10cea23b6aae15e8324f4101d785687f2c514fe5 Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Thu, 26 Mar 2020 11:26:18 +0800 +Subject: misc: rtsx: set correct pcr_ops for rts522A + +From: YueHaibing + +commit 10cea23b6aae15e8324f4101d785687f2c514fe5 upstream. + +rts522a should use rts522a_pcr_ops, which is +diffrent with rts5227 in phy/hw init setting. + +Fixes: ce6a5acc9387 ("mfd: rtsx: Add support for rts522A") +Signed-off-by: YueHaibing +Cc: stable +Link: https://lore.kernel.org/r/20200326032618.20472-1-yuehaibing@huawei.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/cardreader/rts5227.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/misc/cardreader/rts5227.c ++++ b/drivers/misc/cardreader/rts5227.c +@@ -394,6 +394,7 @@ static const struct pcr_ops rts522a_pcr_ + void rts522a_init_params(struct rtsx_pcr *pcr) + { + rts5227_init_params(pcr); ++ pcr->ops = &rts522a_pcr_ops; + pcr->tx_initial_phase = SET_CLOCK_PHASE(20, 20, 11); + pcr->reg_pm_ctrl3 = RTS522A_PM_CTRL3; + diff --git a/queue-5.6/nvmem-check-for-null-reg_read-and-reg_write-before-dereferencing.patch b/queue-5.6/nvmem-check-for-null-reg_read-and-reg_write-before-dereferencing.patch new file mode 100644 index 00000000000..b46f60a8cca --- /dev/null +++ b/queue-5.6/nvmem-check-for-null-reg_read-and-reg_write-before-dereferencing.patch @@ -0,0 +1,48 @@ +From 3c91ef69a3e94f78546b246225ed573fbf1735b4 Mon Sep 17 00:00:00 2001 +From: Nicholas Johnson +Date: Tue, 10 Mar 2020 13:22:52 +0000 +Subject: nvmem: check for NULL reg_read and reg_write before dereferencing + +From: Nicholas Johnson + +commit 3c91ef69a3e94f78546b246225ed573fbf1735b4 upstream. + +Return -EPERM if reg_read is NULL in bin_attr_nvmem_read() or if +reg_write is NULL in bin_attr_nvmem_write(). + +This prevents NULL dereferences such as the one described in +03cd45d2e219 ("thunderbolt: Prevent crash if non-active NVMem file is +read") + +Signed-off-by: Nicholas Johnson +Cc: stable +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20200310132257.23358-10-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/nvmem/nvmem-sysfs.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/nvmem/nvmem-sysfs.c ++++ b/drivers/nvmem/nvmem-sysfs.c +@@ -56,6 +56,9 @@ static ssize_t bin_attr_nvmem_read(struc + + count = round_down(count, nvmem->word_size); + ++ if (!nvmem->reg_read) ++ return -EPERM; ++ + rc = nvmem->reg_read(nvmem->priv, pos, buf, count); + + if (rc) +@@ -90,6 +93,9 @@ static ssize_t bin_attr_nvmem_write(stru + + count = round_down(count, nvmem->word_size); + ++ if (!nvmem->reg_write) ++ return -EPERM; ++ + rc = nvmem->reg_write(nvmem->priv, pos, buf, count); + + if (rc) diff --git a/queue-5.6/nvmem-release-the-write-protect-pin.patch b/queue-5.6/nvmem-release-the-write-protect-pin.patch new file mode 100644 index 00000000000..234ee3820a9 --- /dev/null +++ b/queue-5.6/nvmem-release-the-write-protect-pin.patch @@ -0,0 +1,37 @@ +From a9c3766cb19cdadf2776aba41b64470002645894 Mon Sep 17 00:00:00 2001 +From: Khouloud Touil +Date: Tue, 10 Mar 2020 13:22:50 +0000 +Subject: nvmem: release the write-protect pin + +From: Khouloud Touil + +commit a9c3766cb19cdadf2776aba41b64470002645894 upstream. + +Put the write-protect GPIO descriptor in nvmem_release() so that it can +be automatically released when the associated device's reference count +drops to 0. + +Fixes: 2a127da461a9 ("nvmem: add support for the write-protect pin") +Reported-by: Geert Uytterhoeven +Signed-off-by: Khouloud Touil +Cc: stable +[Bartosz: tweak the commit message] +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20200310132257.23358-8-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/nvmem/core.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/nvmem/core.c ++++ b/drivers/nvmem/core.c +@@ -72,6 +72,7 @@ static void nvmem_release(struct device + struct nvmem_device *nvmem = to_nvmem_device(dev); + + ida_simple_remove(&nvmem_ida, nvmem->id); ++ gpiod_put(nvmem->wp_gpio); + kfree(nvmem); + } + diff --git a/queue-5.6/nvmem-sprd-fix-the-block-lock-operation.patch b/queue-5.6/nvmem-sprd-fix-the-block-lock-operation.patch new file mode 100644 index 00000000000..284f4b539c8 --- /dev/null +++ b/queue-5.6/nvmem-sprd-fix-the-block-lock-operation.patch @@ -0,0 +1,35 @@ +From c66ebde4d988b592e8f0008e04c47cc4950a49d3 Mon Sep 17 00:00:00 2001 +From: Freeman Liu +Date: Mon, 23 Mar 2020 15:00:03 +0000 +Subject: nvmem: sprd: Fix the block lock operation + +From: Freeman Liu + +commit c66ebde4d988b592e8f0008e04c47cc4950a49d3 upstream. + +According to the Spreadtrum eFuse specification, we should write 0 to +the block to trigger the lock operation. + +Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support") +Cc: stable +Signed-off-by: Freeman Liu +Signed-off-by: Baolin Wang +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20200323150007.7487-2-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/nvmem/sprd-efuse.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/nvmem/sprd-efuse.c ++++ b/drivers/nvmem/sprd-efuse.c +@@ -239,7 +239,7 @@ static int sprd_efuse_raw_prog(struct sp + ret = -EBUSY; + } else { + sprd_efuse_set_prog_lock(efuse, lock); +- writel(*data, efuse->base + SPRD_EFUSE_MEM(blk)); ++ writel(0, efuse->base + SPRD_EFUSE_MEM(blk)); + sprd_efuse_set_prog_lock(efuse, false); + } + diff --git a/queue-5.6/pci-sysfs-revert-rescan-file-renames.patch b/queue-5.6/pci-sysfs-revert-rescan-file-renames.patch new file mode 100644 index 00000000000..fccc1a6baf6 --- /dev/null +++ b/queue-5.6/pci-sysfs-revert-rescan-file-renames.patch @@ -0,0 +1,60 @@ +From bd641fd8303a371e789e924291086268256766b0 Mon Sep 17 00:00:00 2001 +From: Kelsey Skunberg +Date: Wed, 25 Mar 2020 09:17:08 -0600 +Subject: PCI: sysfs: Revert "rescan" file renames + +From: Kelsey Skunberg + +commit bd641fd8303a371e789e924291086268256766b0 upstream. + +We changed these sysfs filenames: + + .../pci_bus//rescan -> .../pci_bus//bus_rescan + ...//rescan -> ...//dev_rescan + +and Ruslan reported [1] that this broke a userspace application. + +Revert these name changes so both files are named "rescan" again. + +Note that we have to use __ATTR() to assign custom C symbols, i.e., +"struct device_attribute ". + +[1] https://lore.kernel.org/r/CAB=otbSYozS-ZfxB0nCiNnxcbqxwrHOSYxJJtDKa63KzXbXgpw@mail.gmail.com + +[bhelgaas: commit log, use __ATTR() both places so we don't have to rename +the attributes] +Fixes: 8bdfa145f582 ("PCI: sysfs: Define device attributes with DEVICE_ATTR*()") +Fixes: 4e2b79436e4f ("PCI: sysfs: Change DEVICE_ATTR() to DEVICE_ATTR_WO()") +Link: https://lore.kernel.org/r/20200325151708.32612-1-skunberg.kelsey@gmail.com +Signed-off-by: Kelsey Skunberg +Signed-off-by: Bjorn Helgaas +Reviewed-by: Greg Kroah-Hartman +Cc: stable@vger.kernel.org # v5.4+ +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/pci-sysfs.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/pci/pci-sysfs.c ++++ b/drivers/pci/pci-sysfs.c +@@ -464,7 +464,8 @@ static ssize_t dev_rescan_store(struct d + } + return count; + } +-static DEVICE_ATTR_WO(dev_rescan); ++static struct device_attribute dev_attr_dev_rescan = __ATTR(rescan, 0200, NULL, ++ dev_rescan_store); + + static ssize_t remove_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +@@ -501,7 +502,8 @@ static ssize_t bus_rescan_store(struct d + } + return count; + } +-static DEVICE_ATTR_WO(bus_rescan); ++static struct device_attribute dev_attr_bus_rescan = __ATTR(rescan, 0200, NULL, ++ bus_rescan_store); + + #if defined(CONFIG_PM) && defined(CONFIG_ACPI) + static ssize_t d3cold_allowed_store(struct device *dev, diff --git a/queue-5.6/power-supply-axp288_charger-add-special-handling-for-hp-pavilion-x2-10.patch b/queue-5.6/power-supply-axp288_charger-add-special-handling-for-hp-pavilion-x2-10.patch new file mode 100644 index 00000000000..25d4766da62 --- /dev/null +++ b/queue-5.6/power-supply-axp288_charger-add-special-handling-for-hp-pavilion-x2-10.patch @@ -0,0 +1,178 @@ +From 9c80662a74cd2a5d1113f5c69d027face963a556 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 23 Feb 2020 16:32:08 +0100 +Subject: power: supply: axp288_charger: Add special handling for HP Pavilion x2 10 + +From: Hans de Goede + +commit 9c80662a74cd2a5d1113f5c69d027face963a556 upstream. + +Some HP Pavilion x2 10 models use an AXP288 for charging and fuel-gauge. +We use a native power_supply / PMIC driver in this case, because on most +models with an AXP288 the ACPI AC / Battery code is either completely +missing or relies on custom / proprietary ACPI OpRegions which Linux +does not implement. + +The native drivers mostly work fine, but there are 2 problems: + +1. These model uses a Type-C connector for charging which the AXP288 does +not support. As long as a Type-A charger (which uses the USB data pins for +charger type detection) is used everything is fine. But if a Type-C +charger is used (such as the charger shipped with the device) then the +charger is not recognized. + +So we end up slowly discharging the device even though a charger is +connected, because we are limiting the current from the charger to 500mA. +To make things worse this happens with the device's official charger. + +Looking at the ACPI tables HP has "solved" the problem of the AXP288 not +being able to recognize Type-C chargers by simply always programming the +input-current-limit at 3000mA and relying on a Vhold setting of 4.7V +(normally 4.4V) to limit the current intake if the charger cannot handle +this. + +2. If no charger is connected when the machine boots then it boots with the +vbus-path disabled. On other devices this is done when a 5V boost converter +is active to avoid the PMIC trying to charge from the 5V boost output. +This is done when an OTG host cable is inserted and the ID pin on the +micro-B receptacle is pulled low, the ID pin has an ACPI event handler +associated with it which re-enables the vbus-path when the ID pin is pulled +high when the OTG cable is removed. The Type-C connector has no ID pin, +there is no ID pin handler and there appears to be no 5V boost converter, +so we end up not charging because the vbus-path is disabled, until we +unplug the charger which automatically clears the vbus-path disable bit and +then on the second plug-in of the adapter we start charging. + +The HP Pavilion x2 10 models with an AXP288 do have mostly working ACPI +AC / Battery code which does not rely on custom / proprietary ACPI +OpRegions. So one possible solution would be to blacklist the AXP288 +native power_supply drivers and add the HP Pavilion x2 10 with AXP288 +DMI ids to the list of devices which should use the ACPI AC / Battery +code even though they have an AXP288 PMIC. This would require changes to +4 files: drivers/acpi/ac.c, drivers/power/supply/axp288_charger.c, +drivers/acpi/battery.c and drivers/power/supply/axp288_fuel_gauge.c. + +Beside needing adding the same DMI matches to 4 different files, this +approach also triggers problem 2. from above, but then when suspended, +during suspend the machine will not wakeup because the vbus path is +disabled by the AML code when not charging, so the Vbus low-to-high +IRQ is not triggered, the CPU never wakes up and the device does not +charge even though the user likely things it is charging, esp. since +the charge status LED is directly coupled to an adapter being plugged +in and does not reflect actual charging. + +This could be worked by enabling vbus-path explicitly from say the +axp288_charger driver's suspend handler. + +So neither situation is ideal, in both cased we need to explicitly enable +the vbus-path to work around different variants of problem 2 above, this +requires a quirk in the axp288_charger code. + +If we go the route of using the ACPI AC / Battery drivers then we need +modifications to 3 other drivers; and we need to partially disable the +axp288_charger code, while at the same time keeping it around to enable +vbus-path on suspend. + +OTOH we can copy the hardcoding of 3A input-current-limit (we never touch +Vhold, so that would stay at 4.7V) to the axp288_charger code, which needs +changes regardless, then we concentrate all special handling of this +interesting device model in the axp288_charger code. That is what this +commit does. + +Cc: stable@vger.kernel.org +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1791098 +Signed-off-by: Hans de Goede +Signed-off-by: Sebastian Reichel +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/power/supply/axp288_charger.c | 57 +++++++++++++++++++++++++++++++++- + 1 file changed, 56 insertions(+), 1 deletion(-) + +--- a/drivers/power/supply/axp288_charger.c ++++ b/drivers/power/supply/axp288_charger.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #define PS_STAT_VBUS_TRIGGER BIT(0) + #define PS_STAT_BAT_CHRG_DIR BIT(2) +@@ -545,6 +546,49 @@ out: + return IRQ_HANDLED; + } + ++/* ++ * The HP Pavilion x2 10 series comes in a number of variants: ++ * Bay Trail SoC + AXP288 PMIC, DMI_BOARD_NAME: "815D" ++ * Cherry Trail SoC + AXP288 PMIC, DMI_BOARD_NAME: "813E" ++ * Cherry Trail SoC + TI PMIC, DMI_BOARD_NAME: "827C" or "82F4" ++ * ++ * The variants with the AXP288 PMIC are all kinds of special: ++ * ++ * 1. All variants use a Type-C connector which the AXP288 does not support, so ++ * when using a Type-C charger it is not recognized. Unlike most AXP288 devices, ++ * this model actually has mostly working ACPI AC / Battery code, the ACPI code ++ * "solves" this by simply setting the input_current_limit to 3A. ++ * There are still some issues with the ACPI code, so we use this native driver, ++ * and to solve the charging not working (500mA is not enough) issue we hardcode ++ * the 3A input_current_limit like the ACPI code does. ++ * ++ * 2. If no charger is connected the machine boots with the vbus-path disabled. ++ * Normally this is done when a 5V boost converter is active to avoid the PMIC ++ * trying to charge from the 5V boost converter's output. This is done when ++ * an OTG host cable is inserted and the ID pin on the micro-B receptacle is ++ * pulled low and the ID pin has an ACPI event handler associated with it ++ * which re-enables the vbus-path when the ID pin is pulled high when the ++ * OTG host cable is removed. The Type-C connector has no ID pin, there is ++ * no ID pin handler and there appears to be no 5V boost converter, so we ++ * end up not charging because the vbus-path is disabled, until we unplug ++ * the charger which automatically clears the vbus-path disable bit and then ++ * on the second plug-in of the adapter we start charging. To solve the not ++ * charging on first charger plugin we unconditionally enable the vbus-path at ++ * probe on this model, which is safe since there is no 5V boost converter. ++ */ ++static const struct dmi_system_id axp288_hp_x2_dmi_ids[] = { ++ { ++ /* ++ * Bay Trail model has "Hewlett-Packard" as sys_vendor, Cherry ++ * Trail model has "HP", so we only match on product_name. ++ */ ++ .matches = { ++ DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion x2 Detachable"), ++ }, ++ }, ++ {} /* Terminating entry */ ++}; ++ + static void axp288_charger_extcon_evt_worker(struct work_struct *work) + { + struct axp288_chrg_info *info = +@@ -568,7 +612,11 @@ static void axp288_charger_extcon_evt_wo + } + + /* Determine cable/charger type */ +- if (extcon_get_state(edev, EXTCON_CHG_USB_SDP) > 0) { ++ if (dmi_check_system(axp288_hp_x2_dmi_ids)) { ++ /* See comment above axp288_hp_x2_dmi_ids declaration */ ++ dev_dbg(&info->pdev->dev, "HP X2 with Type-C, setting inlmt to 3A\n"); ++ current_limit = 3000000; ++ } else if (extcon_get_state(edev, EXTCON_CHG_USB_SDP) > 0) { + dev_dbg(&info->pdev->dev, "USB SDP charger is connected\n"); + current_limit = 500000; + } else if (extcon_get_state(edev, EXTCON_CHG_USB_CDP) > 0) { +@@ -685,6 +733,13 @@ static int charger_init_hw_regs(struct a + return ret; + } + ++ if (dmi_check_system(axp288_hp_x2_dmi_ids)) { ++ /* See comment above axp288_hp_x2_dmi_ids declaration */ ++ ret = axp288_charger_vbus_path_select(info, true); ++ if (ret < 0) ++ return ret; ++ } ++ + /* Read current charge voltage and current limit */ + ret = regmap_read(info->regmap, AXP20X_CHRG_CTRL1, &val); + if (ret < 0) { diff --git a/queue-5.6/revert-alsa-uapi-drop-asound.h-inclusion-from-asoc.h.patch b/queue-5.6/revert-alsa-uapi-drop-asound.h-inclusion-from-asoc.h.patch new file mode 100644 index 00000000000..9268bd9cbff --- /dev/null +++ b/queue-5.6/revert-alsa-uapi-drop-asound.h-inclusion-from-asoc.h.patch @@ -0,0 +1,36 @@ +From b6f69c795547f59ddf1db17cddbd2b9a15c656ed Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 31 Mar 2020 11:00:23 +0200 +Subject: Revert "ALSA: uapi: Drop asound.h inclusion from asoc.h" + +From: Takashi Iwai + +commit b6f69c795547f59ddf1db17cddbd2b9a15c656ed upstream. + +This reverts commit 645c08f17f477915f6d900b767e789852f150054 +which was reported to break the build a program using this header. + +The original issue was addressed in the alsa-lib side recently, so we +can make the header more self-contained again. + +Reported-by: Dmitry V. Levin +Fixes: 645c08f17f47 ("ALSA: uapi: Drop asound.h inclusion from asoc.h") +Cc: +Link: https://lore.kernel.org/r/20200331090023.8112-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + include/uapi/sound/asoc.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/uapi/sound/asoc.h ++++ b/include/uapi/sound/asoc.h +@@ -17,6 +17,7 @@ + #define __LINUX_UAPI_SND_ASOC_H + + #include ++#include + + /* + * Maximum number of channels topology kcontrol can represent. diff --git a/queue-5.6/revert-dm-always-call-blk_queue_split-in-dm_process_bio.patch b/queue-5.6/revert-dm-always-call-blk_queue_split-in-dm_process_bio.patch new file mode 100644 index 00000000000..6e8ce2b37de --- /dev/null +++ b/queue-5.6/revert-dm-always-call-blk_queue_split-in-dm_process_bio.patch @@ -0,0 +1,110 @@ +From 120c9257f5f19e5d1e87efcbb5531b7cd81b7d74 Mon Sep 17 00:00:00 2001 +From: Mike Snitzer +Date: Thu, 2 Apr 2020 19:36:26 -0400 +Subject: Revert "dm: always call blk_queue_split() in dm_process_bio()" + +From: Mike Snitzer + +commit 120c9257f5f19e5d1e87efcbb5531b7cd81b7d74 upstream. + +This reverts commit effd58c95f277744f75d6e08819ac859dbcbd351. + +blk_queue_split() is causing excessive IO splitting -- because +blk_max_size_offset() depends on 'chunk_sectors' limit being set and +if it isn't (as is the case for DM targets!) it falls back to +splitting on a 'max_sectors' boundary regardless of offset. + +"Fix" this by reverting back to _not_ using blk_queue_split() in +dm_process_bio() for normal IO (reads and writes). Long-term fix is +still TBD but it should focus on training blk_max_size_offset() to +call into a DM provided hook (to call DM's max_io_len()). + +Test results from simple misaligned IO test on 4-way dm-striped device +with chunksize of 128K and stripesize of 512K: + +xfs_io -d -c 'pread -b 2m 224s 4072s' /dev/mapper/stripe_dev + +before this revert: + +253,0 21 1 0.000000000 2206 Q R 224 + 4072 [xfs_io] +253,0 21 2 0.000008267 2206 X R 224 / 480 [xfs_io] +253,0 21 3 0.000010530 2206 X R 224 / 256 [xfs_io] +253,0 21 4 0.000027022 2206 X R 480 / 736 [xfs_io] +253,0 21 5 0.000028751 2206 X R 480 / 512 [xfs_io] +253,0 21 6 0.000033323 2206 X R 736 / 992 [xfs_io] +253,0 21 7 0.000035130 2206 X R 736 / 768 [xfs_io] +253,0 21 8 0.000039146 2206 X R 992 / 1248 [xfs_io] +253,0 21 9 0.000040734 2206 X R 992 / 1024 [xfs_io] +253,0 21 10 0.000044694 2206 X R 1248 / 1504 [xfs_io] +253,0 21 11 0.000046422 2206 X R 1248 / 1280 [xfs_io] +253,0 21 12 0.000050376 2206 X R 1504 / 1760 [xfs_io] +253,0 21 13 0.000051974 2206 X R 1504 / 1536 [xfs_io] +253,0 21 14 0.000055881 2206 X R 1760 / 2016 [xfs_io] +253,0 21 15 0.000057462 2206 X R 1760 / 1792 [xfs_io] +253,0 21 16 0.000060999 2206 X R 2016 / 2272 [xfs_io] +253,0 21 17 0.000062489 2206 X R 2016 / 2048 [xfs_io] +253,0 21 18 0.000066133 2206 X R 2272 / 2528 [xfs_io] +253,0 21 19 0.000067507 2206 X R 2272 / 2304 [xfs_io] +253,0 21 20 0.000071136 2206 X R 2528 / 2784 [xfs_io] +253,0 21 21 0.000072764 2206 X R 2528 / 2560 [xfs_io] +253,0 21 22 0.000076185 2206 X R 2784 / 3040 [xfs_io] +253,0 21 23 0.000077486 2206 X R 2784 / 2816 [xfs_io] +253,0 21 24 0.000080885 2206 X R 3040 / 3296 [xfs_io] +253,0 21 25 0.000082316 2206 X R 3040 / 3072 [xfs_io] +253,0 21 26 0.000085788 2206 X R 3296 / 3552 [xfs_io] +253,0 21 27 0.000087096 2206 X R 3296 / 3328 [xfs_io] +253,0 21 28 0.000093469 2206 X R 3552 / 3808 [xfs_io] +253,0 21 29 0.000095186 2206 X R 3552 / 3584 [xfs_io] +253,0 21 30 0.000099228 2206 X R 3808 / 4064 [xfs_io] +253,0 21 31 0.000101062 2206 X R 3808 / 3840 [xfs_io] +253,0 21 32 0.000104956 2206 X R 4064 / 4096 [xfs_io] +253,0 21 33 0.001138823 0 C R 4096 + 200 [0] + +after this revert: + +253,0 18 1 0.000000000 4430 Q R 224 + 3896 [xfs_io] +253,0 18 2 0.000018359 4430 X R 224 / 256 [xfs_io] +253,0 18 3 0.000028898 4430 X R 256 / 512 [xfs_io] +253,0 18 4 0.000033535 4430 X R 512 / 768 [xfs_io] +253,0 18 5 0.000065684 4430 X R 768 / 1024 [xfs_io] +253,0 18 6 0.000091695 4430 X R 1024 / 1280 [xfs_io] +253,0 18 7 0.000098494 4430 X R 1280 / 1536 [xfs_io] +253,0 18 8 0.000114069 4430 X R 1536 / 1792 [xfs_io] +253,0 18 9 0.000129483 4430 X R 1792 / 2048 [xfs_io] +253,0 18 10 0.000136759 4430 X R 2048 / 2304 [xfs_io] +253,0 18 11 0.000152412 4430 X R 2304 / 2560 [xfs_io] +253,0 18 12 0.000160758 4430 X R 2560 / 2816 [xfs_io] +253,0 18 13 0.000183385 4430 X R 2816 / 3072 [xfs_io] +253,0 18 14 0.000190797 4430 X R 3072 / 3328 [xfs_io] +253,0 18 15 0.000197667 4430 X R 3328 / 3584 [xfs_io] +253,0 18 16 0.000218751 4430 X R 3584 / 3840 [xfs_io] +253,0 18 17 0.000226005 4430 X R 3840 / 4096 [xfs_io] +253,0 18 18 0.000250404 4430 Q R 4120 + 176 [xfs_io] +253,0 18 19 0.000847708 0 C R 4096 + 24 [0] +253,0 18 20 0.000855783 0 C R 4120 + 176 [0] + +Fixes: effd58c95f27774 ("dm: always call blk_queue_split() in dm_process_bio()") +Cc: stable@vger.kernel.org +Reported-by: Andreas Gruenbacher +Tested-by: Barry Marson +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/dm.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/md/dm.c ++++ b/drivers/md/dm.c +@@ -1739,8 +1739,9 @@ static blk_qc_t dm_process_bio(struct ma + * won't be imposed. + */ + if (current->bio_list) { +- blk_queue_split(md->queue, &bio); +- if (!is_abnormal_io(bio)) ++ if (is_abnormal_io(bio)) ++ blk_queue_split(md->queue, &bio); ++ else + dm_queue_split(md, ti, &bio); + } + diff --git a/queue-5.6/series b/queue-5.6/series index fb5db1bb1b2..76a494a4acd 100644 --- a/queue-5.6/series +++ b/queue-5.6/series @@ -12,3 +12,16 @@ bpf-fix-tnum-constraints-for-32-bit-comparisons.patch xarray-fix-xa_find_next-for-large-multi-index-entrie.patch drm-bridge-analogix-anx6345-avoid-duplicate-supply-suffix.patch drm-i915-display-fix-mode-private_flags-comparison-at-atomic_check.patch +misc-rtsx-set-correct-pcr_ops-for-rts522a.patch +misc-pci_endpoint_test-fix-to-support-10-pci-endpoint-test-devices.patch +misc-pci_endpoint_test-avoid-using-module-parameter-to-determine-irqtype.patch +pci-sysfs-revert-rescan-file-renames.patch +coresight-do-not-use-the-bit-macro-in-the-uapi-header.patch +mei-me-add-cedar-fork-device-ids.patch +nvmem-release-the-write-protect-pin.patch +nvmem-check-for-null-reg_read-and-reg_write-before-dereferencing.patch +nvmem-sprd-fix-the-block-lock-operation.patch +extcon-axp288-add-wakeup-support.patch +power-supply-axp288_charger-add-special-handling-for-hp-pavilion-x2-10.patch +revert-alsa-uapi-drop-asound.h-inclusion-from-asoc.h.patch +revert-dm-always-call-blk_queue_split-in-dm_process_bio.patch -- 2.47.3