soundwire: intel: add error log for clock-stop invalid configs
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 1 Sep 2020 15:05:54 +0000 (23:05 +0800)
committerVinod Koul <vkoul@kernel.org>
Thu, 3 Sep 2020 10:44:39 +0000 (16:14 +0530)
Detect cases where the clock is assumed to be stopped but the IP is
not in the relevant state. There is no real way to recover here, but
adding an error log can help detect bad programming sequences or race
conditions.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200901150556.19432-9-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/intel.c

index 272826973426c891c94eb67987b0f24029154eb9..97c8cfc54ddd3a44eb71e7fa42839f8ffab11f4b 100644 (file)
@@ -1931,6 +1931,11 @@ static int intel_resume_runtime(struct device *dev)
                        }
                }
        } else if (!clock_stop_quirks) {
+
+               clock_stop0 = sdw_cdns_is_clock_stop(&sdw->cdns);
+               if (!clock_stop0)
+                       dev_err(dev, "%s invalid configuration, clock was not stopped", __func__);
+
                ret = intel_init(sdw);
                if (ret) {
                        dev_err(dev, "%s failed: %d", __func__, ret);