Skip to content

Commit

Permalink
i3c: mipi-i3c-hci: Handle I3C address header error in hci_cmd_v1_daa()
Browse files Browse the repository at this point in the history
Handle also I3C address header error response status as the end of DAA
process in hci_cmd_v1_daa().

According to MIPI I3C HCI Specification v1.1 the NACK error during DAA
process comes when the device does not accept the dynamic address.
Currently code uses it for successful exit from the process and fails
with any other error response.

I'm unsure is this MIPI I3C HCI version specific difference or
specification misunderstanding but on an early MIPI I3C HCI version
compatible controller responds always with I3C address header error and
not with NACK error when there is no device on the bus or no more devices
participating to DAA process.

Handle now both response statuses as the end of DAA.

Signed-off-by: Jarkko Nikula <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
  • Loading branch information
jhnikula authored and alexandrebelloni committed Nov 16, 2023
1 parent 0be1a06 commit f83f86e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/i3c/master/mipi-i3c-hci/cmd_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci)
ret = -ETIME;
break;
}
if (RESP_STATUS(xfer->response) == RESP_ERR_NACK &&
if ((RESP_STATUS(xfer->response) == RESP_ERR_ADDR_HEADER ||
RESP_STATUS(xfer->response) == RESP_ERR_NACK) &&
RESP_DATA_LENGTH(xfer->response) == 1) {
ret = 0; /* no more devices to be assigned */
break;
Expand Down

0 comments on commit f83f86e

Please sign in to comment.