Skip to content

Commit f014699

Browse files
committed
Merge tag 'soundwire-6.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire
Pull soundwire fixes from Vinod Koul: "Two qcom driver fixes for broadcast completion reinit and check for outanding writes. And a lone Intel driver fix for clock stop timeout" * tag 'soundwire-6.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: qcom: check for outanding writes before doing a read soundwire: qcom: reinit broadcast completion soundwire: intel: Initialize clock stop timeout
2 parents 8395ee6 + 49a4673 commit f014699

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/soundwire/intel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,7 @@ static int intel_link_probe(struct auxiliary_device *auxdev,
15131513

15141514
bus->link_id = auxdev->id;
15151515
bus->dev_num_ida_min = INTEL_DEV_NUM_IDA_MIN;
1516+
bus->clk_stop_timeout = 1;
15161517

15171518
sdw_cdns_probe(cdns);
15181519

drivers/soundwire/qcom.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ static int qcom_swrm_cmd_fifo_wr_cmd(struct qcom_swrm_ctrl *swrm, u8 cmd_data,
344344
if (swrm_wait_for_wr_fifo_avail(swrm))
345345
return SDW_CMD_FAIL_OTHER;
346346

347+
if (cmd_id == SWR_BROADCAST_CMD_ID)
348+
reinit_completion(&swrm->broadcast);
349+
347350
/* Its assumed that write is okay as we do not get any status back */
348351
swrm->reg_write(swrm, SWRM_CMD_FIFO_WR_CMD, val);
349352

@@ -377,6 +380,12 @@ static int qcom_swrm_cmd_fifo_rd_cmd(struct qcom_swrm_ctrl *swrm,
377380

378381
val = swrm_get_packed_reg_val(&swrm->rcmd_id, len, dev_addr, reg_addr);
379382

383+
/*
384+
* Check for outstanding cmd wrt. write fifo depth to avoid
385+
* overflow as read will also increase write fifo cnt.
386+
*/
387+
swrm_wait_for_wr_fifo_avail(swrm);
388+
380389
/* wait for FIFO RD to complete to avoid overflow */
381390
usleep_range(100, 105);
382391
swrm->reg_write(swrm, SWRM_CMD_FIFO_RD_CMD, val);

0 commit comments

Comments
 (0)