All of lore.kernel.org
 help / color / mirror / Atom feed
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 1/2] PCI/LINK: bw_notification: Clear interrupt before enabling it
Date: Mon, 25 Mar 2019 18:50:06 +0000	[thread overview]
Message-ID: <5d58348d5bba4003861d8aeb993fdb7f@ausx13mps321.AMER.DELL.COM> (raw)
In-Reply-To: 87006d1f5b6868c0a6bb2fbb2765ee4dde550f28.1553078908.git.lukas@wunner.de

On 3/20/19 6:14 AM, Lukas Wunner wrote:
> 
> [EXTERNAL EMAIL]
> 
> When booting a MacBookPro9,1, duplicate link downtraining messages are
> logged for the devices directly attached to the two CPU-internal Root
> Ports of the Core i7 3615QM:  Once on device enumeration and once on
> enablement of the bandwidth notification interrupt on the Root Ports.
> 
> Duplicate messages do not occur with Root Ports on the PCH and Downstream
> Ports on the Thunderbolt controller:  Only a single message is logged for
> these, namely on device enumeration.
> 
> The reason for the duplicate messages is a stale interrupt in the Link
> Status register of the 3615QM's internal Root Ports.  Avoid by clearing
> the interrupt before enabling it.
> 
> An alternative approach would be to clear the interrupt already on device
> enumeration or to report link downtraining only if the speed has changed.
> That way, link downtraining occurring between device enumeration and
> enablement of the bandwidth notification interrupt could be catched.
> However clearing stale interrupts before enabling them is a standard
> operating procedure for any driver and keeping the two steps in one place
> makes the code easier to follow.
> 
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Reviewed-by: Alexandru Gagniuc <alex.gagniuc@dellteam.com>

> ---
>   drivers/pci/pcie/bw_notification.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/pcie/bw_notification.c b/drivers/pci/pcie/bw_notification.c
> index 001d6253ad48..69e6ba2558bf 100644
> --- a/drivers/pci/pcie/bw_notification.c
> +++ b/drivers/pci/pcie/bw_notification.c
> @@ -30,6 +30,8 @@ static void pcie_enable_link_bandwidth_notification(struct pci_dev *dev)
>   {
>   	u16 lnk_ctl;
>   
> +	pcie_capability_write_word(dev, PCI_EXP_LNKSTA, PCI_EXP_LNKSTA_LBMS);
> +
>   	pcie_capability_read_word(dev, PCI_EXP_LNKCTL, &lnk_ctl);
>   	lnk_ctl |= PCI_EXP_LNKCTL_LBMIE;
>   	pcie_capability_write_word(dev, PCI_EXP_LNKCTL, lnk_ctl);
> 


  reply	other threads:[~2019-03-25 18:50 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 [this message]
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
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=5d58348d5bba4003861d8aeb993fdb7f@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 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.