-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
bcm2835-sdhost: Only claim one DMA channel #1329
Conversation
looks good |
Any comments, @HiassofT ? |
Same exercise also for sdhci? |
Looks good to me as well, thanks a lot! Ultra-minor nitpicking: you have a typo in the referenced issue (132 instead of 1327) |
OK - I meant bcm2835-mmc.c not sdhci (which is this one)... |
Thanks - the cut and paste was a character short - I'll fix before pushing. |
With both MMC controllers enabled there are few DMA channels left. The bcm2835-sdhost driver only uses DMA in one direction at a time, so it doesn't need to claim two channels. See: raspberrypi#1327 Signed-off-by: Phil Elwell <[email protected]>
I think these commits are good to go, but I'd appreciate a second opinion or some testing. |
I've been using a rpi-4.4.y build plus this patch for the last 12 hours on 4x Pi3B, 1x Pi2B and a Zero. |
sdcard still working for me after applying this patch |
Cool. I've added an equivalent patch for bcm2835-mmc. |
I did some tests on my RPi2 with a Samsung EVO 32GB and everything works as expected. Only a very minor cosmetic issue in bcm2835-mmc.c, "channels" instead of "channel" (same for the error cause, "Unable to initialise DMA channels").
I tested the performance with sdhost without PR:
sdhost with PR:
mmc without PR:
mmc with PR:
|
With both MMC controllers enabled there are few DMA channels left. The bcm2835-mmc driver only uses DMA in one direction at a time, so it doesn't need to claim two channels. See: raspberrypi#1327 Signed-off-by: Phil Elwell <[email protected]>
Thanks, everyone. |
bcm2835-sdhost: Only claim one DMA channel
thanks to all... |
Just so you guys know, call it feedback.... My 4.4.y builds are running on 15x Pi's locally (B, B+, Zero, CM, 2B and 3B) and out in the wild, by approx. 30 users. All have an I2S DAC (of some description) attached. So from a dma point of view, sdcard and cyclic for I2S have been well tested. Won't have seen much (any) testing for SPI dma..... Although I think one guy has an ethernet port attached to a CM via SPI. @msperl Your 15x patch upstream backport dma series has been patched into my rpi-4.4.y builds since Jan 06.... This code is now well tested, especially cyclic dma. @HiassofT I added the 3x patches yesterday to enable extra channels. And obviously, @pelwell, latest to use single dma channel for sdhost and mmc drivers is now in 4.4.y, so now included in my builds without patching. |
Both have I2S DAC attached.... [PI3B dma]$ for f in dma0chan*; do echo -n "$f: in_use: " && cat $f/in_use; done; [ZERO dma]$ for f in dma0chan*; do echo -n "$f: in_use: " && cat $f/in_use; done; |
Looks good. BTW, a little trick I learnt from @popcornmix:
|
or simpler still: @clivem: the lates upstream patches are slightly different - Eric wanted the LITE channel handling in a separate patch, Vinod wanted some values configurable in dt and some more things (like peeking into the dma channel registers via debugfs) |
LOL. Thanks guys. If there is a long-winded way of doing anything, you can bet your last dollar, I'll be doing it that way....
@msperl Thanks for the info. I did notice a flurry of stuff from you to lk-arm ML in the last couple of weeks, but haven't looked too closely. My company has settled on using UDOO Neo for a SBC based commercial product, so my "work" attention is now on all things IMX related rather than Pi. |
With both MMC controllers enabled there are few DMA channels left. The
bcm2835-sdhost driver only uses DMA in one direction at a time, so it
doesn't need to claim two channels.
See: #132