From: "Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, Ian Munsie <imunsie@au1.ibm.com>,
Frederic Barrat <fbarrat@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Cc: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Subject: [PATCH 2/2] cxl: Set VPD timeout to avoid access failures
Date: Mon, 21 Nov 2016 15:10:06 -0600 [thread overview]
Message-ID: <1479762606-51632-1-git-send-email-mrochs@linux.vnet.ibm.com> (raw)
In-Reply-To: <1479762225-51440-1-git-send-email-mrochs@linux.vnet.ibm.com>
Some IBM CXL devices can take up to ~120ms to complete a VPD access
transaction when under heavy load. With an existing default VPD timeout
of 50ms, reads/writes can fail despite there not being an issue with the
underlying hardware.
To avoid these false failures, increase the VPD wait timeout for certain
CXL devices to a value that allows appropriate VPD access delay when faced
with a worst-case scenario.
Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
---
drivers/misc/cxl/pci.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index e96be9c..56a67cf 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -1675,6 +1675,10 @@ bool cxl_slot_is_supported(struct pci_dev *dev, int flags)
}
EXPORT_SYMBOL_GPL(cxl_slot_is_supported);
+static bool cxl_pci_is_slow_vpd_device(struct pci_dev *dev)
+{
+ return dev->device == 0x0601;
+}
static int cxl_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
@@ -1692,6 +1696,9 @@ static int cxl_probe(struct pci_dev *dev, const struct pci_device_id *id)
return -ENODEV;
}
+ if (cxl_pci_is_slow_vpd_device(dev))
+ pci_set_vpd_timeout(dev, msecs_to_jiffies(125));
+
if (cxl_verbose)
dump_cxl_config_space(dev);
--
2.1.0
next prev parent reply other threads:[~2016-11-21 21:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-21 21:03 [PATCH 0/2] Add device-specific VPD timeout Matthew R. Ochs
2016-11-21 21:09 ` [PATCH 1/2] PCI: Add pci_set_vpd_timeout() to set VPD access timeout Matthew R. Ochs
2016-11-21 22:05 ` Bjorn Helgaas
2016-11-22 0:15 ` Andrew Donnellan
2016-11-22 17:17 ` Stephen Hemminger
2016-11-22 0:34 ` Matthew R. Ochs
2016-11-21 21:10 ` Matthew R. Ochs [this message]
2016-11-22 0:32 ` [PATCH 2/2] cxl: Set VPD timeout to avoid access failures Andrew Donnellan
2016-11-22 0:40 ` Matthew R. Ochs
2016-11-22 17:41 ` Frederic Barrat
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=1479762606-51632-1-git-send-email-mrochs@linux.vnet.ibm.com \
--to=mrochs@linux.vnet.ibm.com \
--cc=bhelgaas@google.com \
--cc=fbarrat@linux.vnet.ibm.com \
--cc=imunsie@au1.ibm.com \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=ukrishn@linux.vnet.ibm.com \
/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).