linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: linux-pci@vger.kernel.org, Keith Busch <keith.busch@intel.com>,
	Lukas Wunner <lukas@wunner.de>,
	Russell Currey <ruscur@russell.cc>,
	Sam Bobroff <sbobroff@linux.ibm.com>,
	Oliver O'Halloran <oohall@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Sinan Kaya <okaya@kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Matthew Wilcox <willy@infradead.org>,
	Frederick Lawler <fred@fredlawl.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] Log PCIe service info with pci_dev, not pcie_device
Date: Mon, 11 Mar 2019 10:50:23 +0100	[thread overview]
Message-ID: <1585578.yUfP4slHvQ@aspire.rjw.lan> (raw)
In-Reply-To: <20190308180149.GD214730@google.com>

On Friday, March 8, 2019 7:01:49 PM CET Bjorn Helgaas wrote:
> This is strictly a discussion starter, obviously not for application.
> 
> The portdrv driver binds to pci_dev for PCIe Root Ports and Switch
> Ports.  It creates additional pcie_devices for each "service" (Power
> Management events, AER, hotplug, Downstream Port Containment, etc).
> These pcie_devices have their own struct device, in addition to the
> one in the struct pci_dev.
> 
> Service drivers can then bind to those pcie_devices, and their
> dev_printk output is typically associated with those, e.g.,
> 
>   pciehp 0000:80:10.0:pcie004: Slot #36 ...
> 
> The "pcie004" is a bitmask that identifies the particular service, but
> I don't think it's very useful to users, especially since we already
> have "pciehp" as the driver name.
> 
> I think the fact that pcie_device has its own struct device is
> probably a design mistake and it would be better if those "services"
> were more tightly integrated into the PCI core.
> 
> Changing that would be a big project that I don't want to tackle right
> now, but I think a small step would be to simplify the dmesg logging
> by doing it with the underlying pci_dev instead of the pcie_device.
> For example, we could do something like the patch below, which would
> change the dmesg output like this:
> 
>   - pciehp 0000:80:10.0:pcie004: Slot #36 AttnBtn- PwrCtrl- MRL- AttnInd+ PwrInd+ HotPlug+ Surprise+ Interlock- NoCompl- LLActRep+
>   + pcieport 0000:80:10.0: pciehp: Slot #36 AttnBtn- PwrCtrl- MRL- AttnInd+ PwrInd+ HotPlug+ Surprise+ Interlock- NoCompl- LLActRep+
> 
> Please discuss :)

No strong opinion here, and please feel free to add

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

to this patch.

> diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
> index 7dd443aea5a5..2761778f2ecc 100644
> --- a/drivers/pci/hotplug/pciehp_hpc.c
> +++ b/drivers/pci/hotplug/pciehp_hpc.c
> @@ -868,7 +868,7 @@ struct controller *pcie_init(struct pcie_device *dev)
>  		PCI_EXP_SLTSTA_MRLSC | PCI_EXP_SLTSTA_CC |
>  		PCI_EXP_SLTSTA_DLLSC | PCI_EXP_SLTSTA_PDC);
>  
> -	ctrl_info(ctrl, "Slot #%d AttnBtn%c PwrCtrl%c MRL%c AttnInd%c PwrInd%c HotPlug%c Surprise%c Interlock%c NoCompl%c LLActRep%c%s\n",
> +	pci_info(pdev, "Slot #%d AttnBtn%c PwrCtrl%c MRL%c AttnInd%c PwrInd%c HotPlug%c Surprise%c Interlock%c NoCompl%c LLActRep%c%s\n",
>  		(slot_cap & PCI_EXP_SLTCAP_PSN) >> 19,
>  		FLAG(slot_cap, PCI_EXP_SLTCAP_ABP),
>  		FLAG(slot_cap, PCI_EXP_SLTCAP_PCP),
> 



      parent reply	other threads:[~2019-03-11  9:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 18:01 [RFC] Log PCIe service info with pci_dev, not pcie_device Bjorn Helgaas
2019-03-08 18:24 ` Keith Busch
2019-03-11  9:50 ` Rafael J. Wysocki [this message]

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=1585578.yUfP4slHvQ@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=fred@fredlawl.com \
    --cc=helgaas@kernel.org \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mika.westerberg@linux.intel.com \
    --cc=okaya@kernel.org \
    --cc=oohall@gmail.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=ruscur@russell.cc \
    --cc=sbobroff@linux.ibm.com \
    --cc=willy@infradead.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 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).