public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: <vkoul@kernel.org>, <yung-chuan.liao@linux.intel.com>,
	<sanyog.r.kale@intel.com>, <alsa-devel@alsa-project.org>,
	<linux-kernel@vger.kernel.org>, <patches@opensource.cirrus.com>
Subject: Re: [PATCH 2/2] soundwire: bus: Allow SoundWire peripherals to register IRQ handlers
Date: Fri, 20 Jan 2023 09:59:41 +0000	[thread overview]
Message-ID: <20230120095941.GL36097@ediswmail.ad.cirrus.com> (raw)
In-Reply-To: <c05a6791-96a7-2b10-d353-eb7b316aefc8@linux.intel.com>

On Thu, Jan 19, 2023 at 11:12:04AM -0600, Pierre-Louis Bossart wrote:
> No objection on this addition, just a couple of comments to improve it:
> 
> >  EXPORT_SYMBOL(sdw_bus_master_add);
> > @@ -158,6 +183,8 @@ static int sdw_delete_slave(struct device *dev, void *data)
> >  	mutex_lock(&bus->bus_lock);
> >  
> >  	if (slave->dev_num) { /* clear dev_num if assigned */
> > +		irq_dispose_mapping(irq_find_mapping(bus->domain, slave->dev_num));
> > +
> 
> could this be done conditionally. e.g.
> 
> if (slave->prop.irq)
>     irq_dispose_mapping(irq_find_mapping(bus->domain, slave->dev_num));
> 
> > +			slave->irq = irq_create_mapping(bus->domain, dev_num);
> > +			if (!slave->irq) {
> > +				dev_err(bus->dev, "Failed to map IRQ\n");
> > +				return -EINVAL;
> > +			}
> 
> ...and here....
> 
> if (slave->prop.irq) {
> 	slave->irq = irq_create_mapping(bus->domain, dev_num);
> 	if (!slave->irq) {
> 		dev_err(bus->dev, "Failed to map IRQ\n");
> 		return -EINVAL;
> 	}
> }
> 

Yeah I am happy to make those conditional, I guess it is cleaner
to not map IRQs if they wont be used.

> > @@ -369,6 +371,7 @@ struct sdw_dpn_prop {
> >   * @clock_reg_supported: the Peripheral implements the clock base and scale
> >   * registers introduced with the SoundWire 1.2 specification. SDCA devices
> >   * do not need to set this boolean property as the registers are required.
> > + * @irq: call actual IRQ handler on slave, as well as callback
> >   */
> >  struct sdw_slave_prop {
> >  	u32 mipi_revision;
> > @@ -393,6 +396,7 @@ struct sdw_slave_prop {
> >  	u8 scp_int1_mask;
> >  	u32 quirks;
> >  	bool clock_reg_supported;
> > +	bool irq;
> 
> this can be confused with the 'wake_capable' property.
> 
> maybe 'out_of_band_irq' ?
> 

Yes I struggle on the name a bit and then just gave up and
went with plain "irq", hard to know what to call it. Not sure
out_of_band is quite right since it not really out of band,
handle_nested_irq pretty much basically boils down to a function
call really. Maybe something like "map_irq", or "use_domain_irq"?

> There should be an explanation and something checking that both are not
> used concurrently.

I will try to expand the explanation a litte, but I dont see any
reason to block calling both handlers, no ill effects would come
for a driver having both and it is useful if any soundwire
specific steps are needed that arn't on other control buses.

Thanks,
Charles

  reply	other threads:[~2023-01-20 10:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 16:51 [PATCH 1/2] soundwire: bus: Don't filter slave alerts Charles Keepax
2023-01-19 16:51 ` [PATCH 2/2] soundwire: bus: Allow SoundWire peripherals to register IRQ handlers Charles Keepax
2023-01-19 17:12   ` Pierre-Louis Bossart
2023-01-20  9:59     ` Charles Keepax [this message]
2023-01-20 16:20       ` Pierre-Louis Bossart
2023-01-23 14:53         ` Charles Keepax
2023-01-23 15:50           ` Pierre-Louis Bossart
2023-01-23 16:08             ` Richard Fitzgerald
2023-01-23 16:38               ` Pierre-Louis Bossart
2023-01-23 17:17                 ` Richard Fitzgerald
2023-01-23 18:07                   ` Pierre-Louis Bossart
2023-01-23 17:07             ` Charles Keepax
2023-01-19 17:27 ` [PATCH 1/2] soundwire: bus: Don't filter slave alerts Pierre-Louis Bossart
2023-01-20 10:14   ` Charles Keepax
2023-01-20 16:11     ` 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=20230120095941.GL36097@ediswmail.ad.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=pierre-louis.bossart@linux.intel.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