From 5aef8fe8dbc33b1a49e9ee015aecef37a576a262 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Thu, 5 Dec 2019 15:57:25 -0600 Subject: [PATCH] soundwire: cadence_master: debug error on Olympic device in clock_stop Somehow the master-2 fails to stop the clock [ 24.007288] intel-sdw sdw-master-2: intel_suspend_runtime start [ 24.007297] intel-sdw sdw-master-2: sdw_cdns_clock_stop: start [ 24.007303] intel-sdw sdw-master-2: sdw_cdns_clock_stop: slave attached 0 [ 24.007498] intel-sdw sdw-master-2: Msg ignored for Slave 15 [ 24.007501] intel-sdw sdw-master-2: ClockStopNow Broadcast message failed -61 [ 24.007505] intel-sdw sdw-master-2: bus clock stop failed -61 [ 24.007508] intel-sdw sdw-master-2: cannot enable clock stop on suspend there are not slaves attached, so the command ignored should be accepted what's not clear is what the CMD_ACCEPT (1) is already the default? Signed-off-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index 971b10a74b7557..c1d7d013511706 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire/cadence_master.c @@ -1222,6 +1222,8 @@ int sdw_cdns_clock_stop(struct sdw_cdns *cdns, bool block_wake) u32 status; int ret; + dev_dbg(cdns->dev, "%s: start\n", __func__); + /* Check suspend status */ status = cdns_readl(cdns, CDNS_MCP_STAT); if (status & CDNS_MCP_STAT_CLK_STOP) { @@ -1247,6 +1249,7 @@ int sdw_cdns_clock_stop(struct sdw_cdns *cdns, bool block_wake) } } + dev_dbg(cdns->dev, "%s: slave attached %d\n", __func__, slave_attached); /* * This CMD_ACCEPT should be used when there are no devices * attached on the link when entering clock stop mode. If this is @@ -1283,6 +1286,8 @@ int sdw_cdns_clock_stop(struct sdw_cdns *cdns, bool block_wake) if (ret < 0) dev_err(cdns->dev, "Clock stop failed %d\n", ret); + dev_dbg(cdns->dev, "%s: end\n", __func__); + return ret; } EXPORT_SYMBOL(sdw_cdns_clock_stop);