From 240b9b180498b025abc1150bffebd4cd66a2f69e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 31 Oct 2020 12:17:06 +0100 Subject: [PATCH] 5.9-stable patches added patches: io_uring-don-t-reuse-linked_timeout.patch misc-rtsx-do-not-setting-oc_power_down-reg-in-rtsx_pci_init_ocp.patch phy-marvell-comphy-convert-internal-smcc-firmware-return-codes-to-errno.patch --- .../io_uring-don-t-reuse-linked_timeout.patch | 35 ++++++ ..._power_down-reg-in-rtsx_pci_init_ocp.patch | 34 ++++++ ...-smcc-firmware-return-codes-to-errno.patch | 111 ++++++++++++++++++ queue-5.9/series | 3 + 4 files changed, 183 insertions(+) create mode 100644 queue-5.9/io_uring-don-t-reuse-linked_timeout.patch create mode 100644 queue-5.9/misc-rtsx-do-not-setting-oc_power_down-reg-in-rtsx_pci_init_ocp.patch create mode 100644 queue-5.9/phy-marvell-comphy-convert-internal-smcc-firmware-return-codes-to-errno.patch diff --git a/queue-5.9/io_uring-don-t-reuse-linked_timeout.patch b/queue-5.9/io_uring-don-t-reuse-linked_timeout.patch new file mode 100644 index 00000000000..b82dfc929b1 --- /dev/null +++ b/queue-5.9/io_uring-don-t-reuse-linked_timeout.patch @@ -0,0 +1,35 @@ +From ff5771613cd7b3a76cd16cb54aa81d30d3c11d48 Mon Sep 17 00:00:00 2001 +From: Pavel Begunkov +Date: Tue, 20 Oct 2020 23:50:27 +0100 +Subject: io_uring: don't reuse linked_timeout + +From: Pavel Begunkov + +commit ff5771613cd7b3a76cd16cb54aa81d30d3c11d48 upstream. + +Clear linked_timeout for next requests in __io_queue_sqe() so we won't +queue it up unnecessary when it's going to be punted. + +Signed-off-by: Pavel Begunkov +Cc: stable@vger.kernel.org # v5.9 +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + fs/io_uring.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/fs/io_uring.c ++++ b/fs/io_uring.c +@@ -6249,8 +6249,10 @@ err: + if (nxt) { + req = nxt; + +- if (req->flags & REQ_F_FORCE_ASYNC) ++ if (req->flags & REQ_F_FORCE_ASYNC) { ++ linked_timeout = NULL; + goto punt; ++ } + goto again; + } + exit: diff --git a/queue-5.9/misc-rtsx-do-not-setting-oc_power_down-reg-in-rtsx_pci_init_ocp.patch b/queue-5.9/misc-rtsx-do-not-setting-oc_power_down-reg-in-rtsx_pci_init_ocp.patch new file mode 100644 index 00000000000..40a47336a4b --- /dev/null +++ b/queue-5.9/misc-rtsx-do-not-setting-oc_power_down-reg-in-rtsx_pci_init_ocp.patch @@ -0,0 +1,34 @@ +From 551b6729578a8981c46af964c10bf7d5d9ddca83 Mon Sep 17 00:00:00 2001 +From: Ricky Wu +Date: Mon, 24 Aug 2020 11:00:06 +0800 +Subject: misc: rtsx: do not setting OC_POWER_DOWN reg in rtsx_pci_init_ocp() + +From: Ricky Wu + +commit 551b6729578a8981c46af964c10bf7d5d9ddca83 upstream. + +this power saving action in rtsx_pci_init_ocp() cause INTEL-NUC6 platform +missing card reader + +Signed-off-by: Ricky Wu +Link: https://lore.kernel.org/r/20200824030006.30033-1-ricky_wu@realtek.com +Cc: Chris Clayton +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/cardreader/rtsx_pcr.c | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/drivers/misc/cardreader/rtsx_pcr.c ++++ b/drivers/misc/cardreader/rtsx_pcr.c +@@ -1155,10 +1155,6 @@ void rtsx_pci_init_ocp(struct rtsx_pcr * + rtsx_pci_write_register(pcr, REG_OCPGLITCH, + SD_OCP_GLITCH_MASK, pcr->hw_param.ocp_glitch); + rtsx_pci_enable_ocp(pcr); +- } else { +- /* OC power down */ +- rtsx_pci_write_register(pcr, FPDCTL, OC_POWER_DOWN, +- OC_POWER_DOWN); + } + } + } diff --git a/queue-5.9/phy-marvell-comphy-convert-internal-smcc-firmware-return-codes-to-errno.patch b/queue-5.9/phy-marvell-comphy-convert-internal-smcc-firmware-return-codes-to-errno.patch new file mode 100644 index 00000000000..38fccc4e7d3 --- /dev/null +++ b/queue-5.9/phy-marvell-comphy-convert-internal-smcc-firmware-return-codes-to-errno.patch @@ -0,0 +1,111 @@ +From ea17a0f153af2cd890e4ce517130dcccaa428c13 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Wed, 2 Sep 2020 16:43:43 +0200 +Subject: phy: marvell: comphy: Convert internal SMCC firmware return codes to errno +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +commit ea17a0f153af2cd890e4ce517130dcccaa428c13 upstream. + +Driver ->power_on and ->power_off callbacks leaks internal SMCC firmware +return codes to phy caller. This patch converts SMCC error codes to +standard linux errno codes. Include file linux/arm-smccc.h already provides +defines for SMCC error codes, so use them instead of custom driver defines. +Note that return value is signed 32bit, but stored in unsigned long type +with zero padding. + +Tested-by: Tomasz Maciej Nowak +Link: https://lore.kernel.org/r/20200902144344.16684-2-pali@kernel.org +Signed-off-by: Pali Rohár +Signed-off-by: Lorenzo Pieralisi +Reviewed-by: Rob Herring +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 +++++++++++--- + drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 14 +++++++++++--- + 2 files changed, 22 insertions(+), 6 deletions(-) + +--- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c ++++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c +@@ -26,7 +26,6 @@ + #define COMPHY_SIP_POWER_ON 0x82000001 + #define COMPHY_SIP_POWER_OFF 0x82000002 + #define COMPHY_SIP_PLL_LOCK 0x82000003 +-#define COMPHY_FW_NOT_SUPPORTED (-1) + + #define COMPHY_FW_MODE_SATA 0x1 + #define COMPHY_FW_MODE_SGMII 0x2 +@@ -112,10 +111,19 @@ static int mvebu_a3700_comphy_smc(unsign + unsigned long mode) + { + struct arm_smccc_res res; ++ s32 ret; + + arm_smccc_smc(function, lane, mode, 0, 0, 0, 0, 0, &res); ++ ret = res.a0; + +- return res.a0; ++ switch (ret) { ++ case SMCCC_RET_SUCCESS: ++ return 0; ++ case SMCCC_RET_NOT_SUPPORTED: ++ return -EOPNOTSUPP; ++ default: ++ return -EINVAL; ++ } + } + + static int mvebu_a3700_comphy_get_fw_mode(int lane, int port, +@@ -220,7 +228,7 @@ static int mvebu_a3700_comphy_power_on(s + } + + ret = mvebu_a3700_comphy_smc(COMPHY_SIP_POWER_ON, lane->id, fw_param); +- if (ret == COMPHY_FW_NOT_SUPPORTED) ++ if (ret == -EOPNOTSUPP) + dev_err(lane->dev, + "unsupported SMC call, try updating your firmware\n"); + +--- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c ++++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c +@@ -123,7 +123,6 @@ + + #define COMPHY_SIP_POWER_ON 0x82000001 + #define COMPHY_SIP_POWER_OFF 0x82000002 +-#define COMPHY_FW_NOT_SUPPORTED (-1) + + /* + * A lane is described by the following bitfields: +@@ -273,10 +272,19 @@ static int mvebu_comphy_smc(unsigned lon + unsigned long lane, unsigned long mode) + { + struct arm_smccc_res res; ++ s32 ret; + + arm_smccc_smc(function, phys, lane, mode, 0, 0, 0, 0, &res); ++ ret = res.a0; + +- return res.a0; ++ switch (ret) { ++ case SMCCC_RET_SUCCESS: ++ return 0; ++ case SMCCC_RET_NOT_SUPPORTED: ++ return -EOPNOTSUPP; ++ default: ++ return -EINVAL; ++ } + } + + static int mvebu_comphy_get_mode(bool fw_mode, int lane, int port, +@@ -819,7 +827,7 @@ static int mvebu_comphy_power_on(struct + if (!ret) + return ret; + +- if (ret == COMPHY_FW_NOT_SUPPORTED) ++ if (ret == -EOPNOTSUPP) + dev_err(priv->dev, + "unsupported SMC call, try updating your firmware\n"); + diff --git a/queue-5.9/series b/queue-5.9/series index 15ab230a4d4..749b1282979 100644 --- a/queue-5.9/series +++ b/queue-5.9/series @@ -69,3 +69,6 @@ pm-runtime-fix-timer_expires-data-type-on-32-bit-arches.patch ata-sata_rcar-fix-dma-boundary-mask.patch mm-mark-async-iocb-read-as-nowait-once-some-data-has-been-copied.patch xen-gntdev.c-mark-pages-as-dirty.patch +io_uring-don-t-reuse-linked_timeout.patch +misc-rtsx-do-not-setting-oc_power_down-reg-in-rtsx_pci_init_ocp.patch +phy-marvell-comphy-convert-internal-smcc-firmware-return-codes-to-errno.patch -- 2.47.3