lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCXjltG40x9mJ25U@black.fi.intel.com>
Date: Thu, 15 May 2025 15:52:38 +0300
From: Raag Jadav <raag.jadav@...el.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: gregkh@...uxfoundation.org, david.m.ertman@...el.com,
	ira.weiny@...el.com, lee@...nel.org,
	mika.westerberg@...ux.intel.com, heikki.krogerus@...ux.intel.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/2] driver core: auxiliary bus: Introduce auxiliary
 device resource management

On Wed, May 14, 2025 at 03:36:49PM +0300, Andy Shevchenko wrote:
> On Wed, May 14, 2025 at 05:54:31PM +0530, Raag Jadav wrote:
> > With more and more drivers adopting to auxiliary bus infrastructure comes
> > the need for managing resources at auxiliary device level. This is useful
> > for cases where parent device shares variable number and type of resources
> > with auxiliary child device but doesn't require any active involvement in
> > managing them.
> > 
> > This reduces potential duplication of resource APIs that may be required by
> > parent device driver. With this in place parent driver will be responsible
> > for filling up respective resources and its count in auxiliary device
> > structure before registering it, so that the leaf drivers can utilize in
> > their probe function. Lifecycle of these resources will be as long as the
> > auxiliary device exists.
> 
> ...
> 
> > +/**
> > + * auxiliary_get_irq_optional - get an optional IRQ for auxiliary device
> > + * @auxdev: auxiliary device
> > + * @num: IRQ number index
> > + *
> > + * Gets an IRQ for a auxiliary device. Device drivers should check the return value
> > + * for errors so as to not pass a negative integer value to the request_irq()
> > + * APIs. This is the same as auxiliary_get_irq(), except that it does not print an
> > + * error message if an IRQ can not be obtained.
> > + *
> > + * For example::
> > + *
> > + *		int irq = auxiliary_get_irq_optional(auxdev, 0);
> > + *		if (irq < 0)
> > + *			return irq;
> > + *
> > + * Return: non-zero IRQ number on success, negative error number on failure.
> > + */
> > +int auxiliary_get_irq_optional(struct auxiliary_device *auxdev, unsigned int num)
> > +{
> > +	struct resource *r;
> > +	int ret = -ENXIO;
> > +
> > +	r = auxiliary_get_resource(auxdev, IORESOURCE_IRQ, num);
> > +	if (!r)
> > +		goto out;
> > +
> > +	/*
> > +	 * The resources may pass trigger flags to the irqs that need to be
> > +	 * set up. It so happens that the trigger flags for IORESOURCE_BITS
> > +	 * correspond 1-to-1 to the IRQF_TRIGGER* settings.
> > +	 */
> > +	if (r->flags & IORESOURCE_BITS) {
> > +		struct irq_data *irqd;
> > +
> > +		irqd = irq_get_irq_data(r->start);
> > +		if (!irqd)
> > +			goto out;
> > +		irqd_set_trigger_type(irqd, r->flags & IORESOURCE_BITS);
> > +	}
> > +
> > +	ret = r->start;
> > +	if (WARN(!ret, "0 is an invalid IRQ number\n"))
> > +		ret = -EINVAL;
> > +out:
> > +	return ret;
> > +}
> 
> Please, do not inherit the issues that the respective platform device API has.
> And after all, why do you need this? What's wrong with plain fwnode_irq_get()?

Can you please elaborate? Are we expecting fwnode to be supported by auxiliary
device?

Raag

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ