From owner-svn-src-all@FreeBSD.ORG Sun Nov 10 23:34:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BA3FDA2F; Sun, 10 Nov 2013 23:34:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C22029A8; Sun, 10 Nov 2013 23:34:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAANYW4l090051; Sun, 10 Nov 2013 23:34:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAANYWjK090050; Sun, 10 Nov 2013 23:34:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311102334.rAANYWjK090050@svn.freebsd.org> From: Alexander Motin Date: Sun, 10 Nov 2013 23:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257930 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 10 Nov 2013 23:34:32 -0000 Author: mav Date: Sun Nov 10 23:34:32 2013 New Revision: 257930 URL: http://svnweb.freebsd.org/changeset/base/257930 Log: Some more registers access optimizations: - Process ATIO queue only if interrupt status tells so; - Do not update queue out pointers after each processed command, do it only once at the end of the loop. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Nov 10 23:00:39 2013 (r257929) +++ head/sys/dev/isp/isp.c Sun Nov 10 23:34:32 2013 (r257930) @@ -5082,7 +5082,9 @@ again: /* * Check for ATIO Queue entries. */ - if (IS_24XX(isp)) { + if (IS_24XX(isp) && + ((isr & BIU2400_R2HST_ISTAT_MASK) == ISP2400R2HST_ATIO_RSPQ_UPDATE || + (isr & BIU2400_R2HST_ISTAT_MASK) == ISP2400R2HST_ATIO_RQST_UPDATE)) { iptr = ISP_READ(isp, BIU2400_ATIO_RSPINP); optr = isp->isp_atioodx; @@ -5107,9 +5109,11 @@ again: break; } optr = ISP_NXT_QENTRY(oop, RESULT_QUEUE_LEN(isp)); + } + if (isp->isp_atioodx != optr) { ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, optr); + isp->isp_atioodx = optr; } - isp->isp_atioodx = optr; } #endif @@ -5284,7 +5288,6 @@ again: optr = ISP_NXT_QENTRY(tsto, RESULT_QUEUE_LEN(isp)); } if (r > 0) { - ISP_WRITE(isp, isp->isp_respoutrp, optr); ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ last_etype = etype; continue; @@ -5319,7 +5322,6 @@ again: if (sp->req_header.rqs_flags & RQSFLAG_MASK) { if (sp->req_header.rqs_flags & RQSFLAG_CONTINUATION) { isp_print_bytes(isp, "unexpected continuation segment", QENTRY_LEN, sp); - ISP_WRITE(isp, isp->isp_respoutrp, optr); last_etype = etype; continue; } @@ -5343,7 +5345,6 @@ again: } if (sp->req_header.rqs_flags & RQSFLAG_BADORDER) { isp_print_bytes(isp, "invalid IOCB ordering", QENTRY_LEN, sp); - ISP_WRITE(isp, isp->isp_respoutrp, optr); last_etype = etype; continue; } @@ -5352,7 +5353,6 @@ again: if (!ISP_VALID_HANDLE(isp, sp->req_handle)) { isp_prt(isp, ISP_LOGERR, "bad request handle 0x%x (iocb type 0x%x)", sp->req_handle, etype); ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ - ISP_WRITE(isp, isp->isp_respoutrp, optr); last_etype = etype; continue; } @@ -5369,7 +5369,6 @@ again: isp_prt(isp, ISP_LOGERR, "cannot find handle 0x%x (status 0x%x)", sp->req_handle, ts); } ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ - ISP_WRITE(isp, isp->isp_respoutrp, optr); last_etype = etype; continue; }