Skip to content

Commit 7483aca

Browse files
jhnikulamehmetb0
authored andcommitted
i3c: mipi-i3c-hci: Add Intel specific quirk to ring resuming
BugLink: https://bugs.launchpad.net/bugs/2104873 [ Upstream commit ccdb2e0 ] MIPI I3C HCI on Intel hardware requires a quirk where ring needs to stop and set to run again after resuming the halted controller. This is not expected from the MIPI I3C HCI specification and is Intel specific. Add this quirk to generic aborted transfer handling and execute it only when ring is not in running state after a transfer error and attempted controller resume. This is the case on Intel hardware. It is not fully clear to me what is the ring running state in generic hardware in such case. I would expect if ring is not running, then stop request is a no-op and run request is either required or does the same what controller resume would do. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20241231115904.620052-1-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Noah Wager <noah.wager@canonical.com>
1 parent 93dcd6f commit 7483aca

File tree

1 file changed

+17
-0
lines changed
  • drivers/i3c/master/mipi-i3c-hci

1 file changed

+17
-0
lines changed

drivers/i3c/master/mipi-i3c-hci/dma.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,26 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci, unsigned int mask)
762762
complete(&rh->op_done);
763763

764764
if (status & INTR_TRANSFER_ABORT) {
765+
u32 ring_status;
766+
765767
dev_notice_ratelimited(&hci->master.dev,
766768
"ring %d: Transfer Aborted\n", i);
767769
mipi_i3c_hci_resume(hci);
770+
ring_status = rh_reg_read(RING_STATUS);
771+
if (!(ring_status & RING_STATUS_RUNNING) &&
772+
status & INTR_TRANSFER_COMPLETION &&
773+
status & INTR_TRANSFER_ERR) {
774+
/*
775+
* Ring stop followed by run is an Intel
776+
* specific required quirk after resuming the
777+
* halted controller. Do it only when the ring
778+
* is not in running state after a transfer
779+
* error.
780+
*/
781+
rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE);
782+
rh_reg_write(RING_CONTROL, RING_CTRL_ENABLE |
783+
RING_CTRL_RUN_STOP);
784+
}
768785
}
769786
if (status & INTR_WARN_INS_STOP_MODE)
770787
dev_warn_ratelimited(&hci->master.dev,

0 commit comments

Comments
 (0)