<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/firewire, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>firewire: core: replace drain_workqueue() with flush_workqueue()</title>
<updated>2026-10-19T12:25:55+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-10-19T12:25:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=06d410ba93d33a6c78e917d54e821355492e3ce4'/>
<id>06d410ba93d33a6c78e917d54e821355492e3ce4</id>
<content type='text'>
drain_workqueue() allows only chained work to be queued while draining.
This is inconvenient because work can be queued from contexts other than
work items already executing on the workqueue.

Use flush_workqueue() instead to allow work to be queued from any
context.

Link: https://lore.kernel.org/r/20261019122555.328060-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
drain_workqueue() allows only chained work to be queued while draining.
This is inconvenient because work can be queued from contexts other than
work items already executing on the workqueue.

Use flush_workqueue() instead to allow work to be queued from any
context.

Link: https://lore.kernel.org/r/20261019122555.328060-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: core: adjust context_unsafe() usage for lockdep checks</title>
<updated>2026-10-19T12:25:54+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-10-19T12:25:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3e3858e479a8fc0c78afb7da8ff65ed053f8ddce'/>
<id>3e3858e479a8fc0c78afb7da8ff65ed053f8ddce</id>
<content type='text'>
schedule_error_callback() requires a lock to be held by the caller.
However, __fw_send_request() calls the function without holding any lock
when retrieving the transaction label fails, as no lock is needed in
this case. context_safe() is used to suppress the precondition check in
compiler-based context analysis, but it does not affect lockdep checks.
As a result, lockdep reports a violation of the precondition.

Acquire the lock before calling the function instead of using
context_unsafe().

Link: https://lore.kernel.org/r/20261019122555.328060-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
schedule_error_callback() requires a lock to be held by the caller.
However, __fw_send_request() calls the function without holding any lock
when retrieving the transaction label fails, as no lock is needed in
this case. context_safe() is used to suppress the precondition check in
compiler-based context analysis, but it does not affect lockdep checks.
As a result, lockdep reports a violation of the precondition.

Acquire the lock before calling the function instead of using
context_unsafe().

Link: https://lore.kernel.org/r/20261019122555.328060-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: core: invoke packet callback from workqueue when removing card instance</title>
<updated>2026-10-18T13:29:55+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-10-18T13:29:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7d1e256fa1d0d72bcb1185a83e7251331cb6ec21'/>
<id>7d1e256fa1d0d72bcb1185a83e7251331cb6ec21</id>
<content type='text'>
Current implementation switches the underlying driver of a card instance
to the dummy driver in the kernel stack when removing the card. The dummy
driver simply invokes callbacks when sending request and response
packets.

Recent changes for the 1394 OHCI driver and core transaction layer ensure
that callbacks are invoked in process context from a workqueue. This
guarantees a consistent execution context for callbacks. However, card
removel is currently an exception.

Invoke packet callbacks from a workqueue during card removal.

Link: https://lore.kernel.org/r/20261018132955.391090-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current implementation switches the underlying driver of a card instance
to the dummy driver in the kernel stack when removing the card. The dummy
driver simply invokes callbacks when sending request and response
packets.

Recent changes for the 1394 OHCI driver and core transaction layer ensure
that callbacks are invoked in process context from a workqueue. This
guarantees a consistent execution context for callbacks. However, card
removel is currently an exception.

Invoke packet callbacks from a workqueue during card removal.

Link: https://lore.kernel.org/r/20261018132955.391090-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: core: use designated initializer for dummy driver on card removal</title>
<updated>2026-10-18T13:29:54+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-10-18T13:29:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2b6748c5c673f1ce9c57c577dbe995952f29c2c9'/>
<id>2b6748c5c673f1ce9c57c577dbe995952f29c2c9</id>
<content type='text'>
The dummy driver used during card removal contains mutable variables.
Use a designated initializer instead of a static constant assignment.

Link: https://lore.kernel.org/r/20261018132955.391090-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The dummy driver used during card removal contains mutable variables.
Use a designated initializer instead of a static constant assignment.

Link: https://lore.kernel.org/r/20261018132955.391090-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: core: use context analysis to check lock state when scheduling error callbacks</title>
<updated>2026-10-18T06:30:56+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-10-18T06:30:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d7a7c63437d3c5db282ebff08f5258e906ae9920'/>
<id>d7a7c63437d3c5db282ebff08f5258e906ae9920</id>
<content type='text'>
The precondition for schedule_error_callback() involves accessing the
pending transaction list. This access should be protected by the
transaction lock.

Use compiler-based context analysis to verify that the lock is held when
accessing the list.

Link: https://lore.kernel.org/r/20261018063056.329226-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The precondition for schedule_error_callback() involves accessing the
pending transaction list. This access should be protected by the
transaction lock.

Use compiler-based context analysis to verify that the lock is held when
accessing the list.

Link: https://lore.kernel.org/r/20261018063056.329226-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: core: check precondition when scheduling error callbacks</title>
<updated>2026-10-18T06:30:55+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-10-18T06:30:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=31ab33a6e3721902f3dbfbf1fd3116ef4d683810'/>
<id>31ab33a6e3721902f3dbfbf1fd3116ef4d683810</id>
<content type='text'>
Current implementation requires that the transaction not be on the
pending list before its error callback is scheduled. A WARN_ON() in the
callback function detects violations of this precondition, but the check
belongs in the scheduling helper.

Move the WARN_ON() to schedule_error_callback().

Link: https://lore.kernel.org/r/20261018063056.329226-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current implementation requires that the transaction not be on the
pending list before its error callback is scheduled. A WARN_ON() in the
callback function detects violations of this precondition, but the check
belongs in the scheduling helper.

Move the WARN_ON() to schedule_error_callback().

Link: https://lore.kernel.org/r/20261018063056.329226-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: core: use workqueue to cancel all pending transactions on card removal</title>
<updated>2026-10-18T06:30:54+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-10-18T06:30:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=767e87bb6f0f721e0b97640780ff3ab1d413b329'/>
<id>767e87bb6f0f721e0b97640780ff3ab1d413b329</id>
<content type='text'>
When a card is being removed, all pending transactions are canceled by
calling fw_cancel_pending_transactions(). This function moves the entries
for unfinished transactions to a local list so that their callbacks can
be invoked without holding the transaction lock. However, this complicates
the management of pending transactions.

Use workqueue to invoke error callbacks for all pending transactions.

Link: https://lore.kernel.org/r/20261018063056.329226-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a card is being removed, all pending transactions are canceled by
calling fw_cancel_pending_transactions(). This function moves the entries
for unfinished transactions to a local list so that their callbacks can
be invoked without holding the transaction lock. However, this complicates
the management of pending transactions.

Use workqueue to invoke error callbacks for all pending transactions.

Link: https://lore.kernel.org/r/20261018063056.329226-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: core: reuse helper function for scheduling error callbacks</title>
<updated>2026-10-17T15:33:39+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-10-17T15:33:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3e7ed554a85a21a1d4a9bff520f9f2f8b59c7f79'/>
<id>3e7ed554a85a21a1d4a9bff520f9f2f8b59c7f79</id>
<content type='text'>
The transaction layer has some code that can be replaced with the
existing helper function for scheduling error callbacks.

Link: https://lore.kernel.org/r/20261017153339.267337-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The transaction layer has some code that can be replaced with the
existing helper function for scheduling error callbacks.

Link: https://lore.kernel.org/r/20261017153339.267337-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: core: don't disable error work for transaction</title>
<updated>2026-10-17T15:33:38+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-10-17T15:33:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e7f6c18a8c1e991d52cd49804f1f55902d54e7ba'/>
<id>e7f6c18a8c1e991d52cd49804f1f55902d54e7ba</id>
<content type='text'>
The error callback work is scheduled only when the transaction instance
is no longer on the pending list. Therefore, iterating over the list to
cancel the work is pointless.

Remove the code that cancels the work while iterating over the pending
list. Once scheduled, the work can run and invoke the error callback
without being cancelled.

Link: https://lore.kernel.org/r/20261017153339.267337-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The error callback work is scheduled only when the transaction instance
is no longer on the pending list. Therefore, iterating over the list to
cancel the work is pointless.

Remove the code that cancels the work while iterating over the pending
list. Once scheduled, the work can run and invoke the error callback
without being cancelled.

Link: https://lore.kernel.org/r/20261017153339.267337-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>firewire: core: use release/acquire pair when replacing underlying driver on card removal</title>
<updated>2026-10-17T08:17:20+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2026-10-17T08:17:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=23b790766adfb140abc09c83fbe625e2c7f35a36'/>
<id>23b790766adfb140abc09c83fbe625e2c7f35a36</id>
<content type='text'>
When removing a card instance, the underlying driver is replaced to handle
closing operations. Without proper memory reordering, other CPUs may
observe the driver before it is fully initialized.

Use a release/acquire pair to ensure that the driver's initialization is
visible before the driver is accessed for close operations.

Link: https://lore.kernel.org/r/20261017081720.186688-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When removing a card instance, the underlying driver is replaced to handle
closing operations. Without proper memory reordering, other CPUs may
observe the driver before it is fully initialized.

Use a release/acquire pair to ensure that the driver's initialization is
visible before the driver is accessed for close operations.

Link: https://lore.kernel.org/r/20261017081720.186688-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</pre>
</div>
</content>
</entry>
</feed>
