All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bios/perf: Correctly parse PCIe speeds for ver 0x40
@ 2017-04-05 21:46 Karol Herbst
  0 siblings, 0 replies; only message in thread
From: Karol Herbst @ 2017-04-05 21:46 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
---
 drm/nouveau/nvkm/subdev/bios/perf.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drm/nouveau/nvkm/subdev/bios/perf.c b/drm/nouveau/nvkm/subdev/bios/perf.c
index c3068358..9fdf3736 100644
--- a/drm/nouveau/nvkm/subdev/bios/perf.c
+++ b/drm/nouveau/nvkm/subdev/bios/perf.c
@@ -146,18 +146,16 @@ nvbios_perfEp(struct nvkm_bios *bios, int idx,
 		break;
 	case 0x40:
 		info->voltage  = nvbios_rd08(bios, perf + 0x02);
-		switch (nvbios_rd08(bios, perf + 0xb) & 0x3) {
-		case 0:
-			info->pcie_speed = NVKM_PCIE_SPEED_5_0;
-			break;
-		case 3:
-		case 1:
+		switch (nvbios_rd08(bios, perf + 0xb) & 0x21) {
+		case 0x01:
 			info->pcie_speed = NVKM_PCIE_SPEED_2_5;
 			break;
-		case 2:
-			info->pcie_speed = NVKM_PCIE_SPEED_8_0;
+		case 0x20:
+			info->pcie_speed = NVKM_PCIE_SPEED_5_0;
 			break;
+		case 0x00:
 		default:
+			info->pcie_speed = NVKM_PCIE_SPEED_8_0;
 			break;
 		}
 		info->pcie_width = 0xff;
-- 
2.12.2

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-05 21:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05 21:46 [PATCH] bios/perf: Correctly parse PCIe speeds for ver 0x40 Karol Herbst

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.