From owner-svn-src-stable@FreeBSD.ORG Tue Nov 17 14:47:40 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D56141065670; Tue, 17 Nov 2009 14:47:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9F798FC15; Tue, 17 Nov 2009 14:47:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAHEleO5013801; Tue, 17 Nov 2009 14:47:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAHEle3b013799; Tue, 17 Nov 2009 14:47:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200911171447.nAHEle3b013799@svn.freebsd.org> From: Alexander Motin Date: Tue, 17 Nov 2009 14:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199384 - stable/8/sys/dev/ahci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 17 Nov 2009 14:47:40 -0000 Author: mav Date: Tue Nov 17 14:47:40 2009 New Revision: 199384 URL: http://svn.freebsd.org/changeset/base/199384 Log: MFC r196907: To save small bit of CPU time, hide part of SNTF register read latency behind other reads. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Tue Nov 17 14:38:47 2009 (r199383) +++ stable/8/sys/dev/ahci/ahci.c Tue Nov 17 14:47:40 2009 (r199384) @@ -891,16 +891,12 @@ ahci_phy_check_events(device_t dev) } static void -ahci_notify_events(device_t dev) +ahci_notify_events(device_t dev, u_int32_t status) { struct ahci_channel *ch = device_get_softc(dev); struct cam_path *dpath; - u_int32_t status; int i; - status = ATA_INL(ch->r_mem, AHCI_P_SNTF); - if (status == 0) - return; ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status); if (bootverbose) device_printf(dev, "SNTF 0x%04x\n", status); @@ -948,7 +944,7 @@ ahci_ch_intr(void *data) { device_t dev = (device_t)data; struct ahci_channel *ch = device_get_softc(dev); - uint32_t istatus, cstatus, sstatus, ok, err; + uint32_t istatus, sstatus, cstatus, sntf = 0, ok, err; enum ahci_err_type et; int i, ccs, ncq_err = 0; @@ -958,8 +954,10 @@ ahci_ch_intr(void *data) return; ATA_OUTL(ch->r_mem, AHCI_P_IS, istatus); /* Read command statuses. */ - cstatus = ATA_INL(ch->r_mem, AHCI_P_CI); sstatus = ATA_INL(ch->r_mem, AHCI_P_SACT); + cstatus = ATA_INL(ch->r_mem, AHCI_P_CI); + if ((istatus & AHCI_P_IX_SDB) && (ch->caps & AHCI_CAP_SSNTF)) + sntf = ATA_INL(ch->r_mem, AHCI_P_SNTF); /* Process PHY events */ if (istatus & (AHCI_P_IX_PRC | AHCI_P_IX_PC)) ahci_phy_check_events(dev); @@ -1023,8 +1021,8 @@ ahci_ch_intr(void *data) ahci_issue_read_log(dev); } /* Process NOTIFY events */ - if ((istatus & AHCI_P_IX_SDB) && (ch->caps & AHCI_CAP_SSNTF)) - ahci_notify_events(dev); + if (sntf) + ahci_notify_events(dev, sntf); } /* Must be called with channel locked. */