mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
i3c: mipi-i3c-hci: Factor out hci_dma_abort()
Factor out hci_dma_abort() from hci_dma_dequeue_xfer() in preparation for further changes. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260603090754.16252-11-adrian.hunter@intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
29ca24fbd2
commit
5d38555049
|
|
@ -597,6 +597,13 @@ static void hci_dma_xfer_done(struct i3c_hci *hci, struct hci_rh_data *rh)
|
|||
rh_reg_write(RING_OPERATION1, op1_val);
|
||||
}
|
||||
|
||||
static void hci_dma_abort(struct hci_rh_data *rh)
|
||||
{
|
||||
reinit_completion(&rh->op_done);
|
||||
rh_reg_write(RING_CONTROL, rh_reg_read(RING_CONTROL) | RING_CTRL_ABORT);
|
||||
wait_for_completion_timeout(&rh->op_done, HZ);
|
||||
}
|
||||
|
||||
static void hci_dma_unblock_enqueue(struct i3c_hci *hci)
|
||||
{
|
||||
if (hci->enqueue_blocked) {
|
||||
|
|
@ -623,9 +630,7 @@ static bool hci_dma_dequeue_xfer(struct i3c_hci *hci,
|
|||
hci->enqueue_blocked = true;
|
||||
spin_unlock_irq(&hci->lock);
|
||||
/* stop the ring */
|
||||
reinit_completion(&rh->op_done);
|
||||
rh_reg_write(RING_CONTROL, rh_reg_read(RING_CONTROL) | RING_CTRL_ABORT);
|
||||
wait_for_completion_timeout(&rh->op_done, HZ);
|
||||
hci_dma_abort(rh);
|
||||
spin_lock_irq(&hci->lock);
|
||||
ring_status = rh_reg_read(RING_STATUS);
|
||||
if (ring_status & RING_STATUS_RUNNING) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user