From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
"Veaceslav Falico" <vfalico@redhat.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Yinghai Lu" <yinghai@kernel.org>,
"Knut Petersen" <Knut_Petersen@t-online.de>,
"Ingo Molnar" <mingo@kernel.org>,
"Paul McKenney" <paulmck@linux.vnet.ibm.com>,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Neil Horman" <nhorman@tuxdriver.com>
Subject: Re: [RFC PATCH] PCI: export MSI mode using attributes, not kobjects
Date: Sat, 2 Nov 2013 08:50:54 -0700 [thread overview]
Message-ID: <20131102155054.GD23938@kroah.com> (raw)
In-Reply-To: <CAErSpo5YpE-aoTbXd5=0xBDe+_aQPEO4PejrG=+JoEM=w2ZxQw@mail.gmail.com>
On Fri, Nov 01, 2013 at 05:40:02PM -0600, Bjorn Helgaas wrote:
> On Tue, Oct 29, 2013 at 3:46 PM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >
> > The PCI MSI sysfs code is a mess with kobjects for things that don't
> > really need to be kobjects. This patch creates attributes dynamically
> > for the MSI interrupts instead of using kobjects.
> >
> > Note, this does not delete the existing sysfs MSI code, but puts the
> > attributes under a "msi_irqs_2" directory for testing / example.
> >
> > Also note, this removes a directory from the current MSI interrupt sysfs
> > code:
> >
> > old MSI kobjects:
> > pci_device
> > └── msi_irqs
> > └── 40
> > └── mode
> >
> > new MSI attributes:
> > pci_device
> > └── msi_irqs_2
> > └── 40
> >
> > As there was only one file "mode" with the kobject model, the interrupt
> > number is now a file that returns the "mode" of the interrupt (msi vs.
> > msix).
> >
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >
> > Bjorn, I can make up a patch that rips out the existing kobject code
> > here, but I figured this patch would make things easier to follow
> > instead of having to dig through the removed logic at the same time.
> >
> > I'll clean up the error handling path for the create attribute logic as
> > well, this was just a proof of concept that this could be done.
> >
> > Do you think that anyone cares about the current mode files in sysfs to
> > move things in this manner?
>
> I like this a lot better than trying to fix all the holes in the
> current kobject code.
Great.
> I have no idea who, if anybody, cares about the "mode" files. I
> assume there's a way to create the "mode" files with attributes, too?
> If so, we could replicate the existing structure with one patch, and
> simplify it with a second patch, so it would be easier to revert the
> directory change while keeping the fix.
No, we can't create a 2-level deep attribute at the moment, only one
level, like the patch does.
Based on Neil's comments, I think we should be fine with this as-is as
no one is messing with these files directly (which implies that we could
possibly just remove them entirely to save us the overall pain...)
Want me to redo this in a way that is acceptable (i.e. remove the
existing code at the same time?)
thanks,
greg k-h
next prev parent reply other threads:[~2013-11-02 15:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 21:46 [RFC PATCH] PCI: export MSI mode using attributes, not kobjects Greg Kroah-Hartman
2013-11-01 23:40 ` Bjorn Helgaas
2013-11-02 2:09 ` Neil Horman
2013-11-02 15:50 ` Greg Kroah-Hartman [this message]
2013-11-05 18:55 ` Bjorn Helgaas
2013-11-14 19:33 ` Bjorn Helgaas
2013-11-14 20:17 ` Neil Horman
2013-11-14 21:16 ` Bjorn Helgaas
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=20131102155054.GD23938@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Knut_Petersen@t-online.de \
--cc=bhelgaas@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vfalico@redhat.com \
--cc=yinghai@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.