Skip to content

Revert "mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K"#363

Merged
igorpecovnik merged 1 commit intoarmbian:rk-6.1-rkr5.1from
nyanmisaka:fix-dwmmc-swiotlb-regression
May 29, 2025
Merged

Revert "mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K"#363
igorpecovnik merged 1 commit intoarmbian:rk-6.1-rkr5.1from
nyanmisaka:fix-dwmmc-swiotlb-regression

Conversation

@nyanmisaka
Copy link
Copy Markdown
Member

Fixes an upstream regression in 6.1.115 that caused SD card controller to emit swiotlb warnings and potential kernel booting and data integrity issues:

[   31.794471] dwmmc_rockchip fe2c0000.mmc: swiotlb buffer is full (sz: 942080 bytes), total 32768 (slots), used 52 (slots)
[   31.794828] dwmmc_rockchip fe2c0000.mmc: swiotlb buffer is full (sz: 942080 bytes), total 32768 (slots), used 54 (slots)
[   31.812276] dwmmc_rockchip fe2c0000.mmc: swiotlb buffer is full (sz: 1048576 bytes), total 32768 (slots), used 2 (slots)
[   31.813356] dwmmc_rockchip fe2c0000.mmc: swiotlb buffer is full (sz: 1048576 bytes), total 32768 (slots), used 0 (slots)
[   31.813460] dwmmc_rockchip fe2c0000.mmc: swiotlb buffer is full (sz: 1048576 bytes), total 32768 (slots), used 0 (slots)
[   31.833476] dwmmc_rockchip fe2c0000.mmc: swiotlb buffer is full (sz: 1048576 bytes), total 32768 (slots), used 0 (slots)
[   34.864803] swiotlb_tbl_map_single: 80 callbacks suppressed

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.1.y&id=8f9416147d7ed414109d3501f1cb3d7a1735b25a

commit 1635e407a4a64d08a8517ac59ca14ad4fc785e75 upstream.

The commit 8396c793ffdf ("mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K") increased the max_req_size, even for 4K pages, causing various issues:
- Panic booting the kernel/rootfs from an SD card on Rockchip RK3566
- Panic booting the kernel/rootfs from an SD card on StarFive JH7100
- "swiotlb buffer is full" and data corruption on StarFive JH7110

At this stage no fix have been found, so it's probably better to just revert the change.

This reverts commit 8396c793ffdf28bb8aee7cfe0891080f8cab7890.

Cc: stable@vger.kernel.org
Cc: Sam Protsenko <semen.protsenko@linaro.org>
Fixes: 8396c793ffdf ("mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K")
Closes: https://lore.kernel.org/linux-mmc/614692b4-1dbe-31b8-a34d-cb6db1909bb7@w6rz.net/
Closes: https://lore.kernel.org/linux-mmc/CAC8uq=Ppnmv98mpa1CrWLawWoPnu5abtU69v-=G-P7ysATQ2Pw@mail.gmail.com/

Message-ID: <20241110114700.622372-1-aurelien@aurel32.net>

commit 1635e40 upstream.

The commit 8396c79 ("mmc: dw_mmc: Fix IDMAC operation with pages
bigger than 4K") increased the max_req_size, even for 4K pages, causing
various issues:
- Panic booting the kernel/rootfs from an SD card on Rockchip RK3566
- Panic booting the kernel/rootfs from an SD card on StarFive JH7100
- "swiotlb buffer is full" and data corruption on StarFive JH7110

At this stage no fix have been found, so it's probably better to just
revert the change.

This reverts commit 8396c79.

Cc: stable@vger.kernel.org
Cc: Sam Protsenko <semen.protsenko@linaro.org>
Fixes: 8396c79 ("mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K")
Closes: https://lore.kernel.org/linux-mmc/614692b4-1dbe-31b8-a34d-cb6db1909bb7@w6rz.net/
Closes: https://lore.kernel.org/linux-mmc/CAC8uq=Ppnmv98mpa1CrWLawWoPnu5abtU69v-=G-P7ysATQ2Pw@mail.gmail.com/
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Message-ID: <20241110114700.622372-1-aurelien@aurel32.net>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@igorpecovnik igorpecovnik merged commit e8cc15e into armbian:rk-6.1-rkr5.1 May 29, 2025
1 check passed
@nyanmisaka nyanmisaka deleted the fix-dwmmc-swiotlb-regression branch May 29, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants