linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Ilia Mirkin <imirkin@alum.mit.edu>,
	Ben Skeggs <bskeggs@redhat.com>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.0 80/93] drm/nouveau/volt/gf117: fix speedo readout register
Date: Thu, 18 Apr 2019 19:57:58 +0200	[thread overview]
Message-ID: <20190418160445.105440887@linuxfoundation.org> (raw)
In-Reply-To: <20190418160436.781762249@linuxfoundation.org>

[ Upstream commit fc782242749fa4235592854fafe1a1297583c1fb ]

GF117 appears to use the same register as GK104 (but still with the
general Fermi readout mechanism).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108980
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../drm/nouveau/include/nvkm/subdev/volt.h    |  1 +
 .../gpu/drm/nouveau/nvkm/engine/device/base.c |  2 +-
 .../gpu/drm/nouveau/nvkm/subdev/volt/Kbuild   |  1 +
 .../gpu/drm/nouveau/nvkm/subdev/volt/gf117.c  | 60 +++++++++++++++++++
 4 files changed, 63 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c

diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h
index 8a0f85f5fc1a..6a765682fbfa 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h
@@ -38,6 +38,7 @@ int nvkm_volt_set_id(struct nvkm_volt *, u8 id, u8 min_id, u8 temp,
 
 int nv40_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
 int gf100_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
+int gf117_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
 int gk104_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
 int gk20a_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
 int gm20b_volt_new(struct nvkm_device *, int, struct nvkm_volt **);
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
index d9edb5785813..d75fa7678483 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
@@ -1613,7 +1613,7 @@ nvd7_chipset = {
 	.pci = gf106_pci_new,
 	.therm = gf119_therm_new,
 	.timer = nv41_timer_new,
-	.volt = gf100_volt_new,
+	.volt = gf117_volt_new,
 	.ce[0] = gf100_ce_new,
 	.disp = gf119_disp_new,
 	.dma = gf119_dma_new,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild
index bcd179ba11d0..146adcdd316a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild
@@ -2,6 +2,7 @@ nvkm-y += nvkm/subdev/volt/base.o
 nvkm-y += nvkm/subdev/volt/gpio.o
 nvkm-y += nvkm/subdev/volt/nv40.o
 nvkm-y += nvkm/subdev/volt/gf100.o
+nvkm-y += nvkm/subdev/volt/gf117.o
 nvkm-y += nvkm/subdev/volt/gk104.o
 nvkm-y += nvkm/subdev/volt/gk20a.o
 nvkm-y += nvkm/subdev/volt/gm20b.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c
new file mode 100644
index 000000000000..547a58f0aeac
--- /dev/null
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gf117.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2019 Ilia Mirkin
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Ilia Mirkin
+ */
+#include "priv.h"
+
+#include <subdev/fuse.h>
+
+static int
+gf117_volt_speedo_read(struct nvkm_volt *volt)
+{
+	struct nvkm_device *device = volt->subdev.device;
+	struct nvkm_fuse *fuse = device->fuse;
+
+	if (!fuse)
+		return -EINVAL;
+
+	return nvkm_fuse_read(fuse, 0x3a8);
+}
+
+static const struct nvkm_volt_func
+gf117_volt = {
+	.oneinit = gf100_volt_oneinit,
+	.vid_get = nvkm_voltgpio_get,
+	.vid_set = nvkm_voltgpio_set,
+	.speedo_read = gf117_volt_speedo_read,
+};
+
+int
+gf117_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt)
+{
+	struct nvkm_volt *volt;
+	int ret;
+
+	ret = nvkm_volt_new_(&gf117_volt, device, index, &volt);
+	*pvolt = volt;
+	if (ret)
+		return ret;
+
+	return nvkm_voltgpio_init(volt);
+}
-- 
2.19.1




  parent reply	other threads:[~2019-04-18 18:15 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 17:56 [PATCH 5.0 00/93] 5.0.9-stable review Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 01/93] ARC: u-boot args: check that magic number is correct Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 02/93] arc: hsdk_defconfig: Enable CONFIG_BLK_DEV_RAM Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 03/93] inotify: Fix fsnotify_mark refcount leak in inotify_update_existing_watch() Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 04/93] perf/core: Restore mmap record type correctly Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 05/93] perf data: Dont store auxtrace index for directory data file Greg Kroah-Hartman
2019-04-18 19:28   ` Thomas Backlund
2019-04-19 13:25     ` Sasha Levin
2019-04-20  8:48       ` Jiri Olsa
2019-04-18 19:29   ` Dan Rue
2019-04-18 17:56 ` [PATCH 5.0 06/93] mips: bcm47xx: Enable USB power on Netgear WNDR3400v2 Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 07/93] ext4: avoid panic during forced reboot Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 08/93] ext4: add missing brelse() in add_new_gdb_meta_bg() Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 09/93] ext4: report real fs size after failed resize Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 10/93] ALSA: echoaudio: add a check for ioremap_nocache Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 11/93] ALSA: sb8: add a check for request_region Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 12/93] auxdisplay: hd44780: Fix memory leak on ->remove() Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 13/93] drm/udl: use drm_gem_object_put_unlocked Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 14/93] IB/mlx4: Fix race condition between catas error reset and aliasguid flows Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 15/93] i40iw: Avoid panic when handling the inetdev event Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 16/93] mmc: davinci: remove extraneous __init annotation Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 17/93] ALSA: opl3: fix mismatch between snd_opl3_drum_switch definition and declaration Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 18/93] paride/pf: cleanup queues when detection fails Greg Kroah-Hartman
2019-04-19  7:13   ` nobuhiro1.iwamatsu
2019-04-19 13:30     ` Sasha Levin
2019-04-18 17:56 ` [PATCH 5.0 19/93] paride/pcd: " Greg Kroah-Hartman
2019-04-19  7:13   ` nobuhiro1.iwamatsu
2019-04-19 13:32     ` Sasha Levin
2019-04-18 17:56 ` [PATCH 5.0 20/93] thermal/intel_powerclamp: fix __percpu declaration of worker_data Greg Kroah-Hartman
2019-04-18 17:56 ` [PATCH 5.0 21/93] thermal: samsung: Fix incorrect check after code merge Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 22/93] thermal: bcm2835: Fix crash in bcm2835_thermal_debugfs Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 23/93] thermal/int340x_thermal: Add additional UUIDs Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 24/93] thermal/int340x_thermal: fix mode setting Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 25/93] thermal/intel_powerclamp: fix truncated kthread name Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 26/93] scsi: iscsi: flush running unbind operations when removing a session Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 27/93] sched/cpufreq: Fix 32-bit math overflow Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 28/93] sched/core: Fix buffer overflow in cgroup2 property cpu.max Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 29/93] x86/mm: Dont leak kernel addresses Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 30/93] tools/power turbostat: return the exit status of a command Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 31/93] scsi: core: Also call destroy_rcu_head() for passthrough requests Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 32/93] scsi: qla2xxx: Fix NULL pointer crash due to stale CPUID Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 33/93] perf stat: Fix --no-scale Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 34/93] perf list: Dont forget to drop the reference to the allocated thread_map Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 35/93] perf tools: Fix errors under optimization level -Og Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 36/93] perf config: Fix an error in the config template documentation Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 37/93] perf config: Fix a memory leak in collect_config() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 38/93] perf build-id: Fix memory leak in print_sdt_events() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 39/93] perf top: Delete the evlist before perf_session, fixing heap-use-after-free issue Greg Kroah-Hartman
2019-04-18 19:31   ` Dan Rue
2019-04-19 13:35     ` Sasha Levin
2019-04-18 19:33   ` Thomas Backlund
2019-04-18 17:57 ` [PATCH 5.0 40/93] perf top: Fix error handling in cmd_top() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 41/93] perf hist: Add missing map__put() in error case Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 42/93] perf map: Remove map from names tree in __maps__remove() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 43/93] perf maps: Purge all maps from the names tree Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 44/93] perf top: Fix global-buffer-overflow issue Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 45/93] perf evsel: Free evsel->counts in perf_evsel__exit() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 46/93] perf tests: Fix a memory leak of cpu_map object in the openat_syscall_event_on_all_cpus test Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 47/93] perf tests: Fix memory leak by expr__find_other() in test__expr() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 48/93] perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 49/93] ACPI / utils: Drop reference in test for device presence Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 50/93] PM / Domains: Avoid a potential deadlock Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 51/93] blk-iolatency: #include "blk.h" Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 52/93] drm/exynos/mixer: fix MIXER shadow registry synchronisation code Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 53/93] irqchip/stm32: Dont clear rising/falling config registers at init Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 54/93] irqchip/stm32: Dont set rising configuration " Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 55/93] irqchip/mbigen: Dont clear eventid when freeing an MSI Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 56/93] x86/hpet: Prevent potential NULL pointer dereference Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 57/93] x86/hyperv: " Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 58/93] x86/cpu/cyrix: Use correct macros for Cyrix calls on Geode processors Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 59/93] drm/nouveau/debugfs: Fix check of pm_runtime_get_sync failure Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 60/93] iommu/vt-d: Check capability before disabling protected memory Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 61/93] iommu/vt-d: Save the right domain ID used by hardware Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 62/93] x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 63/93] cifs: fix that return -EINVAL when do dedupe operation Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 64/93] fix incorrect error code mapping for OBJECTID_NOT_FOUND Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 65/93] cifs: Fix slab-out-of-bounds when tracing SMB tcon Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 66/93] x86/gart: Exclude GART aperture from kcore Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 67/93] ext4: prohibit fstrim in norecovery mode Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 68/93] lkdtm: Print real addresses Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 69/93] lkdtm: Add tests for NULL pointer dereference Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 70/93] drm/amdgpu: psp_ring_destroy cause psp->km_ring.ring_mem NULL Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 71/93] drm/panel: panel-innolux: set display off in innolux_panel_unprepare Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 72/93] net: hns3: Fix NULL deref when unloading driver Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 73/93] crypto: axis - fix for recursive locking from bottom half Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 74/93] Revert "ACPI / EC: Remove old CLEAR_ON_RESUME quirk" Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 75/93] RDMA/hns: Fix the Oops during rmmod or insmod ko when reset occurs Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 76/93] coresight: cpu-debug: Support for CA73 CPUs Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 77/93] PCI: Blacklist power management of Gigabyte X299 DESIGNARE EX PCIe ports Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 78/93] PCI/ASPM: Save LTR Capability for suspend/resume Greg Kroah-Hartman
2019-04-18 17:57 ` [PATCH 5.0 79/93] f2fs: sync filesystem after roll-forward recovery Greg Kroah-Hartman
2019-04-18 17:57 ` Greg Kroah-Hartman [this message]
2019-04-18 17:57 ` [PATCH 5.0 81/93] platform/x86: intel_pmc_core: Quirk to ignore XTAL shutdown Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 82/93] ARM: 8839/1: kprobe: make patch_lock a raw_spinlock_t Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 83/93] drm/amdkfd: use init_mqd function to allocate object for hid_mqd (CI) Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 84/93] appletalk: Fix use-after-free in atalk_proc_exit Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 85/93] cifs: return -ENODATA when deleting an xattr that does not exist Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 86/93] lib/div64.c: off by one in shift Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 87/93] rxrpc: Fix client call connect/disconnect race Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 88/93] f2fs: fix to dirty inode for i_mode recovery Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 89/93] f2fs: fix to use kvfree instead of kzfree Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 90/93] f2fs: fix to add refcount once page is tagged PG_private Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 91/93] include/linux/swap.h: use offsetof() instead of custom __swapoffset macro Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 92/93] bpf: fix use after free in bpf_evict_inode Greg Kroah-Hartman
2019-04-18 17:58 ` [PATCH 5.0 93/93] IB/hfi1: Failed to drain send queue when QP is put into error state Greg Kroah-Hartman
2019-04-19 10:08 ` [PATCH 5.0 00/93] 5.0.9-stable review Jon Hunter
2019-04-20 14:40   ` Greg Kroah-Hartman
2019-04-19 14:24 ` shuah
2019-04-20  7:05   ` Greg Kroah-Hartman
2019-04-19 19:41 ` Guenter Roeck
2019-04-19 21:00   ` Guenter Roeck
2019-04-20  7:05     ` Greg Kroah-Hartman
2019-04-20  4:52 ` Naresh Kamboju
2019-04-20 14:41   ` Greg Kroah-Hartman
2019-04-20 12:28 ` Bharath Vedartham
2019-04-20 14:41   ` Greg Kroah-Hartman

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=20190418160445.105440887@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=bskeggs@redhat.com \
    --cc=imirkin@alum.mit.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.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).