From owner-freebsd-bugs Tue Jul 13 14:50: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id E49F315042 for ; Tue, 13 Jul 1999 14:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id OAA40700; Tue, 13 Jul 1999 14:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from shidahara1.planet.sci.kobe-u.ac.jp (shidahara1.planet.sci.kobe-u.ac.jp [133.30.50.200]) by hub.freebsd.org (Postfix) with ESMTP id 108DA15195 for ; Tue, 13 Jul 1999 14:44:45 -0700 (PDT) (envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp) Received: from libr.scitec.kobe-u.ac.jp (cs22225.ppp.infoweb.ne.jp [202.219.171.41]) by shidahara1.planet.sci.kobe-u.ac.jp (8.8.8+2.7Wbeta7/8.8.8) with ESMTP id GAA25016 for ; Wed, 14 Jul 1999 06:34:38 +0900 (JST) Received: (from takawata@localhost) by libr.scitec.kobe-u.ac.jp (8.9.1/3.5Wpl7) id GAA00945; Wed, 14 Jul 1999 06:42:39 +0900 (JST) Message-Id: <199907132142.GAA00945@libr.scitec.kobe-u.ac.jp> Date: Wed, 14 Jul 1999 06:42:39 +0900 (JST) From: Takanori Watanabe Reply-To: takawata@shidahara1.planet.sci.kobe-u.ac.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/12631: intpm driver update Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 12631 >Category: kern >Synopsis: intpm driver update >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Jul 13 14:50:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Takanori Watanabe >Release: FreeBSD 4.0-CURRENT >Organization: Kobe Universitiy >Environment: FreeBSD/i386 4.0-CURRENTFreeBSD/i386 >Description: When any driver is on smbus and the code probe with polling code in intpm driver,intrrupt handler of intpm driver is infinitely called when all device probe is finished. >How-To-Repeat: Use with my experimental driver code,depend on mother board. >Fix: --- /home/ctm/src/sys/pci/intpm.c Tue May 11 10:23:15 1999 +++ intpm.c Fri Jun 4 00:58:03 1999 @@ -244,16 +244,18 @@ return 1; } - if(sc->isbusy&&(status&(PIIX4_SMBHSTSTAT_INTR| + if(status&(PIIX4_SMBHSTSTAT_INTR| PIIX4_SMBHSTSTAT_ERR| PIIX4_SMBHSTSTAT_BUSC| - PIIX4_SMBHSTSTAT_FAIL))){ + PIIX4_SMBHSTSTAT_FAIL)){ int tmp; - sc->isbusy=0; tmp=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTCNT); bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCNT, tmp&~PIIX4_SMBHSTCNT_INTREN); - wakeup(sc); + if(sc->isbusy){ + sc->isbusy=0; + wakeup(sc); + } return 0; } return 1;/* Not Completed*/ @@ -347,6 +349,7 @@ intsmb_stop_poll(device_t dev){ int error,i; struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev); + /* * In smbtx driver ,Simply waiting. * This loops 100-200 times. @@ -371,7 +374,13 @@ return error; } } - sc->isbusy=0; + { + int tmp; + sc->isbusy=0; + tmp=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTCNT); + bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCNT, + tmp&~PIIX4_SMBHSTCNT_INTREN); + } return EIO; } /* @@ -742,6 +751,7 @@ { struct _pcsid *ep =pci_ids; u_int32_t device_id=pci_get_devid(dev); + while (ep->type && ep->type != device_id) ++ep; if(ep->desc!=NULL){ @@ -759,6 +769,7 @@ sc=(struct intpm_pci_softc *)arg; intsmb_intr(sc->smbus); intsmb_slvintr(sc->smbus); + } #endif /* NPCI > 0 */ #endif >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message