Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: qcom-qmp-ufs: drop legacy DT workaround

Commit 5e17b95d9893 ("phy: qcom-qmp: Utilize fully-specified DT
registers") added a workaround for legacy devicetrees which did not
specify register regions for the second lane of some dual-lane PHYs.

At the time, the only two dual-lane PHYs supported by mainline were
"qcom,sdm845-qmp-usb3-phy" and "qcom,sdm845-qmp-ufs-phy" and they had
been added to the binding less than six months before the binding was
fixed.

Presumably no one is using four-year old SDM845 dtbs with mainline
anymore so drop the workaround for malformed devicetrees. In the
unlikely event that anyone complains, we can consider reverting.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220916102340.11520-11-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Johan Hovold and committed by
Vinod Koul
63825558 064bbdba

+6 -21
+6 -21
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
··· 38 38 39 39 #define PHY_INIT_COMPLETE_TIMEOUT 10000 40 40 41 - /* Define the assumed distance between lanes for underspecified device trees. */ 42 - #define QMP_PHY_LEGACY_LANE_STRIDE 0x400 43 - 44 41 struct qmp_phy_init_tbl { 45 42 unsigned int offset; 46 43 unsigned int val; ··· 1134 1137 if (IS_ERR(qphy->pcs)) 1135 1138 return PTR_ERR(qphy->pcs); 1136 1139 1137 - /* 1138 - * If this is a dual-lane PHY, then there should be registers for the 1139 - * second lane. Some old device trees did not specify this, so fall 1140 - * back to old legacy behavior of assuming they can be reached at an 1141 - * offset from the first lane. 1142 - */ 1143 1140 if (cfg->is_dual_lane_phy) { 1144 1141 qphy->tx2 = devm_of_iomap(dev, np, 3, NULL); 1142 + if (IS_ERR(qphy->tx2)) 1143 + return PTR_ERR(qphy->tx2); 1144 + 1145 1145 qphy->rx2 = devm_of_iomap(dev, np, 4, NULL); 1146 - if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) { 1147 - dev_warn(dev, 1148 - "Underspecified device tree, falling back to legacy register regions\n"); 1146 + if (IS_ERR(qphy->rx2)) 1147 + return PTR_ERR(qphy->rx2); 1149 1148 1150 - /* In the old version, pcs_misc is at index 3. */ 1151 - qphy->pcs_misc = qphy->tx2; 1152 - qphy->tx2 = qphy->tx + QMP_PHY_LEGACY_LANE_STRIDE; 1153 - qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE; 1154 - 1155 - } else { 1156 - qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL); 1157 - } 1158 - 1149 + qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL); 1159 1150 } else { 1160 1151 qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL); 1161 1152 }