From owner-svn-src-stable@freebsd.org Mon Aug 8 15:07:39 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E277BB2D75; Mon, 8 Aug 2016 15:07:39 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F7BB1303; Mon, 8 Aug 2016 15:07:39 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u78F7c5c026484; Mon, 8 Aug 2016 15:07:38 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u78F7cYB026482; Mon, 8 Aug 2016 15:07:38 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201608081507.u78F7cYB026482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 8 Aug 2016 15:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r303835 - in stable/11: sys/dev/pci usr.sbin/pciconf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2016 15:07:39 -0000 Author: vangyzen Date: Mon Aug 8 15:07:38 2016 New Revision: 303835 URL: https://svnweb.freebsd.org/changeset/base/303835 Log: MFC r303788 Fix some logic in PCIe HotPlug; display EI status The interpretation of the Electromechanical Interlock Status was inverted, so we disengaged the EI if a card was inserted. Fix it to engage the EI if a card is inserted. When displaying the slot capabilites/status with pciconf: - We inverted the sense of the Power Controller Control bit, saying the power was off when it was really on (according to this bit). Fix that. - Display the status of the Electromechanical Interlock: EI(engaged) EI(disengaged) Approved by: re (gjb) Sponsored by: Dell Inc. Modified: stable/11/sys/dev/pci/pci_pci.c stable/11/usr.sbin/pciconf/cap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/pci/pci_pci.c ============================================================================== --- stable/11/sys/dev/pci/pci_pci.c Mon Aug 8 13:52:18 2016 (r303834) +++ stable/11/sys/dev/pci/pci_pci.c Mon Aug 8 15:07:38 2016 (r303835) @@ -1057,7 +1057,7 @@ static void pcib_pcie_hotplug_update(struct pcib_softc *sc, uint16_t val, uint16_t mask, bool schedule_task) { - bool card_inserted; + bool card_inserted, ei_engaged; /* Clear DETACHING if Present Detect has cleared. */ if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) == @@ -1094,8 +1094,8 @@ pcib_pcie_hotplug_update(struct pcib_sof */ if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_EIP) { mask |= PCIEM_SLOT_CTL_EIC; - if (card_inserted != - !(sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS)) + ei_engaged = (sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS) != 0; + if (card_inserted != ei_engaged) val |= PCIEM_SLOT_CTL_EIC; } @@ -1122,7 +1122,7 @@ pcib_pcie_hotplug_update(struct pcib_sof pcib_pcie_hotplug_command(sc, val, mask); /* - * During attach the child "pci" device is added sychronously; + * During attach the child "pci" device is added synchronously; * otherwise, the task is scheduled to manage the child * device. */ Modified: stable/11/usr.sbin/pciconf/cap.c ============================================================================== --- stable/11/usr.sbin/pciconf/cap.c Mon Aug 8 13:52:18 2016 (r303834) +++ stable/11/usr.sbin/pciconf/cap.c Mon Aug 8 15:07:38 2016 (r303835) @@ -529,10 +529,13 @@ cap_express(int fd, struct pci_conf *p, if (cap & PCIEM_SLOT_CAP_APB) printf(" Attn Button"); if (cap & PCIEM_SLOT_CAP_PCP) - printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "on" : "off"); + printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "off" : "on"); if (cap & PCIEM_SLOT_CAP_MRLSP) printf(" MRL(%s)", sta & PCIEM_SLOT_STA_MRLSS ? "open" : "closed"); + if (cap & PCIEM_SLOT_CAP_EIP) + printf(" EI(%s)", sta & PCIEM_SLOT_STA_EIS ? "engaged" : + "disengaged"); } static void