Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Richard Fitzgerald <rf@opensource.cirrus.com>,
	vkoul@kernel.org, peter.ujfalusi@linux.intel.com,
	yung-chuan.liao@linux.intel.com, sanyog.r.kale@intel.com,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	patches@opensource.cirrus.com
Subject: Re: [PATCH] soundwire: intel_auxdevice: Don't disable IRQs before removing children
Date: Wed, 18 Dec 2024 16:40:22 -0500	[thread overview]
Message-ID: <9b8ef4d2-e4bd-4336-8980-0fb59d672631@linux.dev> (raw)
In-Reply-To: <7479a25e-6729-4aa0-b67e-7781bf8232da@linux.dev>


>> Or do you object to
>> the way I have solved that problem? I am certainly open to other
>> solutions, if you have any suggestions?

Having looked at the code in more details, I think there are other 
issues, see e.g. this part of the code called from snd_bus_master_delete().

static int sdw_delete_slave(struct device *dev, void *data)
{
	struct sdw_slave *slave = dev_to_sdw_dev(dev);
	struct sdw_bus *bus = slave->bus;

	pm_runtime_disable(dev);

	sdw_slave_debugfs_exit(slave);

	mutex_lock(&bus->bus_lock);

	if (slave->dev_num) { /* clear dev_num if assigned */
		clear_bit(slave->dev_num, bus->assigned);
		if (bus->ops && bus->ops->put_device_num)
			bus->ops->put_device_num(bus, slave);
	}

So at this point an interaction with the device is not longer possible, 
even if the Cadence interrupts are kept active, since there's no valid 
device number to use...

	list_del_init(&slave->node);
	mutex_unlock(&bus->bus_lock);

... but this is where the .remove() will take place.

	device_unregister(dev);
	return 0;
}

What am I missing?


  reply	other threads:[~2024-12-18 21:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 11:02 [PATCH] soundwire: intel_auxdevice: Don't disable IRQs before removing children Charles Keepax
2024-12-16 17:35 ` Pierre-Louis Bossart
2024-12-17 10:24   ` Charles Keepax
2024-12-17 10:49   ` Richard Fitzgerald
2024-12-17 23:49     ` Pierre-Louis Bossart
2024-12-18  9:51       ` Charles Keepax
2024-12-18 20:45         ` Pierre-Louis Bossart
2024-12-18 21:40           ` Pierre-Louis Bossart [this message]
2024-12-19 10:27             ` Charles Keepax
2024-12-20 17:59               ` Charles Keepax
2025-01-02 22:14               ` Pierre-Louis Bossart

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=9b8ef4d2-e4bd-4336-8980-0fb59d672631@linux.dev \
    --to=pierre-louis.bossart@linux.dev \
    --cc=ckeepax@opensource.cirrus.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=rf@opensource.cirrus.com \
    --cc=sanyog.r.kale@intel.com \
    --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