From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: bjorn@helgaas.com, Bjorn Helgaas <bhelgaas@google.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Kai-Heng Feng <kai.heng.feng@canonical.com>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: Do not use pcie_get_speed_cap() to determine when to start waiting
Date: Thu, 14 May 2020 15:31:05 +0300 [thread overview]
Message-ID: <20200514123105.GW2571@lahna.fi.intel.com> (raw)
In-Reply-To: <20200512170906.GA268853@bjorn-Precision-5520>
On Tue, May 12, 2020 at 12:09:06PM -0500, Bjorn Helgaas wrote:
> I think that code would be more readable as something like:
>
> if (dev->link_active_reporting)
> wait_for_link_active(dev);
> msleep(delay);
>
> Obviously we still want the printks and error/timeout checking, but
> fundamentally we want to wait for the link to be active (if possible),
> then wait the 100ms. That structure isn't as clear as it could be
> when the delay is buried inside pcie_wait_for_link_delay().
>
> It's not completely trivial to restructure it like that because of
> pcie_wait_for_link() and its callers. But I think it's worth pushing
> on it a little bit to see if it could be done reasonably.
OK, I see what I can do to make it clearer.
> This does expose the fact that per spec, a hot-plug capable port that
> supports only 5 GT/s must support link_active_reporting, but sec 6.6.1
> says we *don't* need to wait for link training to complete before
> waiting 100ms. So maybe we end up waiting slightly more than
> necessary. Probably not worth worrying about?
I would say so. Better wait a bit too much than the opposite IMHO.
next prev parent reply other threads:[~2020-05-14 12:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-16 8:32 [PATCH] PCI: Do not use pcie_get_speed_cap() to determine when to start waiting Mika Westerberg
2020-05-06 22:42 ` Bjorn Helgaas
2020-05-07 11:45 ` Mika Westerberg
2020-05-07 12:24 ` Bjorn Helgaas
2020-05-07 12:35 ` Mika Westerberg
2020-05-07 13:33 ` Bjorn Helgaas
2020-05-07 13:46 ` Mika Westerberg
2020-05-07 17:11 ` Bjorn Helgaas
2020-05-08 22:58 ` Bjorn Helgaas
2020-05-11 10:16 ` Mika Westerberg
2020-05-12 17:09 ` Bjorn Helgaas
2020-05-14 12:31 ` Mika Westerberg [this message]
2020-05-06 23:27 ` 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=20200514123105.GW2571@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=bjorn@helgaas.com \
--cc=helgaas@kernel.org \
--cc=kai.heng.feng@canonical.com \
--cc=linux-pci@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/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).