public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: linux-kernel@vger.kernel.org,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH] sysfs: add per pci device msi[x] irq listing (v4)
Date: Thu, 29 Sep 2011 07:51:26 -0700	[thread overview]
Message-ID: <20110929145126.GA3769@suse.de> (raw)
In-Reply-To: <1317307129-11579-1-git-send-email-nhorman@tuxdriver.com>

On Thu, Sep 29, 2011 at 10:38:49AM -0400, Neil Horman wrote:
> This patch adds a per-pci-device subdirectory in sysfs called:
> /sys/bus/pci/devices/<device>/msi_irqs
> 
> This sub-directory exports the set of msi vectors allocated by a given
> pci device, by creating a numbered sub-directory for each vector beneath
> msi_irqs.  For each vector various attributes can be exported.  Currently the
> only attribute is called mode, which tracks the operational mode of that vector
> (msi vs. msix)
> 
> ---
> 
> Change Notes:
> 
> (v2)
> Fixed up Documentation to put new sysfs interface descriptions in the right
> place, as per request by Greg K-H
> 
> Fixed up oops that resulted from removing pci device.  Not 100% sure I did this
> exactly right, but looking at the crash (triggered by echo 1 >
> /sys/class/net/eth0/device/remove), it looked as though we were freeing the
> pci_dev struct prior to all sysfs objects releasing their use of the device.  AS
> such it seemed most appropriate to hold references on the pci_dev for each msi
> irq sysfs object that we create, and release them on free accordingly.  With
> this change in place, I can remove, and add (via rescan) msi enabled devices
> ad-nauseum without a panic.  Again thanks to Greg K-H
> 
> (v3)
> As per Gregs suggestion, I looked further and noted that in fact, yes, it wasn't
> producing any errors on remove, but only because I had a refcounting problem,
> and my new sysfs objects were left orphaned with a dangling refcount.  I've
> fixed that, added a release method to the new ktype, which now drops the
> reference I hold on the pci_dev for us and I've validated that all objects I've
> created, along with the parent directory and pci device are cleaned up and freed
> by enabling the kobject dyanic_debug set and observing the appropriate release
> calls.  I can provide the logs if anyone wants to review them specifically.
> 
> (v4)
> Fixed up some spelling mistakes, and added a scissors line with a good
> commitlog, so that git-am drops all the version logging
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Greg Kroah-Hartman <gregkh@suse.de>

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>

  reply	other threads:[~2011-09-29 15:03 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-14 18:36 [PATCH] sysfs: add per pci device msi[x] irq listing Neil Horman
2011-09-15 14:40 ` Greg KH
2011-09-15 15:07   ` Neil Horman
2011-09-15 20:08 ` [PATCH] sysfs: add per pci device msi[x] irq listing (v2) Neil Horman
2011-09-16  8:36   ` Greg KH
2011-09-16 10:57     ` Neil Horman
2011-09-16 13:23       ` Greg KH
2011-09-16 13:32         ` Neil Horman
2011-09-16 16:12           ` Bjorn Helgaas
2011-09-19 15:47 ` [PATCH] sysfs: add per pci device msi[x] irq listing (v3) Neil Horman
2011-09-19 17:14   ` Greg KH
2011-09-19 17:33     ` Neil Horman
2011-09-22 10:49   ` Konrad Rzeszutek Wilk
2011-09-22 10:57     ` Neil Horman
2011-09-22 11:10       ` Konrad Rzeszutek Wilk
2011-09-22 13:21         ` Neil Horman
2011-09-22 13:17     ` Neil Horman
2011-09-22 13:54   ` Matthew Wilcox
2011-09-22 14:32     ` Neil Horman
2011-09-28 22:18       ` Bjorn Helgaas
2011-09-29  0:42         ` Neil Horman
2011-09-29  4:40           ` Bjorn Helgaas
2011-09-29 13:07             ` Neil Horman
2011-09-29 14:38 ` [PATCH] sysfs: add per pci device msi[x] irq listing (v4) Neil Horman
2011-09-29 14:51   ` Greg KH [this message]
2011-09-30 12:32   ` Stefan Richter
2011-09-30 15:33     ` Neil Horman
2011-09-30 16:33       ` Bjorn Helgaas
2011-09-30 16:54         ` Neil Horman
2011-10-06 15:36           ` Jesse Barnes
2011-10-06 17:12             ` Neil Horman
2011-10-06 17:57               ` Bjorn Helgaas
2011-10-06 18:08                 ` [PATCH] sysfs: add per pci device msi[x] irq listing (v5) Neil Horman
2011-10-14 16:21                   ` Jesse Barnes
2011-10-14 16:40                     ` Greg KH
2011-10-14 17:31                     ` Neil Horman
2011-11-01 16:47                     ` Neil Horman
2011-11-01 16:58                       ` Jesse Barnes
2011-11-01 18:05                         ` Neil Horman

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=20110929145126.GA3769@suse.de \
    --to=gregkh@suse.de \
    --cc=bhelgaas@google.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=nhorman@tuxdriver.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