From nobody Fri Jan 19 17:17:41 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 4TGmX56mQ6z56xLV; Fri, 19 Jan 2024 17:17:41 +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 4TGmX554P9z4Mpv; Fri, 19 Jan 2024 17:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684661; 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=BKyYwyfqHPCZrL1MN1j5v6J+3oq/7RHN8+bN1I6DeMI=; b=PH6kOL1TmjaiUQKDNn49/n8DYay6NFHEt6j7Ewy7kvfgT79Fhtb75FMGUZXQOBDCMTIti8 9Ei/4Vz/fS0+hgPBanduo6WpBRzWsNj64v+dFBN5K3LkAEg4XqSQrC2tI5chHt62dqg2Y1 wtDHnUGGoYqzmyTAZlyhBBn7pEnK0FQha4PE0rpWYjlauf6QDYLd3N+uOmjRIxr/+O/l88 tLzCjB34tBYteCEJyLeyze6V5Wdjwl8Y26o749UI557HIo7d8lQcO+J3SnLA+BFtXm2szO TCMAB6DD6ReylsjmyB36cEyvlBc3NYAWbUoAvxO9G422cV5VQUyDQrUBI1tG9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705684661; 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=BKyYwyfqHPCZrL1MN1j5v6J+3oq/7RHN8+bN1I6DeMI=; b=LbGD5L5VRSX961lDf598KVKnetHAa/+dLgbfcb323GrRaTQGMA4hmtLhuSH2pR1IBUH4Kw ZKQ0gFBcPI7b930heeQ/pvNL7goE42uU4rcYy/v02QwlfeOHXwEqnBDEQ2F1sFQPIDD35H qm1omiXHSQPLQqUJ0yTMUfkojfG/HW1H+zDoUeuCss01Ee41SX/AYWP4lXPdCcF38nmj1d A1h+HCUisswgwE5tcIPZ9q6dJVbYgXykvQd2JyPLVtiAZ1UQxzNEix2s8L742ZmwW21JU+ MxDrcQeNrUaQLa3uUFvuTg/0ETG8HTMXkYFlL2OkM1GBwIEAc/om9niAMuEB+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705684661; a=rsa-sha256; cv=none; b=Snu54Rx/QlPQxgL01v9FbH5w0pghwvQCcAI0U5FqybNDhPFAcIxpgr7DeRd/VPjW25ZBqb xMowh4YYNnK0KeHVUnZKtJPdesmlFHKrtWvZIs01dAVZ9JdVUMjwk3bsZ6LdxZn0qnstvA bR0B73fhDeFYAX7PnQy8XOUedNRv7UNBu9is7Ewge3KZm16MI/aYaIjozL8CQb4uF3/fzC Lp0888io2n9wD+DtaUR4A0yJaaunrZyX97jBtgV3Mi6hspTyvPTbpCT3km9tNjvQqRxz3h Pxzg9CROkExxQ3QwFTGnvQpBmCbI8FMQjqSeX9crwybFHFEUW81pGEWy2alVUA== 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 4TGmX549R4z10ty; Fri, 19 Jan 2024 17:17:41 +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 40JHHf46097288; Fri, 19 Jan 2024 17:17:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40JHHfJm097285; Fri, 19 Jan 2024 17:17:41 GMT (envelope-from git) Date: Fri, 19 Jan 2024 17:17:41 GMT Message-Id: <202401191717.40JHHfJm097285@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: 2d84c6e89435 - stable/14 - mpi3mr: Make these bus_dmamap_load calls synchronous 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: 2d84c6e894355f56e823937f098a03fe942f90a4 Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=2d84c6e894355f56e823937f098a03fe942f90a4 commit 2d84c6e894355f56e823937f098a03fe942f90a4 Author: Alexander Motin AuthorDate: 2023-11-29 01:50:30 +0000 Commit: Alexander Motin CommitDate: 2024-01-19 17:16:50 +0000 mpi3mr: Make these bus_dmamap_load calls synchronous These calls "should" all be synchrounous. There's no bouncing that's needed for them (at least in the typical case that we have a sane card that has more bits of dma addresses decoded than we have memory), so there's no errors possible. Ensure these calls are really synchronous with BUS_DMA_NOWAIT flags (which should never fail now that the bus_dmamem_alloc() has succeeded). Reviewed by: mav, jhb, imp Differential Revision: https://reviews.freebsd.org/D42606 (cherry picked from commit 39a3e6a812ad9c089bd2c4935193f1b3c4c5c35a) --- sys/dev/mpi3mr/mpi3mr.c | 33 +++++++++++++++++---------------- sys/dev/mpi3mr/mpi3mr_app.c | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr.c b/sys/dev/mpi3mr/mpi3mr.c index 32cba394c7b4..c1f35dbca94c 100644 --- a/sys/dev/mpi3mr/mpi3mr.c +++ b/sys/dev/mpi3mr/mpi3mr.c @@ -624,7 +624,7 @@ static int mpi3mr_create_op_reply_queue(struct mpi3mr_softc *sc, U16 qid) } bzero(op_reply_q->q_base, op_reply_q->qsz); bus_dmamap_load(op_reply_q->q_base_tag, op_reply_q->q_base_dmamap, op_reply_q->q_base, op_reply_q->qsz, - mpi3mr_memaddr_cb, &op_reply_q->q_base_phys, 0); + mpi3mr_memaddr_cb, &op_reply_q->q_base_phys, BUS_DMA_NOWAIT); mpi3mr_dprint(sc, MPI3MR_XINFO, "Operational Reply queue ID: %d phys addr= %#016jx virt_addr: %pa size= %d\n", qid, (uintmax_t)op_reply_q->q_base_phys, op_reply_q->q_base, op_reply_q->qsz); @@ -772,7 +772,7 @@ static int mpi3mr_create_op_req_queue(struct mpi3mr_softc *sc, U16 req_qid, U8 r bzero(op_req_q->q_base, op_req_q->qsz); bus_dmamap_load(op_req_q->q_base_tag, op_req_q->q_base_dmamap, op_req_q->q_base, op_req_q->qsz, - mpi3mr_memaddr_cb, &op_req_q->q_base_phys, 0); + mpi3mr_memaddr_cb, &op_req_q->q_base_phys, BUS_DMA_NOWAIT); mpi3mr_dprint(sc, MPI3MR_XINFO, "Operational Request QID: %d phys addr= %#016jx virt addr= %pa size= %d associated Reply QID: %d\n", req_qid, (uintmax_t)op_req_q->q_base_phys, op_req_q->q_base, op_req_q->qsz, reply_qid); @@ -1008,7 +1008,7 @@ static int mpi3mr_setup_admin_qpair(struct mpi3mr_softc *sc) } bzero(sc->admin_req, sc->admin_req_q_sz); bus_dmamap_load(sc->admin_req_tag, sc->admin_req_dmamap, sc->admin_req, sc->admin_req_q_sz, - mpi3mr_memaddr_cb, &sc->admin_req_phys, 0); + mpi3mr_memaddr_cb, &sc->admin_req_phys, BUS_DMA_NOWAIT); mpi3mr_dprint(sc, MPI3MR_XINFO, "Admin Req queue phys addr= %#016jx size= %d\n", (uintmax_t)sc->admin_req_phys, sc->admin_req_q_sz); @@ -1046,7 +1046,7 @@ static int mpi3mr_setup_admin_qpair(struct mpi3mr_softc *sc) } bzero(sc->admin_reply, sc->admin_reply_q_sz); bus_dmamap_load(sc->admin_reply_tag, sc->admin_reply_dmamap, sc->admin_reply, sc->admin_reply_q_sz, - mpi3mr_memaddr_cb, &sc->admin_reply_phys, 0); + mpi3mr_memaddr_cb, &sc->admin_reply_phys, BUS_DMA_NOWAIT); mpi3mr_dprint(sc, MPI3MR_XINFO, "Admin Reply queue phys addr= %#016jx size= %d\n", (uintmax_t)sc->admin_reply_phys, sc->admin_req_q_sz); @@ -1470,7 +1470,7 @@ static int mpi3mr_issue_iocfacts(struct mpi3mr_softc *sc, bzero(data, data_len); bus_dmamap_load(data_tag, data_map, data, data_len, - mpi3mr_memaddr_cb, &data_phys, 0); + mpi3mr_memaddr_cb, &data_phys, BUS_DMA_NOWAIT); mpi3mr_dprint(sc, MPI3MR_XINFO, "Func: %s line: %d IOCfacts data phys addr= %#016jx size= %d\n", __func__, __LINE__, (uintmax_t)data_phys, data_len); @@ -1760,7 +1760,7 @@ static int mpi3mr_reply_dma_alloc(struct mpi3mr_softc *sc) bzero(sc->reply_buf, sz); bus_dmamap_load(sc->reply_buf_tag, sc->reply_buf_dmamap, sc->reply_buf, sz, - mpi3mr_memaddr_cb, &sc->reply_buf_phys, 0); + mpi3mr_memaddr_cb, &sc->reply_buf_phys, BUS_DMA_NOWAIT); sc->reply_buf_dma_min_address = sc->reply_buf_phys; sc->reply_buf_dma_max_address = sc->reply_buf_phys + sz; @@ -1796,7 +1796,7 @@ static int mpi3mr_reply_dma_alloc(struct mpi3mr_softc *sc) bzero(sc->reply_free_q, sz); bus_dmamap_load(sc->reply_free_q_tag, sc->reply_free_q_dmamap, sc->reply_free_q, sz, - mpi3mr_memaddr_cb, &sc->reply_free_q_phys, 0); + mpi3mr_memaddr_cb, &sc->reply_free_q_phys, BUS_DMA_NOWAIT); mpi3mr_dprint(sc, MPI3MR_XINFO, "reply_free_q (0x%p): depth(%d), frame_size(%d), " "pool_size(%d kB), reply_free_q_dma(0x%llx)\n", @@ -1830,7 +1830,7 @@ static int mpi3mr_reply_dma_alloc(struct mpi3mr_softc *sc) bzero(sc->sense_buf, sz); bus_dmamap_load(sc->sense_buf_tag, sc->sense_buf_dmamap, sc->sense_buf, sz, - mpi3mr_memaddr_cb, &sc->sense_buf_phys, 0); + mpi3mr_memaddr_cb, &sc->sense_buf_phys, BUS_DMA_NOWAIT); mpi3mr_dprint(sc, MPI3MR_XINFO, "sense_buf (0x%p): depth(%d), frame_size(%d), " "pool_size(%d kB), sense_dma(0x%llx)\n", @@ -1864,7 +1864,7 @@ static int mpi3mr_reply_dma_alloc(struct mpi3mr_softc *sc) bzero(sc->sense_buf_q, sz); bus_dmamap_load(sc->sense_buf_q_tag, sc->sense_buf_q_dmamap, sc->sense_buf_q, sz, - mpi3mr_memaddr_cb, &sc->sense_buf_q_phys, 0); + mpi3mr_memaddr_cb, &sc->sense_buf_q_phys, BUS_DMA_NOWAIT); mpi3mr_dprint(sc, MPI3MR_XINFO, "sense_buf_q (0x%p): depth(%d), frame_size(%d), " "pool_size(%d kB), sense_dma(0x%llx)\n", @@ -2000,7 +2000,8 @@ mpi3mr_print_fw_pkg_ver(struct mpi3mr_softc *sc) bzero(fw_pkg_ver, fw_pkg_ver_len); - bus_dmamap_load(fw_pkg_ver_tag, fw_pkg_ver_map, fw_pkg_ver, fw_pkg_ver_len, mpi3mr_memaddr_cb, &fw_pkg_ver_dma, 0); + bus_dmamap_load(fw_pkg_ver_tag, fw_pkg_ver_map, fw_pkg_ver, fw_pkg_ver_len, + mpi3mr_memaddr_cb, &fw_pkg_ver_dma, BUS_DMA_NOWAIT); mpi3mr_dprint(sc, MPI3MR_XINFO, "Func: %s line: %d fw package version phys addr= %#016jx size= %d\n", __func__, __LINE__, (uintmax_t)fw_pkg_ver_dma, fw_pkg_ver_len); @@ -2122,7 +2123,7 @@ static int mpi3mr_issue_iocinit(struct mpi3mr_softc *sc) bzero(drvr_info, drvr_info_len); bus_dmamap_load(drvr_info_tag, drvr_info_map, drvr_info, drvr_info_len, - mpi3mr_memaddr_cb, &drvr_info_phys, 0); + mpi3mr_memaddr_cb, &drvr_info_phys, BUS_DMA_NOWAIT); mpi3mr_dprint(sc, MPI3MR_XINFO, "Func: %s line: %d IOCfacts drvr_info phys addr= %#016jx size= %d\n", __func__, __LINE__, (uintmax_t)drvr_info_phys, drvr_info_len); @@ -2536,7 +2537,7 @@ static int mpi3mr_alloc_chain_bufs(struct mpi3mr_softc *sc) bzero(sc->chain_sgl_list[i].buf, sz); bus_dmamap_load(sc->chain_sgl_list_tag, sc->chain_sgl_list[i].buf_dmamap, sc->chain_sgl_list[i].buf, sz, - mpi3mr_memaddr_cb, &sc->chain_sgl_list[i].buf_phys, 0); + mpi3mr_memaddr_cb, &sc->chain_sgl_list[i].buf_phys, BUS_DMA_NOWAIT); mpi3mr_dprint(sc, MPI3MR_XINFO, "Func: %s line: %d phys addr= %#016jx size= %d\n", __func__, __LINE__, (uintmax_t)sc->chain_sgl_list[i].buf_phys, sz); } @@ -2613,7 +2614,7 @@ static int mpi3mr_pel_alloc(struct mpi3mr_softc *sc) bzero(sc->pel_seq_number, sc->pel_seq_number_sz); bus_dmamap_load(sc->pel_seq_num_dmatag, sc->pel_seq_num_dmamap, sc->pel_seq_number, - sc->pel_seq_number_sz, mpi3mr_memaddr_cb, &sc->pel_seq_number_dma, 0); + sc->pel_seq_number_sz, mpi3mr_memaddr_cb, &sc->pel_seq_number_dma, BUS_DMA_NOWAIT); if (!sc->pel_seq_number) { printf(IOCNAME "%s:%d Cannot load PEL seq number dma memory for size: %d\n", sc->name, @@ -5138,7 +5139,7 @@ void mpi3mr_alloc_ioctl_dma_memory(struct mpi3mr_softc *sc) } bzero(mem_desc->addr, mem_desc->size); bus_dmamap_load(mem_desc->tag, mem_desc->dmamap, mem_desc->addr, mem_desc->size, - mpi3mr_memaddr_cb, &mem_desc->dma_addr, 0); + mpi3mr_memaddr_cb, &mem_desc->dma_addr, BUS_DMA_NOWAIT); if (!mem_desc->addr) goto out_failed; @@ -5168,7 +5169,7 @@ void mpi3mr_alloc_ioctl_dma_memory(struct mpi3mr_softc *sc) } bzero(mem_desc->addr, mem_desc->size); bus_dmamap_load(mem_desc->tag, mem_desc->dmamap, mem_desc->addr, mem_desc->size, - mpi3mr_memaddr_cb, &mem_desc->dma_addr, 0); + mpi3mr_memaddr_cb, &mem_desc->dma_addr, BUS_DMA_NOWAIT); if (!mem_desc->addr) goto out_failed; @@ -5197,7 +5198,7 @@ void mpi3mr_alloc_ioctl_dma_memory(struct mpi3mr_softc *sc) } bzero(mem_desc->addr, mem_desc->size); bus_dmamap_load(mem_desc->tag, mem_desc->dmamap, mem_desc->addr, mem_desc->size, - mpi3mr_memaddr_cb, &mem_desc->dma_addr, 0); + mpi3mr_memaddr_cb, &mem_desc->dma_addr, BUS_DMA_NOWAIT); if (!mem_desc->addr) goto out_failed; diff --git a/sys/dev/mpi3mr/mpi3mr_app.c b/sys/dev/mpi3mr/mpi3mr_app.c index 5bd0ea4ed174..dd3e4ac2ca08 100644 --- a/sys/dev/mpi3mr/mpi3mr_app.c +++ b/sys/dev/mpi3mr/mpi3mr_app.c @@ -358,7 +358,7 @@ mpi3mr_app_build_nvme_prp(struct mpi3mr_softc *sc, bzero(sc->nvme_encap_prp_list, dev_pgsz); bus_dmamap_load(sc->nvme_encap_prp_list_dmatag, sc->nvme_encap_prp_list_dma_dmamap, sc->nvme_encap_prp_list, dev_pgsz, mpi3mr_memaddr_cb, &sc->nvme_encap_prp_list_dma, - 0); + BUS_DMA_NOWAIT); if (!sc->nvme_encap_prp_list) { printf(IOCNAME "%s:%d Cannot load ioctl NVME dma memory for size: %d\n", sc->name,