From owner-svn-src-stable@FreeBSD.ORG Wed Dec 9 13:27:06 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 B6E431065670; Wed, 9 Dec 2009 13:27:06 +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 A55098FC15; Wed, 9 Dec 2009 13:27:06 +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 nB9DR6wr026438; Wed, 9 Dec 2009 13:27:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9DR6TF026436; Wed, 9 Dec 2009 13:27:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912091327.nB9DR6TF026436@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Dec 2009 13:27:06 +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: r200292 - 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: Wed, 09 Dec 2009 13:27:06 -0000 Author: mav Date: Wed Dec 9 13:27:06 2009 New Revision: 200292 URL: http://svn.freebsd.org/changeset/base/200292 Log: MFC r200196: Add Asynchronous Notification support for controllers without SNTF capability by snooping SDB FIS receive area. It should be even faster then regular way, but less reliable. 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 Wed Dec 9 13:10:10 2009 (r200291) +++ stable/8/sys/dev/ahci/ahci.c Wed Dec 9 13:27:06 2009 (r200292) @@ -1129,7 +1129,8 @@ ahci_notify_events(device_t dev, u_int32 struct cam_path *dpath; int i; - ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status); + if (ch->caps & AHCI_CAP_SSNTF) + ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status); if (bootverbose) device_printf(dev, "SNTF 0x%04x\n", status); for (i = 0; i < 16; i++) { @@ -1188,8 +1189,16 @@ ahci_ch_intr(void *data) /* Read command statuses. */ 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); + if (istatus & AHCI_P_IX_SDB) { + if (ch->caps & AHCI_CAP_SSNTF) + sntf = ATA_INL(ch->r_mem, AHCI_P_SNTF); + else { + u_int8_t *fis = ch->dma.rfis + 0x58; + + if (fis[1] & 0x80) + sntf = (1 << (fis[1] & 0x0f)); + } + } /* Process PHY events */ if (istatus & (AHCI_P_IX_PC | AHCI_P_IX_PRC | AHCI_P_IX_OF | AHCI_P_IX_IF | AHCI_P_IX_HBD | AHCI_P_IX_HBF | AHCI_P_IX_TFE)) {