[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190427200301.tujp2535jxmlqttr@wunner.de>
Date: Sat, 27 Apr 2019 22:03:01 +0200
From: Lukas Wunner <lukas@...ner.de>
To: fred@...dlawl.com
Cc: bhelgaas@...gle.com, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, mika.westerberg@...ux.intel.com,
andriy.shevchenko@...ux.intel.com, keith.busch@...el.com,
mr.nuke.me@...il.com, liudongdong3@...wei.com, thesven73@...il.com
Subject: Re: [PATCH 2/4] PCI: pciehp: Replace ctrl_*() with pci_*()
On Sat, Apr 27, 2019 at 02:13:02PM -0500, fred@...dlawl.com wrote:
> Hotplug useses custom ctrl_*() dev_*() printk wrappers for logging
> messages. To make hotplug conform to pci logging, replace uses of these
> wrappers with pci_*() printk wrappers. In addition, replace any
> printk() calls with pr_*() wrappers.
A lot of pciehp's messages are preceded by "Slot(%s): ", where %s is
replaced by the Physical Slot Number in the Slot Capabilities register
(which is cached in struct controller) plus an optional suffix if the
same PSN is used by multiple slots. For some reason (probably a
historic artefact), this prefix is included only in *some* of the
messages.
I think it would be useful to make the messages consistent by *always*
including the "Slot(%s): " prefix. However the prefix is unknown until
pci_hp_initialize() has been called. I'd solve this by keeping the
ctrl_*() wrappers and amending them to print the "Slot(%s): " prefix,
then making sure that ctrl_*() is not called before pci_hp_initialize().
(pci_*() has to be used instead).
> @@ -182,39 +184,39 @@ static int pciehp_probe(struct pcie_device *dev)
>
> if (!dev->port->subordinate) {
> /* Can happen if we run out of bus numbers during probe */
> - dev_err(&dev->device,
> - "Hotplug bridge without secondary bus, ignoring\n");
> + pci_err(dev->port, "Hotplug bridge without secondary bus, ignoring\n");
Hm, the string was likely deliberately put on a new line to avoid
exceeding 80 chars, so I'd keep it that way.
Thanks,
Lukas
Powered by blists - more mailing lists