Skip to content

Commit

Permalink
soundwire: cadence: only prepare attached devices on clock stop
Browse files Browse the repository at this point in the history
We sometimes see COMMAND_IGNORED responses during the clock stop
sequence. It turns out we already have information if devices are
present on a link, so we should only prepare those when they
are attached.

In addition, even when COMMAND_IGNORED are received, we should still
proceed with the clock stop. The device will not be prepared but
that's not a problem.

The only case where the clock stop will fail is if the Cadence IP
reports an error (including a timeout), or if the devices throw a
COMMAND_FAILED response.

BugLink: thesofproject#2621
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210323013707.21455-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
plbossart authored and vinodkoul committed Mar 30, 2021
1 parent 8f29bb8 commit 58ef935
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/soundwire/cadence_master.c
Expand Up @@ -1450,10 +1450,12 @@ int sdw_cdns_clock_stop(struct sdw_cdns *cdns, bool block_wake)
}

/* Prepare slaves for clock stop */
ret = sdw_bus_prep_clk_stop(&cdns->bus);
if (ret < 0) {
dev_err(cdns->dev, "prepare clock stop failed %d", ret);
return ret;
if (slave_present) {
ret = sdw_bus_prep_clk_stop(&cdns->bus);
if (ret < 0 && ret != -ENODATA) {
dev_err(cdns->dev, "prepare clock stop failed %d\n", ret);
return ret;
}
}

/*
Expand Down

0 comments on commit 58ef935

Please sign in to comment.