[PATCH] Correct the end of CardBus memory windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The low twelve bits of memory base/limit are assumed to be all zeros
and all ones, respectively.  Therefore, a window with base == limit
is a valid 4K window, which we should display by default, and the
true end of the window is ...fff, not ...000.  For example,

    05:07.0 CardBus bridge: Texas Instruments PCIxx12 Cardbus Controller
	    ...
-	    Memory window 0: 88000000-8bfff000 (prefetchable)
+	    Memory window 0: 88000000-8bffffff (prefetchable)


Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
---
 lspci.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lspci.c b/lspci.c
index bca1ccb..681ef6a 100644
--- a/lspci.c
+++ b/lspci.c
@@ -590,7 +590,8 @@ show_htype2(struct device *d)
       int p = 8*i;
       u32 base = get_conf_long(d, PCI_CB_MEMORY_BASE_0 + p);
       u32 limit = get_conf_long(d, PCI_CB_MEMORY_LIMIT_0 + p);
-      if (limit > base || verb)
+      limit = limit + 0xfff;
+      if (base <= limit || verb)
 	printf("\tMemory window %d: %08x-%08x%s%s\n", i, base, limit,
 	       (cmd & PCI_COMMAND_MEMORY) ? "" : " [disabled]",
 	       (brc & (PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 << i)) ? " (prefetchable)" : "");

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux