From nobody Thu Feb 06 18:42:36 2025 X-Original-To: dev-commits-src-main@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 4YpmDr1n3Kz5msrC; Thu, 06 Feb 2025 18:42:36 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YpmDr1CZPz3rZ1; Thu, 06 Feb 2025 18:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738867356; 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=o3cSspYa0a6uqGNlRpvwhcKKov8k7ILntJ60U5UiXb8=; b=n5Goj9QSDVa6nz2rB1ruLCU1e2rlLF2RlVWOAAGqHvVh4t7+ZnN5VEEI7R4aO4JN+HLKxK LC6HKVmh1sIt+H4iTVezUphwdQJqM0xlbZY5TPjWskHj5BfmC5NV3h2iKkbg7EUsQkVQaz v5sQxuqtCifrNI4zkCT1/eb4oxyA9Vb9mk9LMKEEkiMM3J/7O86v/bNJY6LqXClceeCuHu E6kgInCINrNIlQtlzq3g99INAJkYrABHvpfAR1zJlAkVFYGrKiriLlFbUbyJjpDoWryg9k outRUmxV0ybbem+57fdJejbXySqXfi0rnM+FcCfkVOU/bVdxnVAfK1qKB3kbtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738867356; 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=o3cSspYa0a6uqGNlRpvwhcKKov8k7ILntJ60U5UiXb8=; b=IJ4DYDe6UFnH1Vkv0DweQsT+a/G2E/XLHTJI+QQNoHfgnv8D442xTWOSCwWHhV6+F0700p qCCsRmcdqNEWc3ryaBG0U5oZ1SqQYA1B3vTecLgIGT2pK4TM+oFkrHk7AvbfPIsggq14rP h6Hca1CwyGhnfhuUDNGnSCIxCE5K1RlsUD5VhcNhFm0KffZKYGbRNe6cHsxOw+MnwnVjDV +AuLGQIYH7XIiwVki0ZxCJcivnMN6Fi09DN8ZDMU6Rif7RKgyiOoe1ie200MXGJig0DL+m 4pWkU+IKk1/XvkMSqqk8fLX2hUwX8b3r1O0/K3HFqKxb9RlQ2bVhVadDM4Ievg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1738867356; a=rsa-sha256; cv=none; b=J05FlcRY/3U+NDgAYxuuOZGOpHEHRkN/EhbnruJNtvNwsUcssPkBCIWxiZTRfwpICYMWgw It8jrtdtg5oEpFXVMhIuOlQ5Y5lUWaKrd7mj/KMaAE0gE3zGdwbMu02BcaRjQxR7a9Llrz 3YvcosDTcDZkK4l+ju4xTnUt5GyA4JIjEkfgmuDM6Fgu4MYeG7CY+7xSFH2AMgULyIkJgZ n28bs3VyjdIP2GuO8WXgEn9GLRcs3gLMWPzxFqyIacItm3Wo+3hVv5+zSMzBMdok+IzF+3 2ImlqzqvK2+SZtjwidxuFv6ymHiicoZ+Sm93hNsp2q7qAX2V66EQLc5XdoFXBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YpmDr0nGfzqfq; Thu, 06 Feb 2025 18:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 516IgaBc057899; Thu, 6 Feb 2025 18:42:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 516IgaIp057896; Thu, 6 Feb 2025 18:42:36 GMT (envelope-from git) Date: Thu, 6 Feb 2025 18:42:36 GMT Message-Id: <202502061842.516IgaIp057896@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: d8c9f53922c6 - main - cam/da: Add some comments about 28/0 asc List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.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 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: d8c9f53922c6ae083a0f49594c29b2df03d61c35 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d8c9f53922c6ae083a0f49594c29b2df03d61c35 commit d8c9f53922c6ae083a0f49594c29b2df03d61c35 Author: Warner Losh AuthorDate: 2025-02-06 18:18:59 +0000 Commit: Warner Losh CommitDate: 2025-02-06 18:40:22 +0000 cam/da: Add some comments about 28/0 asc We don't set the PACK_INVALID flag in response to asc 28/0 "NOT READY TO READY CHANGE, MEDIUM MAY HAVE CHANGED". Explain why: we usally retry this (since it's a UNIT ATTENTION) and it works and/or it's before daopen. In addition, improve the comment about the asysnc unit attention to make it a little more understandable. This is likely sufficient (it's been since before FreeBSD 3.0 when this hack was put in). Ideally, we'd verify what medium is there, but knowing when it's the same is a bit tricky... Differential Revision: https://reviews.freebsd.org/D48839 Sponsored by: Netflix --- sys/cam/scsi/scsi_da.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index f2f3951ebe80..c2805a71850c 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -2198,7 +2198,8 @@ daasync(void *callback_arg, uint32_t code, ccb = (union ccb *)arg; /* - * Handle all UNIT ATTENTIONs except our own, as they will be + * Unit attentions are broadcast to all the LUNs of the device + * so handle all UNIT ATTENTIONs except our own, as they will be * handled by daerror(). */ if (xpt_path_periph(ccb->ccb_h.path) != periph && @@ -6028,6 +6029,16 @@ daerror(union ccb *ccb, uint32_t cam_flags, uint32_t sense_flags) /* 28/0: NOT READY TO READY CHANGE, MEDIUM MAY HAVE CHANGED */ softc->flags &= ~DA_FLAG_PROBED; disk_media_changed(softc->disk, M_NOWAIT); + /* + * In an ideal world, we'd make sure that we have the + * same medium mounted (if we'd seen one already) but + * instead we don't invalidate the pack here and flag + * below to retry the UAs. If we exhaust retries, then + * we'll invalidate it in dadone for ENXIO errors (which + * 28/0 will fail with eventually). Usually, retrying + * just works and/or we get this before we've opened the + * device (which clears the invalid flag). + */ } else if (sense_key == SSD_KEY_UNIT_ATTENTION && asc == 0x3F && ascq == 0x03) { /* 3f/3: INQUIRY DATA HAS CHANGED */