[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120127191032.GA22999@dirshya.in.ibm.com>
Date: Sat, 28 Jan 2012 00:40:32 +0530
From: Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com>
To: Ram Pai <linuxram@...ibm.com>,
Jesse Barnes <jbarnes@...tuousgeek.org>,
Yinghai Lu <yinghai.lu@...cle.com>
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [BUGFIX][PATCH] pci: check for 4k resource_size alignment in
sriov_init
Hi Ram and Jesse,
I found a trivial issue with page size alignment check on IBM POWER
box with 64k base page size. In sriov_init(), changing the check from
PAGE_SIZE (arch and config dependent) to HW_PAGE_SIZE (always 4k) was
required to use one of the sriov adapter as PF since the
resource_size() comes up as 0x8000 and PAGE_SIZE would be 0x10000 for
pseries boxes.
I think resource_size() could be less than SystemPageSize, but I would
like your comments/ack/nack on any consequences of checking for only
4k alignment here in a system with larger base page size.
Thanks,
Vaidy
---
pci: check for 4k resource_size alignment in sriov_init
pci sriov_init should check for 4k page size alignment of resource_size
even if base page size is larger -- like 64k in powerpc.
Signed-off-by: Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com>
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 0321fa3..5816fa0 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -474,7 +474,7 @@ found:
pos + PCI_SRIOV_BAR + i * 4);
if (!res->flags)
continue;
- if (resource_size(res) & (PAGE_SIZE - 1)) {
+ if (resource_size(res) & (HW_PAGE_SIZE - 1)) {
rc = -EIO;
goto failed;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists