From nobody Wed Nov 11 14:26:23 2026 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 4jPm6S0Jbzz70HYH for ; Wed, 11 Nov 2026 14:26:24 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jPm6R54Lhz4Kq1 for ; Wed, 11 Nov 2026 14:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794407183; 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=bWgn02O+6M+Lz+r7aw0sAZvQOIcb/k1F7L2N/PRWWKM=; b=eDFCfZaiY0O6G1b4hVPPIB7DaM4wThlujgQS8JmKJDC2pX9zz7VvCLrf8bkLxgH9XcSRMY R+vTrZ5Jq7nofmLz7tWBr0BJSTfPRkAcU8DSuRA+G20kl1WSKAQCLoj/+x6EgwDea0YMHn rBa7oVArT6vtp4CJOE1NVnxPf5XFkgmKg//5rPsU1IScL17Y90nB2E3y+fZDNvxHwrEEmF RMK9cdtn6cuephSO74GKGk4BeMqEFT5WoMqMHhvCZl2ZANvrpO1mTjJMhDz+JDnxNPgGai 9ZyaKLCcgJEF7p8S1//S8K4z39BbMiYhMkAZGFDMn5Mx1hS3eG4Fmk2SOTDYAQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794407183; b=tx7SG8kcpQFOg6hS8lYg/G9YFgXbBY02N0pizOZZYIhRQpJVS0Ay686Mpm57P8QBD8tjLV YoqtvcBJE088BVTh0M0AlbnUiyb7xsn0D89qxqHQOeLAidxBPGNpaCFGTYA5RtsGNzHmug ByNxfMmLgRnguXrJAjaF8VDedSsrzpCujxMlN6JvEL233k3ug7ek+QxBKCntNA/YyE0Zhp hY99G1dKY4UNhpqh8UDxEE87If7um/TkXUsVYae25u/neLHT4Ca9H/tVaLGaTJ1tEyl1Gs oB674iO3JDJ8Rn3hAEtjxqEQelsPcTGZ4dVfG5Alpa4DsAao02R6s2UUEMEKdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794407183; 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=bWgn02O+6M+Lz+r7aw0sAZvQOIcb/k1F7L2N/PRWWKM=; b=cRbQm5kSdeQdaDH9flEWgPVdj416L3P3nPypgSfIecxfCEOIWeiPRSioVn5eoXUj8tvAif wfbvDD/B6QPvWvCdnC7wOznheEQExyX4jW9+4Blgk4rN17O4xyyCPrt89aBN1HmCJzDMO8 T/f38LzdVnB0xEdcMc9qQqjSJeHjYlOAQU+x2p5T8R3YF0QZNrxcEzf5q2qJgN2srIlhVk nuEQHQtC1jq89ipfw8hic0YTUOzohMZk87TSbFCVOE5cZhV9OVQ3ULozEbVV48ICfhC2UT 5DDABVM51yWCEdnJJYtAsPT9HM4OVl41hRvwseps5oNaqkiOJmNcpsN2Aj83gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jPm6R4F7LzJFc for ; Wed, 11 Nov 2026 14:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id f04f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 11 Nov 2026 14:26:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kenneth D. Merry Subject: git: 88c5709e91ad - main - pass(4): Don't drop the periph lock before selrecord() in passpoll() List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository 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: ken X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88c5709e91ad2cc6df51380673837f0ebd8a2d50 Auto-Submitted: auto-generated Date: Wed, 11 Nov 2026 14:26:23 +0000 Message-Id: <6af47b0f.f04f.6e3f5fbd@gitrepo.freebsd.org> The branch main has been updated by ken: URL: https://cgit.FreeBSD.org/src/commit/?id=88c5709e91ad2cc6df51380673837f0ebd8a2d50 commit 88c5709e91ad2cc6df51380673837f0ebd8a2d50 Author: Kenneth D. Merry AuthorDate: 2026-11-11 14:26:19 +0000 Commit: Kenneth D. Merry CommitDate: 2026-11-11 14:26:19 +0000 pass(4): Don't drop the periph lock before selrecord() in passpoll() passpoll() checked the done queue while holding the peripheral lock, dropped the lock, and only then called selrecord(). A CCB completing in the window between the unlock and the selrecord() call sent its selwakeuppri() before the polling thread was on the selinfo list, so the wakeup was lost and select(2) or poll(2) slept until another completion arrived or the timeout expired. Call selrecord() before dropping the lock. This lock order is already established: passdone() calls selwakeuppri(), which takes the selinfo lock, while holding the peripheral lock. kqueue is not affected, since the knlist is backed by the peripheral mutex. Reported by: llm-postcr Fixes: a9934668aa13 MFC after: 1 week Sponsored by: Spectra Logic Assisted-by: Claude Fable 5 --- sys/cam/scsi/scsi_pass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c index 6bb91e453e2b..50b2c53beca6 100644 --- a/sys/cam/scsi/scsi_pass.c +++ b/sys/cam/scsi/scsi_pass.c @@ -2191,9 +2191,9 @@ passpoll(struct cdev *dev, int poll_events, struct thread *td) if (!TAILQ_EMPTY(&softc->done_queue)) { revents |= poll_events & (POLLIN | POLLRDNORM); } - cam_periph_unlock(periph); if (revents == 0) selrecord(td, &softc->read_select); + cam_periph_unlock(periph); } return (revents);