Re: mttr failures on 2.6.12-mm1

4 messages, 2 authors, 2005-07-29 · open the first message on its own page

Re: mttr failures on 2.6.12-mm1

From: Andrew Morton <hidden>
Date: 2005-07-29 05:02:56

Badari Pulavarty [off-list ref] wrote:
Andi,

I noticed these on my AMD64 box earlier. Just a warning or anything 
to be concerned about ? 
What happened with this one?  Looks like a bug in the vesafb code.  Do we
know if it is fixed in 2.6.13-rc4?

(Badari is on leave - could one of the fbdev developers please help out?)

Thanks.
Thanks,
Badari

NET: Registered protocol family 16
PCI: Using configuration type 1
mtrr: v2.0 (20020519)
ACPI: Subsystem revision 20050309
ACPI: Interpreter enabled
ACPI: Using IOAPIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (0000:00)
PCI: Probing PCI hardware (bus 00)
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 *5 10 11)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 5 *10 11)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 5 10 *11)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 5 10 *11)
ACPI: PCI Root Bridge [PCI1] (0000:08)
PCI: Probing PCI hardware (bus 08)
SCSI subsystem initialized
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a
report
PCI: Bridge: 0000:00:06.0
  IO window: 2000-2fff
  MEM window: fa000000-fa0fffff
  PREFETCH window: e0000000-e00fffff
PCI: Bridge: 0000:09:01.0
  IO window: disabled.
  MEM window: fa400000-faffffff
  PREFETCH window: fc000000-fdffffff
PCI: Bridge: 0000:08:01.0
  IO window: disabled.
  MEM window: fa400000-faffffff
  PREFETCH window: fc000000-fdffffff
PCI: Bridge: 0000:08:02.0
  IO window: 3000-3fff
  MEM window: fb000000-fb0fffff
  PREFETCH window: e0000000-e00fffff
PCI: Bridge: 0000:08:03.0
  IO window: disabled.
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Bridge: 0000:08:04.0
  IO window: 4000-4fff
  MEM window: fb100000-fb1fffff
  PREFETCH window: e0100000-e01fffff
ACPI: PCI Interrupt 0000:08:04.0[A] -> GSI 36 (level, low) -> IRQ 16
PCI-DMA: Disabling AGP.
PCI-DMA: aperture base @ 8000000 size 65536 KB
PCI-DMA: Reserving 64MB of IOMMU area in the AGP aperture
IA32 emulation $Id: sys_ia32.c,v 1.32 2002/03/24 13:02:28 ak Exp $
audit: initializing netlink socket (disabled)
audit(1119372253.776:1): initialized
Total HugeTLB memory allocated, 0
inotify device minor=63
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
JFS: nTxBlock = 8192, nTxLock = 65536
Initializing Cryptographic API
PCI: MSI quirk detected. pci_msi_quirk set.
PCI: MSI quirk detected. pci_msi_quirk set.
PCI: MSI quirk detected. pci_msi_quirk set.
PCI: MSI quirk detected. pci_msi_quirk set.
vesafb: framebuffer at 0xfc000000, mapped to 0xffffc20000600000, using
1875k, total 16384k
vesafb: mode is 800x600x16, linelength=1600, pages=16
vesafb: scrolling: redraw
vesafb: Truecolor: size=0:5:6:5, shift=0:11:5:0
mtrr: type mismatch for fc000000,1000000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,800000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,400000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,200000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,100000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,80000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,40000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,20000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,10000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,8000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,4000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,2000 old: write-back new: write-
combining
mtrr: type mismatch for fc000000,1000 old: write-back new: write-
combining
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB

Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
Console: switching to colour frame buffer device 100x37
fb0: VESA VGA frame buffer device
Real Time Clock Driver v1.12
Non-volatile memory driver v1.2
Linux agpgart interface v0.101 (c) Dave Jones
cn_fork is registered
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing
disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 128000K size 1024 blocksize
loop: loaded (max 8 devices)
tg3.c:v3.31 (June 8, 2005)

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

Re: Re: mttr failures on 2.6.12-mm1

From: "Antonino A. Daplas" <adaplas@gmail.com>
Date: 2005-07-29 13:43:38

Andrew Morton wrote:
Badari Pulavarty [off-list ref] wrote:
quoted
Andi,

I noticed these on my AMD64 box earlier. Just a warning or anything to be concerned about ?
What happened with this one?  Looks like a bug in the vesafb code.  Do we
know if it is fixed in 2.6.13-rc4?

(Badari is on leave - could one of the fbdev developers please help out?)

Thanks.

quoted
vesafb: mode is 800x600x16, linelength=1600, pages=16
vesafb: scrolling: redraw
vesafb: Truecolor: size=0:5:6:5, shift=0:11:5:0
mtrr: type mismatch for fc000000,1000000 old: write-back new: write-
combining
Range is already set to write-back, vesafb attempts to add a write-
combining mtrr (default for vesafb).
quoted
mtrr: size and base must be multiples of 4 kiB
This is a bug, vesafb attempts to add a size < PAGE_SIZE triggering
the messages below.
quoted
Call Trace:<ffffffff8011662d>{mtrr_check+77} <ffffffff801169b9>{mtrr_add
+41}
       <ffffffff80647afe>{vesafb_probe+1390}
<ffffffff802f3f2f>{driver_probe_device+79}
       <ffffffff802f4010>{__device_attach+0}
<ffffffff802f38c6>{bus_for_each_drv+70}
       <ffffffff802f4079>{device_attach+89}
<ffffffff802f378e>{bus_add_device+62}
       <ffffffff802f28ad>{device_add+173}
<ffffffff802f575f>{platform_device_register+255}
       <ffffffff80647e7e>{vesafb_init+542} <ffffffff8010b24a>{init+506}
       <ffffffff8010e967>{child_rip+8} <ffffffff8010b050>{init+0}
       <ffffffff8010e95f>{child_rip+0}
mtrr: size and base must be multiples of 4 kiB
Here's a patch to fix the above.  To eliminate the warning messages,
you can add the option mtrr:2 to add a write-back mtrr for vesafb. Or
just use nomtrr option.

Full changelog attached.

Tony


   vesafb: Fix mtrr bugs

   1. Fix algorithm for finding the best power of 2 size with mtrr_add().
   2. Add option to choose the mtrr type by extending the mtrr boot option:

      mtrr:n where n

       0 = no mtrr (equivalent to using the nomtrr option)
       1 = uncachable
       2 = write back
       3 = write combining (default)
       4 = write through

   From: Antonino Daplas [off-list ref]
   Signed-off-by: Antonino Daplas [off-list ref]
---

vesafb.c |   47 ++++++++++++++++++++++++++++++++++++-----------
1 files changed, 36 insertions(+), 11 deletions(-)
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -46,7 +46,7 @@ static struct fb_fix_screeninfo vesafb_f
};

static int             inverse   = 0;
-static int             mtrr      = 1;
+static int             mtrr      = 3; /* default to write-combining */
static int	       vram_remap __initdata = 0; /* Set amount of memory to be used */
static int	       vram_total __initdata = 0; /* Set total amount of memory */
static int             pmi_setpal = 0;	/* pmi for palette changes ??? */
@@ -237,8 +237,8 @@ static int __init vesafb_setup(char *opt
			pmi_setpal=0;
		else if (! strcmp(this_opt, "pmipal"))
			pmi_setpal=1;
-		else if (! strcmp(this_opt, "mtrr"))
-			mtrr=1;
+		else if (! strncmp(this_opt, "mtrr:", 5))
+			mtrr = simple_strtoul(this_opt+5, NULL, 0);
		else if (! strcmp(this_opt, "nomtrr"))
			mtrr=0;
		else if (! strncmp(this_opt, "vtotal:", 7))
@@ -420,14 +420,39 @@ static int __init vesafb_probe(struct de
	if (mtrr) {
		unsigned int temp_size = size_total;
-		/* Find the largest power-of-two */
-		while (temp_size & (temp_size - 1))
-			temp_size &= (temp_size - 1);
-
-		/* Try and find a power of two to add */
-		while (temp_size > PAGE_SIZE &&
-			mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) {
-			temp_size >>= 1;
+		unsigned int type = 0;
+
+		switch (mtrr) {
+		case 1:
+			type = MTRR_TYPE_UNCACHABLE;
+			break;
+		case 2:
+			type = MTRR_TYPE_WRBACK;
+			break;
+		case 3:
+			type = MTRR_TYPE_WRCOMB;
+			break;
+		case 4:
+			type = MTRR_TYPE_WRTHROUGH;
+			break;
+		default:
+			type = 0;
+			break;
+		}
+
+		if (type) {
+			int rc;
+	
+			/* Find the largest power-of-two */
+			while (temp_size & (temp_size - 1))
+				temp_size &= (temp_size - 1);
+
+			/* Try and find a power of two to add */
+			do { +				rc = mtrr_add(vesafb_fix.smem_start, temp_size,
+					      type, 1);
+				temp_size >>= 1;
+			} while (temp_size >= PAGE_SIZE && rc == -EINVAL);
		}
	}
	





-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

Re: Re: mttr failures on 2.6.12-mm1

From: Andrew Morton <hidden>
Date: 2005-07-29 18:27:05

"Antonino A. Daplas" [off-list ref] wrote:
    vesafb: Fix mtrr bugs
Thanks, Tony.
     1. Fix algorithm for finding the best power of 2 size with mtrr_add().
     2. Add option to choose the mtrr type by extending the mtrr boot option:

        mtrr:n where n

         0 = no mtrr (equivalent to using the nomtrr option)
         1 = uncachable
         2 = write back
         3 = write combining (default)
         4 = write through
Is an update to Documentation/kernel-parameters.txt or
Documentation/fb/vesafb.txt needed?


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

Re: Re: mttr failures on 2.6.12-mm1

From: "Antonino A. Daplas" <adaplas@gmail.com>
Date: 2005-07-29 22:20:42

Andrew Morton wrote:
"Antonino A. Daplas" [off-list ref] wrote:
quoted
    vesafb: Fix mtrr bugs
Thanks, Tony.
quoted
     1. Fix algorithm for finding the best power of 2 size with mtrr_add().
     2. Add option to choose the mtrr type by extending the mtrr boot option:

        mtrr:n where n

         0 = no mtrr (equivalent to using the nomtrr option)
         1 = uncachable
         2 = write back
         3 = write combining (default)
         4 = write through
Is an update to Documentation/kernel-parameters.txt or
Documentation/fb/vesafb.txt needed?
Yes. I'll submit a patch ASAP.

Tony


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help