From nobody Wed Nov 29 01:55:45 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 4Sg2Ts2T6Vz52tX1; Wed, 29 Nov 2023 01:55: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 4Sg2Ts1zvYz4Dt5; Wed, 29 Nov 2023 01:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701222945; 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=NH1SzNYKM4/g/6kTDHOdug5CZxDI8pCJk4ZBL2eWIRI=; b=gyF79tASifKuLfzfxOrhEE6zc69p2uzbDEzjQAclV+5lNGsIWahjWLDmXdS2NPBi/Ge7bj YtzO+H8sxqtF5GqyF3xFTGlK2ZQMnnMNsyFowQhRUeo21hjOw24USlETtXsnphyNMJaZXT ycUtV131CageZ/RFo51ISK61bUEFUNEEsWX0J0CBYp2ByBJCp1JNDwSmj07eReLmdhT6KJ TQM3sgYMar3jT3eM2wTYF1GdM0Gg79T48VIWGzE/F5gqVr4TEOD8s9wykkUsffCOM68kfw Pp88HOJ0UOAPB/eG86iGAqjWLjurSOvtT/vzNCnthoIbrKiiSkPTRHSiVdaHrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701222945; 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=NH1SzNYKM4/g/6kTDHOdug5CZxDI8pCJk4ZBL2eWIRI=; b=LhQn1ohzS967PyN5B0kmJrAzEJSCf2IUzrV9UrgjpeWyhzel2eOX4N7vWjl0XUnp9Fdn1z 126VEdlbgIEjmqEti69I1JjVE9DcR+tlZbQyYT3JhyWfLUPluQV7/oPGyna42/Mb772sR5 copKbWYSZSB0yZTtak/tCdlgrJxBgQzVvRecfFlAfmqQQ95G3CKjXKHTx0ZlOXvxC5AXRa WwMo8kSDmT4VdnPc1vRIQEMTlpJnsXkx1N51ehoFPzmfyt0SInpT3DQefT3GEgSbaGFkUS UM3NvHsV8MULKsaU2jB5hdhXAj1GzG5pXDqXRpqsaHXmaSeHu72HHgYPd0j23g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701222945; a=rsa-sha256; cv=none; b=F4mIVM0Z9xN2E9x3dIOiU+eUFuh8aGrj5uy3/xZxKgIstiFfs3RM3v1xF1PFKHWciD52jc sM5iuaYXiys9uiA7YjhbfcvbkVV6o5H0NwJOBwvifsqhPMeMc/CfCpffftEOiI7xftsytO F4M04600uT8EjC1CLSw+KMUNTj04J+s9+tzJO9ZfZv8b7JrUnCrKeo2cTTpDpaklrVktVk cEWOxKWks8M1SPvyHX0FrBlqx9QkWRnRBBFNQJsH9aGUsQuT5ecK2+8PF9MRbZyhyJs5N0 rSvrmFUeAk8jo7k2TkkfG0jLJ4P5jZxseb1kTaEZY+7Kpkg1Qvj26PMnmMJ8QQ== 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 4Sg2Ts0wQqzmyk; Wed, 29 Nov 2023 01:55:45 +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 3AT1tjDN064795; Wed, 29 Nov 2023 01:55:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AT1tjZY064792; Wed, 29 Nov 2023 01:55:45 GMT (envelope-from git) Date: Wed, 29 Nov 2023 01:55:45 GMT Message-Id: <202311290155.3AT1tjZY064792@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: 2361a0056fc1 - main - mpi3mr: Replace can't happen DataLength == 0 with an assert 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: 2361a0056fc16b5e11df2aa948aaa633ac01d685 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2361a0056fc16b5e11df2aa948aaa633ac01d685 commit 2361a0056fc16b5e11df2aa948aaa633ac01d685 Author: Warner Losh AuthorDate: 2023-11-29 01:50:47 +0000 Commit: Warner Losh CommitDate: 2023-11-29 01:52:28 +0000 mpi3mr: Replace can't happen DataLength == 0 with an assert Replace the test for DataLength == 0 with an assert. It can't happen, but an assert doesn't hurt. Emacs removed some trailing white space too. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42807 --- sys/dev/mpi3mr/mpi3mr_cam.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr_cam.c b/sys/dev/mpi3mr/mpi3mr_cam.c index 0b882b3a641e..3cef46f3f642 100644 --- a/sys/dev/mpi3mr/mpi3mr_cam.c +++ b/sys/dev/mpi3mr/mpi3mr_cam.c @@ -98,7 +98,6 @@ extern int mpi3mr_register_events(struct mpi3mr_softc *sc); extern void mpi3mr_add_sg_single(void *paddr, U8 flags, U32 length, bus_addr_t dma_addr); -extern void mpi3mr_build_zero_len_sge(void *paddr); static U32 event_count; @@ -147,6 +146,9 @@ static void mpi3mr_prepare_sgls(void *arg, KASSERT(nsegs <= MPI3MR_SG_DEPTH && nsegs > 0, ("%s: bad SGE count: %d\n", device_get_nameunit(sc->mpi3mr_dev), nsegs)); + KASSERT(scsiio_req->DataLength != 0, + ("%s: Data segments (%d), but DataLength == 0\n", + device_get_nameunit(sc->mpi3mr_dev), nsegs)); simple_sgl_flags = MPI3_SGE_FLAGS_ELEMENT_TYPE_SIMPLE | MPI3_SGE_FLAGS_DLAS_SYSTEM; @@ -157,13 +159,6 @@ static void mpi3mr_prepare_sgls(void *arg, sg_local = (U8 *)&scsiio_req->SGL; - if (scsiio_req->DataLength == 0) { - /* XXX we don't ever get here when DataLength == 0, right? cm->data is NULL */ - /* This whole if can likely be removed -- we handle it in mpi3mr_request_map */ - mpi3mr_build_zero_len_sge(sg_local); - goto enqueue; - } - sges_left = nsegs; sges_in_segment = (sc->facts.op_req_sz - @@ -214,7 +209,6 @@ fill_in_last_segment: i++; } -enqueue: /* * Now that we've created the sgls, we send the request to the device. * Unlike in Linux, dmaload isn't guaranteed to load every time, but @@ -879,10 +873,10 @@ mpi3mr_scsiio_timeout(void *data) return; /* - * task abort and target reset has failed. So issue Controller reset(soft reset) + * task abort and target reset has failed. So issue Controller reset(soft reset) * through OCR thread context */ - trigger_reset_from_watchdog(sc, MPI3MR_TRIGGER_SOFT_RESET, MPI3MR_RESET_FROM_SCSIIO_TIMEOUT); + trigger_reset_from_watchdog(sc, MPI3MR_TRIGGER_SOFT_RESET, MPI3MR_RESET_FROM_SCSIIO_TIMEOUT); return; } @@ -976,7 +970,7 @@ mpi3mr_action_scsiio(struct mpi3mr_cam_softc *cam_sc, union ccb *ccb) } if (targ->dev_handle == 0x0) { - mpi3mr_dprint(sc, MPI3MR_ERROR, "%s NULL handle for target 0x%x\n", + mpi3mr_dprint(sc, MPI3MR_ERROR, "%s NULL handle for target 0x%x\n", __func__, csio->ccb_h.target_id); mpi3mr_set_ccbstatus(ccb, CAM_DEV_NOT_THERE); xpt_done(ccb);