The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: vkoul@kernel.org, broonie@kernel.org
Cc: yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.dev,
	lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com,
	kai.vehmanen@linux.intel.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, patches@opensource.cirrus.com
Subject: [PATCH v4 4/4] soundwire: intel_auxdevice: Don't disable IRQs before removing children
Date: Tue, 24 Nov 2026 16:10:01 +0000	[thread overview]
Message-ID: <20261124161001.702882-5-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20261124161001.702882-1-ckeepax@opensource.cirrus.com>

Currently the auxiliary device for the link disables IRQs before it
calls sdw_bus_master_delete(). This has the side effect that none
of the devices on the link can access their own registers whilst
their remove functions run, because the IRQs are required for bus
transactions to function.

Now that the link auxiliary drivers register their own IRQs and a
core helper is available to destroy the slaves before the master
is destroyed, it is save to update intel_link_remove() to leave
the IRQ enabled whilst the slaves are destroyed.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---

Changes since v3:
 - Dropped all the link lock and list stuff and just use the IRQ core.
 - Removed Pierre's Reviewed-by as things have changed quite
   substantively.

 drivers/soundwire/intel_auxdevice.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c
index d84fbe716febc..450c3927f0910 100644
--- a/drivers/soundwire/intel_auxdevice.c
+++ b/drivers/soundwire/intel_auxdevice.c
@@ -511,8 +511,6 @@ static void intel_link_remove(struct auxiliary_device *auxdev)
 	struct sdw_intel *sdw = cdns_to_intel(cdns);
 	struct sdw_bus *bus = &cdns->bus;
 
-	free_irq(sdw->link_res->irq, cdns);
-
 	/*
 	 * Since pm_runtime is already disabled, we don't decrease
 	 * the refcount when the clock_stop_quirk is
@@ -521,8 +519,15 @@ static void intel_link_remove(struct auxiliary_device *auxdev)
 	if (!bus->prop.hw_disabled) {
 		sdw_intel_debugfs_exit(sdw);
 		cancel_delayed_work_sync(&cdns->attach_dwork);
-		sdw_cdns_enable_interrupt(cdns, false);
 	}
+
+	sdw_bus_slaves_delete(bus);
+
+	free_irq(sdw->link_res->irq, cdns);
+
+	if (!bus->prop.hw_disabled)
+		sdw_cdns_enable_interrupt(cdns, false);
+
 	sdw_bus_master_delete(bus);
 }
 
-- 
2.47.3


      parent reply	other threads:[~2026-11-24 16:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 16:09 [PATCH v4 0/4] Allow SoundWire devices to communicate during remove Charles Keepax
2026-11-24 16:09 ` [PATCH v4 1/4] ASoC: SOF: Intel: Add IRQ chip to distribute the SoundWire IRQ Charles Keepax
2026-11-24 16:49   ` Pierre-Louis Bossart
2026-11-24 17:06     ` Charles Keepax
2026-11-24 16:09 ` [PATCH v4 2/4] soundwire: bus: Don't unassign dev_num before unregistering device Charles Keepax
2026-11-24 16:10 ` [PATCH v4 3/4] soundwire: bus: Expose a helper to remove devices from the bus Charles Keepax
2026-11-24 16:10 ` Charles Keepax [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261124161001.702882-5-ckeepax@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox