Page MenuHomeFreeBSD

dwmmc: refine locking in dwmmc_card_task()
Needs ReviewPublic

Authored by mhorne on Tue, Feb 4, 8:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Feb 11, 3:24 AM
Unknown Object (File)
Mon, Feb 10, 8:19 PM
Unknown Object (File)
Mon, Feb 10, 1:45 PM
Unknown Object (File)
Mon, Feb 10, 12:45 PM
Unknown Object (File)
Mon, Feb 10, 8:45 AM
Unknown Object (File)
Mon, Feb 10, 8:06 AM
Unknown Object (File)
Sat, Feb 8, 3:07 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