diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -83,6 +83,7 @@ struct scmi_msg *scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz); void scmi_msg_put(device_t dev, struct scmi_msg *msg); int scmi_request(device_t dev, void *in, void **); +int scmi_request_tx(device_t dev, void *in); void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); DECLARE_CLASS(scmi_driver); diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -717,7 +717,7 @@ } int -scmi_request(device_t dev, void *in, void **out) +scmi_request_tx(device_t dev, void *in) { struct scmi_softc *sc; struct scmi_req *req; @@ -732,8 +732,11 @@ /* Set inflight and send using transport specific method - refc-2 */ error = scmi_req_track_inflight(sc, req); - if (error != 0) + if (error != 0) { + device_printf(dev, "Failed to build req with HDR |%0X|\n", + req->msg.hdr); return (error); + } error = SCMI_XFER_MSG(sc->dev, &req->msg); if (error != 0) { @@ -741,5 +744,22 @@ return (error); } + return (0); +} + +int +scmi_request(device_t dev, void *in, void **out) +{ + struct scmi_softc *sc; + struct scmi_req *req; + int error; + + error = scmi_request_tx(dev, in); + if (error != 0) + return (error); + + sc = device_get_softc(dev); + req = buf_to_req(in); + return (scmi_wait_for_response(sc, req, out)); }