From owner-dev-commits-src-all@freebsd.org Mon Mar 8 00:11:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 034EE5554C3; Mon, 8 Mar 2021 00:11: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DtzKP6lYgz4qj7; Mon, 8 Mar 2021 00:11:37 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 DACC71F7A0; Mon, 8 Mar 2021 00:11:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1280BbD9070205; Mon, 8 Mar 2021 00:11:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1280BbaZ070204; Mon, 8 Mar 2021 00:11:37 GMT (envelope-from git) Date: Mon, 8 Mar 2021 00:11:37 GMT Message-Id: <202103080011.1280BbaZ070204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: be56d474e3c2 - stable/13 - camcontrol: change hueristic for I/O-less devtype 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/stable/13 X-Git-Reftype: branch X-Git-Commit: be56d474e3c283dff1b651fd3436739585a5972b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Mar 2021 00:11:38 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=be56d474e3c283dff1b651fd3436739585a5972b commit be56d474e3c283dff1b651fd3436739585a5972b Author: Warner Losh AuthorDate: 2021-02-23 19:33:26 +0000 Commit: Warner Losh CommitDate: 2021-03-07 23:07:30 +0000 camcontrol: change hueristic for I/O-less devtype Some SATA drives have 'config' set to 0 in the identify block. Rather than rely on it, use the strings windows uses to display the drive since they are supposed to be space padded and will always be non-zero. (cherry picked from commit 6b7580f7b1b66134286813b971ab575862b95426) --- sbin/camcontrol/camcontrol.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index cc21a109343c..27d545d924b3 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -5520,9 +5520,14 @@ get_device_type(struct cam_device *dev, int retry_count, int timeout, * For a retry count of -1, used only the cached data to avoid * I/O to the drive. Sending the identify command to the drive * can cause issues for SATL attachaed drives since identify is - * not an NCQ command. + * not an NCQ command. We check for the strings that windows + * displays since those will not be NULs (they are supposed + * to be space padded). We could check other bits, but anything + * non-zero implies SATL. */ - if (cgd.ident_data.config != 0) + if (cgd.ident_data.serial[0] != 0 || + cgd.ident_data.revision[0] != 0 || + cgd.ident_data.model[0] != 0) *devtype = CC_DT_SATL; else *devtype = CC_DT_SCSI;