Page MenuHomeFreeBSD

mmccam: fix mmcsd disk aliases
AcceptedPublic

Authored by bz on Jan 21 2024, 8:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 21, 6:18 PM
Unknown Object (File)
Fri, Jun 21, 12:57 PM
Unknown Object (File)
Apr 21 2024, 11:25 PM
Unknown Object (File)
Mar 4 2024, 4:42 AM
Unknown Object (File)
Jan 28 2024, 4:54 PM
Unknown Object (File)
Jan 25 2024, 3:18 PM
Unknown Object (File)
Jan 22 2024, 12:45 AM
Subscribers

Details

Reviewers
imp
manu
Group Reviewers
cam
Summary

For EXT_CSD_PART_CONFIG_ACC_BOOT<n> and possibly others with suffixes
we fail to create proper disk aliases (symlinks), which shows up as
g_dev_taste: make_dev_alias_p() failed (name=mmcsd0, error=17)

In this case we ended up with the followng two:

/dev/mmcsd0 -> sdda0
/dev/mmcsd1 -> sdda0boot1

Note that (i) it should be mmcsd0boot1 and not mmcsd1 and that
(ii) there is no mmcsd0boot0 (failed above as it tried to create a
second mmcsd0).

While in theory we do not need to handle all cases for the compat
scheme add the code for all of them.

This gives us:

/dev/mmcsd0 -> sdda0
/dev/mmcsd0boot0 -> sdda0boot0
/dev/mmcsd0boot1 -> sdda0boot1

MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 55527
Build 52416: arc lint + arc unit

Event Timeline

bz requested review of this revision.Jan 21 2024, 8:01 PM
This revision is now accepted and ready to land.Jan 22 2024, 1:20 PM
sys/cam/mmc/mmc_da.c
1596

I'd jusr kill this. We are three major releases past this, no?

1622

Panic?

imp added inline comments.
sys/cam/mmc/mmc_da.c
1596

Oh, wait, sorry, ignore this comment. It's wrong....

1625

While this is fine, since it's unlikely that we'll have new part config types, it does repeat the code from the nonCAM MMC stack.

Though if we defined SDDA_FMT as %s%dfoo instead of sdda%dfoo, we could just do a second snprintf and not need the case statement with panic in it, with an adjustment to the first snprintf of course.