From: "Sean O. Stalley" <sean.stalley@intel.com>
To: David Daney <ddaney.cavm@gmail.com>
Cc: Martin Mares <mj@ucw.cz>, Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, David Daney <david.daney@cavium.com>
Subject: Re: [PATCH v3] Add lspci support for Enhanced Allocation Capability.
Date: Wed, 16 Dec 2015 16:55:18 -0800 [thread overview]
Message-ID: <20151217005517.GA3765@sean.stalley.intel.com> (raw)
In-Reply-To: <1450217759-22063-1-git-send-email-ddaney.cavm@gmail.com>
>From 484344fef7e5c96c54576586ce81e6209a48b92c Mon Sep 17 00:00:00 2001
From: "Sean O. Stalley" <sean.stalley@intel.com>
Date: Wed, 16 Dec 2015 10:31:51 -0800
Subject: [PATCH 1/1] Support region sizes that are not power-of-2
Enhanced Allocation allows PCI devices to reserve regions with DWORD
granularity. Make sure lspci doesn't tuncate least significant bits
of the region size.
ex: a 2000 byte region should display [size=2000] instead of [size=1K]
Signed-off-by: Sean O. Stalley <sean.stalley@intel.com>
---
Hi David,
Here are some additional changes I think we should make to lspci in order to support EA.
The truncation problem was a simple fix.
Regions described by EA are being mislabeled as [virtual].
I spent some time today trying to write a patch that fixes this issue.
I couldn't come up with a clean solution, so I just added a comment.
Let me know if you have any questions.
Thanks,
Sean
lspci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lspci.c b/lspci.c
index fe7b7fe..d483f3a 100644
--- a/lspci.c
+++ b/lspci.c
@@ -336,7 +336,7 @@ show_size(pciaddr_t x)
if (!x)
return;
for (i = 0; i < (sizeof(suffix) / sizeof(*suffix) - 1); i++) {
- if (x < 1024)
+ if (x % 1024)
break;
x /= 1024;
}
@@ -366,7 +366,7 @@ show_bases(struct device *d, int cnt)
putchar('\t');
if (pos && !flg) /* Reported by the OS, but not by the device */
{
- printf("[virtual] ");
+ printf("[virtual] "); /* could also be enhanced */
flg = pos;
virtual = 1;
}
--
1.9.1
next prev parent reply other threads:[~2015-12-17 0:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-15 22:15 [PATCH v3] Add lspci support for Enhanced Allocation Capability David Daney
2015-12-17 0:55 ` Sean O. Stalley [this message]
2015-12-23 0:24 ` David Daney
2015-12-22 15:26 ` Martin Mares
2015-12-22 17:33 ` Sean O. Stalley
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=20151217005517.GA3765@sean.stalley.intel.com \
--to=sean.stalley@intel.com \
--cc=bhelgaas@google.com \
--cc=david.daney@cavium.com \
--cc=ddaney.cavm@gmail.com \
--cc=linux-pci@vger.kernel.org \
--cc=mj@ucw.cz \
/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).