Re: [PATCH V2 15/17] i3c: mipi-i3c-hci: Support configurable device NACK retries
From: Frank Li
Date: Fri Sep 18 2026 - 09:57:01 EST
On Thu, Sep 17, 2026 at 10:13:54PM +0300, Adrian Hunter wrote:
...
>
> +static void hci_dat_v1_set_nack_retry(struct i3c_hci *hci, unsigned int dat_idx, unsigned int cnt)
> +{
> + u32 dat_w0;
> +
> + dat_w0 = dat_w0_read(dat_idx);
> + dat_w0 &= ~DAT_0_DEV_NACK_RETRY_CNT;
> + dat_w0 |= FIELD_PREP(DAT_0_DEV_NACK_RETRY_CNT, cnt);
> + dat_w0_write(dat_idx, dat_w0);
> +}
> +
> +static int hci_dat_v1_set_all_nack_retry(struct i3c_hci *hci, unsigned int cnt)
> +{
> + unsigned int dat_idx;
> +
> + if (cnt > FIELD_MAX(DAT_0_DEV_NACK_RETRY_CNT))
> + return -ERANGE;
> +
> + for_each_set_bit(dat_idx, hci->DAT_data, hci->DAT_entries)
> + hci_dat_v1_set_nack_retry(hci, dat_idx, cnt);
> +
> + return 0;
> +}
why need callback hci_dat_v1_set_all_nack_retry(), if it just call
hci_dat_v1_set_nack_retry() in loop.
Frank
> +
> const struct hci_dat_ops mipi_i3c_hci_dat_v1 = {
> .init = hci_dat_v1_init,
> .alloc_entry = hci_dat_v1_alloc_entry,
> @@ -199,4 +222,6 @@ const struct hci_dat_ops mipi_i3c_hci_dat_v1 = {
> .clear_flags = hci_dat_v1_clear_flags,
> .get_index = hci_dat_v1_get_index,
> .restore = hci_dat_v1_restore,
> + .set_nack_retry = hci_dat_v1_set_nack_retry,
> + .set_all_nack_retry = hci_dat_v1_set_all_nack_retry,
> };
> --
> 2.53.0
>