Module Name: src Committed By: tsutsui Date: Sat Sep 22 14:27:24 UTC 2012
Modified Files: src/sys/dev/pci: ehci_pci.c Log Message: 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). To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/dev/pci/ehci_pci.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/dev/pci/ehci_pci.c diff -u src/sys/dev/pci/ehci_pci.c:1.56 src/sys/dev/pci/ehci_pci.c:1.57 --- src/sys/dev/pci/ehci_pci.c:1.56 Fri Jul 20 01:26:19 2012 +++ src/sys/dev/pci/ehci_pci.c Sat Sep 22 14:27:24 2012 @@ -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 @@ ehci_get_ownership(ehci_softc_t *sc, pci 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);