From owner-svn-src-head@freebsd.org Fri Sep 1 09:48:20 2017 Return-Path: Delivered-To: svn-src-head@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 3F78EE0114E; Fri, 1 Sep 2017 09:48:20 +0000 (UTC) (envelope-from mav@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 07B846A813; Fri, 1 Sep 2017 09:48:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v819mJB6031220; Fri, 1 Sep 2017 09:48:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v819mJ8R031219; Fri, 1 Sep 2017 09:48:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201709010948.v819mJ8R031219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 1 Sep 2017 09:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323084 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 323084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Sep 2017 09:48:20 -0000 Author: mav Date: Fri Sep 1 09:48:19 2017 New Revision: 323084 URL: https://svnweb.freebsd.org/changeset/base/323084 Log: Link Interface has no Link Error registers. MFC after: 13 days Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Fri Sep 1 07:10:01 2017 (r323083) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Fri Sep 1 09:48:19 2017 (r323084) @@ -231,6 +231,9 @@ ntb_plx_isr(void *arg) ntb_db_event((device_t)arg, 0); + if (sc->link) /* Link Interface has no Link Error registers. */ + return; + val = NTX_READ(sc, 0xfe0); if (val == 0) return; @@ -275,8 +278,11 @@ ntb_plx_setup_intr(device_t dev) device_printf(dev, "bus_setup_intr failed: %d\n", error); return (error); } - NTX_WRITE(sc, 0xfe0, 0xf); /* Clear link interrupts. */ - NTX_WRITE(sc, 0xfe4, 0x0); /* Unmask link interrupts. */ + + if (!sc->link) { /* Link Interface has no Link Error registers. */ + NTX_WRITE(sc, 0xfe0, 0xf); /* Clear link interrupts. */ + NTX_WRITE(sc, 0xfe4, 0x0); /* Unmask link interrupts. */ + } return (0); } @@ -285,7 +291,9 @@ ntb_plx_teardown_intr(device_t dev) { struct ntb_plx_softc *sc = device_get_softc(dev); - NTX_WRITE(sc, 0xfe4, 0xf); /* Mask link interrupts. */ + if (!sc->link) /* Link Interface has no Link Error registers. */ + NTX_WRITE(sc, 0xfe4, 0xf); /* Mask link interrupts. */ + if (sc->int_res) { bus_teardown_intr(dev, sc->int_res, sc->int_tag); bus_release_resource(dev, SYS_RES_IRQ, sc->int_rid,