From: Greg KH <gregkh@linuxfoundation.org>
To: Shay Drori <shayd@nvidia.com>
Cc: netdev@vger.kernel.org, pabeni@redhat.com, davem@davemloft.net,
kuba@kernel.org, edumazet@google.com, david.m.ertman@intel.com,
rafael@kernel.org, ira.weiny@intel.com,
linux-rdma@vger.kernel.org, leon@kernel.org, tariqt@nvidia.com,
Parav Pandit <parav@nvidia.com>
Subject: Re: [PATCH net-next v5 1/2] driver core: auxiliary bus: show auxiliary device IRQs
Date: Thu, 30 May 2024 16:46:15 +0200 [thread overview]
Message-ID: <2024053007-eldest-extending-3b19@gregkh> (raw)
In-Reply-To: <49c0676c-0b23-4df4-aa3c-d13e578e28f1@nvidia.com>
On Wed, May 29, 2024 at 09:29:33AM +0300, Shay Drori wrote:
>
>
> On 28/05/2024 21:00, Greg KH wrote:
> > External email: Use caution opening links or attachments
> >
> >
> > On Tue, May 28, 2024 at 12:11:43PM +0300, Shay Drory wrote:
> > > +#ifdef CONFIG_SYSFS
> > > +/* Xarray of irqs to determine if irq is exclusive or shared. */
> > > +static DEFINE_XARRAY(irqs);
> > > +/* Protects insertions into the irqs xarray. */
> > > +static DEFINE_MUTEX(irqs_lock);
> >
> > You access the irq xarray without grabbing the lock in places :(
> >
> > But again, I fail to see why the xarray is needed at all, why isn't the
> > needed information here:
> >
> > > +struct auxiliary_irq_info {
> > > + struct device_attribute sysfs_attr;
> > > + int irq;
> > > +};
> >
> > Right there^ should contain everything you need, NOT a global array and
> > lock at all.
>
>
> 1) one xarray is per aux device that indicates which IRQs irqs are used
> by this device. this xarray is holding the info above.
Ok, please document that better, it's not obvious.
> 2) second xarray is global that tracks if irq share between multiple aux
> devices or exclusive to aux device.
That should not be a "global" thing, as now you are getting into what
the msi irq core should be handling, NOT the aux device.
Userspace should be able to determine, just by the number, if it is
"shared" or not by looking at them all, so why need to add complex logic
here to attempt to also mirror this information?
Doesn't the irq layer track this sufficiently? And it wouldn't even be
correct if an irq was "shared" by a device that was NOT controlled by an
aux device so it could be incorrect.
thanks,
greg k-h
next prev parent reply other threads:[~2024-05-30 14:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 9:11 [PATCH net-next v5 0/2] Introduce auxiliary bus IRQs sysfs Shay Drory
2024-05-28 9:11 ` [PATCH net-next v5 1/2] driver core: auxiliary bus: show auxiliary device IRQs Shay Drory
2024-05-28 14:43 ` Przemek Kitszel
2024-05-29 6:58 ` Shay Drori
2024-05-28 18:00 ` Greg KH
2024-05-29 6:29 ` Shay Drori
2024-05-30 14:46 ` Greg KH [this message]
2024-05-28 9:11 ` [PATCH net-next v5 2/2] net/mlx5: Expose SFs IRQs Shay Drory
2024-05-28 14:48 ` Przemek Kitszel
2024-05-28 14:51 ` Parav Pandit
2024-05-29 11:13 ` Shay Drori
2024-05-28 17:57 ` [PATCH net-next v5 0/2] Introduce auxiliary bus IRQs sysfs Greg KH
2024-05-29 6:19 ` Shay Drori
2024-05-30 14:13 ` Shay Drori
2024-05-30 14:50 ` Greg KH
2024-06-03 7:10 ` Parav Pandit
2024-06-06 2:42 ` Parav Pandit
2024-06-10 13:01 ` Parav Pandit
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=2024053007-eldest-extending-3b19@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=david.m.ertman@intel.com \
--cc=edumazet@google.com \
--cc=ira.weiny@intel.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=parav@nvidia.com \
--cc=rafael@kernel.org \
--cc=shayd@nvidia.com \
--cc=tariqt@nvidia.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;
as well as URLs for NNTP newsgroup(s).