Re: atrtc0: Warnings about mappings of I/O and interrupt

From: John Baldwin <jhb_at_freebsd.org>
Date: Thu, 12 Feb 2009 09:23:27 -0500
On Thursday 11 December 2008 5:16:28 pm Roman Divacky wrote:
> On Thu, Dec 04, 2008 at 05:45:14PM -0500, John Baldwin wrote:
> > On Thursday 04 December 2008 05:04:38 pm Roman Divacky wrote:
> > > On Thu, Dec 04, 2008 at 02:24:13PM -0500, John Baldwin wrote:
> > > > On Thursday 20 November 2008 12:13:25 pm Roman Divacky wrote:
> > > > > hi
> > > > > 
> > > > > I upgraded from roughly 10 days old -CURRENT to this:
> > > > > 
> > > > > FreeBSD witten 8.0-CURRENT FreeBSD 8.0-CURRENT #55: Wed Nov 19 
23:23:49 
> > CET 
> > > > 2008
> > > > > root_at_witten:/usr/obj/usr/src/sys/MYKERNEL  i386
> > > > > 
> > > > > and I am getting this at boot:
> > > > > 
> > > > > atrtc0: <AT Real Time Clock> at port 0x70 irq 8 on isa0
> > > > > atrtc0: Warning: Couldn't map I/O.
> > > > > atrtc0: Warning: Couldn't map Interrupt.
> > > > > 
> > > > > the booting itself works fine and I dont see any odd effects.
> > > > 
> > > > The driver is just a stub anyway.  Do you have any atrtc0 hints, and 
can 
> > you 
> > > > grab the output for the 'atrtc0' device from 'devinfo -r'?
> > > 
> > > witten ~# grep atrtc /boot/device.hints
> > > hint.atrtc.0.at="isa"
> > > hint.atrtc.0.port="0x70"
> > > hint.atrtc.0.irq="8"
> > > 
> > > (but that's the default I believe)
> > > 
> > > devinfo -r shows "empty" atrtc0 but:
> > > 
> > >   atrtc1
> > >         Interrupt request lines:
> > >             8
> > >         I/O ports:
> > >             0x70-0x71
> > > 
> > > any more info I can provide?
> > 
> > Hmmmm, that should have worked fine in that atrtc1 should have taken over 
> > the 'atrtc0' hints.  If you don't mind, can you add some debugging printfs 
to 
> > acpi_hint_device_unit() (maybe only do them if the 'name' parameter 
> > is "atrtc" to avoid clutter).
> 
> with the attached patch I am getting the attached dmesg.
> 
> do you want me to do some other thing?

Can you get the dmesg output from this patch?

--- //depot/user/jhb/acpipci/dev/acpica/acpi.c
+++ /home/jhb/work/p4/acpipci/dev/acpica/acpi.c
_at__at_ -974,6 +974,9 _at__at_
     const char *s;
     long value;
     int line, matches, unit;
+    int debug;
+
+    debug = (strcmp(name, "atrtc") == 0);
 
     /*
      * Iterate over all the hints for the devices with the specified
_at__at_ -984,11 +987,18 _at__at_
 	if (resource_find_dev(&line, name, &unit, "at", NULL) != 0)
 	    break;
 
+	if (debug)
+		printf("Trying %s%d ...", name, unit);
+
 	/* Must have an "at" for acpi or isa. */
 	resource_string_value(name, unit, "at", &s);
 	if (!(strcmp(s, "acpi0") == 0 || strcmp(s, "acpi") == 0 ||
 	    strcmp(s, "isa0") == 0 || strcmp(s, "isa") == 0))
+	{
+	    if (debug)
+		printf(" bad bus %s\n", s);
 	    continue;
+	}
 
 	/*
 	 * Check for matching resources.  We must have at least one,
_at__at_ -1000,9 +1010,17 _at__at_
 	matches = 0;
 	if (resource_long_value(name, unit, "port", &value) == 0) {
 	    if (acpi_match_resource_hint(child, SYS_RES_IOPORT, value))
+	    {
 		matches++;
+		if (debug)
+		    printf(" port ok");
+	    }
 	    else
+	    {
+		if (debug)
+		    printf(" bad port\n");
 		continue;
+	    }
 	}
 	if (resource_long_value(name, unit, "maddr", &value) == 0) {
 	    if (acpi_match_resource_hint(child, SYS_RES_MEMORY, value))
_at__at_ -1012,9 +1030,17 _at__at_
 	}
 	if (resource_long_value(name, unit, "irq", &value) == 0) {
 	    if (acpi_match_resource_hint(child, SYS_RES_IRQ, value))
+	    {
+		if (debug)
+		    printf(" irq ok");
 		matches++;
+	    }
 	    else
+	    {
+		if (debug)
+		    printf(" bad irq\n");
 		continue;
+	    }
 	}
 	if (resource_long_value(name, unit, "drq", &value) == 0) {
 	    if (acpi_match_resource_hint(child, SYS_RES_DRQ, value))
_at__at_ -1023,6 +1049,8 _at__at_
 		continue;
 	}
 
+	if (debug)
+	    printf(" matches %d\n", matches);
 	if (matches > 0) {
 	    /* We have a winner! */
 	    *unitp = unit;

-- 
John Baldwin
Received on Thu Feb 12 2009 - 13:36:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:42 UTC