Sat Sep 22 14:27:24 2012 UTC ()
Fix PR kern/46828 (6.0_BETA2 and 6.0_RC1 won't start on DL320/G5p):
 In ehci_get_ownership(), don't explicitly clear EHCI_LEG_HC_BIOS_OWNED
 semaphore bit in the driver before asking BIOS to give up ownership.
 The EHCI spec implies that the semaphore should not be changed by
 the other agent and actually the previous one (introduced in rev 1.53
 after 5.x) caused hangup during probe on at least two HP machines
 as mentioned in the PR.  Analyzed and patch provided by Ryo ONODERA.

Should be pulled up to netbsd-6 (fatal hangup during boot).


(tsutsui)
diff -r1.56 -r1.57 src/sys/dev/pci/ehci_pci.c

cvs diff -r1.56 -r1.57 src/sys/dev/pci/ehci_pci.c (expand / switch to context diff)
--- src/sys/dev/pci/ehci_pci.c 2012/07/20 01:26:19 1.56
+++ src/sys/dev/pci/ehci_pci.c 2012/09/22 14:27:24 1.57
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci_pci.c,v 1.56 2012/07/20 01:26:19 uwe Exp $	*/
+/*	$NetBSD: ehci_pci.c,v 1.57 2012/09/22 14:27:24 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.56 2012/07/20 01:26:19 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.57 2012/09/22 14:27:24 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -395,10 +395,8 @@
 		legsup = pci_conf_read(pc, tag, addr + PCI_EHCI_USBLEGSUP);
 		if (legsup & EHCI_LEG_HC_BIOS_OWNED) {
 			/* Ask BIOS to give up ownership */
-			legsup &= ~EHCI_LEG_HC_BIOS_OWNED;
-			legsup |= EHCI_LEG_HC_OS_OWNED;
 			pci_conf_write(pc, tag, addr + PCI_EHCI_USBLEGSUP,
-			    legsup);
+			    legsup | EHCI_LEG_HC_OS_OWNED);
 			for (ms = 0; ms < EHCI_MAX_BIOS_WAIT; ms++) {
 				legsup = pci_conf_read(pc, tag,
 				    addr + PCI_EHCI_USBLEGSUP);