+++ /dev/null
-From d7cbec12d6dc1abc8a49c609cdc305967c586a47 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:33 +0200
-Subject: phy: qcom-qmp-combo: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit 2de8a325b1084330ae500380cc27edc39f488c30 ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-5-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 32 ++++++++++++-----------
- 1 file changed, 17 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
-index dcf8a8764e17..5606b25ea229 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
-@@ -5919,17 +5919,17 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->pcs = devm_of_iomap(dev, np, 2, NULL);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
- /*
- * If this is a dual-lane PHY, then there should be registers for the
-@@ -5938,9 +5938,9 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- * offset from the first lane.
- */
- if (cfg->is_dual_lane_phy) {
-- qphy->tx2 = of_iomap(np, 3);
-- qphy->rx2 = of_iomap(np, 4);
-- if (!qphy->tx2 || !qphy->rx2) {
-+ qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
-+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
-+ if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
-
-@@ -5950,15 +5950,17 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 5);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
- }
-
-- if (!qphy->pcs_misc)
-+ if (IS_ERR(qphy->pcs_misc)) {
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-+ qphy->pcs_misc = NULL;
-+ }
-
- /*
- * Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3
---
-2.35.1
-
+++ /dev/null
-From 2abab4c77f81b7098c3b63174aa789eed360a53e Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:32 +0200
-Subject: phy: qcom-qmp-pcie-msm8996: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit 1f69ededf8e80c42352e7f1c165a003614de9cc2 ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-4-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 23 +++++++++----------
- 1 file changed, 11 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
-index 51da3a3a199e..9caad14aacde 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
-@@ -900,21 +900,20 @@ int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np,
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
--
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs = devm_of_iomap(dev, np, 2, NULL);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
-- if (!qphy->pcs_misc)
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
-+ if (IS_ERR(qphy->pcs_misc))
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-
- /*
---
-2.35.1
-
+++ /dev/null
-From 08209657389b42d4b5366c98a03fa6c4ba80e035 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:34 +0200
-Subject: phy: qcom-qmp-ufs: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit ef74a97f0df8758efe4476b4645961286aa86f0d ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-6-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 30 ++++++++++++-------------
- 1 file changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
-index c7309e981bfb..66a89fbacb33 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
-@@ -5919,17 +5919,17 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->pcs = devm_of_iomap(dev, np, 2, NULL);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
- /*
- * If this is a dual-lane PHY, then there should be registers for the
-@@ -5938,9 +5938,9 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- * offset from the first lane.
- */
- if (cfg->is_dual_lane_phy) {
-- qphy->tx2 = of_iomap(np, 3);
-- qphy->rx2 = of_iomap(np, 4);
-- if (!qphy->tx2 || !qphy->rx2) {
-+ qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
-+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
-+ if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
-
-@@ -5950,14 +5950,14 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 5);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
- }
-
-- if (!qphy->pcs_misc)
-+ if (IS_ERR(qphy->pcs_misc))
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-
- /*
---
-2.35.1
-
+++ /dev/null
-From e1c35c2f2b63651158f5c4744cf3b5cc3a1a2843 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:35 +0200
-Subject: phy: qcom-qmp-usb: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit a5d6b1ac56cbd6b5850a3a54e35f1cb71e8e8cdd ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Two bindings currently rely on overlapping mappings for the PCS region
-so fallback to non-exclusive mappings for those for now.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-7-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 61 +++++++++++++++++++++++---------
- 1 file changed, 44 insertions(+), 17 deletions(-)
-
---- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
-@@ -2503,6 +2503,21 @@ static const struct phy_ops qcom_qmp_phy
- .owner = THIS_MODULE,
- };
-
-+static void __iomem *qmp_usb_iomap(struct device *dev, struct device_node *np,
-+ int index, bool exclusive)
-+{
-+ struct resource res;
-+
-+ if (!exclusive) {
-+ if (of_address_to_resource(np, index, &res))
-+ return IOMEM_ERR_PTR(-EINVAL);
-+
-+ return devm_ioremap(dev, res.start, resource_size(&res));
-+ }
-+
-+ return devm_of_iomap(dev, np, index, NULL);
-+}
-+
- static
- int qcom_qmp_phy_usb_create(struct device *dev, struct device_node *np, int id,
- void __iomem *serdes, const struct qmp_phy_cfg *cfg)
-@@ -2511,8 +2526,18 @@ int qcom_qmp_phy_usb_create(struct devic
- struct phy *generic_phy;
- struct qmp_phy *qphy;
- char prop_name[MAX_PROP_NAME];
-+ bool exclusive = true;
- int ret;
-
-+ /*
-+ * FIXME: These bindings should be fixed to not rely on overlapping
-+ * mappings for PCS.
-+ */
-+ if (of_device_is_compatible(dev->of_node, "qcom,sdx65-qmp-usb3-uni-phy"))
-+ exclusive = false;
-+ if (of_device_is_compatible(dev->of_node, "qcom,sm8350-qmp-usb3-uni-phy"))
-+ exclusive = false;
-+
- qphy = devm_kzalloc(dev, sizeof(*qphy), GFP_KERNEL);
- if (!qphy)
- return -ENOMEM;
-@@ -2525,17 +2550,17 @@ int qcom_qmp_phy_usb_create(struct devic
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
--
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
--
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-+
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-+
-+ qphy->pcs = qmp_usb_iomap(dev, np, 2, exclusive);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
- /*
- * If this is a dual-lane PHY, then there should be registers for the
-@@ -2544,9 +2569,9 @@ int qcom_qmp_phy_usb_create(struct devic
- * offset from the first lane.
- */
- if (cfg->is_dual_lane_phy) {
-- qphy->tx2 = of_iomap(np, 3);
-- qphy->rx2 = of_iomap(np, 4);
-- if (!qphy->tx2 || !qphy->rx2) {
-+ qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
-+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
-+ if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
-
-@@ -2556,15 +2581,17 @@ int qcom_qmp_phy_usb_create(struct devic
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 5);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
- }
-
-- if (!qphy->pcs_misc)
-+ if (IS_ERR(qphy->pcs_misc)) {
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-+ qphy->pcs_misc = NULL;
-+ }
-
- snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
- qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
phy-qcom-qmp-pcie-change-symbol-prefix-to-qcom_qmp_p.patch
phy-qcom-qmp-pcie-msm8996-drop-support-for-non-pcie-.patch
phy-qcom-qmp-pcie-msm8996-cleanup-the-driver.patch
-phy-qcom-qmp-pcie-msm8996-fix-memleak-on-probe-defer.patch
-phy-qcom-qmp-combo-fix-memleak-on-probe-deferral.patch
-phy-qcom-qmp-ufs-fix-memleak-on-probe-deferral.patch
phy-qcom-qmp-usb-drop-all-non-usb-compatibles-suppor.patch
phy-qcom-qmp-usb-change-symbol-prefix-to-qcom_qmp_ph.patch
phy-qcom-qmp-usb-drop-support-for-non-usb-phy-types.patch
phy-qcom-qmp-usb-cleanup-the-driver.patch
phy-qcom-qmp-usb-clean-up-pipe-clock-handling.patch
-phy-qcom-qmp-usb-fix-memleak-on-probe-deferral.patch
mtd-rawnand-fsl_elbc-fix-none-ecc-mode.patch
rdma-siw-always-consume-all-skbuf-data-in-sk_data_re.patch
rdma-rdmavt-decouple-qp-and-sge-lists-allocations.patch
+++ /dev/null
-From 69765e7de0ba351b70966b2521e979d8f21312c8 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:33 +0200
-Subject: phy: qcom-qmp-combo: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit 2de8a325b1084330ae500380cc27edc39f488c30 ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-5-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 32 ++++++++++++-----------
- 1 file changed, 17 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
-index dcf8a8764e17..5606b25ea229 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
-@@ -5919,17 +5919,17 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->pcs = devm_of_iomap(dev, np, 2, NULL);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
- /*
- * If this is a dual-lane PHY, then there should be registers for the
-@@ -5938,9 +5938,9 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- * offset from the first lane.
- */
- if (cfg->is_dual_lane_phy) {
-- qphy->tx2 = of_iomap(np, 3);
-- qphy->rx2 = of_iomap(np, 4);
-- if (!qphy->tx2 || !qphy->rx2) {
-+ qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
-+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
-+ if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
-
-@@ -5950,15 +5950,17 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 5);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
- }
-
-- if (!qphy->pcs_misc)
-+ if (IS_ERR(qphy->pcs_misc)) {
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-+ qphy->pcs_misc = NULL;
-+ }
-
- /*
- * Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3
---
-2.35.1
-
+++ /dev/null
-From 8ead6de2dc7ebb10a2361ecc4891135ed1dc6d4c Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:30 +0200
-Subject: phy: qcom-qmp-pcie: add pcs_misc sanity check
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit ecd5507e72ea03659dc2cc3e4393fbf8f4e2e02a ]
-
-Make sure that the (otherwise) optional pcs_misc IO region has been
-provided in case the configuration specifies a corresponding
-initialisation table to avoid crashing with malformed device trees.
-
-Note that the related debug message is now superfluous as the region is
-only used when the configuration has a pcs_misc table.
-
-Fixes: 421c9a0e9731 ("phy: qcom: qmp: Add SDM845 PCIe QMP PHY support")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-2-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-index 38fd0c5c3797..77f861bad8da 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-@@ -5966,8 +5966,10 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- of_device_is_compatible(dev->of_node, "qcom,ipq6018-qmp-pcie-phy"))
- qphy->pcs_misc = qphy->pcs + 0x400;
-
-- if (!qphy->pcs_misc)
-- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-+ if (!qphy->pcs_misc) {
-+ if (cfg->pcs_misc_tbl || cfg->pcs_misc_tbl_sec)
-+ return -EINVAL;
-+ }
-
- /*
- * Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3
---
-2.35.1
-
+++ /dev/null
-From 7a0854f6126f463e1c40c592ac067d18c997737d Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:31 +0200
-Subject: phy: qcom-qmp-pcie: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit 4be26f695ffa458b065b7942dbff9393bf0836ea ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-3-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 34 ++++++++++++------------
- 1 file changed, 17 insertions(+), 17 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-index 77f861bad8da..7073af57345b 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-@@ -5924,17 +5924,17 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->pcs = devm_of_iomap(dev, np, 2, NULL);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
- /*
- * If this is a dual-lane PHY, then there should be registers for the
-@@ -5943,9 +5943,9 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- * offset from the first lane.
- */
- if (cfg->is_dual_lane_phy) {
-- qphy->tx2 = of_iomap(np, 3);
-- qphy->rx2 = of_iomap(np, 4);
-- if (!qphy->tx2 || !qphy->rx2) {
-+ qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
-+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
-+ if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
-
-@@ -5955,20 +5955,20 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 5);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
- }
-
-- if (!qphy->pcs_misc &&
-+ if (IS_ERR(qphy->pcs_misc) &&
- of_device_is_compatible(dev->of_node, "qcom,ipq6018-qmp-pcie-phy"))
- qphy->pcs_misc = qphy->pcs + 0x400;
-
-- if (!qphy->pcs_misc) {
-+ if (IS_ERR(qphy->pcs_misc)) {
- if (cfg->pcs_misc_tbl || cfg->pcs_misc_tbl_sec)
-- return -EINVAL;
-+ return PTR_ERR(qphy->pcs_misc);
- }
-
- /*
---
-2.35.1
-
+++ /dev/null
-From ce93f20bba25f5c859d04491050b8a4f70968ad6 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 26 Sep 2022 20:25:14 +0300
-Subject: phy: qcom-qmp-pcie: fix resource mapping for SDM845 QHP PHY
-
-From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
-
-[ Upstream commit 0a40891b83f257b25a2b983758f72f6813f361cb ]
-
-On SDM845 one of PCIe PHYs (the QHP one) has the same region for TX and
-RX registers. Since the commit 4be26f695ffa ("phy: qcom-qmp-pcie: fix
-memleak on probe deferral") added checking that resources are not
-allocated beforehand, this PHY can not be probed anymore. Fix this by
-skipping the map of ->rx resource on the QHP PHY and assign it manually.
-
-Fixes: 4be26f695ffa ("phy: qcom-qmp-pcie: fix memleak on probe deferral")
-Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
-Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220926172514.880776-1-dmitry.baryshkov@linaro.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-index 7073af57345b..154712af5410 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-@@ -5928,7 +5928,10 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- if (IS_ERR(qphy->tx))
- return PTR_ERR(qphy->tx);
-
-- qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (of_device_is_compatible(dev->of_node, "qcom,sdm845-qhp-pcie-phy"))
-+ qphy->rx = qphy->tx;
-+ else
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
- if (IS_ERR(qphy->rx))
- return PTR_ERR(qphy->rx);
-
---
-2.35.1
-
+++ /dev/null
-From a00426d474394b1f287cc9a4ca0212c0ba09db35 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:32 +0200
-Subject: phy: qcom-qmp-pcie-msm8996: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit 1f69ededf8e80c42352e7f1c165a003614de9cc2 ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-4-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 23 +++++++++----------
- 1 file changed, 11 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
-index 51da3a3a199e..9caad14aacde 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
-@@ -900,21 +900,20 @@ int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np,
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
--
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs = devm_of_iomap(dev, np, 2, NULL);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
-- if (!qphy->pcs_misc)
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
-+ if (IS_ERR(qphy->pcs_misc))
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-
- /*
---
-2.35.1
-
+++ /dev/null
-From ae4ac319637206f20dc889c4709c3b9e13aaf18d Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:34 +0200
-Subject: phy: qcom-qmp-ufs: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit ef74a97f0df8758efe4476b4645961286aa86f0d ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-6-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 30 ++++++++++++-------------
- 1 file changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
-index c7309e981bfb..66a89fbacb33 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
-@@ -5919,17 +5919,17 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->pcs = devm_of_iomap(dev, np, 2, NULL);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
- /*
- * If this is a dual-lane PHY, then there should be registers for the
-@@ -5938,9 +5938,9 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- * offset from the first lane.
- */
- if (cfg->is_dual_lane_phy) {
-- qphy->tx2 = of_iomap(np, 3);
-- qphy->rx2 = of_iomap(np, 4);
-- if (!qphy->tx2 || !qphy->rx2) {
-+ qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
-+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
-+ if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
-
-@@ -5950,14 +5950,14 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id,
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 5);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
- }
-
-- if (!qphy->pcs_misc)
-+ if (IS_ERR(qphy->pcs_misc))
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-
- /*
---
-2.35.1
-
+++ /dev/null
-From e1c35c2f2b63651158f5c4744cf3b5cc3a1a2843 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:35 +0200
-Subject: phy: qcom-qmp-usb: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit a5d6b1ac56cbd6b5850a3a54e35f1cb71e8e8cdd ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Two bindings currently rely on overlapping mappings for the PCS region
-so fallback to non-exclusive mappings for those for now.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-7-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 61 +++++++++++++++++++++++---------
- 1 file changed, 44 insertions(+), 17 deletions(-)
-
---- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
-@@ -2503,6 +2503,21 @@ static const struct phy_ops qcom_qmp_phy
- .owner = THIS_MODULE,
- };
-
-+static void __iomem *qmp_usb_iomap(struct device *dev, struct device_node *np,
-+ int index, bool exclusive)
-+{
-+ struct resource res;
-+
-+ if (!exclusive) {
-+ if (of_address_to_resource(np, index, &res))
-+ return IOMEM_ERR_PTR(-EINVAL);
-+
-+ return devm_ioremap(dev, res.start, resource_size(&res));
-+ }
-+
-+ return devm_of_iomap(dev, np, index, NULL);
-+}
-+
- static
- int qcom_qmp_phy_usb_create(struct device *dev, struct device_node *np, int id,
- void __iomem *serdes, const struct qmp_phy_cfg *cfg)
-@@ -2511,8 +2526,18 @@ int qcom_qmp_phy_usb_create(struct devic
- struct phy *generic_phy;
- struct qmp_phy *qphy;
- char prop_name[MAX_PROP_NAME];
-+ bool exclusive = true;
- int ret;
-
-+ /*
-+ * FIXME: These bindings should be fixed to not rely on overlapping
-+ * mappings for PCS.
-+ */
-+ if (of_device_is_compatible(dev->of_node, "qcom,sdx65-qmp-usb3-uni-phy"))
-+ exclusive = false;
-+ if (of_device_is_compatible(dev->of_node, "qcom,sm8350-qmp-usb3-uni-phy"))
-+ exclusive = false;
-+
- qphy = devm_kzalloc(dev, sizeof(*qphy), GFP_KERNEL);
- if (!qphy)
- return -ENOMEM;
-@@ -2525,17 +2550,17 @@ int qcom_qmp_phy_usb_create(struct devic
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
--
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
--
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-+
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-+
-+ qphy->pcs = qmp_usb_iomap(dev, np, 2, exclusive);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
- /*
- * If this is a dual-lane PHY, then there should be registers for the
-@@ -2544,9 +2569,9 @@ int qcom_qmp_phy_usb_create(struct devic
- * offset from the first lane.
- */
- if (cfg->is_dual_lane_phy) {
-- qphy->tx2 = of_iomap(np, 3);
-- qphy->rx2 = of_iomap(np, 4);
-- if (!qphy->tx2 || !qphy->rx2) {
-+ qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
-+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
-+ if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
-
-@@ -2556,15 +2581,17 @@ int qcom_qmp_phy_usb_create(struct devic
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 5);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
- }
-
-- if (!qphy->pcs_misc)
-+ if (IS_ERR(qphy->pcs_misc)) {
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-+ qphy->pcs_misc = NULL;
-+ }
-
- snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
- qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
phy-qcom-qmp-create-copies-of-qmp-phy-driver.patch
phy-qcom-qmp-usb-disable-runtime-pm-on-unbind.patch
phy-qcom-qmp-pcie-split-pcs_misc-region-for-ipq6018-.patch
-phy-qcom-qmp-pcie-add-pcs_misc-sanity-check.patch
-phy-qcom-qmp-pcie-fix-memleak-on-probe-deferral.patch
phy-qcom-qmp-pcie-msm8996-drop-all-compatibles-excep.patch
phy-qcom-qmp-pcie-change-symbol-prefix-to-qcom_qmp_p.patch
phy-qcom-qmp-pcie-msm8996-drop-support-for-non-pcie-.patch
phy-qcom-qmp-pcie-msm8996-cleanup-the-driver.patch
-phy-qcom-qmp-pcie-msm8996-fix-memleak-on-probe-defer.patch
-phy-qcom-qmp-combo-fix-memleak-on-probe-deferral.patch
-phy-qcom-qmp-ufs-fix-memleak-on-probe-deferral.patch
phy-qcom-qmp-usb-drop-all-non-usb-compatibles-suppor.patch
phy-qcom-qmp-usb-change-symbol-prefix-to-qcom_qmp_ph.patch
phy-qcom-qmp-usb-drop-support-for-non-usb-phy-types.patch
phy-qcom-qmp-usb-cleanup-the-driver.patch
phy-qcom-qmp-usb-clean-up-pipe-clock-handling.patch
-phy-qcom-qmp-usb-fix-memleak-on-probe-deferral.patch
phy-amlogic-phy-meson-axg-mipi-pcie-analog-hold-refe.patch
phy-phy-mtk-tphy-fix-the-phy-type-setting-issue.patch
mtd-rawnand-intel-read-the-chip-select-line-from-the.patch
mfd-fsl-imx25-fix-check-for-platform_get_irq-errors.patch
mfd-sm501-add-check-for-platform_driver_register.patch
clk-mediatek-mt8183-mfgcfg-propagate-rate-changes-to.patch
-phy-qcom-qmp-pcie-fix-resource-mapping-for-sdm845-qh.patch
dmaengine-ioat-stop-mod_timer-from-resurrecting-dele.patch
usb-mtu3-fix-failed-runtime-suspend-in-host-only-mod.patch
spmi-pmic-arb-correct-duplicate-apid-to-ppid-mapping.patch
+++ /dev/null
-From 054adeef4adf42533f3432c3503e8554592552a9 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:33 +0200
-Subject: phy: qcom-qmp-combo: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit 2de8a325b1084330ae500380cc27edc39f488c30 ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-5-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 32 ++++++++++++-----------
- 1 file changed, 17 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
-index bbdca263058c..f089977c85bb 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
-@@ -2350,17 +2350,17 @@ int qcom_qmp_phy_combo_create(struct device *dev, struct device_node *np, int id
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->pcs = devm_of_iomap(dev, np, 2, NULL);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
- if (cfg->pcs_usb_offset)
- qphy->pcs_usb = qphy->pcs + cfg->pcs_usb_offset;
-@@ -2372,9 +2372,9 @@ int qcom_qmp_phy_combo_create(struct device *dev, struct device_node *np, int id
- * offset from the first lane.
- */
- if (cfg->is_dual_lane_phy) {
-- qphy->tx2 = of_iomap(np, 3);
-- qphy->rx2 = of_iomap(np, 4);
-- if (!qphy->tx2 || !qphy->rx2) {
-+ qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
-+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
-+ if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
-
-@@ -2384,15 +2384,17 @@ int qcom_qmp_phy_combo_create(struct device *dev, struct device_node *np, int id
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 5);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
- }
-
-- if (!qphy->pcs_misc)
-+ if (IS_ERR(qphy->pcs_misc)) {
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-+ qphy->pcs_misc = NULL;
-+ }
-
- /*
- * Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3
---
-2.35.1
-
+++ /dev/null
-From b0679c6500ea26c60063bcf4d02b8ebfa44747de Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:30 +0200
-Subject: phy: qcom-qmp-pcie: add pcs_misc sanity check
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit ecd5507e72ea03659dc2cc3e4393fbf8f4e2e02a ]
-
-Make sure that the (otherwise) optional pcs_misc IO region has been
-provided in case the configuration specifies a corresponding
-initialisation table to avoid crashing with malformed device trees.
-
-Note that the related debug message is now superfluous as the region is
-only used when the configuration has a pcs_misc table.
-
-Fixes: 421c9a0e9731 ("phy: qcom: qmp: Add SDM845 PCIe QMP PHY support")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-2-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-index 2d65e1f56bfc..0e0f2482827a 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-@@ -2371,8 +2371,10 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,
- of_device_is_compatible(dev->of_node, "qcom,ipq6018-qmp-pcie-phy"))
- qphy->pcs_misc = qphy->pcs + 0x400;
-
-- if (!qphy->pcs_misc)
-- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-+ if (!qphy->pcs_misc) {
-+ if (cfg->pcs_misc_tbl || cfg->pcs_misc_tbl_sec)
-+ return -EINVAL;
-+ }
-
- snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
- qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
---
-2.35.1
-
+++ /dev/null
-From 904b84de86ab00f2be7d59265d3f042ed8c16866 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:31 +0200
-Subject: phy: qcom-qmp-pcie: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit 4be26f695ffa458b065b7942dbff9393bf0836ea ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-3-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 34 ++++++++++++------------
- 1 file changed, 17 insertions(+), 17 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-index 0e0f2482827a..819bcd975ba4 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-@@ -2329,17 +2329,17 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->pcs = devm_of_iomap(dev, np, 2, NULL);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
- /*
- * If this is a dual-lane PHY, then there should be registers for the
-@@ -2348,9 +2348,9 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,
- * offset from the first lane.
- */
- if (cfg->is_dual_lane_phy) {
-- qphy->tx2 = of_iomap(np, 3);
-- qphy->rx2 = of_iomap(np, 4);
-- if (!qphy->tx2 || !qphy->rx2) {
-+ qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
-+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
-+ if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
-
-@@ -2360,20 +2360,20 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 5);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
- }
-
-- if (!qphy->pcs_misc &&
-+ if (IS_ERR(qphy->pcs_misc) &&
- of_device_is_compatible(dev->of_node, "qcom,ipq6018-qmp-pcie-phy"))
- qphy->pcs_misc = qphy->pcs + 0x400;
-
-- if (!qphy->pcs_misc) {
-+ if (IS_ERR(qphy->pcs_misc)) {
- if (cfg->pcs_misc_tbl || cfg->pcs_misc_tbl_sec)
-- return -EINVAL;
-+ return PTR_ERR(qphy->pcs_misc);
- }
-
- snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
---
-2.35.1
-
+++ /dev/null
-From 87a01c97154a568e1fd26c5466d20d876ff53227 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 26 Sep 2022 20:25:14 +0300
-Subject: phy: qcom-qmp-pcie: fix resource mapping for SDM845 QHP PHY
-
-From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
-
-[ Upstream commit 0a40891b83f257b25a2b983758f72f6813f361cb ]
-
-On SDM845 one of PCIe PHYs (the QHP one) has the same region for TX and
-RX registers. Since the commit 4be26f695ffa ("phy: qcom-qmp-pcie: fix
-memleak on probe deferral") added checking that resources are not
-allocated beforehand, this PHY can not be probed anymore. Fix this by
-skipping the map of ->rx resource on the QHP PHY and assign it manually.
-
-Fixes: 4be26f695ffa ("phy: qcom-qmp-pcie: fix memleak on probe deferral")
-Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
-Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220926172514.880776-1-dmitry.baryshkov@linaro.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-index 819bcd975ba4..0baf62d80214 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
-@@ -2333,7 +2333,10 @@ int qcom_qmp_phy_pcie_create(struct device *dev, struct device_node *np, int id,
- if (IS_ERR(qphy->tx))
- return PTR_ERR(qphy->tx);
-
-- qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (of_device_is_compatible(dev->of_node, "qcom,sdm845-qhp-pcie-phy"))
-+ qphy->rx = qphy->tx;
-+ else
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
- if (IS_ERR(qphy->rx))
- return PTR_ERR(qphy->rx);
-
---
-2.35.1
-
+++ /dev/null
-From a06ae0a9467f4f612888a2949003679fe7cc33e8 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:32 +0200
-Subject: phy: qcom-qmp-pcie-msm8996: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit 1f69ededf8e80c42352e7f1c165a003614de9cc2 ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-4-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 23 +++++++++----------
- 1 file changed, 11 insertions(+), 12 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
-index be6a94439b6c..14ea4ae95861 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
-@@ -875,21 +875,20 @@ int qcom_qmp_phy_pcie_msm8996_create(struct device *dev, struct device_node *np,
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
--
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs = devm_of_iomap(dev, np, 2, NULL);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
-- if (!qphy->pcs_misc)
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
-+ if (IS_ERR(qphy->pcs_misc))
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-
- snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
---
-2.35.1
-
+++ /dev/null
-From 16c0bb2a08f3574308e6a40045da6c6bc5170e1b Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:34 +0200
-Subject: phy: qcom-qmp-ufs: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit ef74a97f0df8758efe4476b4645961286aa86f0d ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-6-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 30 ++++++++++++-------------
- 1 file changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
-index c8583f5a54bd..f586e5260856 100644
---- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
-@@ -1188,17 +1188,17 @@ int qcom_qmp_phy_ufs_create(struct device *dev, struct device_node *np, int id,
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->pcs = devm_of_iomap(dev, np, 2, NULL);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
- /*
- * If this is a dual-lane PHY, then there should be registers for the
-@@ -1207,9 +1207,9 @@ int qcom_qmp_phy_ufs_create(struct device *dev, struct device_node *np, int id,
- * offset from the first lane.
- */
- if (cfg->is_dual_lane_phy) {
-- qphy->tx2 = of_iomap(np, 3);
-- qphy->rx2 = of_iomap(np, 4);
-- if (!qphy->tx2 || !qphy->rx2) {
-+ qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
-+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
-+ if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
-
-@@ -1219,14 +1219,14 @@ int qcom_qmp_phy_ufs_create(struct device *dev, struct device_node *np, int id,
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 5);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
- }
-
-- if (!qphy->pcs_misc)
-+ if (IS_ERR(qphy->pcs_misc))
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-
- generic_phy = devm_phy_create(dev, np, &qcom_qmp_ufs_ops);
---
-2.35.1
-
+++ /dev/null
-From e1c35c2f2b63651158f5c4744cf3b5cc3a1a2843 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 16 Sep 2022 12:23:35 +0200
-Subject: phy: qcom-qmp-usb: fix memleak on probe deferral
-
-From: Johan Hovold <johan+linaro@kernel.org>
-
-[ Upstream commit a5d6b1ac56cbd6b5850a3a54e35f1cb71e8e8cdd ]
-
-Switch to using the device-managed of_iomap helper to avoid leaking
-memory on probe deferral and driver unbind.
-
-Note that this helper checks for already reserved regions and may fail
-if there are multiple devices claiming the same memory.
-
-Two bindings currently rely on overlapping mappings for the PCS region
-so fallback to non-exclusive mappings for those for now.
-
-Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
-Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
-Link: https://lore.kernel.org/r/20220916102340.11520-7-johan+linaro@kernel.org
-Signed-off-by: Vinod Koul <vkoul@kernel.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 61 +++++++++++++++++++++++---------
- 1 file changed, 44 insertions(+), 17 deletions(-)
-
---- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
-+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
-@@ -2489,6 +2489,21 @@ static const struct phy_ops qcom_qmp_phy
- .owner = THIS_MODULE,
- };
-
-+static void __iomem *qmp_usb_iomap(struct device *dev, struct device_node *np,
-+ int index, bool exclusive)
-+{
-+ struct resource res;
-+
-+ if (!exclusive) {
-+ if (of_address_to_resource(np, index, &res))
-+ return IOMEM_ERR_PTR(-EINVAL);
-+
-+ return devm_ioremap(dev, res.start, resource_size(&res));
-+ }
-+
-+ return devm_of_iomap(dev, np, index, NULL);
-+}
-+
- static
- int qcom_qmp_phy_usb_create(struct device *dev, struct device_node *np, int id,
- void __iomem *serdes, const struct qmp_phy_cfg *cfg)
-@@ -2497,8 +2512,18 @@ int qcom_qmp_phy_usb_create(struct devic
- struct phy *generic_phy;
- struct qmp_phy *qphy;
- char prop_name[MAX_PROP_NAME];
-+ bool exclusive = true;
- int ret;
-
-+ /*
-+ * FIXME: These bindings should be fixed to not rely on overlapping
-+ * mappings for PCS.
-+ */
-+ if (of_device_is_compatible(dev->of_node, "qcom,sdx65-qmp-usb3-uni-phy"))
-+ exclusive = false;
-+ if (of_device_is_compatible(dev->of_node, "qcom,sm8350-qmp-usb3-uni-phy"))
-+ exclusive = false;
-+
- qphy = devm_kzalloc(dev, sizeof(*qphy), GFP_KERNEL);
- if (!qphy)
- return -ENOMEM;
-@@ -2511,17 +2536,17 @@ int qcom_qmp_phy_usb_create(struct devic
- * For dual lane PHYs: tx2 -> 3, rx2 -> 4, pcs_misc (optional) -> 5
- * For single lane PHYs: pcs_misc (optional) -> 3.
- */
-- qphy->tx = of_iomap(np, 0);
-- if (!qphy->tx)
-- return -ENOMEM;
--
-- qphy->rx = of_iomap(np, 1);
-- if (!qphy->rx)
-- return -ENOMEM;
--
-- qphy->pcs = of_iomap(np, 2);
-- if (!qphy->pcs)
-- return -ENOMEM;
-+ qphy->tx = devm_of_iomap(dev, np, 0, NULL);
-+ if (IS_ERR(qphy->tx))
-+ return PTR_ERR(qphy->tx);
-+
-+ qphy->rx = devm_of_iomap(dev, np, 1, NULL);
-+ if (IS_ERR(qphy->rx))
-+ return PTR_ERR(qphy->rx);
-+
-+ qphy->pcs = qmp_usb_iomap(dev, np, 2, exclusive);
-+ if (IS_ERR(qphy->pcs))
-+ return PTR_ERR(qphy->pcs);
-
- if (cfg->pcs_usb_offset)
- qphy->pcs_usb = qphy->pcs + cfg->pcs_usb_offset;
-@@ -2533,9 +2558,9 @@ int qcom_qmp_phy_usb_create(struct devic
- * offset from the first lane.
- */
- if (cfg->is_dual_lane_phy) {
-- qphy->tx2 = of_iomap(np, 3);
-- qphy->rx2 = of_iomap(np, 4);
-- if (!qphy->tx2 || !qphy->rx2) {
-+ qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
-+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
-+ if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
-
-@@ -2545,15 +2570,17 @@ int qcom_qmp_phy_usb_create(struct devic
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 5);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
-
- } else {
-- qphy->pcs_misc = of_iomap(np, 3);
-+ qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
- }
-
-- if (!qphy->pcs_misc)
-+ if (IS_ERR(qphy->pcs_misc)) {
- dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
-+ qphy->pcs_misc = NULL;
-+ }
-
- snprintf(prop_name, sizeof(prop_name), "pipe%d", id);
- qphy->pipe_clk = devm_get_clk_from_child(dev, np, prop_name);
mtd-devices-docg3-check-the-return-value-of-devm_ior.patch
remoteproc-harden-rproc_handle_vdev-against-integer-.patch
phy-qcom-qmp-usb-disable-runtime-pm-on-unbind.patch
-phy-qcom-qmp-pcie-add-pcs_misc-sanity-check.patch
-phy-qcom-qmp-pcie-fix-memleak-on-probe-deferral.patch
-phy-qcom-qmp-pcie-msm8996-fix-memleak-on-probe-defer.patch
-phy-qcom-qmp-combo-fix-memleak-on-probe-deferral.patch
-phy-qcom-qmp-ufs-fix-memleak-on-probe-deferral.patch
-phy-qcom-qmp-usb-fix-memleak-on-probe-deferral.patch
phy-amlogic-phy-meson-axg-mipi-pcie-analog-hold-refe.patch
phy-phy-mtk-tphy-fix-the-phy-type-setting-issue.patch
mtd-rawnand-intel-read-the-chip-select-line-from-the.patch
clk-mediatek-clk-mt8195-mfg-reparent-mfg_bg3d-and-pr.patch
clk-mediatek-fix-unregister-function-in-mtk_clk_regi.patch
clk-mediatek-migrate-remaining-clk_unregister_-to-cl.patch
-phy-qcom-qmp-pcie-fix-resource-mapping-for-sdm845-qh.patch
io_uring-rw-defer-fsnotify-calls-to-task-context.patch
dmaengine-ioat-stop-mod_timer-from-resurrecting-dele.patch
hid-amd_sfh-handle-condition-of-no-sensors-for-sfh1..patch