From owner-svn-src-all@FreeBSD.ORG Sun Nov 10 23:48:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CEA78D3F; Sun, 10 Nov 2013 23:48:17 +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 9FA652A37; Sun, 10 Nov 2013 23:48:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAANmHbf093725; Sun, 10 Nov 2013 23:48:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAANmHvX093723; Sun, 10 Nov 2013 23:48:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311102348.rAANmHvX093723@svn.freebsd.org> From: Alexander Motin Date: Sun, 10 Nov 2013 23:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257932 - 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:48:17 -0000 Author: mav Date: Sun Nov 10 23:48:16 2013 New Revision: 257932 URL: http://svnweb.freebsd.org/changeset/base/257932 Log: Use relaxed (write-only) memory barriers when writing some of queue index registers (for now on ISP2400+). We never read those registers back and AFAIK their semantics does not require any immediate reaction on write. Modified: head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Sun Nov 10 23:35:08 2013 (r257931) +++ head/sys/dev/isp/isp_freebsd.h Sun Nov 10 23:48:16 2013 (r257932) @@ -459,6 +459,39 @@ default: \ break; \ } +#define MEMORYBARRIERW(isp, type, offset, size, chan) \ +switch (type) { \ +case SYNC_SFORDEV: \ +{ \ + struct isp_fc *fc = ISP_FC_PC(isp, chan); \ + bus_dmamap_sync(fc->tdmat, fc->tdmap, \ + BUS_DMASYNC_PREWRITE); \ + break; \ +} \ +case SYNC_REQUEST: \ + bus_dmamap_sync(isp->isp_osinfo.cdmat, \ + isp->isp_osinfo.cdmap, BUS_DMASYNC_PREWRITE); \ + break; \ +case SYNC_SFORCPU: \ +{ \ + struct isp_fc *fc = ISP_FC_PC(isp, chan); \ + bus_dmamap_sync(fc->tdmat, fc->tdmap, \ + BUS_DMASYNC_POSTWRITE); \ + break; \ +} \ +case SYNC_RESULT: \ + bus_dmamap_sync(isp->isp_osinfo.cdmat, \ + isp->isp_osinfo.cdmap, BUS_DMASYNC_POSTWRITE); \ + break; \ +case SYNC_REG: \ + bus_space_barrier(isp->isp_osinfo.bus_tag, \ + isp->isp_osinfo.bus_handle, offset, size, \ + BUS_SPACE_BARRIER_WRITE); \ + break; \ +default: \ + break; \ +} + #define MBOX_ACQUIRE isp_mbox_acquire #define MBOX_WAIT_COMPLETE isp_mbox_wait_complete #define MBOX_NOTIFY_COMPLETE isp_mbox_notify_done Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sun Nov 10 23:35:08 2013 (r257931) +++ head/sys/dev/isp/isp_pci.c Sun Nov 10 23:48:16 2013 (r257932) @@ -1432,6 +1432,15 @@ isp_pci_wr_reg_2400(ispsoftc_t *isp, int case BIU2400_GPIOE: case BIU2400_HSEMA: BXW4(isp, IspVirt2Off(isp, regoff), val); +#ifdef MEMORYBARRIERW + if (regoff == BIU2400_REQINP || + regoff == BIU2400_RSPOUTP || + regoff == BIU2400_PRI_REQINP || + regoff == BIU2400_ATIO_RSPOUTP) + MEMORYBARRIERW(isp, SYNC_REG, + IspVirt2Off(isp, regoff), 4, -1) + else +#endif MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 4, -1); break; default: