From nobody Fri Jan 21 18:50:32 2022 X-Original-To: dev-commits-src-branches@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 17D3A19677BA; Fri, 21 Jan 2022 18:50:33 +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 4JgT3D6D3pz3GbL; Fri, 21 Jan 2022 18:50:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642791033; 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=QynsBextp6RDhALQgmbv3s+czntdXpg6lwvBc5q4+kg=; b=BLSAyvR2mKnOL5TzB5ESADW3n82qgHQcI9P3KJwfh9yZQcanVt8s3QpMGO4GhTg40wH6zd oS2tdySWkBX9PDQhtXtUyaAgr0GiWJquykwj2oHGYWLfgFYinNlxs/UE+nuHSZ7gWC+lrM PSO7OiNzxiiFFArZzo7JXQCCkRczXE3vIb/QZIFIZtaLTEjk6mkEz7YwU6Sorqb+szl5TL CkTQhn8gudVQhszO1ssmAELHlYKNXk9P3hB9tgMWtM4jumPhlR1peejQbhy/3o2ngdF4sU VZL5yIdOPGZtXeKDygc173D6at2P2xJvZ32FsXuzdEPDHCNXSFRsipASmjjySA== 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 A073D209E4; Fri, 21 Jan 2022 18:50:32 +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 20LIoWi8017534; Fri, 21 Jan 2022 18:50:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20LIoWEZ017533; Fri, 21 Jan 2022 18:50:32 GMT (envelope-from git) Date: Fri, 21 Jan 2022 18:50:32 GMT Message-Id: <202201211850.20LIoWEZ017533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 67873a4fcabf - stable/13 - nvd: For AHCI attached devices, report ahci bridge List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 67873a4fcabfd9f9dbd95be978df535209d8cc84 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642791033; 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=QynsBextp6RDhALQgmbv3s+czntdXpg6lwvBc5q4+kg=; b=p2DL0h2LgvWCUsL2gI39y82B2da9i9vKhjSBIja4wfD3UzzBhYiAV9tLoFhNWvPeLUOAfH 2rchBKQrfOUIpr2OsQ06uydk4MYeoxX5SqRCHPbBA19naTnLAP2/PRfstSPLSsaZL4GGhp cGSBoD0IVIL2bOrVDyU1m6Y6qvUDLErwTVddnzmvhmnoAIxo12eEwVbru6/BhHN4R+Srwe dn0tPkHG+3AXdam6AIbI461FrDBdLdm2xs+uAYvtYSix+iwP0wcHrorrLKPlJIeBW4ouzO Vy9in2y8qdBc6gyAIATCeUOb97qTjx9dFkiP7ikfBpElLTAL0dnOFkhcXNV7mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642791033; a=rsa-sha256; cv=none; b=ohaYz42SWBHFJ+3w4d5o5zhP7i+JqYKokkJWgK1nbTlNmdyrwGLQR/JcIldHalCUX9xXnI WIN4+oO37TjfItZ/Z/BlJizyQtqcfxIU0BOYxlzyHfORB/4h/DULd+QHkH8mfcpd0Fp872 opvp0spCY3RwIA18vxRdFqpBYCZejLn6v66h9/A/cp9xXhb+OhpwdjAKrz34bj7ZEaZq7S gz5Z8eyjRD9Q5XhgUUKRe704tcgw/RnsqHbMZDNkz6Mcbhi0Gze27+YvzEvCJTq2ldJ4x6 cUV3DcPqxhKH6lwL8nbAabims4Sh1OOoL1NN99n0GrGP+Pq0+eF7FItul+M5Uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=67873a4fcabfd9f9dbd95be978df535209d8cc84 commit 67873a4fcabfd9f9dbd95be978df535209d8cc84 Author: Warner Losh AuthorDate: 2021-12-06 17:23:14 +0000 Commit: Alexander Motin CommitDate: 2022-01-21 18:49:57 +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 (cherry picked from commit b8194f37666768dac35a0e1105c41242aad9b2d0) --- 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);