From nobody Mon Jan 27 03:41:37 2025 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 4YhDjt1C7Sz5m77R; Mon, 27 Jan 2025 03:41:38 +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 4YhDjt0Lyzz4J3F; Mon, 27 Jan 2025 03:41:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737949298; 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=jDi4U0mV3v2LlxpaS4Xk2VevoxIp5oBmdi7BSYDkOwQ=; b=aW+35jNcep8B56QY3OOlaW3Sex27uOpWfOSkKx+DQOmlpacntpN30B9TJjUmh2/urekBfj FEjdoEIE/iGlRjpW0eSBErCfyH8a1m4U86xC1jNvhtWwVsVV+Ca4xC/6zs/ebYAulhq0yr cUbEl9Umjm5UIsv27FK+Rh3Qg/TDCa5tEY7LkuatbcUyNBbi1hloA/Lb8TkkF60A1qFL9c rGRj/ltS1jkSELqgTEPuqSiW4rRfQajjMTskzZa5reI67luxkJy8gh2GvLUNnCMDZjitsu nN/P1gp8XIJCX3adunzQpmlC8B5x6hGZ1dvyQUVZdG3DDsVi+dbEVGfuXghcpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737949298; 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=jDi4U0mV3v2LlxpaS4Xk2VevoxIp5oBmdi7BSYDkOwQ=; b=FEhx6KEKVIY66vJ8OkSwAQTVfU58CQ071SWKm/NhsiI4Tqu+V+vRe5nmMspaqXzpHRL1u1 Z15HZvilgft+Qd/vL56JtFPcfqw80zfOL5kQ1QJZcE3vfVptZRTooYJP3Nm0+bgirSAVav dej224HsQOIZpnP6860fowGnIvaIy/bdUFzR7brMZ3u44/VlCD4EIstsGocYxKIRInVTck ZgxJ/dvP8dj/qbQ02oy7385+S4rN2LDYLPSkhJzP8bNfd+1ADzmgCvtfySRnVXr4r7B4pA W2r9QaZxhfyT0ct8nnuk1OWWjWQzNIarIjkC9EWztyTO4fuaMJVtXsGuSiEesA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737949298; a=rsa-sha256; cv=none; b=AUsWANagqxTBG640egHVhJ80sf7zPGuv3KvRYwdrOqC29u7X9h+QkSFz3au33+ld4K/n0r sag4CoyfYB3SfB2BQVfoCEWzJSoJeNo1kdsYVxoKp6M7ZhzNYzTa7abnIOGbEPBYiImJsS WLB65e+YjiAFLW10YL0y46dflhokpXqFkO+Xgh7EKWrj9D79ZQ1xToh/G20sdSOcn73RSH A3dYt4gpVpP2GBsGQUEgRcMNKFY8+cthle/MAE4si2263+aRBISRmVbg18/QDUoDbQLbnw LbFk3QlezyNlzXSxoEmryY6S7pB7pqZn7u1prdz8aZupQUHOCrF4DAMZCg2bqg== 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 4YhDjs6y6rz19kZ; Mon, 27 Jan 2025 03:41:37 +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 50R3fbMT064044; Mon, 27 Jan 2025 03:41:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50R3fbiv064041; Mon, 27 Jan 2025 03:41:37 GMT (envelope-from git) Date: Mon, 27 Jan 2025 03:41:37 GMT Message-Id: <202501270341.50R3fbiv064041@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: 0eacc5c43321 - main - cam/cd: Add comments about ASC/ASCQ codes 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 0eacc5c4332176b63d665f91f73f8be4a4294afb Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0eacc5c4332176b63d665f91f73f8be4a4294afb commit 0eacc5c4332176b63d665f91f73f8be4a4294afb Author: Warner Losh AuthorDate: 2025-01-27 03:32:37 +0000 Commit: Warner Losh CommitDate: 2025-01-27 03:35:20 +0000 cam/cd: Add comments about ASC/ASCQ codes I added these comments to da a while ago, and they seem good. Sponsored by: Netflix --- sys/cam/scsi/scsi_cd.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index 540419d4f153..d9a40544e845 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -466,6 +466,7 @@ cdasync(void *callback_arg, uint32_t code, if (xpt_path_periph(ccb->ccb_h.path) != periph && scsi_extract_sense_ccb(ccb, &error_code, &sense_key, &asc, &ascq)) { + /* 28/0: NOT READY TO READY CHANGE, MEDIUM MAY HAVE CHANGED */ if (asc == 0x28 && ascq == 0x00) disk_media_changed(softc->disk, M_NOWAIT); } @@ -1270,6 +1271,8 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) * CDROM or WORM device, as long as it * doesn't return a "Logical unit not * supported" (0x25) error. + * + * 25/0: LOGICAL UNIT NOT SUPPORTED */ if ((have_sense) && (asc != 0x25) && (error_code == SSD_CURRENT_ERROR @@ -2887,13 +2890,19 @@ cderror(union ccb *ccb, uint32_t cam_flags, uint32_t sense_flags) error = cd6byteworkaround(ccb); } else if (scsi_extract_sense_ccb(ccb, &error_code, &sense_key, &asc, &ascq)) { - if (sense_key == SSD_KEY_ILLEGAL_REQUEST) + if (sense_key == SSD_KEY_ILLEGAL_REQUEST) { error = cd6byteworkaround(ccb); - else if (sense_key == SSD_KEY_UNIT_ATTENTION && - asc == 0x28 && ascq == 0x00) + } else if (sense_key == SSD_KEY_UNIT_ATTENTION && + asc == 0x28 && ascq == 0x00) { + /* 28/0: NOT READY TO READY CHANGE, MEDIUM MAY HAVE CHANGED */ disk_media_changed(softc->disk, M_NOWAIT); - else if (sense_key == SSD_KEY_NOT_READY && + } else if (sense_key == SSD_KEY_NOT_READY && asc == 0x3a && (softc->flags & CD_FLAG_SAW_MEDIA)) { + /* 3a/0: MEDIUM NOT PRESENT */ + /* 3a/1: MEDIUM NOT PRESENT - TRAY CLOSED */ + /* 3a/2: MEDIUM NOT PRESENT - TRAY OPEN */ + /* 3a/3: MEDIUM NOT PRESENT - LOADABLE */ + /* 3a/4: MEDIUM NOT PRESENT - MEDIUM AUXILIARY MEMORY ACCESSIBLE */ softc->flags &= ~CD_FLAG_SAW_MEDIA; disk_media_gone(softc->disk, M_NOWAIT); }