Re: [alsa-devel] [PATCH 1/6] soundwire: fix startup sequence for Intel/Cadence
From: Pierre-Louis Bossart
Date: Mon Sep 16 2019 - 14:14:16 EST
@@ -1043,8 +1043,6 @@ static int intel_probe(struct platform_device
*pdev)
ÂÂÂÂÂ if (ret)
ÂÂÂÂÂÂÂÂÂ goto err_init;
-ÂÂÂ ret = sdw_cdns_enable_interrupt(&sdw->cdns);
-
ÂÂÂÂÂ /* Read the PDI config and initialize cadence PDI */
ÂÂÂÂÂ intel_pdi_init(sdw, &config);
ÂÂÂÂÂ ret = sdw_cdns_pdi_init(&sdw->cdns, config);
@@ -1062,6 +1060,18 @@ static int intel_probe(struct platform_device
*pdev)
ÂÂÂÂÂÂÂÂÂ goto err_init;
ÂÂÂÂÂ }
+ÂÂÂ ret = sdw_cdns_enable_interrupt(&sdw->cdns);
+ÂÂÂ if (ret < 0) {
+ÂÂÂÂÂÂÂ dev_err(sdw->cdns.dev, "cannot enable interrupts\n");
+ÂÂÂÂÂÂÂ goto err_init;
+ÂÂÂ }
+
+ÂÂÂ ret = sdw_cdns_exit_reset(&sdw->cdns);
+ÂÂÂ if (ret < 0) {
+ÂÂÂÂÂÂÂ dev_err(sdw->cdns.dev, "unable to exit bus reset sequence\n");
+ÂÂÂÂÂÂÂ goto err_init;
Don't you want to disable interrupts at least... before you return
error? err_init does bus cleanup and not controller one
yes good point, let me look at this.
The existing code has no interrupt disable sequence.
I will add this improved error handling in a follow-up patch, after the
capability to disable interrupts is added.