linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Barry Song <21cnbao@gmail.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Jonathan.Cameron@huawei.com, bilbao@vt.edu,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	leon@kernel.org, LKML <linux-kernel@vger.kernel.org>,
	linux-pci@vger.kernel.org, Linuxarm <linuxarm@huawei.com>,
	luzmaximilian@gmail.com, mchehab+huawei@kernel.org,
	schnelle@linux.ibm.com, Barry Song <song.bao.hua@hisilicon.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2 1/2] PCI/MSI: Fix the confusing IRQ sysfs ABI for MSI-X
Date: Mon, 23 Aug 2021 11:33:15 +0100	[thread overview]
Message-ID: <878s0sqwlw.wl-maz@kernel.org> (raw)
In-Reply-To: <CAGsJ_4w35+mRE_qp117HhNOaHeUN1cO6GGPW36qtjaX6wUcQNA@mail.gmail.com>

On Sat, 21 Aug 2021 23:41:17 +0100,
Barry Song <21cnbao@gmail.com> wrote:

[...]

> > So probably we should set this ABI invisible when devices are using
> > MSI or MSI-X?
> 
> i mean something like the below,
> 
> diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
> index 5d63df7..1323841 100644
> --- a/drivers/pci/pci-sysfs.c
> +++ b/drivers/pci/pci-sysfs.c
> @@ -26,6 +26,7 @@
>  #include <linux/slab.h>
>  #include <linux/vgaarb.h>
>  #include <linux/pm_runtime.h>
> +#include <linux/msi.h>
>  #include <linux/of.h>
>  #include "pci.h"
> 
> @@ -1437,6 +1438,16 @@ static umode_t pci_dev_attrs_are_visible(struct
> kobject *kobj,
>                 if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
>                         return 0;
> 
> +#ifdef CONFIG_PCI_MSI
> +       /*
> +        * if devices are MSI and MSI-X, IRQ sysfs ABI is meaningless
> +        * and broken
> +        */
> +       if (a == &dev_attr_irq.attr)
> +               if (first_pci_msi_entry(pdev))
> +                       return 0;
> +#endif
> +
>         return a->mode;
>  }

I don't think you can break what we have today. Whatever change we
make to the kernel internals, the userspace view must stay unchanged.

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2021-08-23 10:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20 22:37 [PATCH v2 0/2] PCI/MSI: Clarify the IRQ sysfs ABI for PCI devices Barry Song
2021-08-20 22:37 ` [PATCH v2 1/2] PCI/MSI: Fix the confusing IRQ sysfs ABI for MSI-X Barry Song
2021-08-20 23:33   ` Bjorn Helgaas
2021-08-21 10:42     ` Marc Zyngier
2021-08-21 22:14       ` Barry Song
2021-08-21 22:41         ` Barry Song
2021-08-23 10:33           ` Marc Zyngier [this message]
2021-08-24 19:25           ` Bjorn Helgaas
2021-08-23 10:30         ` Marc Zyngier
2021-08-23 11:03           ` Barry Song
2021-08-23 11:28             ` Marc Zyngier
2021-08-23 22:46               ` Barry Song
2021-08-24 19:34                 ` Bjorn Helgaas
2021-08-25  9:45                   ` Marc Zyngier
2021-08-24 20:51       ` Barry Song
2021-08-24 21:29         ` Barry Song
2021-08-25 10:24           ` Marc Zyngier
2021-08-24 22:51             ` Barry Song
2021-08-20 22:37 ` [PATCH v2 2/2] Documentation: ABI: sysfs-bus-pci: Add description for IRQ entry Barry Song

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=878s0sqwlw.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=21cnbao@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=bilbao@vt.edu \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=helgaas@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=luzmaximilian@gmail.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=schnelle@linux.ibm.com \
    --cc=song.bao.hua@hisilicon.com \
    --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;
as well as URLs for NNTP newsgroup(s).