Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overclock support to the upstream SDHOST driver #6610

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

pelwell
Copy link
Contributor

@pelwell pelwell commented Jan 13, 2025

This is the follow-up to #6603, which has arrived a bit sooner than advertised. It should probably be kept away from any stable kernel releases for a while. Unless an overclock is specified it is just the standard upstream driver, but that has probably had much less testing than the current downstream version.

@popcornmix
Copy link
Collaborator

It should probably be kept away from any stable kernel releases for a while

Can we merge it to 6.12 first? Can be merged to 6.6 once the next apt kernel is out.

@pelwell pelwell changed the base branch from rpi-6.6.y to rpi-6.12.y January 13, 2025 16:31
Now that the upstream driver is overclockable, switch to using it in
preference of the downstream driver (which can be deleted by a followup
commit).

Signed-off-by: Phil Elwell <[email protected]>
The principal differences between the downstream SDHOST driver and the
version accepted upstream driver are that the upstream version loses the
overclock support and DMA configuration via DT, but gains some tidying
up (and maintenance by the upstream devs).

Add the missing features (with the exception of the low-overhead logging)
as a patch to the upstream driver.

Signed-off-by: Phil Elwell <[email protected]>
@pelwell
Copy link
Contributor Author

pelwell commented Jan 13, 2025

Yes, that can work. I've updated the PR, then swapped the commit order to persuade GitHub to rerun the checks - it can be swapped back if preferred.

@pelwell
Copy link
Contributor Author

pelwell commented Jan 13, 2025

Rebuilt against 6.12 and updated a 3B+ running a slightly dodgy SD card overclocked to 100MHz, which had then stepped the clock down to 66MHz until the errors stopped. The 3B+ survived the reboot, so it can't be too bad:

$ uname -a
Linux raspberrypi 6.12.9-v8+ #147 SMP PREEMPT Mon Jan 13 16:36:46 GMT 2025 aarch64 GNU/Linux
$ dmesg | grep -E "(mmc0|3f202000)"
[    3.497626] sdhost-bcm2835 3f202000.mmc: loaded - DMA enabled (>1)
[    3.636149] mmc0: host does not support reading read-only switch, assuming write-enable
[    3.648016] mmc0: overclocking to 100000000Hz
[    3.653547] mmc0: new high speed SDXC card at address d555
[    3.660726] mmcblk0: mmc0:d555 WP256 236 GiB
[    3.673280] mmcblk0: mmc0:d555 WP256 236 GiB (quirks 0x00004000)
[   17.885626] sdhost-bcm2835 3f202000.mmc: timeout waiting for hardware interrupt.
[   17.941648] sdhost-bcm2835 3f202000.mmc: reducing overclock due to errors
[   17.950836] mmc0: overclocking to 83333333Hz
[   28.893619] sdhost-bcm2835 3f202000.mmc: timeout waiting for hardware interrupt.
[   28.945637] sdhost-bcm2835 3f202000.mmc: reducing overclock due to errors
[   28.953828] mmc0: overclocking to 80000000Hz
[   39.645621] sdhost-bcm2835 3f202000.mmc: timeout waiting for hardware interrupt.
[   39.697634] sdhost-bcm2835 3f202000.mmc: reducing overclock due to errors
[   39.705823] mmc0: overclocking to 66666666Hz

@pelwell pelwell merged commit c2ec0c0 into raspberrypi:rpi-6.12.y Jan 14, 2025
12 checks passed
@pelwell
Copy link
Contributor Author

pelwell commented Jan 14, 2025

YOLO!

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.

2 participants