From owner-svn-src-vendor@freebsd.org Thu May 10 09:18:27 2018 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 937FEFBE588; Thu, 10 May 2018 09:18:27 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473B7686E5; Thu, 10 May 2018 09:18:27 +0000 (UTC) (envelope-from mw@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 277EE1E62E; Thu, 10 May 2018 09:18:27 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4A9IQqm062797; Thu, 10 May 2018 09:18:26 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4A9IQkJ062796; Thu, 10 May 2018 09:18:26 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201805100918.w4A9IQkJ062796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 10 May 2018 09:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333451 - vendor-sys/ena-com/dist X-SVN-Group: vendor-sys X-SVN-Commit-Author: mw X-SVN-Commit-Paths: vendor-sys/ena-com/dist X-SVN-Commit-Revision: 333451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 May 2018 09:18:27 -0000 Author: mw Date: Thu May 10 09:18:26 2018 New Revision: 333451 URL: https://svnweb.freebsd.org/changeset/base/333451 Log: Apply fixes in ena-com * Change ena-com BIT macro to work on unsigned value. To make the shifting operations safer, they should be working on unsigned values. * Fix a mutex not owned ASSERT panic in ENA control path. A thread calling cv_broadcast()/cv_signal() must hold the mutex used for cv_wait(). Fix the ENA control path code that has this problem. Submitted by: Krishna Yenduri Reviewed by: Michal Krawczyk Tested by: Michal Krawczyk Modified: vendor-sys/ena-com/dist/ena_plat.h Modified: vendor-sys/ena-com/dist/ena_plat.h ============================================================================== --- vendor-sys/ena-com/dist/ena_plat.h Thu May 10 09:06:21 2018 (r333450) +++ vendor-sys/ena-com/dist/ena_plat.h Thu May 10 09:18:26 2018 (r333451) @@ -165,7 +165,7 @@ static inline long PTR_ERR(const void *ptr) #define GENMASK(h, l) (((1U << ((h) - (l) + 1)) - 1) << (l)) #define GENMASK_ULL(h, l) (((~0ULL) << (l)) & (~0ULL >> (64 - 1 - (h)))) -#define BIT(x) (1 << (x)) +#define BIT(x) (1UL << (x)) #define ENA_ABORT() BUG() #define BUG() panic("ENA BUG") @@ -244,7 +244,12 @@ static inline long PTR_ERR(const void *ptr) timeout_us * hz / 1000 / 1000 ); \ mtx_unlock(&((waitqueue).mtx)); \ } while (0) -#define ENA_WAIT_EVENT_SIGNAL(waitqueue) cv_broadcast(&((waitqueue).wq)) +#define ENA_WAIT_EVENT_SIGNAL(waitqueue) \ + do { \ + mtx_lock(&((waitqueue).mtx)); \ + cv_broadcast(&((waitqueue).wq)); \ + mtx_unlock(&((waitqueue).mtx)); \ + } while (0) #define dma_addr_t bus_addr_t #define u8 uint8_t