From owner-dev-commits-src-all@freebsd.org Mon Sep 20 20:22:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B0A16AD290; Mon, 20 Sep 2021 20:22:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HCwwL43PFz3ByK; Mon, 20 Sep 2021 20:22:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 612E61719A; Mon, 20 Sep 2021 20:22:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18KKMgmN021799; Mon, 20 Sep 2021 20:22:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18KKMg8V021798; Mon, 20 Sep 2021 20:22:42 GMT (envelope-from git) Date: Mon, 20 Sep 2021 20:22:42 GMT Message-Id: <202109202022.18KKMg8V021798@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 0f28c893a8b7 - stable/12 - Remove unnecessary WITNESS check in x86 bus_dma MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0f28c893a8b7b24e778e849acf699ac35c5117d0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2021 20:22:42 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0f28c893a8b7b24e778e849acf699ac35c5117d0 commit 0f28c893a8b7b24e778e849acf699ac35c5117d0 Author: Jason A. Harmening AuthorDate: 2020-06-03 00:16:36 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-20 20:22:29 +0000 Remove unnecessary WITNESS check in x86 bus_dma When I did some bus_dma cleanup in r320528, I brought forward some sketchy WITNESS checks from the prior x86 busdma wrappers, instead of recognizing them as technical debt and just dropping them. Two of these were removed in r346351 and r346851, but one remains in bounce_bus_dmamem_alloc(). This check could be constrained to only apply in the BUS_DMA_NOWAIT case, but it's cleaner to simply remove it and rely on the checks already present in the sleepable allocation paths used by this function. While here, remove another unnecessary witness check in bus_dma_tag_create (the tag is always allocated with M_NOWAIT), and fix a couple of typos. Reported by: cem Reviewed by: kib, cem MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25107 (cherry picked from commit 1dccf71b4b6dca1a912f3085918239559498c508) --- sys/x86/x86/busdma_bounce.c | 4 +--- sys/x86/x86/busdma_machdep.c | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/x86/x86/busdma_bounce.c b/sys/x86/x86/busdma_bounce.c index d25f29ff8e38..462ab66888e2 100644 --- a/sys/x86/x86/busdma_bounce.c +++ b/sys/x86/x86/busdma_bounce.c @@ -406,8 +406,6 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags, vm_memattr_t attr; int mflags; - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); - if (flags & BUS_DMA_NOWAIT) mflags = M_NOWAIT; else @@ -491,7 +489,7 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags, } /* - * Free a piece of memory and it's allociated dmamap, that was allocated + * Free a piece of memory and its associated dmamap, that was allocated * via bus_dmamem_alloc. Make the same choice for free/contigfree. */ static void diff --git a/sys/x86/x86/busdma_machdep.c b/sys/x86/x86/busdma_machdep.c index 152fec591417..e0286c9d6f96 100644 --- a/sys/x86/x86/busdma_machdep.c +++ b/sys/x86/x86/busdma_machdep.c @@ -223,8 +223,6 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, struct bus_dma_tag_common *tc; int error; - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); - if (parent == NULL) { error = bus_dma_bounce_impl.tag_create(parent, alignment, boundary, lowaddr, highaddr, filter, filterarg, maxsize,