From nobody Wed Nov 29 01:55:42 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 4Sg2Tq2Hc6z52tRW; Wed, 29 Nov 2023 01:55:43 +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 4Sg2Tq04KWz4Dpx; Wed, 29 Nov 2023 01:55:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701222943; 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=sCR0c9zblKqGIjcWoPa7UO4uSwCnlx5AzefK7PmDIJc=; b=xLppFEUcpJBA5GOhjLEjWbBpnHjXHdcIyPLLMJX1/UVcOL3W5Ylsx24sXr4P0tV0tAND5w eP8dOLcA4ArFhQ8DphLQs8eNMDiz7J1AOJBQDDj61MXRcIWWp1CR1s0mHfw4DVNqMg5vBF UIGU2b5EKNmFzHZnSrHmY8G8aRsBavp2BV9nJfFJI4dyELqzrk+wmhDEmbvfrZuIzD8tET Vnj1HQxlaJ9CX9VeyZ45BCZ+7d6/HEQZEUJ7+nKCJmP92ypGzlCNndFer/doilcI1g30Hu mIr8jzUcoVP6WkKXzY8f1L7kJHe6z5GSA7PTYc2HO9R5wQsB8Qr7Y5Z5QuLglg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701222943; 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=sCR0c9zblKqGIjcWoPa7UO4uSwCnlx5AzefK7PmDIJc=; b=FnSA2ShHTj/c8R6B5TvSonZQtTeSDqI555YSMeDBvnlUpgca15OzlnKIkDvaVZu1dua2mO gZJ0AIg0SDDXrsPJDMnIwViV1CdI78GkCHETROoxedSSQ561uXiMp28N746KcIDjSRtL4X OYHurmXJKNec8bgbdpfMMc70sNY16F12YUabUSXRfbWxXpCZIIRjOcANmHdOoPWpb7JP1L aqpuo5CwadV4GDcc8Jh/BV0U0qMSwxwT2HTFuP5kdlTo5b4N9abGd3r2gBwEaLjC5trZnb rGWu+7Nqw3yEqw7lS5psLCAZSRW9YxK7Z72G2fL6oh8MbkMOlV2sFDfmgVkjfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701222943; a=rsa-sha256; cv=none; b=q4KehGGX05+aU+JSUJY+xA/XleQIFhXscmHGa/oD4LNuslMQ6pgHhq/JkTttsJ6dmc49WJ JXg0sWT1V/S0tOVd9wxhHTrDhzWObyigzxi4tdA8bDtfLkFGo4opZ9zmqdJ1xecKlSUNe4 3SnbwJ9Wpe6Gk4bQoCELu7QEFwBFgNyvWxbOtRQ69HfpJT/o3Jnsp2RTeEpuK8fgj/JCf8 VBw3L0nkgy7+6C9mrX1xj/biL18tCyJw/ROKn7fOhKehkx1nCv2dh8B+zaEaGiIUVNg6df 7xqXD+XsTByUHkeb1vm+G3Q1e2VY/leXc5IBt7VDU1Wf2hs8S2cxvn7H+ZE/Jw== 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 4Sg2Tp6HZ7zmhh; Wed, 29 Nov 2023 01:55:42 +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 3AT1tgXB064690; Wed, 29 Nov 2023 01:55:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AT1tgrS064687; Wed, 29 Nov 2023 01:55:42 GMT (envelope-from git) Date: Wed, 29 Nov 2023 01:55:42 GMT Message-Id: <202311290155.3AT1tgrS064687@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: 39a3e6a812ad - main - 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39a3e6a812ad9c089bd2c4935193f1b3c4c5c35a Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=39a3e6a812ad9c089bd2c4935193f1b3c4c5c35a commit 39a3e6a812ad9c089bd2c4935193f1b3c4c5c35a Author: Alexander Motin AuthorDate: 2023-11-29 01:50:30 +0000 Commit: Warner Losh CommitDate: 2023-11-29 01:52:16 +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 --- 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 d063ca1b6255..cc970de00e8b 100644 --- a/sys/dev/mpi3mr/mpi3mr.c +++ b/sys/dev/mpi3mr/mpi3mr.c @@ -623,7 +623,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); @@ -771,7 +771,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); @@ -1007,7 +1007,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); @@ -1045,7 +1045,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); @@ -1469,7 +1469,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); @@ -1759,7 +1759,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; @@ -1795,7 +1795,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", @@ -1829,7 +1829,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", @@ -1863,7 +1863,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", @@ -1999,7 +1999,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); @@ -2121,7 +2122,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); @@ -2535,7 +2536,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); } @@ -2612,7 +2613,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, @@ -5137,7 +5138,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; @@ -5167,7 +5168,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; @@ -5196,7 +5197,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 eaa983958565..14cea43db2ca 100644 --- a/sys/dev/mpi3mr/mpi3mr_app.c +++ b/sys/dev/mpi3mr/mpi3mr_app.c @@ -357,7 +357,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,