public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Cc: Mark Brown <broonie@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] regmap: Allow setting IRQ domain name suffix
Date: Mon, 8 Jul 2024 15:40:26 +0300	[thread overview]
Message-ID: <12228ec5-cf2f-47b2-842d-ce336d921260@gmail.com> (raw)
In-Reply-To: <87plrpvzmg.ffs@tglx>

On 7/7/24 21:13, Thomas Gleixner wrote:
> On Mon, Jul 01 2024 at 13:59, Matti Vaittinen wrote:
>> +static int regmap_irq_create_domain(struct fwnode_handle *fwnode, int irq_base,
>> +				    const struct regmap_irq_chip *chip,
>> +				    struct regmap_irq_chip_data *d)
>> +{
>> +	struct irq_domain_info info = {
>> +		.fwnode = fwnode,
>> +		.size = irq_base + chip->num_irqs,
>> +		.hwirq_max = irq_base + chip->num_irqs,
> 
> This is not correct. irq_base is the linux interrupt number base. The
> first_hwirq argument of irq_domain_create_legacy() is 0.

I tried to pick the logic from the implementation of the 
irq_domain_create_legacy() - but I must've missed something. I will 
re-check this.

> 
>> +		.ops = &regmap_domain_ops,
>> +		.host_data = d,
>> +		.name_suffix = chip->domain_suffix,
>> +	};
>> +
>> +	d->domain = irq_domain_instantiate(&info);
>> +	if (IS_ERR(d->domain)) {
>> +		dev_err(d->map->dev, "Failed to create IRQ domain\n");
>> +		return PTR_ERR(d->domain);
>> +	}
>> +
>> +	if (irq_base)
>> +		irq_domain_associate_many(d->domain, irq_base, 0, chip->num_irqs);
> 
> I wonder whether this can be handled at the core. Let me stare at it.

Thanks Thomas! I'll wait for your ideas before re-spinning this series :)

Yours,
	-- Matti


-- 
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~


  reply	other threads:[~2024-07-08 12:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 10:58 [PATCH 0/2] regmap IRQ support for devices with multiple IRQs Matti Vaittinen
2024-07-01 10:58 ` [PATCH 1/2] irqdomain: Allow giving name suffix for domain Matti Vaittinen
2024-07-01 10:59 ` [PATCH 2/2] regmap: Allow setting IRQ domain name suffix Matti Vaittinen
2024-07-07 18:13   ` Thomas Gleixner
2024-07-08 12:40     ` Matti Vaittinen [this message]
2024-07-13 12:22       ` Thomas Gleixner
2024-08-05 13:04         ` Matti Vaittinen
2024-08-05 13:11           ` Thomas Gleixner
2024-08-06  8:18             ` Matti Vaittinen
2024-08-06 11:51         ` Matti Vaittinen
2024-08-07 13:02           ` Thomas Gleixner
2024-08-07 15:57             ` Thomas Gleixner
2024-08-08  5:30               ` Matti Vaittinen

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=12228ec5-cf2f-47b2-842d-ce336d921260@gmail.com \
    --to=mazziesaccount@gmail.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=rafael@kernel.org \
    --cc=tglx@linutronix.de \
    /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