From nobody Fri Jan 19 17:17:44 2024 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 4TGmX9312dz56xLf; Fri, 19 Jan 2024 17:17:45 +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 4TGmX90l0Zz4Mwy; Fri, 19 Jan 2024 17:17:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684665; 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=m81vHoCE/YKQ0GzSDQ+zWx4D34cnzvgm2i3FJppHsKs=; b=J+KPN6ZWCeSgqK7Cagiyjs6Yvt1lO0fC0S+/kHXyiM3mOML9Lnkxq2Tx7ViVoXIhoamapw rZ92cHR7IrTtk8ZOQS+weHFsAAch6dwRqt3RA+10XVnyh2acJr7oHgsfStFmRCW/KFqBPT HvDjjff10yZphcyOy12LRhydg6WY7O8UP7x7eD2b3pfZI6l56txdaqW8w2ZPbquj2A7La8 azRSBUC/idS7Ag7xQC6RIIgRX4ruLj+s4W5tIv47mRdpgBj4p62K/f08IuJHTf0AHv/xES ehet7vY44q8piTJzLTf4bIaJaj/y5JrLtBdbJp3t4pQ5kGLfi8uLOiicPTuT4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684665; 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=m81vHoCE/YKQ0GzSDQ+zWx4D34cnzvgm2i3FJppHsKs=; b=eiDWs9ixXqmQ0wZqYuZr5WSGTaPlc9XcS9pw3y3MPKNc3vt3NaMobP9KPMRt0wjcU8IUGn iX7tpav22rWVzUEJzuhHq08j54zTdWhqrS67O37s8HfIUm0wodnhqQw9qK5gyaN8YaNADV OZUAi5t4aT9mow/rhVBkK1a+4xc0RHPkPFcSReW/Ki9+OQ2LV8dIpne6sXT6fo9IKVdk+/ diair87gwD2hueP6Ahq2TK1bys3sBK3V+Ho2ABjCieh74CRImji6a8BTSIbLV12pNWZRTY MxWNmyFmn/+nO+9oDVI5oRn6ErIRlE0cezjDR5492MwyAx4rKFGRRIUE7UJXmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705684665; a=rsa-sha256; cv=none; b=f4CvX0bOoaVDpE+DxbrbnrjO18Gz4WCHTLBbA7hw8xqQ3MQtqEdUamsrcYBeUFhr3IWzb/ p6zMGoRyn3KW7usLfTOs6Irglyy8hIv9RwHwBEagBAyOTvS/z6yWtLZJmEmsQXa3Z1GVzh xnO/tl7TB17O5UfD0gv1looX7w1XSj68q4DFSs1TE1oJARx0F+/2gTgU1wrS0hB4axrGjn +XdhZRJFvo/0FuYpS7K2NsDaKtExQRIF1x5FVijqF2ifELYANUT3gtGQYCv5xCjq/9LtMa bmd5pojA5dMI+pp0XzpSU3mqDsl0iKNAitbJ8VMMPrlduyhLUIft+sTTOLhZKg== 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 4TGmX86wsVz10v2; Fri, 19 Jan 2024 17:17: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 40JHHiRd097452; Fri, 19 Jan 2024 17:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40JHHib5097449; Fri, 19 Jan 2024 17:17:44 GMT (envelope-from git) Date: Fri, 19 Jan 2024 17:17:44 GMT Message-Id: <202401191717.40JHHib5097449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 344cdef0ccd7 - stable/14 - mpi3mr: Assume dma_hiaddr is BUS_SPACE_MAXADDR 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: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 344cdef0ccd7ee3fb2ba67591298959f803bd292 Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=344cdef0ccd7ee3fb2ba67591298959f803bd292 commit 344cdef0ccd7ee3fb2ba67591298959f803bd292 Author: Warner Losh AuthorDate: 2023-11-29 01:50:52 +0000 Commit: Alexander Motin CommitDate: 2024-01-19 17:16:50 +0000 mpi3mr: Assume dma_hiaddr is BUS_SPACE_MAXADDR No sense having a variable for this. So use BUS_SPACE_MAXADDR and remove dma_hiaddr from softc. Suggested by: jhb Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42808 (cherry picked from commit 1ec7c672bc2854a1efb1d50f189d4881163c16c6) --- sys/dev/mpi3mr/mpi3mr.c | 47 ++++++++++++++++++++++----------------------- sys/dev/mpi3mr/mpi3mr.h | 1 - sys/dev/mpi3mr/mpi3mr_app.c | 2 +- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr.c b/sys/dev/mpi3mr/mpi3mr.c index c1f35dbca94c..73a40b374c1a 100644 --- a/sys/dev/mpi3mr/mpi3mr.c +++ b/sys/dev/mpi3mr/mpi3mr.c @@ -605,7 +605,7 @@ static int mpi3mr_create_op_reply_queue(struct mpi3mr_softc *sc, U16 qid) if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ op_reply_q->qsz, /* maxsize */ 1, /* nsegments */ @@ -751,7 +751,7 @@ static int mpi3mr_create_op_req_queue(struct mpi3mr_softc *sc, U16 req_qid, U8 r if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ op_req_q->qsz, /* maxsize */ 1, /* nsegments */ @@ -1441,10 +1441,10 @@ static int mpi3mr_issue_iocfacts(struct mpi3mr_softc *sc, /* - * We can't use sc->dma_loaddr / hiaddr here. We set those only after - * we get the iocfacts. So allocate in the lower 4GB. The amount of - * data is tiny and we don't do this that often, so any bouncing we - * might have to do isn't a cause for concern. + * We can't use sc->dma_loaddr here. We set those only after we get the + * iocfacts. So allocate in the lower 4GB. The amount of data is tiny + * and we don't do this that often, so any bouncing we might have to do + * isn't a cause for concern. */ if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ @@ -1689,8 +1689,8 @@ static int mpi3mr_process_factsdata(struct mpi3mr_softc *sc, /* * Set the DMA mask for the card. dma_mask is the number of bits that - * can have bits set in them. Translate this into bus_dma loaddr/hiaddr - * args. Add sanity for more bits than address space or other overflow + * can have bits set in them. Translate this into bus_dma loaddr args. + * Add sanity for more bits than address space or other overflow * situations. */ if (sc->facts.dma_mask == 0 || @@ -1698,10 +1698,9 @@ static int mpi3mr_process_factsdata(struct mpi3mr_softc *sc, sc->dma_loaddr = BUS_SPACE_MAXADDR; else sc->dma_loaddr = ~((1ull << sc->facts.dma_mask) - 1); - sc->dma_hiaddr = BUS_SPACE_MAXADDR; mpi3mr_dprint(sc, MPI3MR_INFO, - "dma_mask bits: %d loaddr 0x%jx hiaddr 0x%jx\n", - sc->facts.dma_mask, sc->dma_loaddr, sc->dma_hiaddr); + "dma_mask bits: %d loaddr 0x%jx\n", + sc->facts.dma_mask, sc->dma_loaddr); return retval; } @@ -1739,7 +1738,7 @@ static int mpi3mr_reply_dma_alloc(struct mpi3mr_softc *sc) if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sz, /* maxsize */ 1, /* nsegments */ @@ -1775,7 +1774,7 @@ static int mpi3mr_reply_dma_alloc(struct mpi3mr_softc *sc) if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 8, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sz, /* maxsize */ 1, /* nsegments */ @@ -1809,7 +1808,7 @@ static int mpi3mr_reply_dma_alloc(struct mpi3mr_softc *sc) if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sz, /* maxsize */ 1, /* nsegments */ @@ -1843,7 +1842,7 @@ static int mpi3mr_reply_dma_alloc(struct mpi3mr_softc *sc) if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 8, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sz, /* maxsize */ 1, /* nsegments */ @@ -1980,7 +1979,7 @@ mpi3mr_print_fw_pkg_ver(struct mpi3mr_softc *sc) if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ fw_pkg_ver_len, /* maxsize */ 1, /* nsegments */ @@ -2102,7 +2101,7 @@ static int mpi3mr_issue_iocinit(struct mpi3mr_softc *sc) if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ drvr_info_len, /* maxsize */ 1, /* nsegments */ @@ -2515,7 +2514,7 @@ static int mpi3mr_alloc_chain_bufs(struct mpi3mr_softc *sc) if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4096, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sz, /* maxsize */ 1, /* nsegments */ @@ -2590,8 +2589,8 @@ static int mpi3mr_pel_alloc(struct mpi3mr_softc *sc) sc->pel_seq_number_sz = sizeof(Mpi3PELSeq_t); if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4, 0, /* alignment, boundary */ - sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + sc->dma_loaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ sc->pel_seq_number_sz, /* maxsize */ 1, /* nsegments */ @@ -4946,7 +4945,7 @@ mpi3mr_alloc_requests(struct mpi3mr_softc *sc) ret = bus_dma_tag_create( sc->mpi3mr_parent_dmat, /* parent */ 1, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ BUS_SPACE_MAXSIZE, /* maxsize */ nsegs, /* nsegments */ @@ -5120,7 +5119,7 @@ void mpi3mr_alloc_ioctl_dma_memory(struct mpi3mr_softc *sc) if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ mem_desc->size, /* maxsize */ 1, /* nsegments */ @@ -5150,7 +5149,7 @@ void mpi3mr_alloc_ioctl_dma_memory(struct mpi3mr_softc *sc) if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ mem_desc->size, /* maxsize */ 1, /* nsegments */ @@ -5179,7 +5178,7 @@ void mpi3mr_alloc_ioctl_dma_memory(struct mpi3mr_softc *sc) if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ mem_desc->size, /* maxsize */ 1, /* nsegments */ diff --git a/sys/dev/mpi3mr/mpi3mr.h b/sys/dev/mpi3mr/mpi3mr.h index 3a9612449c63..ca1f42a4a7e5 100644 --- a/sys/dev/mpi3mr/mpi3mr.h +++ b/sys/dev/mpi3mr/mpi3mr.h @@ -545,7 +545,6 @@ struct mpi3mr_softc { char driver_name[MPI3MR_NAME_LENGTH]; int bars; bus_addr_t dma_loaddr; - bus_addr_t dma_hiaddr; u_int mpi3mr_debug; struct mpi3mr_reset reset; int max_msix_vectors; diff --git a/sys/dev/mpi3mr/mpi3mr_app.c b/sys/dev/mpi3mr/mpi3mr_app.c index dd3e4ac2ca08..384d0d6fe178 100644 --- a/sys/dev/mpi3mr/mpi3mr_app.c +++ b/sys/dev/mpi3mr/mpi3mr_app.c @@ -337,7 +337,7 @@ mpi3mr_app_build_nvme_prp(struct mpi3mr_softc *sc, if (bus_dma_tag_create(sc->mpi3mr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ sc->dma_loaddr, /* lowaddr */ - sc->dma_hiaddr, /* highaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ dev_pgsz, /* maxsize */ 1, /* nsegments */