Commit 7c527c1
committed
firewire: core: use reference counting to invoke address handlers safely
The lifetime of address handler has been managed by linked list and RCU.
This approach was introduced in commit 35202f7 ("firewire: remove
global lock around address handlers, convert to RCU"). The invocations of
address handler are performed within RCU read-side critical sections.
In commit 57e6d9f ("firewire: ohci: use workqueue to handle events
of AR request/response contexts"), the invocations are in a workqueue
context. The approach still imposes limitation that sleeping is not
allowed within RCU read-side critical sections. However, since sleeping
is not permitted within RCU read-side critical sections, this approach
still has a limitation.
This commit adds reference counting to decouple handler invocation from
handler discovery. The linked list and RCU is used to discover the
handlers, while the reference counting is used to invoke them safely.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Sakamoto <[email protected]>1 parent 8f5ae30 commit 7c527c1
2 files changed
+34
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
553 | 570 | | |
554 | 571 | | |
555 | 572 | | |
| |||
596 | 613 | | |
597 | 614 | | |
598 | 615 | | |
| 616 | + | |
| 617 | + | |
599 | 618 | | |
600 | 619 | | |
601 | 620 | | |
| |||
621 | 640 | | |
622 | 641 | | |
623 | 642 | | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
624 | 646 | | |
625 | 647 | | |
626 | 648 | | |
| |||
913 | 935 | | |
914 | 936 | | |
915 | 937 | | |
916 | | - | |
| 938 | + | |
| 939 | + | |
917 | 940 | | |
918 | 941 | | |
919 | 942 | | |
| 943 | + | |
| 944 | + | |
920 | 945 | | |
921 | 946 | | |
922 | 947 | | |
| |||
952 | 977 | | |
953 | 978 | | |
954 | 979 | | |
955 | | - | |
| 980 | + | |
| 981 | + | |
956 | 982 | | |
957 | 983 | | |
958 | 984 | | |
| 985 | + | |
| 986 | + | |
959 | 987 | | |
960 | 988 | | |
961 | 989 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| 344 | + | |
| 345 | + | |
344 | 346 | | |
| 347 | + | |
| 348 | + | |
345 | 349 | | |
346 | 350 | | |
347 | 351 | | |
| |||
0 commit comments