linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karol Herbst <kherbst@redhat.com>
To: nouveau@lists.freedesktop.org
Cc: Lyude Paul <lyude@redhat.com>,
	linux-pci@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org>,
	Karol Herbst <kherbst@redhat.com>
Subject: [PATCH v2 3/4] pci: add nvkm_pcie_get_speed
Date: Tue,  7 May 2019 22:12:44 +0200	[thread overview]
Message-ID: <20190507201245.9295-4-kherbst@redhat.com> (raw)
In-Reply-To: <20190507201245.9295-1-kherbst@redhat.com>

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
---
 drm/nouveau/include/nvkm/subdev/pci.h | 1 +
 drm/nouveau/nvkm/subdev/pci/pcie.c    | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/drm/nouveau/include/nvkm/subdev/pci.h b/drm/nouveau/include/nvkm/subdev/pci.h
index 23803cc8..1fdf3098 100644
--- a/drm/nouveau/include/nvkm/subdev/pci.h
+++ b/drm/nouveau/include/nvkm/subdev/pci.h
@@ -53,4 +53,5 @@ int gp100_pci_new(struct nvkm_device *, int, struct nvkm_pci **);
 
 /* pcie functions */
 int nvkm_pcie_set_link(struct nvkm_pci *, enum nvkm_pcie_speed, u8 width);
+enum nvkm_pcie_speed nvkm_pcie_get_speed(struct nvkm_pci *);
 #endif
diff --git a/drm/nouveau/nvkm/subdev/pci/pcie.c b/drm/nouveau/nvkm/subdev/pci/pcie.c
index d71e5db5..70ccbe0d 100644
--- a/drm/nouveau/nvkm/subdev/pci/pcie.c
+++ b/drm/nouveau/nvkm/subdev/pci/pcie.c
@@ -163,3 +163,11 @@ nvkm_pcie_set_link(struct nvkm_pci *pci, enum nvkm_pcie_speed speed, u8 width)
 
 	return ret;
 }
+
+enum nvkm_pcie_speed
+nvkm_pcie_get_speed(struct nvkm_pci *pci)
+{
+	if (!pci || !pci_is_pcie(pci->pdev) || !pci->pcie.cur_speed)
+		return -ENODEV;
+	return pci->func->pcie.cur_speed(pci);
+}
-- 
2.21.0


  parent reply	other threads:[~2019-05-07 20:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 20:12 [PATCH v2 0/4] Potential fix for runpm issues on various laptops Karol Herbst
2019-05-07 20:12 ` [PATCH v2 1/4] drm: don't set the pci power state if the pci subsystem handles the ACPI bits Karol Herbst
2019-05-08 19:10   ` Lyude Paul
2019-05-07 20:12 ` [PATCH v2 2/4] pci: enable pcie link changes for pascal Karol Herbst
2019-05-20 21:25   ` Bjorn Helgaas
2019-05-07 20:12 ` Karol Herbst [this message]
2019-05-07 20:12 ` [PATCH v2 4/4] pci: save the boot pcie link speed and restore it on fini Karol Herbst
2019-05-20 21:19   ` Bjorn Helgaas
2019-05-20 22:30     ` Karol Herbst
2019-05-21 13:10       ` Bjorn Helgaas
2019-05-21 13:28         ` Karol Herbst
2019-05-21 13:50           ` [Nouveau] " Ilia Mirkin
2019-05-21 13:56             ` Karol Herbst
2019-05-21 14:13           ` Bjorn Helgaas
2019-05-21 14:30             ` Karol Herbst
2019-05-21 17:35               ` Karol Herbst
2019-05-21 17:48                 ` Karol Herbst
2019-06-03 13:18                   ` Karol Herbst
2019-06-03 18:10                     ` Bjorn Helgaas
2019-06-19 12:07                       ` Karol Herbst
2019-06-19 12:12                         ` Karol Herbst
2019-06-24 15:04                           ` Karol Herbst
2019-05-20 13:23 ` [PATCH v2 0/4] Potential fix for runpm issues on various laptops Karol Herbst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190507201245.9295-4-kherbst@redhat.com \
    --to=kherbst@redhat.com \
    --cc=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=nouveau@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).