回覆: [PATCH 4/8] i3c: mipi-i3c-hci: Add a quirk to clear the TX start threshold

From
Billy Tsai <billy_tsai@aspeedtech.com>
Date
2026-09-09 05:37:55
Also in
linux-arm-kernel, linux-aspeed, linux-i3c, lkml
Reply to
Frank Li, 2026-09-01
quoted
+     if (dma && (hci->quirks & HCI_QUIRK_TX_START_THLD) && hci->PIO_regs) {
+             void __iomem *thld_reg = hci->PIO_regs + PIO_DATA_BUFFER_THLD_CTRL;
+             u32 thld_val = readl(thld_reg);
+
+             thld_val &= ~DATA_TX_START_THLD;
+             writel(thld_val, thld_reg);
don't move these defination, original isolate is quite good. Add API or
callback to implement clean DATA_TX_START_THLD.
Okay.

Will revert the pio.h split and keep the PIO Access Area
register/bitfield definitions private to pio.c as before. Instead,
add a small accessor there:

    void mipi_i3c_hci_pio_clr_tx_start_thld(struct i3c_hci *hci)
    {
            u32 val = pio_reg_read(DATA_BUFFER_THLD_CTRL);

            pio_reg_write(DATA_BUFFER_THLD_CTRL, val & ~DATA_TX_START_THLD);
    }

declared in hci.h next to the other pio.c-implemented cross-file
functions (mipi_i3c_hci_pio_reset(), mipi_i3c_hci_pio_reset_all_queues()).
i3c_hci_set_io_mode() then just calls it:

    if (dma && (hci->quirks & HCI_QUIRK_TX_START_THLD) && hci->PIO_regs)
            mipi_i3c_hci_pio_clr_tx_start_thld(hci);

core.c no longer needs to know the PIO register layout at all.

Billy
Thread (30 messages) 30 messages, 6 authors, last reply 12d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help