Re: [driver-core PATCH v8 2/9] driver core: Establish order of operations for device_add and device_del via bitflag

From
Dan Williams <hidden>
Date
2018-12-10 21:24:02
Also in
lkml, nvdimm
Reply to
Dan Williams, 2018-12-10
On Mon, Dec 10, 2018 at 1:15 PM Dan Williams [off-list ref] wrote:
On Mon, Dec 10, 2018 at 12:58 PM Alexander Duyck
[off-list ref] wrote:
[..]
quoted
Also the context for the two functions seems to be a bit different. In
the case of __device_attach_driver the device_lock is already held. In
__driver_attach the lock on the device isn't taken until after a match
has been found.
Yes, I was only pattern matching when looking at the context of where
dev->dead is checked in __driver_attach() and wondering why it was
checked outside of __device_attach_driver()
...and now I realize the bigger point of your concern, we need to
check dev->dead after acquiring the device_lock otherwise the race is
back. We can defer that consolidation, but the larger concern of
making it internal to __device_attach_driver() still stands.
Thread (21 messages) 21 messages, 3 authors, last reply 2018-12-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help