Skip to content

Commit a8b961b

Browse files
committed
sm8550-6.18: Fix TF card IO performance regression
- Fix the issue that downstream MSM sdhc driver cannot work on 6.18.14 or newer kernel - Switch back to downstream MSM sdhc driver for Ayn Odin2 devices to fix the IO performance regression brought by upstream driver. Before this fix, average sequential read bandwidth on a UHS-I SDR104 card is 16.8MiB/s. After this fix applied, it is 85.1MiB/s. It fixes commit f785a6d Signed-off-by: Alex Ling <ling_kasim@hotmail.com>
1 parent be0bd46 commit a8b961b

File tree

4 files changed

+300
-8
lines changed

4 files changed

+300
-8
lines changed

config/kernel/linux-sm8550-edge.config

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ CONFIG_KEXEC_FILE=y
5353
CONFIG_ARCH_QCOM=y
5454
# CONFIG_NVIDIA_CARMEL_CNP_ERRATUM is not set
5555
# CONFIG_ROCKCHIP_ERRATUM_3588001 is not set
56+
CONFIG_ARM64_VA_BITS_48=y
5657
CONFIG_NUMA=y
5758
CONFIG_PARAVIRT=y
5859
CONFIG_COMPAT=y
@@ -163,27 +164,24 @@ CONFIG_NFT_FWD_NETDEV=m
163164
CONFIG_NFT_FIB_NETDEV=m
164165
CONFIG_NFT_REJECT_NETDEV=m
165166
CONFIG_NETFILTER_XTABLES_COMPAT=y
167+
CONFIG_NETFILTER_XTABLES_LEGACY=y
166168
CONFIG_NETFILTER_XT_SET=m
167169
CONFIG_NETFILTER_XT_TARGET_AUDIT=m
168170
CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
169171
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
170172
CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
171-
CONFIG_NETFILTER_XT_TARGET_CT=m
172173
CONFIG_NETFILTER_XT_TARGET_DSCP=m
173-
CONFIG_NETFILTER_XT_TARGET_HL=m
174174
CONFIG_NETFILTER_XT_TARGET_HMARK=m
175175
CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m
176176
CONFIG_NETFILTER_XT_TARGET_LED=m
177177
CONFIG_NETFILTER_XT_TARGET_LOG=m
178178
CONFIG_NETFILTER_XT_TARGET_MARK=m
179-
CONFIG_NETFILTER_XT_NAT=m
180-
CONFIG_NETFILTER_XT_TARGET_NETMAP=m
181179
CONFIG_NETFILTER_XT_TARGET_NFLOG=m
182180
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
183-
CONFIG_NETFILTER_XT_TARGET_REDIRECT=m
184-
CONFIG_NETFILTER_XT_TARGET_MASQUERADE=m
181+
CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
185182
CONFIG_NETFILTER_XT_TARGET_TEE=m
186183
CONFIG_NETFILTER_XT_TARGET_TPROXY=m
184+
CONFIG_NETFILTER_XT_TARGET_TRACE=m
187185
CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
188186
CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
189187
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
@@ -248,6 +246,12 @@ CONFIG_NFT_DUP_IPV4=m
248246
CONFIG_NFT_FIB_IPV4=m
249247
CONFIG_NF_TABLES_ARP=y
250248
CONFIG_IP_NF_IPTABLES=m
249+
CONFIG_IP_NF_NAT=m
250+
CONFIG_IP_NF_TARGET_MASQUERADE=m
251+
CONFIG_IP_NF_TARGET_NETMAP=m
252+
CONFIG_IP_NF_TARGET_REDIRECT=m
253+
CONFIG_IP_NF_RAW=m
254+
CONFIG_IP_NF_SECURITY=m
251255
CONFIG_NFT_DUP_IPV6=m
252256
CONFIG_NFT_FIB_IPV6=m
253257
CONFIG_IP6_NF_IPTABLES=m
@@ -261,12 +265,22 @@ CONFIG_IP6_NF_MATCH_MH=m
261265
CONFIG_IP6_NF_MATCH_RPFILTER=m
262266
CONFIG_IP6_NF_MATCH_RT=m
263267
CONFIG_IP6_NF_MATCH_SRH=m
268+
CONFIG_IP6_NF_TARGET_HL=m
264269
CONFIG_IP6_NF_TARGET_REJECT=m
265270
CONFIG_IP6_NF_TARGET_SYNPROXY=m
271+
CONFIG_IP6_NF_RAW=m
272+
CONFIG_IP6_NF_SECURITY=m
273+
CONFIG_IP6_NF_NAT=m
274+
CONFIG_IP6_NF_TARGET_MASQUERADE=m
266275
CONFIG_IP6_NF_TARGET_NPT=m
267276
CONFIG_NF_TABLES_BRIDGE=m
268277
CONFIG_NFT_BRIDGE_META=m
269278
CONFIG_NFT_BRIDGE_REJECT=m
279+
CONFIG_BRIDGE_NF_EBTABLES_LEGACY=m
280+
CONFIG_BRIDGE_NF_EBTABLES=m
281+
CONFIG_BRIDGE_EBT_BROUTE=m
282+
CONFIG_BRIDGE_EBT_T_FILTER=m
283+
CONFIG_BRIDGE_EBT_T_NAT=m
270284
CONFIG_BRIDGE=y
271285
CONFIG_BRIDGE_VLAN_FILTERING=y
272286
CONFIG_VLAN_8021Q=m
@@ -766,6 +780,7 @@ CONFIG_MMC_SDHCI=y
766780
CONFIG_MMC_SDHCI_ACPI=y
767781
CONFIG_MMC_SDHCI_PLTFM=y
768782
CONFIG_MMC_SDHCI_MSM=y
783+
CONFIG_MMC_SDHCI_MSM_DOWNSTREAM=y
769784
CONFIG_MMC_SPI=y
770785
CONFIG_MMC_DW=y
771786
CONFIG_MMC_HSQ=y
@@ -1032,8 +1047,6 @@ CONFIG_CONSOLE_LOGLEVEL_DEFAULT=4
10321047
CONFIG_CONSOLE_LOGLEVEL_QUIET=1
10331048
CONFIG_BOOT_PRINTK_DELAY=y
10341049
CONFIG_DYNAMIC_DEBUG=y
1035-
CONFIG_DEBUG_INFO_DWARF5=y
1036-
CONFIG_DEBUG_INFO_REDUCED=y
10371050
CONFIG_MAGIC_SYSRQ=y
10381051
CONFIG_DEBUG_FS=y
10391052
CONFIG_DEBUG_MEMORY_INIT=y
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From 8ed623bd2f04dc319da87d2ed5bed24cff30818d Mon Sep 17 00:00:00 2001
2+
From: Alex Ling <ling_kasim@hotmail.com>
3+
Date: Fri, 23 Jan 2026 09:29:36 +0800
4+
Subject: [PATCH 1/3] drivers: mmc: Added qcom downstream sdhci driver
5+
6+
---
7+
drivers/mmc/host/sdhci-msm-downstream.c | 2 --
8+
1 file changed, 2 deletions(-)
9+
10+
diff --git a/drivers/mmc/host/sdhci-msm-downstream.c b/drivers/mmc/host/sdhci-msm-downstream.c
11+
index 41fd45fbe100..4cc1b2fde376 100644
12+
--- a/drivers/mmc/host/sdhci-msm-downstream.c
13+
+++ b/drivers/mmc/host/sdhci-msm-downstream.c
14+
@@ -5633,7 +5633,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)
15+
if (!IS_ERR(msm_host->bus_clk))
16+
clk_disable_unprepare(msm_host->bus_clk);
17+
pltfm_free:
18+
- sdhci_pltfm_free(pdev);
19+
return ret;
20+
}
21+
22+
@@ -5696,7 +5695,6 @@ static void sdhci_msm_remove(struct platform_device *pdev)
23+
sdhci_msm_bus_get_and_set_vote(host, 0);
24+
sdhci_msm_bus_unregister(&pdev->dev, msm_host);
25+
}
26+
- sdhci_pltfm_free(pdev);
27+
}
28+
29+
static __maybe_unused int sdhci_msm_runtime_suspend(struct device *dev)
30+
--
31+
2.43.0
32+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 8f40d4ac02f20b672ec66a5f1bbcddd913749a29 Mon Sep 17 00:00:00 2001
2+
From: Alex Ling <ling_kasim@hotmail.com>
3+
Date: Wed, 4 Mar 2026 22:48:48 +0800
4+
Subject: [PATCH 2/3] Revert "clk: qcom: gcc-sm8550: Use floor ops for SDCC
5+
RCGs"
6+
7+
This reverts commit b714c1d0bb437e46b1bb82fea5d0a138bbfe6f98.
8+
---
9+
drivers/clk/qcom/gcc-sm8550.c | 4 ++--
10+
1 file changed, 2 insertions(+), 2 deletions(-)
11+
12+
diff --git a/drivers/clk/qcom/gcc-sm8550.c b/drivers/clk/qcom/gcc-sm8550.c
13+
index 36a5b7de5b55..862a9bf73bcb 100644
14+
--- a/drivers/clk/qcom/gcc-sm8550.c
15+
+++ b/drivers/clk/qcom/gcc-sm8550.c
16+
@@ -1025,7 +1025,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
17+
.parent_data = gcc_parent_data_9,
18+
.num_parents = ARRAY_SIZE(gcc_parent_data_9),
19+
.flags = CLK_SET_RATE_PARENT,
20+
- .ops = &clk_rcg2_shared_floor_ops,
21+
+ .ops = &clk_rcg2_shared_ops,
22+
},
23+
};
24+
25+
@@ -1048,7 +1048,7 @@ static struct clk_rcg2 gcc_sdcc4_apps_clk_src = {
26+
.parent_data = gcc_parent_data_0,
27+
.num_parents = ARRAY_SIZE(gcc_parent_data_0),
28+
.flags = CLK_SET_RATE_PARENT,
29+
- .ops = &clk_rcg2_shared_floor_ops,
30+
+ .ops = &clk_rcg2_shared_ops,
31+
},
32+
};
33+
34+
--
35+
2.43.0
36+
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
From ccfc44521cb9133569b1ace1c51efb80a4aaf925 Mon Sep 17 00:00:00 2001
2+
From: Alex Ling <ling_kasim@hotmail.com>
3+
Date: Mon, 16 Mar 2026 16:02:50 +0800
4+
Subject: [PATCH 3/3] arm64: dts: Switch to downstream sdhc driver for Odin2
5+
6+
Signed-off-by: Alex Ling <ling_kasim@hotmail.com>
7+
---
8+
.../arm64/boot/dts/qcom/qcs8550-ayn-odin2.dts | 86 +++++++++++++++++
9+
.../boot/dts/qcom/qcs8550-ayn-odin2portal.dts | 95 +++++++++++++++++++
10+
2 files changed, 181 insertions(+)
11+
12+
diff --git a/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2.dts b/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2.dts
13+
index 98cf638b24f4..08fbffc250b3 100644
14+
--- a/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2.dts
15+
+++ b/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2.dts
16+
@@ -321,3 +321,89 @@ &spk_amp_r {
17+
firmware-name = "qcom/sm8550/ayn/odin2/aw883xx_acf.bin";
18+
};
19+
20+
+/delete-node/ &sdhc_2;
21+
+
22+
+&soc {
23+
+ sdhc_2: sdhci@8804000 {
24+
+ compatible = "qcom,sdhci-msm-v5-downstream";
25+
+ reg = <0 0x08804000 0 0x1000>;
26+
+ reg-names = "hc_mem";
27+
+ interrupts = <GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH 0>,
28+
+ <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH 0>;
29+
+ interrupt-names = "hc_irq", "pwr_irq";
30+
+ bus-width = <4>;
31+
+ no-sdio;
32+
+ no-mmc;
33+
+ qcom,restore-after-cx-collapse;
34+
+ qcom,uses_level_shifter;
35+
+ qcom,dll_lock_bist_fail_wa;
36+
+ clocks = <&gcc GCC_SDCC2_AHB_CLK>,
37+
+ <&gcc GCC_SDCC2_APPS_CLK>;
38+
+ clock-names = "iface", "core";
39+
+
40+
+ /*
41+
+ * DLL HSR settings. Refer go/hsr - <Target> DLL settings.
42+
+ * Note that the DLL_CONFIG_2 value is not passed from the
43+
+ * device tree, 0 but it is calculated in the driver.
44+
+ */
45+
+ qcom,dll-hsr-list = <0x0007442C 0x0 0x10
46+
+ 0x090106C0 0x80040868>;
47+
+
48+
+ iommus = <&apps_smmu 0x540 0x0>;
49+
+ dma-coherent;
50+
+ interconnects = <&aggre2_noc MASTER_SDCC_2 0 &mc_virt SLAVE_EBI1 0>,
51+
+ <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_SDCC_2 0>;
52+
+ interconnect-names = "sdhc-ddr", "cpu-sdhc";
53+
+
54+
+ qcom,msm-bus,name = "sdhc2";
55+
+ qcom,msm-bus,num-cases = <0x07>;
56+
+ qcom,msm-bus,num-paths = <0x02>;
57+
+ qcom,msm-bus,vectors-KBps = <0x00 0x00 0x00 0x00 0x416 0xc80 0x640 0x640 0xff50 0x3d090 0x186a0 0x208c8 0x1fe9e 0x3d090 0x208c8 0x208c8 0x3fd3e 0x3d090 0x249f0 0x208c8 0x3fd3e 0xc3500 0x493e0 0x493e0 0x146cc2 0x3e8000 0x146cc2 0x3e8000>;
58+
+ qcom,bus-bw-vectors-bps = <0x00 0x61a80 0x17d7840 0x2faf080 0x5f5e100 0xbebc200 0xffffffff>;
59+
+
60+
+ operating-points-v2 = <&sdhc2_opp_table>;
61+
+
62+
+ vdd-supply = <&vreg_l9b_2p9>;
63+
+ qcom,vdd-voltage-level = <0x2d0370 0x2d2a80>;
64+
+ qcom,vdd-current-level = <0x00 0xc3500>;
65+
+
66+
+ vdd-io-supply = <&vreg_l8b_1p8>;
67+
+ qcom,vdd-io-voltage-level = <0x1b7740 0x2d2a80>;
68+
+ qcom,vdd-io-current-level = <0x00 0x15e0>;
69+
+
70+
+ pinctrl-names = "default", "sleep";
71+
+ pinctrl-0 = <&sdc2_default &sdc2_card_det_n>;
72+
+ pinctrl-1 = <&sdc2_sleep &sdc2_card_det_n>;
73+
+
74+
+ cd-gpios = <&pm8550_gpios 12 GPIO_ACTIVE_LOW>;
75+
+ resets = <&gcc GCC_SDCC2_BCR>;
76+
+ reset-names = "core_reset";
77+
+
78+
+ qos0 {
79+
+ mask = <0xf0>;
80+
+ vote = <0x2c>;
81+
+ };
82+
+
83+
+ qos1 {
84+
+ mask = <0x0f>;
85+
+ vote = <0x2c>;
86+
+ };
87+
+
88+
+ sdhc2_opp_table: opp-table {
89+
+ compatible = "operating-points-v2";
90+
+
91+
+ opp-100000000 {
92+
+ opp-hz = <0x00 0x5f5e100>;
93+
+ opp-peak-kBps = <0x27100 0x186a0>;
94+
+ opp-avg-kBps = <0xc350 0x00>;
95+
+ };
96+
+
97+
+ opp-202000000 {
98+
+ opp-hz = <0x00 0xc0a4680>;
99+
+ opp-peak-kBps = <0x30d40 0x1d4c0>;
100+
+ opp-avg-kBps = <0x19640 0x00>;
101+
+ };
102+
+ };
103+
+ };
104+
+};
105+
+
106+
diff --git a/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2portal.dts b/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2portal.dts
107+
index 70e7e64dc879..c0daa80caa31 100644
108+
--- a/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2portal.dts
109+
+++ b/arch/arm64/boot/dts/qcom/qcs8550-ayn-odin2portal.dts
110+
@@ -292,3 +292,98 @@ &spk_amp_r {
111+
firmware-name = "qcom/sm8550/ayn/odin2portal/aw883xx_acf.bin";
112+
};
113+
114+
+/delete-node/ &sdhc2_opp_table;
115+
+/delete-node/ &sdhc_2;
116+
+
117+
+&soc {
118+
+ qcom_tzlog: qcom_tzlog {
119+
+ status = "disabled";
120+
+ };
121+
+
122+
+ arch_timer: arch_timer {
123+
+ status = "disabled";
124+
+ };
125+
+
126+
+ sdhc_2: sdhci@8804000 {
127+
+ compatible = "qcom,sdhci-msm-v5-downstream";
128+
+ reg = <0 0x08804000 0 0x1000>;
129+
+ reg-names = "hc_mem";
130+
+ interrupts = <GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH 0>,
131+
+ <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH 0>;
132+
+ interrupt-names = "hc_irq", "pwr_irq";
133+
+ bus-width = <4>;
134+
+ no-sdio;
135+
+ no-mmc;
136+
+ qcom,restore-after-cx-collapse;
137+
+ qcom,uses_level_shifter;
138+
+ qcom,dll_lock_bist_fail_wa;
139+
+ clocks = <&gcc GCC_SDCC2_AHB_CLK>,
140+
+ <&gcc GCC_SDCC2_APPS_CLK>;
141+
+ clock-names = "iface", "core";
142+
+
143+
+ /*
144+
+ * DLL HSR settings. Refer go/hsr - <Target> DLL settings.
145+
+ * Note that the DLL_CONFIG_2 value is not passed from the
146+
+ * device tree, but it is calculated in the driver.
147+
+ */
148+
+ qcom,dll-hsr-list = <0x0007442C 0x0 0x10
149+
+ 0x090106C0 0x80040868>;
150+
+
151+
+ iommus = <&apps_smmu 0x540 0x0>;
152+
+ dma-coherent;
153+
+ interconnects = <&aggre2_noc MASTER_SDCC_2 0 &mc_virt SLAVE_EBI1 0>,
154+
+ <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_SDCC_2 0>;
155+
+ interconnect-names = "sdhc-ddr", "cpu-sdhc";
156+
+
157+
+ qcom,msm-bus,name = "sdhc2";
158+
+ qcom,msm-bus,num-cases = <0x07>;
159+
+ qcom,msm-bus,num-paths = <0x02>;
160+
+ qcom,msm-bus,vectors-KBps = <0x00 0x00 0x00 0x00 0x416 0xc80 0x640 0x640 0xff50 0x3d090 0x186a0 0x208c8 0x1fe9e 0x3d090 0x208c8 0x208c8 0x3fd3e 0x3d090 0x249f0 0x208c8 0x3fd3e 0xc3500 0x493e0 0x493e0 0x146cc2 0x3e8000 0x146cc2 0x3e8000>;
161+
+ qcom,bus-bw-vectors-bps = <0x00 0x61a80 0x17d7840 0x2faf080 0x5f5e100 0xbebc200 0xffffffff>;
162+
+
163+
+ operating-points-v2 = <&sdhc2_opp_table>;
164+
+
165+
+ vdd-supply = <&vreg_l9b_2p9>;
166+
+ qcom,vdd-voltage-level = <0x2d0370 0x2d2a80>;
167+
+ qcom,vdd-current-level = <0x00 0xc3500>;
168+
+
169+
+ vdd-io-supply = <&vreg_l8b_1p8>;
170+
+ qcom,vdd-io-voltage-level = <0x1b7740 0x2d2a80>;
171+
+ qcom,vdd-io-current-level = <0x00 0x15e0>;
172+
+
173+
+ pinctrl-names = "default", "sleep";
174+
+ pinctrl-0 = <&sdc2_default &sdc2_card_det_n>;
175+
+ pinctrl-1 = <&sdc2_sleep &sdc2_card_det_n>;
176+
+
177+
+ cd-gpios = <&pm8550_gpios 12 GPIO_ACTIVE_LOW>;
178+
+ resets = <&gcc GCC_SDCC2_BCR>;
179+
+ reset-names = "core_reset";
180+
+
181+
+ qos0 {
182+
+ mask = <0xf0>;
183+
+ vote = <0x2c>;
184+
+ };
185+
+
186+
+ qos1 {
187+
+ mask = <0x0f>;
188+
+ vote = <0x2c>;
189+
+ };
190+
+
191+
+ sdhc2_opp_table: opp-table {
192+
+ compatible = "operating-points-v2";
193+
+
194+
+ opp-100000000 {
195+
+ opp-hz = <0x00 0x5f5e100>;
196+
+ opp-peak-kBps = <0x27100 0x186a0>;
197+
+ opp-avg-kBps = <0xc350 0x00>;
198+
+ };
199+
+
200+
+ opp-202000000 {
201+
+ opp-hz = <0x00 0xc0a4680>;
202+
+ opp-peak-kBps = <0x30d40 0x1d4c0>;
203+
+ opp-avg-kBps = <0x19640 0x00>;
204+
+ };
205+
+ };
206+
+ };
207+
+};
208+
+
209+
--
210+
2.43.0
211+

0 commit comments

Comments
 (0)