From nobody Mon Dec 06 17:25:44 2021 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 434CF18C20F3; Mon, 6 Dec 2021 17:25:45 +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 4J79Lc3HcVz3QF3; Mon, 6 Dec 2021 17:25:44 +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 2E9177CCD; Mon, 6 Dec 2021 17:25:44 +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 1B6HPiwR055648; Mon, 6 Dec 2021 17:25:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B6HPi4h055647; Mon, 6 Dec 2021 17:25:44 GMT (envelope-from git) Date: Mon, 6 Dec 2021 17:25:44 GMT Message-Id: <202112061725.1B6HPi4h055647@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: b8194f376667 - main - nvd: For AHCI attached devices, report ahci bridge 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: b8194f37666768dac35a0e1105c41242aad9b2d0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638811544; 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=/j+19eByKkcg2RsAfOKAliB8ZYhBSmBq+Q8VcnPh+/U=; b=EeUOO7HfK2Abz/3/YtsMJm58DH92eS0nPv8I43tjMa92nZyohKSvhbLIUGDJA1REn2p3qS O1+c6WOCLaVTi1H9q1r/B6xmM/Rap5cdo/JcbsYzVfK01sLA5UZ4zY3RB2VIlKUzwhsei7 PRllkrnl3tisWLt9242fdQqHDoawXQDhNhm3roHar1cDceFfBVnZgUZip+MgOLXJdjHgmT yklnAc3BhBb1xd0p0Z/UPz95u9PShgu/U2XtT20ueTQAj2JsWUEm0+VLx/HG0Ez/bboh6h 9rUjrj4MGzN0+PvxQQ/HLhCgqQcn/NItwhxqaBgfAC+iwD61PESBUV2OZQV3vA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638811544; a=rsa-sha256; cv=none; b=XYjC0lCl1FczRyp46lj0adx9uB4TdSFXAxU4/4ru+KfQAY1A07IMGIL5Sg/4ARxog8rnO+ 5ifloGkeBBsG7A0S9IPrjahm6ZCYQwINa1uvGJD2FKnZ7T09+bYLrLLBUOGrshXtQgIO9m c2m3m6bIFZparYbcj/+THBtq6aLWSwBk61QwRg3mDVzONX7jRO8LK21uVD6Vs8586XVQtk mgZbc9Y9LqFRvfPrTSvQHOQMH2QBpoEt0BQfJeK9PI/j3KUTfHzgtnj71kl5dZjYDOCr2e 6d7+q8hKIYfr0YNK7FS2ABxmn9F8lWEOc21eW567Gq+Vz8N+aFRsc2cipLL8Mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b8194f37666768dac35a0e1105c41242aad9b2d0 commit b8194f37666768dac35a0e1105c41242aad9b2d0 Author: Warner Losh AuthorDate: 2021-12-06 17:23:14 +0000 Commit: Warner Losh CommitDate: 2021-12-06 17:23:40 +0000 nvd: For AHCI attached devices, report ahci bridge When an NVME device is attached via a AHCI controller, we have no access to its config space. So instead of information about the nvme drive itself, return info about the AHCI controller as the next best thing. Since the Intel Hardware RAID support looks at these values, this likely is best. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D33286 --- sys/dev/nvd/nvd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/nvd/nvd.c b/sys/dev/nvd/nvd.c index 061304471905..ea44458885d2 100644 --- a/sys/dev/nvd/nvd.c +++ b/sys/dev/nvd/nvd.c @@ -484,6 +484,13 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg) NVME_MODEL_NUMBER_LENGTH); strlcpy(disk->d_descr, descr, sizeof(descr)); + /* + * For devices that are reported as children of the AHCI controller, + * which has no access to the config space for this controller, report + * the AHCI controller's data. + */ + if (ctrlr->ctrlr->quirks & QUIRK_AHCI) + dev = device_get_parent(dev); disk->d_hba_vendor = pci_get_vendor(dev); disk->d_hba_device = pci_get_device(dev); disk->d_hba_subvendor = pci_get_subvendor(dev);