From owner-svn-src-all@FreeBSD.ORG Mon Mar 16 16:15:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C31921065697; Mon, 16 Mar 2009 16:15:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96FBF8FC15; Mon, 16 Mar 2009 16:15:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2GGFEtn065282; Mon, 16 Mar 2009 16:15:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2GGFERX065281; Mon, 16 Mar 2009 16:15:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200903161615.n2GGFERX065281@svn.freebsd.org> From: Andriy Gapon Date: Mon, 16 Mar 2009 16:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189882 - head/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2009 16:15:16 -0000 Author: avg Date: Mon Mar 16 16:15:14 2009 New Revision: 189882 URL: http://svn.freebsd.org/changeset/base/189882 Log: intpm: minor enhancements 1. fix nointr check in intsmb_start, matters only if ENABLE_ALART is defined (by default, it is not); 2. drop unnecessary inspection/reporting of power-management io registers base address; 3. in verbose mode report errors from SMBus host controller and their mapping to smbus(4) errors; Approved by: jhb (mentor) Modified: head/sys/pci/intpm.c Modified: head/sys/pci/intpm.c ============================================================================== --- head/sys/pci/intpm.c Mon Mar 16 16:14:26 2009 (r189881) +++ head/sys/pci/intpm.c Mon Mar 16 16:15:14 2009 (r189882) @@ -167,10 +167,6 @@ intsmb_attach(device_t dev) goto fail; } - value = pci_read_config(dev, PCI_BASE_ADDR_PM, 4); - device_printf(dev, "PM %s %x\n", (value & 1) ? "I/O mapped" : "Memory", - value & 0xfffe); - sc->isbusy = 0; sc->smbus = device_add_child(dev, "smbus", -1); if (sc->smbus == NULL) { @@ -365,13 +361,13 @@ intsmb_start(struct intsmb_softc *sc, un tmp |= PIIX4_SMBHSTCNT_START; /* While not in autoconfiguration enable interrupts. */ - if (!cold || !nointr) + if (!cold && !nointr) tmp |= PIIX4_SMBHSTCNT_INTREN; bus_write_1(sc->io_res, PIIX4_SMBHSTCNT, tmp); } static int -intsmb_error(int status) +intsmb_error(device_t dev, int status) { int error = 0; @@ -381,6 +377,10 @@ intsmb_error(int status) error |= SMB_ECOLLI; if (status & PIIX4_SMBHSTSTAT_FAIL) error |= SMB_ENOACK; + + if (error != 0 && bootverbose) + device_printf(dev, "error = %d, status = %#x\n", error, status); + return (error); } @@ -410,7 +410,7 @@ intsmb_stop_poll(struct intsmb_softc *sc status = bus_read_1(sc->io_res, PIIX4_SMBHSTSTS); if (!(status & PIIX4_SMBHSTSTAT_BUSY)) { sc->isbusy = 0; - error = intsmb_error(status); + error = intsmb_error(sc->dev, status); if (error == 0 && !(status & PIIX4_SMBHSTSTAT_INTR)) device_printf(sc->dev, "unknown cause why?\n"); return (error); @@ -442,7 +442,7 @@ intsmb_stop(struct intsmb_softc *sc) if (error == 0) { status = bus_read_1(sc->io_res, PIIX4_SMBHSTSTS); if (!(status & PIIX4_SMBHSTSTAT_BUSY)) { - error = intsmb_error(status); + error = intsmb_error(sc->dev, status); if (error == 0 && !(status & PIIX4_SMBHSTSTAT_INTR)) device_printf(sc->dev, "unknown cause why?\n"); #ifdef ENABLE_ALART