From nobody Fri Apr 01 03:17:58 2022 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 75F201A4D18D; Fri, 1 Apr 2022 03:17:59 +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 4KV52v06pNz4gZt; Fri, 1 Apr 2022 03:17:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648783079; 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=qzC5heEdn1GOMQlcJ8nadvQtgEGOlTD7+gPi+8agE7U=; b=nEHt+eaMdZn9+b7FfDzG9fcvrbUKCKXqeyDmY5poU4P7L8JA2hBLfpsohzH5AEZu29Zq5j QLzzQNP9jTseWd6o+npTBHJqaFMpTSz9SU7ux9mPjpgr6AUDWFQe6Q2vmzoW6KPhUOmwCh O/C7dOlmZDB34i7rIEKl+EV9uWAPQsloUKluCbIMqOqTO2eQIZwhMk1PxdaXRq/+9gXFxh pXBOIbskWVTG39NUZ1e5SQ6sHbxSokKOHbNtWEwLajBf7pZ89CDDHFvIpXbfERGSacQB8S jUIJo2WfBtWVHjrnzBX1TCxY/6w8pCpiTwA21glhoITSdHgu0+M55pKST46Eyg== 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 C3EEE426E; Fri, 1 Apr 2022 03:17:58 +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 2313HwJ1003262; Fri, 1 Apr 2022 03:17:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2313Hwh4003261; Fri, 1 Apr 2022 03:17:58 GMT (envelope-from git) Date: Fri, 1 Apr 2022 03:17:58 GMT Message-Id: <202204010317.2313Hwh4003261@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: 6af6a52ee47b - main - nvme: Save cap_lo and cap_hi 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 6af6a52ee47bbe1b6148006bd33377f419f9643a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648783079; 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=qzC5heEdn1GOMQlcJ8nadvQtgEGOlTD7+gPi+8agE7U=; b=vl1dZ2YmSd8fJUbMwXBSdC/vgBjwTfMIrQCJ+FpIgUIPFD1Yg66iaARo268Qtc94uWQn2m 5XeLWZMiBllvUzkUUvZ93SS4weup/cwIQAK/fA63o1BnpGxbMlGy17QVSNtQsS7vQnwYUe 4wL95XpGV0AiPwRiKAOt+mCtbzyjwWbGVR++sZN5r61hbQ7PrMTFe1ZXurkkLUOPNnS62r uyE+0srSwqI5LcAG1utzBE/wVwNYO3BtfsplDos/lmyFA5TXImHR4EF5BiZ4eoy0XyRE/J u95vjlx508/4ugbiyPcPxj7yRXnUMNtXbyhFBad7gJjUT+DcS9wmSZUd/t9Xkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648783079; a=rsa-sha256; cv=none; b=sC7s6bHDZb9CPJl91YnnTNhPTI+Q9tZwL1QX1ZT4gQhYQjhgSIOf8laSGSDG+CfND6Q2Ai Z1rX7JoMciU3OlBAjAN85H86RdjdASprNKJVI7nm0sn8ubebutprOzM6DHPUKGGFKbNCkR jc+mhHlZu5SQ29Nln0l1yoaCHEHtQl3rZSgO8NBifNWZmFo7GCIqbTsMYoV65/CDCn8XKG b3NQw6CWtPhDPHQ+qTGGd87DxzlQkTEzSQpRLtKTrjaRYITdugOmszSPGGfMs9eJLhXihJ k0fvd6evXI084S9lHsKe8avahHXrxXJpRS5LETV5tzwzx7Rc7UsXVGhDjETIiw== 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=6af6a52ee47bbe1b6148006bd33377f419f9643a commit 6af6a52ee47bbe1b6148006bd33377f419f9643a Author: Warner Losh AuthorDate: 2022-03-29 22:59:05 +0000 Commit: Warner Losh CommitDate: 2022-04-01 03:12:38 +0000 nvme: Save cap_lo and cap_hi Save the capabilities for the drive. Sponsored by: Netflix --- sys/dev/nvme/nvme_ctrlr.c | 4 ++-- sys/dev/nvme/nvme_private.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index a632d7fb68e9..95a2b5c4285d 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1388,7 +1388,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev) if (bus_get_domain(dev, &ctrlr->domain) != 0) ctrlr->domain = 0; - cap_lo = nvme_mmio_read_4(ctrlr, cap_lo); + ctrlr->cap_lo = cap_lo = nvme_mmio_read_4(ctrlr, cap_lo); if (bootverbose) { device_printf(dev, "CapLo: 0x%08x: MQES %u%s%s%s%s, TO %u\n", cap_lo, NVME_CAP_LO_MQES(cap_lo), @@ -1398,7 +1398,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev) (NVME_CAP_LO_AMS(cap_lo) & 0x2) ? " VS" : "", NVME_CAP_LO_TO(cap_lo)); } - cap_hi = nvme_mmio_read_4(ctrlr, cap_hi); + ctrlr->cap_hi = cap_hi = nvme_mmio_read_4(ctrlr, cap_hi); if (bootverbose) { device_printf(dev, "CapHi: 0x%08x: DSTRD %u%s, CSS %x%s, " "MPSMIN %u, MPSMAX %u%s%s\n", cap_hi, diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index 977cc2c8d30d..eaf0468096c4 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -284,6 +284,10 @@ struct nvme_controller { /** maximum i/o size in bytes */ uint32_t max_xfer_size; + /** LO and HI capacity mask */ + uint32_t cap_lo; + uint32_t cap_hi; + /** minimum page size supported by this controller in bytes */ uint32_t min_page_size;