Messages in this thread | | | Date | Wed, 18 May 2022 11:39:27 +0200 | Subject | Re: [PATCH net v2] NFC: hci: fix sleep in atomic context bugs in nfc_hci_hcp_message_tx | From | Krzysztof Kozlowski <> |
| |
On 18/05/2022 06:39, duoming@zju.edu.cn wrote: >> There is. >> >> nfc_hci_failure -> spin lock -> nfc_driver_failure -> nfc_targets_found >> -> device_lock >> >> I found it just by a very quick look, so I suspect there are several >> other places, not really checked. > > I agree with you, the spin_lock is not a good solution to this problem. There is another solution: > > We could put the nfc_hci_send_event() of st21nfca_se_wt_timeout() in a work item, then, using > schedule_work() in st21nfca_se_wt_timeout() to execute the work item. The schedule_work() will > wake up another kernel thread which is in process context to execute the bottom half of the interrupt, > so it allows sleep. > > The following is the details.
Yes, this seems good solution. You might also need to add cancel_work_sync to all places removing the timer.
Best regards, Krzysztof
| |