public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: gregkh@linuxfoundation.org, david.m.ertman@intel.com,
	ira.weiny@intel.com, lee@kernel.org,
	mika.westerberg@linux.intel.com, heikki.krogerus@linux.intel.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] mfd: core: Support auxiliary device
Date: Sun, 20 Apr 2025 09:20:13 +0300	[thread overview]
Message-ID: <aASSHasej5Lme0Wc@black.fi.intel.com> (raw)
In-Reply-To: <aAPBHBplhmZ_D0jC@smile.fi.intel.com>

On Sat, Apr 19, 2025 at 06:28:28PM +0300, Andy Shevchenko wrote:
> On Fri, Apr 18, 2025 at 06:04:33PM +0530, Raag Jadav wrote:
> > Extend MFD subsystem to support auxiliary child device. This is useful
> > for MFD usecases where parent device is on a discoverable bus and doesn't
> > fit into the platform device criteria. Purpose of this implementation is
> > to provide discoverable MFDs just enough infrastructure to register
> > independent child devices with their own memory and interrupt resources
> > without abusing the platform device.
> > 
> > Current support is limited to just PCI type MFDs, but this can be further
> > extended to support other types like USB in the future.
> 
> ...
> 
> >  config MFD_CORE
> >  	tristate
> > +	select AUXILIARY_BUS
> >  	select IRQ_DOMAIN
> 
> >  	default n
> 
> Can be dropped. It's the default 'default' and with user invisible
> configuration, it makes even less sense.

Sure.

> > +/*
> > + * Common structure between MFD parent and auxiliary child device.
> > + * To be used by leaf drivers to access child device resources.
> > + */
> > +struct mfd_aux_device {
> > +	struct auxiliary_device auxdev;
> > +	struct resource	mem;
> > +	struct resource	irq;
> > +	/* Place holder for other types */
> > +	struct resource	ext;
> 
> I don't like it. It's no-scalable solution, just make it VLA. Each resource
> already has type in case one needs to extract an exact one, also this won't
> work in case of the two resources for memory or IRQ needed.

Agree, but is it worth introducing a whole new set of get_resource() and
friends? I'm not sure if the maintainers will be okay with it.

> > +/* TODO: Convert the platform device abusers and remove this flag */
> > +#define MFD_AUX_TYPE	BIT(31)
> 
> Yeah, LKP wants this to be signed... Or 'id' to be unsigned.

I'll revert it back to INT_MIN, a specific number would rather become more
questionable.

Raag

      reply	other threads:[~2025-04-20  6:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18 12:34 [PATCH v3] mfd: core: Support auxiliary device Raag Jadav
2025-04-18 15:29 ` kernel test robot
2025-04-19 15:28 ` Andy Shevchenko
2025-04-20  6:20   ` Raag Jadav [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=aASSHasej5Lme0Wc@black.fi.intel.com \
    --to=raag.jadav@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=david.m.ertman@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=ira.weiny@intel.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@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