summaryrefslogtreecommitdiffstats
path: root/drivers/i3c
diff options
context:
space:
mode:
authorJarkko Nikula <jarkko.nikula@linux.intel.com>2023-09-21 07:57:00 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2023-09-25 23:35:14 +0200
commit7ccd40edc1f5c43e3f1c7d209336d3981943ab63 (patch)
tree50cca4531a95a56aa197efb9f0cdcee6fea63579 /drivers/i3c
parenti3c: mipi-i3c-hci: Fix race between bus cleanup and interrupt (diff)
downloadlinux-7ccd40edc1f5c43e3f1c7d209336d3981943ab63.tar.xz
linux-7ccd40edc1f5c43e3f1c7d209336d3981943ab63.zip
i3c: mipi-i3c-hci: Set number of SW enabled Ring Bundles earlier
Number of software enabled Ring Bundles must be set before using them. Otherwise Ring will not start and may be power-gated by the Host Controller. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20230921055704.1087277-9-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/i3c')
-rw-r--r--drivers/i3c/master/mipi-i3c-hci/dma.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/i3c/master/mipi-i3c-hci/dma.c b/drivers/i3c/master/mipi-i3c-hci/dma.c
index d2dbbcdad1e9..cb41d0026abd 100644
--- a/drivers/i3c/master/mipi-i3c-hci/dma.c
+++ b/drivers/i3c/master/mipi-i3c-hci/dma.c
@@ -229,6 +229,9 @@ static int hci_dma_init(struct i3c_hci *hci)
hci->io_data = rings;
rings->total = nr_rings;
+ regval = FIELD_PREP(MAX_HEADER_COUNT, rings->total);
+ rhs_reg_write(CONTROL, regval);
+
for (i = 0; i < rings->total; i++) {
u32 offset = rhs_reg_read(RHn_OFFSET(i));
@@ -329,8 +332,6 @@ ring_ready:
RING_CTRL_RUN_STOP);
}
- regval = FIELD_PREP(MAX_HEADER_COUNT, rings->total);
- rhs_reg_write(CONTROL, regval);
return 0;
err_out: