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)
Wed, Oct 7, 3:53 AM
Unknown Object (File)
Wed, Sep 30, 10:33 AM
Unknown Object (File)
Sat, Sep 26, 11:21 AM
Unknown Object (File)
Sat, Sep 26, 5:44 AM
Unknown Object (File)
Tue, Sep 22, 7:36 PM
Unknown Object (File)
Tue, Sep 22, 6:52 PM
Unknown Object (File)
Sep 10 2026, 2:48 PM
Unknown Object (File)
Sep 9 2026, 3:30 AM
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