From nobody Wed Nov 29 01:55:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sg2Tr1m9Qz52tTj; Wed, 29 Nov 2023 01:55:44 +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 4Sg2Tr0yH2z4F1W; Wed, 29 Nov 2023 01:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701222944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1lqe8aE0U1mjmF7j/Q/CShqZgqxifVCsfATihfpyTPM=; b=h26hVH5hN5+HaVfX52ywOMxeLz7lGtWGsY79uMTnhfTfC+13HOhOcYJm88Y1d9TjjoKtCz i/ry3vTKs0eYpxQGWP0AM/ebrnGP8vWbo/aVpvql6ERA/G06Fw9ow+Yba83AGJOSV3IXuZ WO6S9XTmHHhLb+2u7HVcPT4IqJ7gPCqVG0qFvSYZKnpGv0lx1CJB7M6UCWAyOnKdHneSEt IkBQ84YGMAcx/CJyC3+UVlMhB0G5PGeqmTDlJd3tslbMCwIJZKXQo74YNTqQOEd2xyC3nh SjsX4hvhGD+I65hJQDxMQkm+r21BJbiCtxApn8vPmbarGCcZo26jBwndhmgQjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701222944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1lqe8aE0U1mjmF7j/Q/CShqZgqxifVCsfATihfpyTPM=; b=Set3OUDlE6AMIRFZbRnxcgdV2L9rmLElDuq5BakrBv3V6DmGnhzWTskkYbzy4cPs7rwwzY ZZTbvosASelbSXZTaeFrpZmpxt5tOApKlve/gFIwUaaluevkVNbsDkunHkj5w6keRRgjC9 gFgx7uRxH7IlPZPrJLJ5cUCzn0h3WmckD5bQn4kI/SP3TR0a78cFNDIj6S/ZZisI1N4mEB mQvxa0CaLNSQih3e3UWLcZmYymzt2sgYh0hPxgjZDaAtDw5hZ0Mi533HgZ8mo45CgffpLK S+E2KTYJ4grik4JzdrcC/JDnEuqCd9+ZUjwRy876CScS/6PNpMgXoLFuJuRzbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701222944; a=rsa-sha256; cv=none; b=yzrGHv0RlV0xwpWxowVK/HZ7rc4S0xZsP/Z//lkasDOrfpi9hQ9QD3Ml55/+wH5B80z+0b PrrFS2lnMNPEKwYTqfLtz4S+L9zkDxjJiI+AJt1nyT8zEC5OSyCVi3Ll99qTbJPeaosgo/ kD5jG/btsWPsifAtUDayPA6U18PWuwHh3JaZIiFGL/LzxYCkOpXTzO911dVtePXABDYhPt yvha6B0q8pndGScKzR+ndnBoh5maEVMWzgpqjan0U4dGnd9pYgP/2TkEkX/OQzR7h6ZecL bg5/a4UzRrmN0kQtrahN19S3RUSbdXUmVsktQypIqqpKfoJAzpmErACGx6XwFw== 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 4Sg2Tr03vVzmhj; Wed, 29 Nov 2023 01:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AT1th5A064738; Wed, 29 Nov 2023 01:55:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AT1th4B064735; Wed, 29 Nov 2023 01:55:43 GMT (envelope-from git) Date: Wed, 29 Nov 2023 01:55:43 GMT Message-Id: <202311290155.3AT1th4B064735@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 489eee0d41dc - main - mpi3mr: Use template for main busdma tag. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 489eee0d41dce317678adb0dae8d509a5f1d6d93 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=489eee0d41dce317678adb0dae8d509a5f1d6d93 commit 489eee0d41dce317678adb0dae8d509a5f1d6d93 Author: Alexander Motin AuthorDate: 2023-11-29 01:50:39 +0000 Commit: Warner Losh CommitDate: 2023-11-29 01:52:23 +0000 mpi3mr: Use template for main busdma tag. Use the simpler template code for the parent busdma tag for all I/O to this card. Reviewed by: mav, jhb, imp Differential Revision: https://reviews.freebsd.org/D42607 --- sys/dev/mpi3mr/mpi3mr_pci.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr_pci.c b/sys/dev/mpi3mr/mpi3mr_pci.c index d07463366943..c1c0211aab4e 100644 --- a/sys/dev/mpi3mr/mpi3mr_pci.c +++ b/sys/dev/mpi3mr/mpi3mr_pci.c @@ -256,6 +256,7 @@ mpi3mr_release_resources(struct mpi3mr_softc *sc) static int mpi3mr_setup_resources(struct mpi3mr_softc *sc) { + bus_dma_template_t t; int i; device_t dev = sc->mpi3mr_dev; @@ -288,20 +289,11 @@ static int mpi3mr_setup_resources(struct mpi3mr_softc *sc) * dma_mask on the device. */ /* Allocate the parent DMA tag */ - if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ - 1, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsize */ - BUS_SPACE_UNRESTRICTED, /* nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->mpi3mr_parent_dmat)) { + bus_dma_template_init(&t, bus_get_dma_tag(dev)); + if (bus_dma_template_tag(&t, &sc->mpi3mr_parent_dmat)) { mpi3mr_dprint(sc, MPI3MR_ERROR, "Cannot allocate parent DMA tag\n"); return (ENOMEM); - } + } sc->max_msix_vectors = pci_msix_count(dev);