NetBSD Problem Report #43765

From www@NetBSD.org  Sun Aug 15 17:15:01 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 0663363BBEB
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 15 Aug 2010 17:15:01 +0000 (UTC)
Message-Id: <20100815171500.56CFB63BBBD@www.NetBSD.org>
Date: Sun, 15 Aug 2010 17:15:00 +0000 (UTC)
From: scotte@warped.com
Reply-To: scotte@warped.com
To: gnats-bugs@NetBSD.org
Subject: acpicpu causes ichlpcib0: can't map power management i/o space
X-Send-Pr-Version: www-1.0

>Number:         43765
>Category:       kern
>Synopsis:       acpicpu causes ichlpcib0: can't map power management i/o space
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jruoho
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 15 17:20:00 +0000 2010
>Closed-Date:    Fri Aug 27 03:06:00 +0000 2010
>Last-Modified:  Fri Aug 27 03:10:02 +0000 2010
>Originator:     Scott Ellis
>Release:        amd64-current (5.99.38)
>Organization:
>Environment:
NetBSD intrepid 5.99.38 NetBSD 5.99.38 (INTREPID.P5W) #7: Sun Aug 15 10:02:39 PDT 2010  scotte@intrepid:/nbu/source/netbsd/src/obj.amd64/nbu/source/netbsd/src/sys/arch/amd64/compile/INTREPID.P5W amd64

>Description:
Enabling 'acpicpu' on my server causes the ichlpcib0 to not be configured properly (specifically, the Watchdog support is not present...I didn't check hpet and other items).

Without acpicpu:
...
exphy0 at ex0 phy 24: 3Com internal media interface
exphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ichlpcib0 at pci0 dev 31 function 0: vendor 0x8086 product 0x27b8 (rev. 0x01)
timecounter: Timecounter "ichlpcib0" frequency 3579545 Hz quality 1000
ichlpcib0: 24-bit timer
ichlpcib0: TCO (watchdog) timer configured.
piixide0 at pci0 dev 31 function 1: Intel 82801GB/GR IDE Controller (ICH7) (rev.
 0x01)
...


With acpicpu:
...
exphy0 at ex0 phy 24: 3Com internal media interface
exphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ichlpcib0 at pci0 dev 31 function 0: vendor 0x8086 product 0x27b8 (rev. 0x01)
ichlpcib0: can't map power management i/o spacepiixide0 at pci0 dev 31 function
1: Intel 82801GB/GR IDE Controller (ICH7) (rev. 0x01)
piixide0: bus-master DMA support present
...


>How-To-Repeat:
In kernel configuration, add:
acpicpu*       at acpi?                # ACPI CPU

>Fix:

>Release-Note:

>Audit-Trail:
From: Jukka Ruohonen <jruohonen@iki.fi>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/43765: acpicpu causes ichlpcib0: can't map power management i/o space
Date: Sun, 15 Aug 2010 21:11:54 +0300

 > Enabling 'acpicpu' on my server causes the ichlpcib0 to not be configured
 > properly (specifically, the Watchdog support is not present...I didn't
 > check hpet and other items).

 This is a known issue; ichlpcib(4) wrongly maps space that belongs to ACPI
 CPU (or vice versa). This will be dealt with before 6.0. In the meanwhile,
 you can use the following patch.

 Index: acpi_cpu.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/acpi/acpi_cpu.c,v
 retrieving revision 1.16
 diff -u -p -r1.16 acpi_cpu.c
 --- acpi_cpu.c	14 Aug 2010 11:16:14 -0000	1.16
 +++ acpi_cpu.c	15 Aug 2010 18:06:50 -0000
 @@ -116,7 +116,6 @@ acpicpu_attach(device_t parent, device_t

  	sc->sc_dev = self;
  	sc->sc_cold = false;
 -	sc->sc_mapped = false;
  	sc->sc_iot = aa->aa_iot;
  	sc->sc_node = aa->aa_node;
  	sc->sc_cpuid = acpicpu_id(sc->sc_object.ao_procid);
 @@ -141,20 +140,6 @@ acpicpu_attach(device_t parent, device_t
  	aprint_naive("\n");
  	aprint_normal(": ACPI CPU\n");

 -	/*
 -	 * We should claim the bus space. However, we do this only
 -	 * to announce that the space is in use. As is noted in
 -	 * ichlpcib(4), we can continue our I/O without bus_space(9).
 -	 */
 -	if (sc->sc_object.ao_pblklen == 6 && sc->sc_object.ao_pblkaddr != 0) {
 -
 -		rv = bus_space_map(sc->sc_iot, sc->sc_object.ao_pblkaddr,
 -		    sc->sc_object.ao_pblklen, 0, &sc->sc_ioh);
 -
 -		if (rv == 0)
 -			sc->sc_mapped = true;
 -	}
 -
  	acpicpu_cstate_attach(self);
  	acpicpu_pstate_attach(self);
  	acpicpu_tstate_attach(self);
 @@ -174,7 +159,6 @@ static int
  acpicpu_detach(device_t self, int flags)
  {
  	struct acpicpu_softc *sc = device_private(self);
 -	const bus_addr_t addr = sc->sc_object.ao_pblkaddr;
  	static ONCE_DECL(once_detach);
  	int rv = 0;

 @@ -204,9 +188,6 @@ acpicpu_detach(device_t self, int flags)
  	if (rv != 0)
  		return rv;

 -	if (sc->sc_mapped != false)
 -		bus_space_unmap(sc->sc_iot, sc->sc_ioh, addr);
 -
  	mutex_destroy(&sc->sc_mtx);

  	return 0;
 Index: acpi_cpu.h
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/acpi/acpi_cpu.h,v
 retrieving revision 1.15
 diff -u -p -r1.15 acpi_cpu.h
 --- acpi_cpu.h	14 Aug 2010 05:13:21 -0000	1.15
 +++ acpi_cpu.h	15 Aug 2010 18:06:50 -0000
 @@ -189,7 +189,6 @@ struct acpicpu_softc {
  	uint32_t		 sc_flags;
  	cpuid_t			 sc_cpuid;
  	bool			 sc_cold;
 -	bool			 sc_mapped;
  };

  void		acpicpu_cstate_attach(device_t);

Responsible-Changed-From-To: kern-bug-people->jruoho
Responsible-Changed-By: jruoho@NetBSD.org
Responsible-Changed-When: Mon, 16 Aug 2010 08:19:22 +0000
Responsible-Changed-Why:
Mine.


State-Changed-From-To: open->closed
State-Changed-By: jruoho@NetBSD.org
State-Changed-When: Fri, 27 Aug 2010 03:06:00 +0000
State-Changed-Why:
Fixed.


From: Jukka Ruohonen <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43765 CVS commit: src
Date: Fri, 27 Aug 2010 03:05:27 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Fri Aug 27 03:05:26 UTC 2010

 Modified Files:
 	src/share/man/man4: acpicpu.4
 	src/sys/dev/acpi: acpi_cpu.c acpi_cpu.h

 Log Message:
 Fix PR kern/43765 from Scott Ellis.

 Note that the solution is not optimal. If ichlpcib(4) provides SpeedStep
 support, possible I/O resource conflicts may occur with acpicpu(4). Ideally,
 as noted for instance in Windows design documents, ichlpcib(4) should never
 expose SpeedStep when ACPI is being used. The probability for potential race
 conditions is however very small, being limited to few P4-era machines and
 being dependent on user actions.


 To generate a diff of this commit:
 cvs rdiff -u -r1.15 -r1.16 src/share/man/man4/acpicpu.4
 cvs rdiff -u -r1.21 -r1.22 src/sys/dev/acpi/acpi_cpu.c
 cvs rdiff -u -r1.24 -r1.25 src/sys/dev/acpi/acpi_cpu.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.