Repository navigation
Conversation
The litex_mmc driver assumes the card is already probed in the BIOS and skip the phy initialization. This will cause the command fail like the following when the old card is unplugged and then insert a new card: [ 62.923593] litex-mmc f0004000.mmc: Command (cmd 8) error, status -110 [ 62.949717] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110 [ 62.976606] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110 [ 63.002516] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110 [ 63.028442] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110 Add required clock settings and initialization for the CMD 0, so it can probe the new card. Fixes: 92e0991 ("mmc: Add driver for LiteX's LiteSDCard interface") Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Author
|
Hi, @gsomlo. Could you take a look at this? |
The current implementation requires a fixed 4-bits bus width, it can not be satisfied by all the litex hardware generation. Remove this restriction so the hardware with 1-bit bus width can be used. Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
inochisa
force-pushed
the
litex/mmc-improvement
branch
from
May 19, 2026 04:42
929adb0 to
e3c3614
Compare
|
On Mon, May 18, 2026 at 09:37:59PM -0700, Inochi Amaoto wrote:
●inochisa left a comment (litex-hub/linux#17)
Hi, @gsomlo. Could you take a look at this?
Patch 1/2 ("mmc: litex_mmc: Set mandatory idle clocks before CMD0")
appears to be a variant of this patch:
https://marc.info/?l=linux-mmc&m=177699738404075&w=2
which has since evolved into a version I tested and reviewed (v3):
https://marc.info/?l=linux-mmc&m=177720510529258&w=2
and, subsequently, as part of an attempt to address Ulf Hansson's
feedback, another version (v4) which unfortunately no longer works
for me:
https://marc.info/?l=linux-mmc&m=177898282478558&w=2
The version included as 1/2 in this PR also does not work for me, and
prints:
[ 6.526198] mmc0: invalid bus width
[ 6.528802] mmc0: error -22 whilst initialising SD card
I'd recommend starting with the v3 you submitted to linux-mmc, and
trying to come up with a way to implement it as part of set_ios that
is functionally identical to v3... I'm happy to keep testing whatever
updated versions you post there... :)
BTW, this tree is dedicated to maintaining currently out-of-tree
drivers for LiteX modules. If something's already in the upstream
kernel, such as the sdcard driver, then your original approach (submit
to litex-mmc and deal with the feedback and reviews there) is the
correct one.
Same goes for your patch 2/2, which should be reworked (and possibly
split into multiple smaller patches) in order to "tell a story" that
can be more easily reviewed. Right now, with both patches applied to
litex-rebase, I get:
[ 6.474630] mmc0: unrecognised SCR structure version 12
[ 6.479042] mmc0: error -22 whilst initialising SD card
Let's continue this conversation on litex-mmc, the original place you
sent your first patch, and the right venue to work out any remaining
problems.
HTH,
--Gabriel
|
Author
|
Great to know, I opened this PR as a fast check to see if the problem should be solved. At last I will go through LKML. It is a good feedback for me to know the problem (Also for patch 2). I will try to figure the real problem is. Thanks. |
|
On Tue, May 19, 2026 at 04:43:26PM -0700, Inochi Amaoto wrote:
●inochisa left a comment (litex-hub/linux#17)
Great to know, I opened this PR as a fast check [...]
Happy to test anything you post here (if you want to iterate before
posting updates to litex-mmc). As long as you're OK with this being
completely informal (i.e., if I tell you "it works great" in this
thread, that's not at all a guarantee that someone else on LKML won't
have unrelated objections, as we've already seen with Ulf :)
Cheers,
--Gabriel
|
Author
|
Yeah, you are right. I will go through LKML for this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow https://lore.kernel.org/linux-mmc/20260517015323.264179-1-inochiama@gmail.com