Date: Mon, 20 Sep 2021 20:22:42 GMT From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 0f28c893a8b7 - stable/12 - Remove unnecessary WITNESS check in x86 bus_dma Message-ID: <202109202022.18KKMg8V021798@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0f28c893a8b7b24e778e849acf699ac35c5117d0 commit 0f28c893a8b7b24e778e849acf699ac35c5117d0 Author: Jason A. Harmening <jah@FreeBSD.org> AuthorDate: 2020-06-03 00:16:36 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> 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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109202022.18KKMg8V021798>