From owner-svn-src-all@freebsd.org Thu Dec 29 06:58:52 2016 Return-Path: Delivered-To: svn-src-all@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 3A179C95C7F; Thu, 29 Dec 2016 06:58:52 +0000 (UTC) (envelope-from arybchik@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 0965B120D; Thu, 29 Dec 2016 06:58:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBT6wpvZ050482; Thu, 29 Dec 2016 06:58:51 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBT6wp8n050481; Thu, 29 Dec 2016 06:58:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612290658.uBT6wp8n050481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Dec 2016 06:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310750 - head/sys/dev/sfxge/common 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.23 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: Thu, 29 Dec 2016 06:58:52 -0000 Author: arybchik Date: Thu Dec 29 06:58:51 2016 New Revision: 310750 URL: https://svnweb.freebsd.org/changeset/base/310750 Log: sfxge(4): add missing barrier in common code MCDI response handling The semantics of the MCDI interfacve require reading the first dword of the header before any other data in the buffer. Add a barrier to the common code MCDI handler to enforce this. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8949 Modified: head/sys/dev/sfxge/common/ef10_mcdi.c Modified: head/sys/dev/sfxge/common/ef10_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mcdi.c Thu Dec 29 06:57:36 2016 (r310749) +++ head/sys/dev/sfxge/common/ef10_mcdi.c Thu Dec 29 06:58:51 2016 (r310750) @@ -159,6 +159,8 @@ ef10_mcdi_poll_response( efx_dword_t hdr; EFSYS_MEM_READD(esmp, 0, &hdr); + EFSYS_MEM_READ_BARRIER(); + return (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) ? B_TRUE : B_FALSE); }