From zozo@z.gid0.org  Fri Aug 22 13:01:47 2008
Return-Path: <zozo@z.gid0.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA308106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Aug 2008 13:01:47 +0000 (UTC)
	(envelope-from zozo@z.gid0.org)
Received: from postfix1-g20.free.fr (postfix1-g20.free.fr [212.27.60.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 3572C8FC22
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Aug 2008 13:01:47 +0000 (UTC)
	(envelope-from zozo@z.gid0.org)
Received: from smtp7-g19.free.fr (smtp7-g19.free.fr [212.27.42.64])
	by postfix1-g20.free.fr (Postfix) with ESMTP id 61D8C29ADBD4
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Aug 2008 14:42:57 +0200 (CEST)
Received: from smtp7-g19.free.fr (localhost [127.0.0.1])
	by smtp7-g19.free.fr (Postfix) with ESMTP id 2460BB017B
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Aug 2008 14:42:55 +0200 (CEST)
Received: from z.gid0.org (s.gid0.org [88.163.116.140])
	by smtp7-g19.free.fr (Postfix) with ESMTP id AC788B019E
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 22 Aug 2008 14:42:54 +0200 (CEST)
Received: (from zozo@localhost)
	by z.gid0.org (8.14.2/8.14.2/Submit) id m7MCgpVW060842;
	Fri, 22 Aug 2008 14:42:51 +0200 (CEST)
	(envelope-from zozo)
Message-Id: <200808221242.m7MCgpVW060842@z.gid0.org>
Date: Fri, 22 Aug 2008 14:42:51 +0200 (CEST)
From: Olivier Smedts <olivier@gid0.org>
Reply-To: Olivier Smedts <olivier@gid0.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [ichwd] [patch] ICH10 support
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         126736
>Category:       kern
>Synopsis:       [ichwd] [patch] ICH10 support
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jhb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 22 13:10:02 UTC 2008
>Closed-Date:    Mon Sep 29 15:41:36 UTC 2008
>Last-Modified:  Mon Sep 29 15:41:36 UTC 2008
>Originator:     Olivier Smedts
>Release:        FreeBSD 7.0-STABLE amd64
>Organization:
<gid0.org>
>Environment:
System: FreeBSD z.gid0.org 7.0-STABLE FreeBSD 7.0-STABLE #0: Thu Aug 21 23:17:33 CEST 2008 root@z.gid0.org:/work/obj/work/src/sys/QUAD amd64

Hardware : ASUS P5Q3 Deluxe motherboard, with Intel Core 2 Quad Q9450 CPU.

GENERIC-like kernel, with the following modules :
# kldstat 
Id Refs Address            Size     Name
 1   11 0xffffffff80100000 5df4f8   kernel
 2    1 0xffffffff806e0000 1a880    snd_hda.ko
 3    2 0xffffffff806fb000 67458    sound.ko
 4    1 0xffffffff80763000 4f78     ichsmb.ko
 5    2 0xffffffff80768000 24a0     smbus.ko
 6    1 0xffffffff8076b000 3508     ichwd.ko
 7    1 0xffffffff8076f000 2d10     acpi_aiboost.ko
 8    1 0xffffffffb0d99000 4ba1     tmpfs.ko
 9    1 0xffffffffb0e1b000 4976     if_lagg.ko

>Description:
I patched ichwd.c and ichwd.h to have a hardware watchdog support on my ICH10-based motherboard.
Patch contents :
- tab-ify
- sort
- add support for various ICH chipsets, pci ids 0x24dc, 0x27b0, 0x2811, 0x2919, 0x2917 (vendor 0x8086)
- add support for ICH10 and ICH10-based chipsets, pci ids 0x3a18, 0x3a1a, 0x3a14, 0x3a1 (vendor 0x8086)

IDs found in Intel ICH chipsets Windows drivers (.inf).

>How-To-Repeat:

The patch has been tested on ICH10R hardware.

dmesg output after verbose boot with the patched ichwd.ko module loaded (ichwd0 not detected without patch) :
Aug 20 23:26:26 z kernel: ichwd0: <Intel ICH10R watchdog timer> on isa0
Aug 20 23:26:26 z kernel: isab0: found ICH10 or equivalent chipset: Intel ICH10R watchdog timer
Aug 20 23:26:26 z kernel: ichwd0: Intel ICH10R watchdog timer (ICH10 or equivalent)
Aug 20 23:26:26 z kernel: ichwd0: timer disabled

dmesg output after launching watchdogd (by hand or with rc script and watchdogd_enable="YES"), still verbose mode :
Aug 20 23:26:27 z kernel: ichwd0: timer enabled
Aug 20 23:26:27 z kernel: ichwd0: timeout set to 28 ticks
Aug 20 23:26:27 z kernel: ichwd0: timer reloaded
Aug 20 23:26:27 z kernel: ichwd0: timer reloaded
Aug 20 23:26:28 z kernel: ichwd0: timer reloaded
Aug 20 23:26:34 z last message repeated 6 times
Aug 20 23:26:35 z kernel: ichwd0: timer reloaded
Aug 20 23:26:36 z kernel: ichwd0: timer reloaded
Aug 20 23:26:42 z last message repeated 6 times
Aug 20 23:26:43 z kernel: ichwd0: timer reloaded
Aug 20 23:27:05 z last message repeated 22 times
Aug 20 23:27:06 z kernel: ichwd0: timer reloaded
Aug 20 23:27:37 z last message repeated 31 times
Aug 20 23:29:38 z last message repeated 121 times

watchdogd running :
# ps auxww | grep watchdog
root    721  0,0  0,0  6816   924  ??  Ss    9:03     0:00,29 /usr/sbin/watchdogd
root  60812  0,0  0,1  7888  1192  p1  R+   14:39     0:00,00 grep watchdog

I then tested the watchdog by setting incorrect RAM timings in BIOS. A "make -j4 buildkernel" hardware froze the computer, it rebooted after 16 seconds.

>Fix:
Apply the following patch in /usr/src/. It should apply against STABLE and HEAD as they're in sync.

Thanks.

	

--- PATCH begins here ---
--- sys/dev/ichwd/ichwd.h.orig	2008-08-20 21:35:40.000000000 +0200
+++ sys/dev/ichwd/ichwd.h	2008-08-20 22:10:09.000000000 +0200
@@ -73,6 +73,7 @@
 #define DEVICEID_82801DB	0x24c0
 #define DEVICEID_82801DBM	0x24cc
 #define DEVICEID_82801E		0x2450
+#define DEVICEID_82801EB	0x24dc
 #define DEVICEID_82801EBR	0x24d0
 #define DEVICEID_6300ESB	0x25a1
 #define DEVICEID_82801FBR	0x2640
@@ -80,16 +81,24 @@
 #define DEVICEID_ICH6W		0x2642
 #define DEVICEID_63XXESB	0x2670
 #define DEVICEID_ICH7		0x27b8
+#define DEVICEID_ICH7DH		0x27b0
 #define DEVICEID_ICH7M		0x27b9
 #define DEVICEID_ICH7MDH	0x27bd
 #define DEVICEID_ICH8		0x2810
 #define DEVICEID_ICH8DH		0x2812
 #define DEVICEID_ICH8DO		0x2814
 #define DEVICEID_ICH8M		0x2815
+#define DEVICEID_ICH8ME		0x2811
 #define DEVICEID_ICH9		0x2918
-#define DEVICEID_ICH9R		0x2916
 #define DEVICEID_ICH9DH		0x2912
 #define DEVICEID_ICH9DO		0x2914
+#define DEVICEID_ICH9M		0x2919
+#define DEVICEID_ICH9ME		0x2917
+#define DEVICEID_ICH9R		0x2916
+#define DEVICEID_ICH10		0x3a18
+#define DEVICEID_ICH10D		0x3a1a
+#define DEVICEID_ICH10DO	0x3a14
+#define DEVICEID_ICH10R		0x3a16
 
 /* ICH LPC Interface Bridge Registers (ICH5 and older) */
 #define ICH_GEN_STA		0xd4
--- sys/dev/ichwd/ichwd.c.orig	2008-08-20 21:35:46.000000000 +0200
+++ sys/dev/ichwd/ichwd.c	2008-08-20 22:13:30.000000000 +0200
@@ -82,23 +82,32 @@
 	{ DEVICEID_82801DB,  "Intel 82801DB watchdog timer",	4 },
 	{ DEVICEID_82801DBM, "Intel 82801DBM watchdog timer",	4 },
 	{ DEVICEID_82801E,   "Intel 82801E watchdog timer",	5 },
-	{ DEVICEID_82801EBR, "Intel 82801EB/ER watchdog timer", 5 },
+	{ DEVICEID_82801EB,  "Intel 82801EB watchdog timer",	5 },
+	{ DEVICEID_82801EBR, "Intel 82801EB/ER watchdog timer",	5 },
 	{ DEVICEID_6300ESB,  "Intel 6300ESB watchdog timer",	5 },
-	{ DEVICEID_82801FBR, "Intel 82801FB/FR watchdog timer", 6 },
+	{ DEVICEID_82801FBR, "Intel 82801FB/FR watchdog timer",	6 },
 	{ DEVICEID_ICH6M,    "Intel ICH6M watchdog timer",	6 },
 	{ DEVICEID_ICH6W,    "Intel ICH6W watchdog timer",	6 },
 	{ DEVICEID_ICH7,     "Intel ICH7 watchdog timer",	7 },
+	{ DEVICEID_ICH7DH,   "Intel ICH7DH watchdog timer",	7 },
 	{ DEVICEID_ICH7M,    "Intel ICH7M watchdog timer",	7 },
 	{ DEVICEID_ICH7MDH,  "Intel ICH7MDH watchdog timer",	7 },
 	{ DEVICEID_ICH8,     "Intel ICH8 watchdog timer",	8 },
 	{ DEVICEID_ICH8DH,   "Intel ICH8DH watchdog timer",	8 },
 	{ DEVICEID_ICH8DO,   "Intel ICH8DO watchdog timer",	8 },
-	{ DEVICEID_ICH8M,    "Intel ICH8M watchdog timer",      8 },
+	{ DEVICEID_ICH8M,    "Intel ICH8M watchdog timer",	8 },
+	{ DEVICEID_ICH8ME,   "Intel ICH8M-E watchdog timer",	8 },
 	{ DEVICEID_63XXESB,  "Intel 63XXESB watchdog timer",	8 },
 	{ DEVICEID_ICH9,     "Intel ICH9 watchdog timer",	9 },
-	{ DEVICEID_ICH9R,    "Intel ICH9R watchdog timer",	9 },
 	{ DEVICEID_ICH9DH,   "Intel ICH9DH watchdog timer",	9 },
 	{ DEVICEID_ICH9DO,   "Intel ICH9DO watchdog timer",	9 },
+	{ DEVICEID_ICH9M,    "Intel ICH9M watchdog timer",	9 },
+	{ DEVICEID_ICH9ME,   "Intel ICH9M-E watchdog timer",	9 },
+	{ DEVICEID_ICH9R,    "Intel ICH9R watchdog timer",	9 },
+	{ DEVICEID_ICH10,    "Intel ICH10 watchdog timer",	10 },
+	{ DEVICEID_ICH10D,   "Intel ICH10D watchdog timer",	10 },
+	{ DEVICEID_ICH10DO,  "Intel ICH10DO watchdog timer",	10 },
+	{ DEVICEID_ICH10R,   "Intel ICH10R watchdog timer",	10 },
 	{ 0, NULL, 0 },
 };
 
--- PATCH ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: jhb 
State-Changed-When: Mon Aug 25 15:24:05 UTC 2008 
State-Changed-Why:  
Patch committed to HEAD. 


Responsible-Changed-From-To: freebsd-bugs->jhb 
Responsible-Changed-By: jhb 
Responsible-Changed-When: Mon Aug 25 15:24:05 UTC 2008 
Responsible-Changed-Why:  
Patch committed to HEAD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=126736 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/126736: commit references a PR
Date: Mon, 25 Aug 2008 15:24:16 +0000 (UTC)

 jhb         2008-08-25 15:23:54 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/dev/ichwd        ichwd.c ichwd.h 
   Log:
   SVN rev 182161 on 2008-08-25 15:23:54Z by jhb
   
   Add more PCI IDs including those for ICH10.
   
   PR:             kern/126736
   Submitted by:   Olivier Smedts  olivier of gid0 org
   MFC after:      1 week
   
   Revision  Changes    Path
   1.15      +13 -4     src/sys/dev/ichwd/ichwd.c
   1.9       +10 -1     src/sys/dev/ichwd/ichwd.h
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: jhb 
State-Changed-When: Mon Sep 29 15:41:12 UTC 2008 
State-Changed-Why:  
Merged to 6.x and 7.x. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=126736 
>Unformatted:
