From: Sasha Levin Date: Mon, 18 Nov 2024 14:35:48 +0000 (-0500) Subject: Fixes for 5.15 X-Git-Tag: v6.12.1~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6283e740ee8ef1ca3879f3532a80f755d01a3951;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.15 Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/mmc-sunxi-mmc-add-d1-mmc-variant.patch b/queue-5.15/mmc-sunxi-mmc-add-d1-mmc-variant.patch new file mode 100644 index 00000000000..bbb287a7e73 --- /dev/null +++ b/queue-5.15/mmc-sunxi-mmc-add-d1-mmc-variant.patch @@ -0,0 +1,53 @@ +From 1996fa35badeff835ec92e45a21fc838ea6a457d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 2 Feb 2022 19:51:11 -0600 +Subject: mmc: sunxi-mmc: Add D1 MMC variant + +From: Samuel Holland + +[ Upstream commit 75a2f412d0aed4a4a80ab2a2d96d040b17acb6d6 ] + +D1's MMC controllers are unique in that they have the DMA address shift +(like A100) with a 13-bit descriptor size field (like sun4i). Add the +compatible and parameters for this new variant. + +Signed-off-by: Samuel Holland +Acked-by: Maxime Ripard +Link: https://lore.kernel.org/r/20220203015112.12008-2-samuel@sholland.org +Signed-off-by: Ulf Hansson +Stable-dep-of: 85b580afc2c2 ("mmc: sunxi-mmc: Fix A100 compatible description") +Signed-off-by: Sasha Levin +--- + drivers/mmc/host/sunxi-mmc.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c +index 3c213816db786..cd81f9a79169e 100644 +--- a/drivers/mmc/host/sunxi-mmc.c ++++ b/drivers/mmc/host/sunxi-mmc.c +@@ -1168,6 +1168,14 @@ static const struct sunxi_mmc_cfg sun9i_a80_cfg = { + .can_calibrate = false, + }; + ++static const struct sunxi_mmc_cfg sun20i_d1_cfg = { ++ .idma_des_size_bits = 13, ++ .idma_des_shift = 2, ++ .can_calibrate = true, ++ .mask_data0 = true, ++ .needs_new_timings = true, ++}; ++ + static const struct sunxi_mmc_cfg sun50i_a64_cfg = { + .idma_des_size_bits = 16, + .clk_delays = NULL, +@@ -1206,6 +1214,7 @@ static const struct of_device_id sunxi_mmc_of_match[] = { + { .compatible = "allwinner,sun7i-a20-mmc", .data = &sun7i_a20_cfg }, + { .compatible = "allwinner,sun8i-a83t-emmc", .data = &sun8i_a83t_emmc_cfg }, + { .compatible = "allwinner,sun9i-a80-mmc", .data = &sun9i_a80_cfg }, ++ { .compatible = "allwinner,sun20i-d1-mmc", .data = &sun20i_d1_cfg }, + { .compatible = "allwinner,sun50i-a64-mmc", .data = &sun50i_a64_cfg }, + { .compatible = "allwinner,sun50i-a64-emmc", .data = &sun50i_a64_emmc_cfg }, + { .compatible = "allwinner,sun50i-a100-mmc", .data = &sun50i_a100_cfg }, +-- +2.43.0 + diff --git a/queue-5.15/mmc-sunxi-mmc-fix-a100-compatible-description.patch b/queue-5.15/mmc-sunxi-mmc-fix-a100-compatible-description.patch new file mode 100644 index 00000000000..cb7d1dd8230 --- /dev/null +++ b/queue-5.15/mmc-sunxi-mmc-fix-a100-compatible-description.patch @@ -0,0 +1,62 @@ +From c019751a094d6726758210d35539894c0f1e4047 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 7 Nov 2024 01:42:40 +0000 +Subject: mmc: sunxi-mmc: Fix A100 compatible description + +From: Andre Przywara + +[ Upstream commit 85b580afc2c215394e08974bf033de9face94955 ] + +It turns out that the Allwinner A100/A133 SoC only supports 8K DMA +blocks (13 bits wide), for both the SD/SDIO and eMMC instances. +And while this alone would make a trivial fix, the H616 falls back to +the A100 compatible string, so we have to now match the H616 compatible +string explicitly against the description advertising 64K DMA blocks. + +As the A100 is now compatible with the D1 description, let the A100 +compatible string point to that block instead, and introduce an explicit +match against the H616 string, pointing to the old description. +Also remove the redundant setting of clk_delays to NULL on the way. + +Fixes: 3536b82e5853 ("mmc: sunxi: add support for A100 mmc controller") +Cc: stable@vger.kernel.org +Signed-off-by: Andre Przywara +Tested-by: Parthiban Nallathambi +Reviewed-by: Chen-Yu Tsai +Message-ID: <20241107014240.24669-1-andre.przywara@arm.com> +Signed-off-by: Ulf Hansson +Signed-off-by: Sasha Levin +--- + drivers/mmc/host/sunxi-mmc.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c +index cd81f9a79169e..1b6e41d55b622 100644 +--- a/drivers/mmc/host/sunxi-mmc.c ++++ b/drivers/mmc/host/sunxi-mmc.c +@@ -1191,10 +1191,9 @@ static const struct sunxi_mmc_cfg sun50i_a64_emmc_cfg = { + .needs_new_timings = true, + }; + +-static const struct sunxi_mmc_cfg sun50i_a100_cfg = { ++static const struct sunxi_mmc_cfg sun50i_h616_cfg = { + .idma_des_size_bits = 16, + .idma_des_shift = 2, +- .clk_delays = NULL, + .can_calibrate = true, + .mask_data0 = true, + .needs_new_timings = true, +@@ -1217,8 +1216,9 @@ static const struct of_device_id sunxi_mmc_of_match[] = { + { .compatible = "allwinner,sun20i-d1-mmc", .data = &sun20i_d1_cfg }, + { .compatible = "allwinner,sun50i-a64-mmc", .data = &sun50i_a64_cfg }, + { .compatible = "allwinner,sun50i-a64-emmc", .data = &sun50i_a64_emmc_cfg }, +- { .compatible = "allwinner,sun50i-a100-mmc", .data = &sun50i_a100_cfg }, ++ { .compatible = "allwinner,sun50i-a100-mmc", .data = &sun20i_d1_cfg }, + { .compatible = "allwinner,sun50i-a100-emmc", .data = &sun50i_a100_emmc_cfg }, ++ { .compatible = "allwinner,sun50i-h616-mmc", .data = &sun50i_h616_cfg }, + { /* sentinel */ } + }; + MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match); +-- +2.43.0 + diff --git a/queue-5.15/series b/queue-5.15/series index a3bea3d8ca0..c8c19808aa0 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -16,3 +16,5 @@ ocfs2-fix-ubsan-warning-in-ocfs2_verify_volume.patch nilfs2-fix-null-ptr-deref-in-block_dirty_buffer-tracepoint.patch revert-mmc-dw_mmc-fix-idmac-operation-with-pages-bigger-than-4k.patch drm-bridge-tc358768-fix-dsi-command-tx.patch +mmc-sunxi-mmc-add-d1-mmc-variant.patch +mmc-sunxi-mmc-fix-a100-compatible-description.patch