ASoC: codecs: show PING status on resume failures
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 14 Jul 2022 01:10:43 +0000 (09:10 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 17 Aug 2022 12:00:55 +0000 (13:00 +0100)
This helper should help identify cases where devices fall off the bus
and don't resync.

BugLink: https://github.com/thesofproject/linux/issues/3638
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20220714011043.46059-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/max98373-sdw.c
sound/soc/codecs/rt1308-sdw.c
sound/soc/codecs/rt1316-sdw.c
sound/soc/codecs/rt5682-sdw.c
sound/soc/codecs/rt700-sdw.c
sound/soc/codecs/rt711-sdca-sdw.c
sound/soc/codecs/rt715-sdca-sdw.c
sound/soc/codecs/rt715-sdw.c

index 97b64477dde671632e28d9b2c12984ff8c6db08e..899965b19d12da10ae5e9d725500b57501d96b91 100644 (file)
@@ -281,6 +281,8 @@ static __maybe_unused int max98373_resume(struct device *dev)
                                           msecs_to_jiffies(MAX98373_PROBE_TIMEOUT));
        if (!time) {
                dev_err(dev, "Initialization not complete, timed out\n");
+               sdw_show_ping_status(slave->bus, true);
+
                return -ETIMEDOUT;
        }
 
index 0be6e72ff5a9a97880e2c2adab2aa286298406fb..5c29416aa781c457cd7f539df9cf0dde57440080 100644 (file)
@@ -749,6 +749,8 @@ static int __maybe_unused rt1308_dev_resume(struct device *dev)
                                msecs_to_jiffies(RT1308_PROBE_TIMEOUT));
        if (!time) {
                dev_err(&slave->dev, "Initialization not complete, timed out\n");
+               sdw_show_ping_status(slave->bus, true);
+
                return -ETIMEDOUT;
        }
 
index e53396606a1c6f8af317dbf2904427137027f9ff..ed0a114363621026cafdf1e4f9841ff89507a4e2 100644 (file)
@@ -734,6 +734,8 @@ static int __maybe_unused rt1316_dev_resume(struct device *dev)
                                msecs_to_jiffies(RT1316_PROBE_TIMEOUT));
        if (!time) {
                dev_err(&slave->dev, "Initialization not complete, timed out\n");
+               sdw_show_ping_status(slave->bus, true);
+
                return -ETIMEDOUT;
        }
 
index f04e18c32489ddef2b9f1fc32f49bc56e869688a..c1a94229dc7e3c06784cf9c9cb2e9e4042eb285d 100644 (file)
@@ -793,6 +793,8 @@ static int __maybe_unused rt5682_dev_resume(struct device *dev)
                                msecs_to_jiffies(RT5682_PROBE_TIMEOUT));
        if (!time) {
                dev_err(&slave->dev, "Initialization not complete, timed out\n");
+               sdw_show_ping_status(slave->bus, true);
+
                return -ETIMEDOUT;
        }
 
index f7439e40ca8b543dff73f464c2a326b4707dd127..96fc5f36d0d05aaf65638c1349958ffb42e99bf1 100644 (file)
@@ -542,6 +542,8 @@ static int __maybe_unused rt700_dev_resume(struct device *dev)
                                msecs_to_jiffies(RT700_PROBE_TIMEOUT));
        if (!time) {
                dev_err(&slave->dev, "Initialization not complete, timed out\n");
+               sdw_show_ping_status(slave->bus, true);
+
                return -ETIMEDOUT;
        }
 
index a085b2f530aa1d268135f3f259ef3b4a72c0c7b8..4120842fe699022440b6f39b57ce8b7ebab5482a 100644 (file)
@@ -449,6 +449,8 @@ static int __maybe_unused rt711_sdca_dev_resume(struct device *dev)
                                msecs_to_jiffies(RT711_PROBE_TIMEOUT));
        if (!time) {
                dev_err(&slave->dev, "Initialization not complete, timed out\n");
+               sdw_show_ping_status(slave->bus, true);
+
                return -ETIMEDOUT;
        }
 
index 13e731d166753ac117f59249a88388b297468df3..3f981a9e7fb67b54caee8290ef4d3eccf0537800 100644 (file)
@@ -244,6 +244,8 @@ static int __maybe_unused rt715_dev_resume(struct device *dev)
                                           msecs_to_jiffies(RT715_PROBE_TIMEOUT));
        if (!time) {
                dev_err(&slave->dev, "Enumeration not complete, timed out\n");
+               sdw_show_ping_status(slave->bus, true);
+
                return -ETIMEDOUT;
        }
 
index b047bf87a100c590241fe4c01ae2e64004e1be79..4e61e16470eda2b6fe40b7bfe304b0ff4160f960 100644 (file)
@@ -562,6 +562,8 @@ static int __maybe_unused rt715_dev_resume(struct device *dev)
                                           msecs_to_jiffies(RT715_PROBE_TIMEOUT));
        if (!time) {
                dev_err(&slave->dev, "Initialization not complete, timed out\n");
+               sdw_show_ping_status(slave->bus, true);
+
                return -ETIMEDOUT;
        }