Skip to content

Commit 170a3ef

Browse files
scosunmenon
authored andcommitted
firmware: ti_sci: Support transfers without response
Check the header flags if an response is expected or not. If it is not expected skip the receive part of ti_sci_do_xfer(). This prepares the driver for one-way messages as prepare_sleep for Partial-IO. Reviewed-by: Kendall Willis <k-willis@ti.com> Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com> Reviewed-by: Dhruva Gole <d-gole@ti.com> Reviewed-by: Sebin Francis <sebin.francis@ti.com> Link: https://patch.msgid.link/20251103-topic-am62-partialio-v6-12-b4-v10-1-0557e858d747@baylibre.com Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent 999e9bc commit 170a3ef

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/firmware/ti_sci.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ static void ti_sci_put_one_xfer(struct ti_sci_xfers_info *minfo,
398398
static inline int ti_sci_do_xfer(struct ti_sci_info *info,
399399
struct ti_sci_xfer *xfer)
400400
{
401+
struct ti_sci_msg_hdr *hdr = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
402+
bool response_expected = !!(hdr->flags & (TI_SCI_FLAG_REQ_ACK_ON_PROCESSED |
403+
TI_SCI_FLAG_REQ_ACK_ON_RECEIVED));
401404
int ret;
402405
int timeout;
403406
struct device *dev = info->dev;
@@ -409,12 +412,12 @@ static inline int ti_sci_do_xfer(struct ti_sci_info *info,
409412

410413
ret = 0;
411414

412-
if (system_state <= SYSTEM_RUNNING) {
415+
if (response_expected && system_state <= SYSTEM_RUNNING) {
413416
/* And we wait for the response. */
414417
timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms);
415418
if (!wait_for_completion_timeout(&xfer->done, timeout))
416419
ret = -ETIMEDOUT;
417-
} else {
420+
} else if (response_expected) {
418421
/*
419422
* If we are !running, we cannot use wait_for_completion_timeout
420423
* during noirq phase, so we must manually poll the completion.

0 commit comments

Comments
 (0)