Page MenuHomeFreeBSD

dwmmc: refine locking in dwmmc_card_task()
AbandonedPublic

Authored by mhorne on Feb 4 2025, 8:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 14 2025, 2:39 AM
Unknown Object (File)
Sep 13 2025, 12:29 PM
Unknown Object (File)
Sep 8 2025, 8:39 PM
Unknown Object (File)
Aug 14 2025, 11:25 PM
Unknown Object (File)
Jun 29 2025, 3:41 AM
Unknown Object (File)
Jun 19 2025, 5:23 AM
Unknown Object (File)
Jun 18 2025, 11:51 PM
Unknown Object (File)
Jun 16 2025, 10:59 PM
Subscribers
None

Details

Reviewers
imp
manu
Summary

It is invalid to call device_add_child() while holding the driver's
mutex. This was previously of no consequence, but a recent change
to device array allocation (f3d3c63442ff) switched the logic to use
M_WAITOK. Now, a LOR warning is printed when the card is inserted.

Fix this by reducing the scope of the device lock in the helper function
to:

  1. Reading device state (card & child device presence)
  2. Updating device state (after child added/before removed)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62261
Build 59145: arc lint + arc unit