Commit 23e1d75b authored by Andre Przywara's avatar Andre Przywara Committed by Wen Zhiwei
Browse files

mmc: sunxi-mmc: Fix A100 compatible description

stable inclusion
from stable-v6.6.63
commit 930f99a21e7f13a8c72e850fb478ad69e2566ecd
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBI1RP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=930f99a21e7f13a8c72e850fb478ad69e2566ecd



--------------------------------

commit 85b580afc2c215394e08974bf033de9face94955 upstream.

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: 3536b82e ("mmc: sunxi: add support for A100 mmc controller")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
Tested-by: default avatarParthiban Nallathambi <parthiban@linumiz.com>
Reviewed-by: default avatarChen-Yu Tsai <wens@csie.org>
Message-ID: <20241107014240.24669-1-andre.przywara@arm.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent 46a6b987
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);