HomeFreeBSD

dwmmc: cleanup cmd and locking, consistency between mmc and mmccam

Description

dwmmc: cleanup cmd and locking, consistency between mmc and mmccam

In general sprinkle locking assertions and harmonized KASSERTs
throughout the upper part of the driver to document expectations.

In dwmmc_cmd_done() "cmd" should be set correctly and be used for
both MMCCAM and classic mmc rather than special-casing mmccam.
In dwmmc_next_operation() place variable declarations on the top
for both cases before the first debug and lock assertion calls;
then factor out common parts at the end and put both cases in the
same order.
By calling dwmmc_next_operation() directly from both dwmmc_request()
in the mmc case, and dwmmc_cam_request() in the mmccase (rather than)
chaining calls in the latter, we avoid unlocking the sc in the mmccam
case and have a consistent call path from both; also removing the
mmccam #ifdef from dwmmc_request() brings more clarity.
In dwmmc_next_operation() enhance the panic/error messages with
some extra information and assert that we come in with a cam pinfo
on CAM_ACTIVE_INDEX.

MFC after: 3 days
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D51628

Details

Provenance
bzAuthored on Jul 29 2025, 12:36 PM
Reviewer
manu
Differential Revision
D51628: dwmmc: cleanup cmd and locking, consistency between mmc and mmccam
Parents
rGa96486531b91: LinuxKPI: pci: use unsigned int for vendor/device arguments
Branches
Unknown
Tags
Unknown