Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Fix a bug that LTR's latency in L1 PM Substates ...
details: https://anonhg.NetBSD.org/src/rev/7687848813b7
branches: trunk
changeset: 354398:7687848813b7
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Jun 15 06:51:18 2017 +0000
description:
Fix a bug that LTR's latency in L1 PM Substates capability and Latency
Tolerance Reporting capability isn't printed correctly.
diffstat:
sys/dev/pci/pci_subr.c | 25 +++++++++++--------------
sys/dev/pci/pcireg.h | 4 ++--
2 files changed, 13 insertions(+), 16 deletions(-)
diffs (64 lines):
diff -r 6ba91c53df6e -r 7687848813b7 sys/dev/pci/pci_subr.c
--- a/sys/dev/pci/pci_subr.c Thu Jun 15 06:32:52 2017 +0000
+++ b/sys/dev/pci/pci_subr.c Thu Jun 15 06:51:18 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_subr.c,v 1.187 2017/06/15 05:42:27 msaitoh Exp $ */
+/* $NetBSD: pci_subr.c,v 1.188 2017/06/15 06:51:18 msaitoh Exp $ */
/*
* Copyright (c) 1997 Zubin D. Dittia. All rights reserved.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.187 2017/06/15 05:42:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.188 2017/06/15 06:51:18 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_pci.h"
@@ -3503,18 +3503,15 @@
pcireg_t reg;
printf("\n Latency Tolerance Reporting\n");
- reg = regs[o2i(extcapoff + PCI_LTR_MAXSNOOPLAT)] & 0xffff;
- printf(" Max Snoop Latency Register: 0x%04x\n", reg);
- printf(" Max Snoop LatencyValue: %u\n",
- (pcireg_t)__SHIFTOUT(reg, PCI_LTR_MAXSNOOPLAT_VAL));
- printf(" Max Snoop LatencyScale: %uns\n",
- PCI_LTR_SCALETONS(__SHIFTOUT(reg, PCI_LTR_MAXSNOOPLAT_SCALE)));
- reg = regs[o2i(extcapoff + PCI_LTR_MAXNOSNOOPLAT)] >> 16;
- printf(" Max No-Snoop Latency Register: 0x%04x\n", reg);
- printf(" Max No-Snoop LatencyValue: %u\n",
- (pcireg_t)__SHIFTOUT(reg, PCI_LTR_MAXNOSNOOPLAT_VAL));
- printf(" Max No-Snoop LatencyScale: %uns\n",
- PCI_LTR_SCALETONS(__SHIFTOUT(reg, PCI_LTR_MAXNOSNOOPLAT_SCALE)));
+ reg = regs[o2i(extcapoff + PCI_LTR_MAXSNOOPLAT)];
+ printf(" Max Snoop Latency Register: 0x%04x\n", reg & 0xffff);
+ printf(" Max Snoop Latency: %luns\n",
+ __SHIFTOUT(reg, PCI_LTR_MAXSNOOPLAT_VAL)
+ * PCI_LTR_SCALETONS(__SHIFTOUT(reg, PCI_LTR_MAXSNOOPLAT_SCALE)));
+ printf(" Max No-Snoop Latency Register: 0x%04x\n", reg >> 16);
+ printf(" Max No-Snoop Latency: %luns\n",
+ __SHIFTOUT(reg, PCI_LTR_MAXNOSNOOPLAT_VAL)
+ * PCI_LTR_SCALETONS(__SHIFTOUT(reg, PCI_LTR_MAXNOSNOOPLAT_SCALE)));
}
static void
diff -r 6ba91c53df6e -r 7687848813b7 sys/dev/pci/pcireg.h
--- a/sys/dev/pci/pcireg.h Thu Jun 15 06:32:52 2017 +0000
+++ b/sys/dev/pci/pcireg.h Thu Jun 15 06:51:18 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcireg.h,v 1.130 2017/05/29 07:09:20 msaitoh Exp $ */
+/* $NetBSD: pcireg.h,v 1.131 2017/06/15 06:51:18 msaitoh Exp $ */
/*
* Copyright (c) 1995, 1996, 1999, 2000
@@ -1877,7 +1877,7 @@
#define PCI_LTR_MAXNOSNOOPLAT 0x04 /* Max No-Snoop Latency */
#define PCI_LTR_MAXNOSNOOPLAT_VAL __BITS(25, 16) /* Max No-Snoop LatencyValue*/
#define PCI_LTR_MAXNOSNOOPLAT_SCALE __BITS(28, 26) /*Max NoSnoop LatencyScale*/
-#define PCI_LTR_SCALETONS(x) ((32 << (x)) / 32)
+#define PCI_LTR_SCALETONS(x) (1 << ((x) * 5))
/*
* Extended capability ID: 0x0019
Home |
Main Index |
Thread Index |
Old Index