bsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jaeyoon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a33860b0a2b98caf32c2ff62707f254ca92773f4 Auto-Submitted: auto-generated Date: Mon, 10 Aug 2026 02:31:34 +0000 Message-Id: <6a793806.1f869.393a2657@gitrepo.freebsd.org> The branch main has been updated by jaeyoon: URL: https://cgit.FreeBSD.org/src/commit/?id=a33860b0a2b98caf32c2ff62707f254ca92773f4 commit a33860b0a2b98caf32c2ff62707f254ca92773f4 Author: Jaeyoon Choi AuthorDate: 2026-08-10 01:53:27 +0000 Commit: Jaeyoon Choi CommitDate: 2026-08-10 02:28:54 +0000 ufshci: do not reset the device in the XPT_RESET_DEV handler CAM calls the SIM action callback with the SIM lock and the CAM device lock held. The XPT_RESET_DEV handler called ufshci_dev_reset(), which sleeps on device commands. Sleeping there panics when another thread contends for the lock: "panic: sleeping thread holds CAM device lock". Report success without touching the device, as nvme_sim(4) does. A real device reset needs the controller reset path. That rework is planned together with in-flight request recovery. Sponsored by: Samsung Electronics Reviewed by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D58671 --- sys/dev/ufshci/ufshci_sim.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/dev/ufshci/ufshci_sim.c b/sys/dev/ufshci/ufshci_sim.c index e40079b23354..f969d9c8311b 100644 --- a/sys/dev/ufshci/ufshci_sim.c +++ b/sys/dev/ufshci/ufshci_sim.c @@ -288,13 +288,14 @@ ufshci_cam_action(struct cam_sim *sim, union ccb *ccb) break; } case XPT_RESET_BUS: - ccb->ccb_h.status = CAM_REQ_CMP; - break; case XPT_RESET_DEV: - if (ufshci_dev_reset(ctrlr)) - ccb->ccb_h.status = CAM_REQ_CMP_ERR; - else - ccb->ccb_h.status = CAM_REQ_CMP; + /* + * This callback cannot sleep: CAM calls it with the SIM + * lock and the CAM device lock held. It cannot reset the + * device here. Report success so CAM keeps going, like + * nvme_sim(4) does. + */ + ccb->ccb_h.status = CAM_REQ_CMP; break; case XPT_ABORT: ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;