From: Shay Drori <shayd@nvidia.com>
To: Greg KH <gregkh@linuxfoundation.org>,
Przemek Kitszel <przemyslaw.kitszel@intel.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 v4 1/2] driver core: auxiliary bus: show auxiliary device IRQs
Date: Sun, 12 May 2024 10:30:02 +0300 [thread overview]
Message-ID: <b3baab48-647e-4ba2-9d0a-fcef64984e56@nvidia.com> (raw)
In-Reply-To: <2024051114-gladly-feline-4302@gregkh>
On 11/05/2024 10:44, Greg KH wrote:
> On Fri, May 10, 2024 at 04:01:01PM +0200, Przemek Kitszel wrote:
>> On 5/10/24 15:07, Greg KH wrote:
>>> On Fri, May 10, 2024 at 02:54:49PM +0200, Przemek Kitszel wrote:
>>>>>> +static ssize_t auxiliary_irq_mode_show(struct device *dev,
>>>>>> + struct device_attribute *attr, char *buf)
>>>>>> +{
>>>>>> + struct auxiliary_irq_info *info =
>>>>>> + container_of(attr, struct auxiliary_irq_info, sysfs_attr);
>>>>>> +
>>>>>> + if (refcount_read(xa_load(&irqs, info->irq)) > 1)
>>>>>
>>>>> refcount combined with xa? That feels wrong, why is refcount used for
>>>>> this at all?
>>>>
>>>> Not long ago I commented on similar usage for ice driver,
>>>> ~"since you are locking anyway this could be a plain counter",
>>>> and author replied
>>>> ~"additional semantics (like saturation) of refcount make me feel warm
>>>> and fuzzy" (sorry if misquoting too much).
>>>> That convinced me back then, so I kept quiet about that here.
>>>
>>> But why is this being incremented / decremented at all? What is that
>>> for?
>>
>> [global]
>> This is just a counter, it is used to tell if given IRQ is shared or
>> exclusive. Hence there is a global xarray for that.
>> And my argument is for this case precisely.
>>
>> [other]
>> There is also a separate xarray for each auxdev (IIRC) which is used as
>> generic dynamic container [that stores sysfs attrs], any other would
>> work (with different characteristics), but I see no problems with
>> picking xarray here.
>
> Again, why is an xarray needed, why isn't this part of the auxdevice
> structure to start with?
If I understand you correctly, you are referring to the xarray of the
auxdevice (not the global one).
If so, instead of xarray what can be used by the auxdevice?
>
> thanks,
>
> greg k-h
>
next prev parent reply other threads:[~2024-05-12 7:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-09 9:14 [PATCH net-next v4 0/2] Introduce auxiliary bus IRQs sysfs Shay Drory
2024-05-09 9:14 ` [PATCH net-next v4 1/2] driver core: auxiliary bus: show auxiliary device IRQs Shay Drory
2024-05-10 8:15 ` Greg KH
2024-05-10 12:54 ` Przemek Kitszel
2024-05-10 13:07 ` Greg KH
2024-05-10 14:01 ` Przemek Kitszel
2024-05-11 7:44 ` Greg KH
2024-05-12 7:30 ` Shay Drori [this message]
2024-05-12 15:32 ` Jason Gunthorpe
2024-05-13 8:33 ` Przemek Kitszel
2024-05-13 23:06 ` Jason Gunthorpe
2024-05-12 7:27 ` Shay Drori
2024-05-09 9:14 ` [PATCH net-next v4 2/2] net/mlx5: Expose SFs IRQs Shay Drory
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=b3baab48-647e-4ba2-9d0a-fcef64984e56@nvidia.com \
--to=shayd@nvidia.com \
--cc=davem@davemloft.net \
--cc=david.m.ertman@intel.com \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--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=przemyslaw.kitszel@intel.com \
--cc=rafael@kernel.org \
--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