<feed xmlns='http://www.w3.org/2005/Atom'>
<title>netbsd/sys/dev/dkwedge/dk.c, branch trunk</title>
<subtitle>NetBSD fork for lockdoc analysis</subtitle>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/'/>
<entry>
<title>dk(4): Add locking notes.</title>
<updated>2023-05-22T15:00:17+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-05-22T15:00:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=ef77db56aeaaa6ca77b6e691e502d984064eccb8'/>
<id>ef77db56aeaaa6ca77b6e691e502d984064eccb8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>dk(4): Explain why no need for device reference in dksize, dkdump.</title>
<updated>2023-05-22T15:00:06+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-05-22T15:00:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=0dc7b1cfb4f6023f6d8e780fd237730dee608cbb'/>
<id>0dc7b1cfb4f6023f6d8e780fd237730dee608cbb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>dk(4): Strengthen preconditions of various devsw operations.</title>
<updated>2023-05-22T14:59:58+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-05-22T14:59:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=20eb1f9e34d5409fee20a0d59a0e3fbe961f8c10'/>
<id>20eb1f9e34d5409fee20a0d59a0e3fbe961f8c10</id>
<content type='text'>
These can only happen between dkopen and dkclose, so there's no need
to test -- we can assert instead that the wedge exists and is fully
initialized.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These can only happen between dkopen and dkclose, so there's no need
to test -- we can assert instead that the wedge exists and is fully
initialized.</pre>
</div>
</content>
</entry>
<entry>
<title>dk(4): Strengthen dkclose preconditions.</title>
<updated>2023-05-22T14:59:50+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-05-22T14:59:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=68c1214528f15cfc9c73e9737610e96e9e4429d0'/>
<id>68c1214528f15cfc9c73e9737610e96e9e4429d0</id>
<content type='text'>
Like dkopen, except it is possible for this to be called after the
wedge has transitioned to dying.

XXX sc_state read here races with sc_state write in dkwedge_detach.
Could change this to atomic_load/store.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Like dkopen, except it is possible for this to be called after the
wedge has transitioned to dying.

XXX sc_state read here races with sc_state write in dkwedge_detach.
Could change this to atomic_load/store.</pre>
</div>
</content>
</entry>
<entry>
<title>dk(4): Strengthen dkopen preconditions.</title>
<updated>2023-05-22T14:59:42+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-05-22T14:59:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=870887472d22cb56bb72ad160083dbf65bf5320c'/>
<id>870887472d22cb56bb72ad160083dbf65bf5320c</id>
<content type='text'>
This cannot be called before dkwedge_attach for the same unit
returns, so sc-&gt;sc_dev is guaranteed to be set to a nonnull device_t
and the state is guaranteed not to be larval.

And this cannot be called concurrently with dkwedge_detach, or after
dkwedge_detach does vdevgone until another wedge with the same number
is attached (which can't happen until dkwedge_detach completes), so
the state is guaranteed not to be dying or dead.

Hence sc-&gt;sc_dev != NULL and sc-&gt;sc_state == DKW_STATE_RUNNING.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This cannot be called before dkwedge_attach for the same unit
returns, so sc-&gt;sc_dev is guaranteed to be set to a nonnull device_t
and the state is guaranteed not to be larval.

And this cannot be called concurrently with dkwedge_detach, or after
dkwedge_detach does vdevgone until another wedge with the same number
is attached (which can't happen until dkwedge_detach completes), so
the state is guaranteed not to be dying or dead.

Hence sc-&gt;sc_dev != NULL and sc-&gt;sc_state == DKW_STATE_RUNNING.</pre>
</div>
</content>
</entry>
<entry>
<title>dk(4): Prevent race between dkwedge_get_parent_name and wedge detach.</title>
<updated>2023-05-22T14:59:34+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-05-22T14:59:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=76031411ad161566edd0a91f01ee9860b5283cb2'/>
<id>76031411ad161566edd0a91f01ee9860b5283cb2</id>
<content type='text'>
Still races with parent detach but maybe this is better.

XXX Maybe we should ditch dkwedge_get_parent_name -- it's used only
by rf_containsboot, which kinda suggests it shouldn't exist.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Still races with parent detach but maybe this is better.

XXX Maybe we should ditch dkwedge_get_parent_name -- it's used only
by rf_containsboot, which kinda suggests it shouldn't exist.</pre>
</div>
</content>
</entry>
<entry>
<title>dk(4): Split unsafe lookups into safe subroutines and unsafe wrappers.</title>
<updated>2023-05-22T14:59:25+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-05-22T14:59:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=f02816aceb52e8120f3a33d4328cea33f609dd84'/>
<id>f02816aceb52e8120f3a33d4328cea33f609dd84</id>
<content type='text'>
No functional change intended.

Eventually we should adjust the callers to use the safe subroutines
instead and device_release when done.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No functional change intended.

Eventually we should adjust the callers to use the safe subroutines
instead and device_release when done.</pre>
</div>
</content>
</entry>
<entry>
<title>dk(4): Don't hold lock around uiomove in dkwedge_list.</title>
<updated>2023-05-22T14:59:16+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-05-22T14:59:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=114491a5a056f9a452ed6c1d44346f4a1a643c7b'/>
<id>114491a5a056f9a452ed6c1d44346f4a1a643c7b</id>
<content type='text'>
Instead, hold a device reference.  dkwedge_detach will not run until
the device reference is released.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead, hold a device reference.  dkwedge_detach will not run until
the device reference is released.</pre>
</div>
</content>
</entry>
<entry>
<title>dk(4): Skip larval wedges in various lookup routines.</title>
<updated>2023-05-22T14:59:07+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-05-22T14:59:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=69e8fc6641bfe6d210346aa9282985649e3092e8'/>
<id>69e8fc6641bfe6d210346aa9282985649e3092e8</id>
<content type='text'>
These have not yet finished a concurent dkwedge_attach, so there's
nothing we can safely do with them.  Just pretend they don't exist --
as if we had arrived at the lookup a moment earlier.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These have not yet finished a concurent dkwedge_attach, so there's
nothing we can safely do with them.  Just pretend they don't exist --
as if we had arrived at the lookup a moment earlier.</pre>
</div>
</content>
</entry>
<entry>
<title>dk(4): Simplify dkwedge_delall by detaching directly.</title>
<updated>2023-05-22T14:58:59+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2023-05-22T14:58:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=b2a8eb43988def1ce4f8bd8844fcc91436dbef03'/>
<id>b2a8eb43988def1ce4f8bd8844fcc91436dbef03</id>
<content type='text'>
No need for O(n^2) algorithm and potentially racy lookups -- not that
n is large enough for n^2 to matter, but the mechanism is simpler
this way.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No need for O(n^2) algorithm and potentially racy lookups -- not that
n is large enough for n^2 to matter, but the mechanism is simpler
this way.</pre>
</div>
</content>
</entry>
</feed>
