From: <Alex_Gagniuc@Dellteam.com>
To: <lukas@wunner.de>, <helgaas@kernel.org>, <mr.nuke.me@gmail.com>
Cc: <linux-pci@vger.kernel.org>, <Austin.Bolen@dell.com>,
<keith.busch@intel.com>, <Shyam.Iyer@dell.com>,
<okaya@kernel.org>
Subject: Re: [PATCH 2/2] PCI/LINK: bw_notification: Deduplicate reports for multi-function devices
Date: Mon, 25 Mar 2019 18:52:38 +0000 [thread overview]
Message-ID: <769ac857205c425fa7b6bab7dddc7f68@ausx13mps321.AMER.DELL.COM> (raw)
In-Reply-To: 70cb1754e3f0da3b84712460b1017ac707cd2616.1553078908.git.lukas@wunner.de
On 3/20/19 6:15 AM, Lukas Wunner wrote:
>
> [EXTERNAL EMAIL]
>
> If a multi-function device's bandwidth is already limited when it is
> enumerated, a message is logged only for function 0. By contrast, when
> downtraining occurs after enumeration, a message is logged for all
> functions. That's because the former uses pcie_report_downtraining(),
> whereas the latter uses __pcie_print_link_status() (which doesn't filter
> functions != 0). I am seeing this happen on a MacBookPro9,1 with a GPU
> (function 0) and an integrated HDA controller (function 1).
>
> Avoid this incongruence by calling pcie_report_downtraining() in both
> cases.
Good catch! Thank you for engineering the fixes.
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Alexandru Gagniuc <alex.gagniuc@dellteam.com>
> ---
> drivers/pci/pci.h | 1 +
> drivers/pci/pcie/bw_notification.c | 2 +-
> drivers/pci/probe.c | 2 +-
> 3 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> index 224d88634115..d994839a3e24 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -273,6 +273,7 @@ enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev);
> u32 pcie_bandwidth_capable(struct pci_dev *dev, enum pci_bus_speed *speed,
> enum pcie_link_width *width);
> void __pcie_print_link_status(struct pci_dev *dev, bool verbose);
> +void pcie_report_downtraining(struct pci_dev *dev);
>
> /* Single Root I/O Virtualization */
> struct pci_sriov {
> diff --git a/drivers/pci/pcie/bw_notification.c b/drivers/pci/pcie/bw_notification.c
> index 69e6ba2558bf..c26045f2a890 100644
> --- a/drivers/pci/pcie/bw_notification.c
> +++ b/drivers/pci/pcie/bw_notification.c
> @@ -76,7 +76,7 @@ static irqreturn_t pcie_bw_notification_handler(int irq, void *context)
> */
> down_read(&pci_bus_sem);
> list_for_each_entry(dev, &port->subordinate->devices, bus_list)
> - __pcie_print_link_status(dev, false);
> + pcie_report_downtraining(dev);
> up_read(&pci_bus_sem);
>
> pcie_capability_read_word(port, PCI_EXP_LNKSTA, &link_status);
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 2ec0df04e0dc..7e12d0163863 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2388,7 +2388,7 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
> return dev;
> }
>
> -static void pcie_report_downtraining(struct pci_dev *dev)
> +void pcie_report_downtraining(struct pci_dev *dev)
> {
> if (!pci_is_pcie(dev))
> return;
>
next prev parent reply other threads:[~2019-03-25 18:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-20 11:05 [PATCH 0/2] Link bandwidth notification fixes Lukas Wunner
2019-03-20 11:05 ` [PATCH 1/2] PCI/LINK: bw_notification: Clear interrupt before enabling it Lukas Wunner
2019-03-25 18:50 ` Alex_Gagniuc
2019-03-20 11:05 ` [PATCH 2/2] PCI/LINK: bw_notification: Deduplicate reports for multi-function devices Lukas Wunner
2019-03-25 18:52 ` Alex_Gagniuc [this message]
2019-03-25 22:33 ` [PATCH 0/2] Link bandwidth notification fixes 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=769ac857205c425fa7b6bab7dddc7f68@ausx13mps321.AMER.DELL.COM \
--to=alex_gagniuc@dellteam.com \
--cc=Austin.Bolen@dell.com \
--cc=Shyam.Iyer@dell.com \
--cc=helgaas@kernel.org \
--cc=keith.busch@intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mr.nuke.me@gmail.com \
--cc=okaya@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 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).