CVS commit: src/sys/arch/x86/include

2010-10-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Oct 26 07:54:12 UTC 2010

Modified Files:
src/sys/arch/x86/include: powernow.h

Log Message:
Remove some unused (ACPI) constants.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/include/powernow.h

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

Modified files:

Index: src/sys/arch/x86/include/powernow.h
diff -u src/sys/arch/x86/include/powernow.h:1.11 src/sys/arch/x86/include/powernow.h:1.12
--- src/sys/arch/x86/include/powernow.h:1.11	Fri Aug 20 06:34:32 2010
+++ src/sys/arch/x86/include/powernow.h	Tue Oct 26 07:54:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: powernow.h,v 1.11 2010/08/20 06:34:32 jruoho Exp $	*/
+/*	$NetBSD: powernow.h,v 1.12 2010/10/26 07:54:12 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2004 Martin V�giard.
@@ -92,12 +92,6 @@
 #define PN7_STA_SVID(x)			(((x)  40)  0x1f)
 #define PN7_STA_MVID(x)			(((x)  48)  0x1f)
 
-/*
- * ACPI ctr_val status register to powernow k7 configuration
- */
-#define PN7_ACPI_CTRL_TO_VID(x)		(((x)  5)  0x1f)
-#define PN7_ACPI_CTRL_TO_SGTC(x)	(((x)  10)  0x)
-
 /* Bitfields used by K8 */
 #define PN8_CTR_FID(x)			((x)  0x3f)
 #define PN8_CTR_VID(x)			(((x)  0x1f)  8)
@@ -123,15 +117,6 @@
 #define PN8_PSB_TO_MVS(x)		(((x)  4)  0x03)
 #define PN8_PSB_TO_BATT(x)		(((x)  6)  0x03)
 
-/* ACPI ctr_val status register to powernow k8 configuration */
-#define ACPI_PN8_CTRL_TO_FID(x)		((x)  0x3f)
-#define ACPI_PN8_CTRL_TO_VID(x)		(((x)  6)  0x1f)
-#define ACPI_PN8_CTRL_TO_VST(x)		(((x)  11)  0x1f)
-#define ACPI_PN8_CTRL_TO_MVS(x)		(((x)  18)  0x03)
-#define ACPI_PN8_CTRL_TO_PLL(x)		(((x)  20)  0x7f)
-#define ACPI_PN8_CTRL_TO_RVO(x)		(((x)  28)  0x03)
-#define ACPI_PN8_CTRL_TO_IRT(x)		(((x)  30)  0x03)
-
 #define POWERNOW_MAX_STATES		16
 
 struct powernow_state {



CVS commit: src/sys/dev/acpi

2010-10-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Oct 26 08:57:46 UTC 2010

Modified Files:
src/sys/dev/acpi: acpidevs

Log Message:
Add more identifiers for ATM chips.

Also add PNP0C32 for quickstart buttons. A driver for this comes later.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/acpi/acpidevs

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

Modified files:

Index: src/sys/dev/acpi/acpidevs
diff -u src/sys/dev/acpi/acpidevs:1.26 src/sys/dev/acpi/acpidevs:1.27
--- src/sys/dev/acpi/acpidevs:1.26	Sun Jul 25 16:23:51 2010
+++ src/sys/dev/acpi/acpidevs	Tue Oct 26 08:57:46 2010
@@ -1,4 +1,4 @@
-# $NetBSD: acpidevs,v 1.26 2010/07/25 16:23:51 jruoho Exp $
+# $NetBSD: acpidevs,v 1.27 2010/10/26 08:57:46 jruoho Exp $
 #
 # Originally extracted from:
 
@@ -139,6 +139,7 @@
 PNP0C13	Plug and Play BIOS (for non-ACPI)
 PNP0C14	WMI Mapper Device
 PNP0C15	ACPI Docking Station
+PNP0C32	ACPI Quickstart Button
 PNP0C33	ACPI Hardware Error Device
 PNP0C80	Hotplug Memory Device
 #--PCMCIA Controller Chipsets--
@@ -363,8 +364,13 @@
 PNPC001	Compaq 2400/9600 Modem (TBD)
 #  TPM chips 
 ATM1200	Atmel Trusted Platform Module
+BCM0101	Broadcom Trusted Platform Module
+BCM0102	Broadcom Trusted Platform Module
+ICO0102	Intel Trusted Platform Module
 IFX0102	Infineon Trusted Platform Module
 NSC1100	NSC Trusted Platform Module
+NSC1200	NSC Trusted Platform Module
+PNP0C31	Trusted Platform Module
 # * ACPI specific devices *
 ACPI0001	SMBus 1.0 Host Controller
 ACPI0002	Smart Battery Subsystem



CVS commit: src/sys/dev/acpi

2010-10-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Oct 26 08:59:06 UTC 2010

Modified Files:
src/sys/dev/acpi: acpidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/acpi/acpidevs_data.h

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

Modified files:

Index: src/sys/dev/acpi/acpidevs_data.h
diff -u src/sys/dev/acpi/acpidevs_data.h:1.19 src/sys/dev/acpi/acpidevs_data.h:1.20
--- src/sys/dev/acpi/acpidevs_data.h:1.19	Wed Jun 16 06:19:16 2010
+++ src/sys/dev/acpi/acpidevs_data.h	Tue Oct 26 08:59:06 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: acpidevs_data.h,v 1.19 2010/06/16 06:19:16 jruoho Exp $	*/
+/*	$NetBSD: acpidevs_data.h,v 1.20 2010/10/26 08:59:06 jruoho Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	# NetBSD: acpidevs,v 1.23 2010/06/16 06:17:48 jruoho Exp
+ *	# NetBSD: acpidevs,v 1.27 2010/10/26 08:57:46 jruoho Exp
  */
 
 const struct { const char *pnp, *str; } acpi_knowndevs[] = {
@@ -377,8 +377,16 @@
 	AT Real-Time Clock,
 	},
 	{
+	PNP0B01,
+	AT Real-Time Clock (PIIX4),
+	},
+	{
+	PNP0B02,
+	AT Real-Time Clock (Dallas Semiconductor),
+	},
+	{
 	PNP0C00,
-	Plug and Play BIOS (only created by the root enumerator),
+	Plug and Play BIOS,
 	},
 	{
 	PNP0C01,
@@ -386,11 +394,11 @@
 	},
 	{
 	PNP0C02,
-	Plug and Play motherboard register resources,
+	Motherboard Register Resources,
 	},
 	{
 	PNP0C03,
-	Plug and Play BIOS Event Notification Interrupt,
+	BIOS Event Notification Interrupt,
 	},
 	{
 	PNP0C04,
@@ -398,15 +406,15 @@
 	},
 	{
 	PNP0C05,
-	APM BIOS (Version independent),
+	APM BIOS,
 	},
 	{
 	PNP0C06,
-	Reserved for identification of early Plug and Play BIOS implementation,
+	Reserved,
 	},
 	{
 	PNP0C07,
-	Reserved for identification of early Plug and Play BIOS implementation,
+	Reserved,
 	},
 	{
 	PNP0C08,
@@ -454,7 +462,7 @@
 	},
 	{
 	PNP0C13,
-	Plug and Play BIOS (used when ACPI mode cannot be used),
+	Plug and Play BIOS (for non-ACPI),
 	},
 	{
 	PNP0C14,
@@ -465,6 +473,10 @@
 	ACPI Docking Station,
 	},
 	{
+	PNP0C32,
+	ACPI Quickstart Button,
+	},
+	{
 	PNP0C33,
 	ACPI Hardware Error Device,
 	},
@@ -1262,7 +1274,7 @@
 	},
 	{
 	PNPB00A,
-	MediaVision Pro Audio Spectrum (Trantor SCSI enabled, Thunder Chip Disabled),
+	MediaVision Pro Audio Spectrum (SCSI),
 	},
 	{
 	PNPB00B,
@@ -1274,11 +1286,11 @@
 	},
 	{
 	PNPB00D,
-	MediaVision Pro Audio Spectrum Basic (No Trantor SCSI, Thunder Chip Enabled),
+	MediaVision Pro Audio Spectrum Basic (Thunder Chip),
 	},
 	{
 	PNPB00E,
-	MediaVision Pro Audio Spectrum (Trantor SCSI enabled, Thunder Chip Enabled),
+	MediaVision Pro Audio Spectrum (SCSI, Thunder Chip),
 	},
 	{
 	PNPB00F,
@@ -1294,7 +1306,7 @@
 	},
 	{
 	PNPB019,
-	MediaVision Pro Audio Spectrum Basic (no Trantor SCSI, Thunder chip Disabled),
+	MediaVision Pro Audio Spectrum Basic,
 	},
 	{
 	PNPB020,
@@ -1329,6 +1341,18 @@
 	Atmel Trusted Platform Module,
 	},
 	{
+	BCM0101,
+	Broadcom Trusted Platform Module,
+	},
+	{
+	BCM0102,
+	Broadcom Trusted Platform Module,
+	},
+	{
+	ICO0102,
+	Intel Trusted Platform Module,
+	},
+	{
 	IFX0102,
 	Infineon Trusted Platform Module,
 	},
@@ -1337,6 +1361,14 @@
 	NSC Trusted Platform Module,
 	},
 	{
+	NSC1200,
+	NSC Trusted Platform Module,
+	},
+	{
+	PNP0C31,
+	Trusted Platform Module,
+	},
+	{
 	ACPI0001,
 	SMBus 1.0 Host Controller,
 	},
@@ -1393,6 +1425,10 @@
 	Wake Alarm Device,
 	},
 	{
+	HPQ0004,
+	Hewlett-Packard 3D DriveGuard accelerometer,
+	},
+	{
 	INT0800,
 	Intel Firmware Hub Device,
 	},



CVS commit: src/sys/dev/acpi

2010-10-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Oct 26 09:13:54 UTC 2010

Modified Files:
src/sys/dev/acpi: acpidevs

Log Message:
Add LEN0014. (And to the previous commit; a driver for this, not PNP0C32, is
possibly coming.)


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/acpi/acpidevs

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

Modified files:

Index: src/sys/dev/acpi/acpidevs
diff -u src/sys/dev/acpi/acpidevs:1.27 src/sys/dev/acpi/acpidevs:1.28
--- src/sys/dev/acpi/acpidevs:1.27	Tue Oct 26 08:57:46 2010
+++ src/sys/dev/acpi/acpidevs	Tue Oct 26 09:13:54 2010
@@ -1,4 +1,4 @@
-# $NetBSD: acpidevs,v 1.27 2010/10/26 08:57:46 jruoho Exp $
+# $NetBSD: acpidevs,v 1.28 2010/10/26 09:13:54 jruoho Exp $
 #
 # Originally extracted from:
 
@@ -389,3 +389,4 @@
 #  Others 
 HPQ0004	Hewlett-Packard 3D DriveGuard accelerometer
 INT0800	Intel Firmware Hub Device
+LEN0014	Lenovo ThinkPad Extras
\ No newline at end of file



CVS commit: src/sys/nfs

2010-10-26 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Tue Oct 26 11:44:53 UTC 2010

Modified Files:
src/sys/nfs: nfs_vnops.c

Log Message:
Add diagnostic check which hits when PR 42455 is reproduced.
Idea from hans@


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/sys/nfs/nfs_vnops.c

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

Modified files:

Index: src/sys/nfs/nfs_vnops.c
diff -u src/sys/nfs/nfs_vnops.c:1.284 src/sys/nfs/nfs_vnops.c:1.285
--- src/sys/nfs/nfs_vnops.c:1.284	Thu Jun 24 13:03:17 2010
+++ src/sys/nfs/nfs_vnops.c	Tue Oct 26 11:44:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_vnops.c,v 1.284 2010/06/24 13:03:17 hannken Exp $	*/
+/*	$NetBSD: nfs_vnops.c,v 1.285 2010/10/26 11:44:53 cegger Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_vnops.c,v 1.284 2010/06/24 13:03:17 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_vnops.c,v 1.285 2010/10/26 11:44:53 cegger Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_nfs.h
@@ -1378,6 +1378,14 @@
 		if (v3) {
 			wccflag = NFSV3_WCCCHK;
 			nfsm_wcc_data(vp, wccflag, NAC_NOTRUNC, !error);
+
+			/* Diagnostic check: The KASSERT hits when PR 42455
+			 * is reproduced.
+			 */
+			if (ctx.nwc_mbufcount = 2) {
+KASSERT(mb-m_next != NULL);
+			}
+
 			if (!error) {
 nfsm_dissect(tl, u_int32_t *, 2 * NFSX_UNSIGNED
 	+ NFSX_V3WRITEVERF);



CVS commit: src/sys/dev/acpi

2010-10-26 Thread Grégoire Sutre
Module Name:src
Committed By:   gsutre
Date:   Tue Oct 26 22:27:44 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi_display.c acpi_pci.c acpi_verbose.c acpivar.h

Log Message:
An _ADR object is not required for PCI root bridges.  To solve
this, the structure acpi_pciinfo now tells whether the ACPI
device node is a PCI bridge, a regular PCI device, or both.

Problem reported by jmcneill@, who also suggested the solution.

ok jmcneill@, jruoho@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/acpi/acpi_display.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/acpi/acpi_pci.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/acpi/acpi_verbose.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/acpi/acpivar.h

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

Modified files:

Index: src/sys/dev/acpi/acpi_display.c
diff -u src/sys/dev/acpi/acpi_display.c:1.2 src/sys/dev/acpi/acpi_display.c:1.3
--- src/sys/dev/acpi/acpi_display.c:1.2	Mon Oct 25 17:06:58 2010
+++ src/sys/dev/acpi/acpi_display.c	Tue Oct 26 22:27:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_display.c,v 1.2 2010/10/25 17:06:58 jruoho Exp $	*/
+/*	$NetBSD: acpi_display.c,v 1.3 2010/10/26 22:27:44 gsutre Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_display.c,v 1.2 2010/10/25 17:06:58 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_display.c,v 1.3 2010/10/26 22:27:44 gsutre Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -406,7 +406,9 @@
 		return 0;
 
 	ap = ad-ad_pciinfo;
-	if ((ap == NULL) || (ap-ap_function == 0x))
+	if ((ap == NULL) ||
+	!(ap-ap_flags  ACPI_PCI_INFO_DEVICE) ||
+	(ap-ap_function == 0x))
 		return 0;
 
 	KASSERT(ap-ap_bus  256  ap-ap_device  32  ap-ap_function  8);

Index: src/sys/dev/acpi/acpi_pci.c
diff -u src/sys/dev/acpi/acpi_pci.c:1.15 src/sys/dev/acpi/acpi_pci.c:1.16
--- src/sys/dev/acpi/acpi_pci.c:1.15	Fri Sep 24 07:48:59 2010
+++ src/sys/dev/acpi/acpi_pci.c	Tue Oct 26 22:27:44 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci.c,v 1.15 2010/09/24 07:48:59 gsutre Exp $ */
+/* $NetBSD: acpi_pci.c,v 1.16 2010/10/26 22:27:44 gsutre Exp $ */
 
 /*
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_pci.c,v 1.15 2010/09/24 07:48:59 gsutre Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_pci.c,v 1.16 2010/10/26 22:27:44 gsutre Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -158,6 +158,10 @@
  *	PCI device if it has an ancestor that is a PCI root bridge and such
  *	that all intermediate nodes are PCI-to-PCI bridges.  Depth-first
  *	recursive implementation.
+ *
+ *	PCI root bridges do not necessarily contain an _ADR, since they already
+ *	contain an _HID (ACPI 4.0a, p. 197).  However we require an _ADR for
+ *	all non-root PCI devices.
  */
 ACPI_STATUS
 acpi_pcidev_scan(struct acpi_devnode *ad)
@@ -169,16 +173,14 @@
 
 	ad-ad_pciinfo = NULL;
 
-	if (ad-ad_devinfo-Type != ACPI_TYPE_DEVICE ||
-	!(ad-ad_devinfo-Valid  ACPI_VALID_ADR))
-		goto rec;
-
 	/*
 	 * We attach PCI information only to devices that are present,
 	 * enabled, and functioning properly.
 	 * Note: there is a possible race condition, because _STA may
 	 * have changed since ad-ad_devinfo-CurrentStatus was set.
 	 */
+	if (ad-ad_devinfo-Type != ACPI_TYPE_DEVICE)
+		goto rec;
 	if ((ad-ad_devinfo-Valid  ACPI_VALID_STA) != 0 
 	(ad-ad_devinfo-CurrentStatus  ACPI_STA_OK) != ACPI_STA_OK)
 		goto rec;
@@ -201,29 +203,43 @@
 		if (ACPI_SUCCESS(rv))
 			ap-ap_segment = ACPI_LOWORD(val);
 
-		/* Try to get bus number using _CRS first. */
-		rv = acpi_pcidev_pciroot_bus(ad-ad_handle, ap-ap_bus);
+		/* Try to get downstream bus number using _CRS first. */
+		rv = acpi_pcidev_pciroot_bus(ad-ad_handle, ap-ap_downbus);
 
 		if (ACPI_FAILURE(rv)) {
 			rv = acpi_eval_integer(ad-ad_handle, _BBN, val);
 
 			if (ACPI_SUCCESS(rv))
-ap-ap_bus = ACPI_LOWORD(val);
+ap-ap_downbus = ACPI_LOWORD(val);
 		}
 
-		ap-ap_device = ACPI_HILODWORD(ad-ad_devinfo-Address);
-		ap-ap_function = ACPI_LOLODWORD(ad-ad_devinfo-Address);
-
-		if (ap-ap_bus  255 || ap-ap_device  31 ||
-		(ap-ap_function  7  ap-ap_function != 0x)) {
+		if (ap-ap_downbus  255) {
 			aprint_error_dev(ad-ad_root,
-			invalid PCI address for %s\n, ad-ad_name);
+			invalid PCI downstream bus for %s\n, ad-ad_name);
 			kmem_free(ap, sizeof(*ap));
 			goto rec;
 		}
 
-		ap-ap_bridge = true;
-		ap-ap_downbus = ap-ap_bus;
+		ap-ap_flags |= ACPI_PCI_INFO_BRIDGE;
+
+		/*
+		 * This ACPI node denotes a PCI root bridge, but it may also
+		 * denote a PCI device on the bridge's downstream bus segment.
+		 */
+		if (ad-ad_devinfo-Valid  ACPI_VALID_ADR) {
+			ap-ap_bus = ap-ap_downbus;
+			ap-ap_device =
+			ACPI_HILODWORD(ad-ad_devinfo-Address);
+			ap-ap_function =
+			ACPI_LOLODWORD(ad-ad_devinfo-Address);
+
+			if