[Nouveau] [Bug 102648] [ASUS X556UR] Can't use Nvidia gpu after Suspend/Wake

2017-09-15 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=102648 RazorSiS changed: What|Removed |Added Summary|unable to use nvidia gpu|[ASUS X556UR] Can't use |a

[Nouveau] [RFC PATCH 27/29] clk: implement limiting pstates just like we do for cstates

2017-09-15 Thread Karol Herbst
Signed-off-by: Karol Herbst --- drm/nouveau/nvkm/subdev/clk/base.c | 62 -- 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/drm/nouveau/nvkm/subdev/clk/base.c b/drm/nouveau/nvkm/subdev/clk/base.c index 9f44ace0..2a51c078 100644 --- a/drm/nouvea

[Nouveau] [RFC PATCH 19/29] secboot/acr352: reset PMU after secboot

2017-09-15 Thread Karol Herbst
This is needed for using Nouveaus PMU image after performing secboot. This will be helpfull for Maxwell2 reclocking on boards without externally controlled fans like on most laptops or fanless boards. Signed-off-by: Karol Herbst --- drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 13 +

[Nouveau] [RFC PATCH 24/29] bios/vpstate: there are some fermi vbios with no boost or tdp entry

2017-09-15 Thread Karol Herbst
Signed-off-by: Karol Herbst --- drm/nouveau/nvkm/subdev/bios/vpstate.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drm/nouveau/nvkm/subdev/bios/vpstate.c b/drm/nouveau/nvkm/subdev/bios/vpstate.c index 20b6fc82..71524548 100644 --- a/drm/nouveau/nvkm/subdev/bios

[Nouveau] [RFC PATCH 17/29] clk: thermal throttling

2017-09-15 Thread Karol Herbst
v2: make message about relaxed throttling an info rework reporting about current clk state Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/subdev/clk.h | 1 + drm/nouveau/nvkm/subdev/clk/base.c| 44 +-- 2 files changed, 33 insertions(+), 12 delet

[Nouveau] [RFC PATCH 16/29] clk: parse thermal policies for throttling thresholds

2017-09-15 Thread Karol Herbst
v2: use min_t Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/subdev/clk.h | 2 ++ drm/nouveau/nvkm/subdev/clk/base.c| 42 +++ 2 files changed, 44 insertions(+) diff --git a/drm/nouveau/include/nvkm/subdev/clk.h b/drm/nouveau/include/nvkm/subdev/cl

[Nouveau] [RFC PATCH 14/29] therm: Trigger reclock in temperature daemon

2017-09-15 Thread Karol Herbst
Depending on the temperature, cstates might become unreachable or the maped voltage of a cstate changes. We want to adjust to that. Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/nvkm/subdev/therm/base.c | 8 1 file changed, 8 insertions(+) diff --git a/drm/nouv

[Nouveau] [RFC PATCH 25/29] bios/vpstate: parse max battery id

2017-09-15 Thread Karol Herbst
Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/subdev/bios/vpstate.h | 1 + drm/nouveau/nvkm/subdev/bios/vpstate.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drm/nouveau/include/nvkm/subdev/bios/vpstate.h b/drm/nouveau/include/nvkm/subdev/bios/vpstat

[Nouveau] [RFC PATCH 29/29] clk: limit clocks on battery

2017-09-15 Thread Karol Herbst
Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/subdev/clk.h | 1 + drm/nouveau/nvkm/subdev/clk/base.c| 18 ++ 2 files changed, 19 insertions(+) diff --git a/drm/nouveau/include/nvkm/subdev/clk.h b/drm/nouveau/include/nvkm/subdev/clk.h index 70505c9b..fae45e6e 1006

[Nouveau] [RFC PATCH 23/29] debugfs: Add boost interface to change the boost_mode

2017-09-15 Thread Karol Herbst
Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/nouveau_debugfs.c | 80 +++ 1 file changed, 80 insertions(+) diff --git a/drm/nouveau/nouveau_debugfs.c b/drm/nouveau/nouveau_debugfs.c index b0a598f9..c19cc535 100644 --- a/drm/nouveau

[Nouveau] [RFC PATCH 28/29] clk: move the switch out of the loop in nvkm_cstate_valid

2017-09-15 Thread Karol Herbst
Signed-off-by: Karol Herbst --- drm/nouveau/nvkm/subdev/clk/base.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/drm/nouveau/nvkm/subdev/clk/base.c b/drm/nouveau/nvkm/subdev/clk/base.c index 2a51c078..994d32b9 100644 --- a/drm/nouveau/

[Nouveau] [RFC PATCH 18/29] clk: Only do partial reclocks as required

2017-09-15 Thread Karol Herbst
Signed-off-by: Karol Herbst --- drm/nouveau/nvkm/subdev/clk/base.c | 26 ++ drm/nouveau/nvkm/subdev/volt/base.c | 3 +++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/drm/nouveau/nvkm/subdev/clk/base.c b/drm/nouveau/nvkm/subdev/clk/base.c index 72ca5e0

[Nouveau] [RFC PATCH 26/29] clk: refactor the base and boost clock limits so that we can limit pstates as well

2017-09-15 Thread Karol Herbst
Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/subdev/clk.h | 9 +++-- drm/nouveau/nvkm/engine/device/ctrl.c | 8 drm/nouveau/nvkm/subdev/clk/base.c| 34 +- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/drm/nouveau/in

[Nouveau] [RFC PATCH 21/29] clk: Save the max clock we can set

2017-09-15 Thread Karol Herbst
Saving the highest possible clock from the vpstate domain makes it easier to read it out whenever we want. Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/include/nvkm/subdev/clk.h | 1 + drm/nouveau/nvkm/subdev/clk/base.c| 2 ++ 2 files changed, 3 insertions(+) diff

[Nouveau] [RFC PATCH 15/29] bios: add thermal policies table

2017-09-15 Thread Karol Herbst
Signed-off-by: Karol Herbst --- .../include/nvkm/subdev/bios/thermal_policies.h| 27 drm/nouveau/nvkm/subdev/bios/Kbuild| 1 + drm/nouveau/nvkm/subdev/bios/thermal_policies.c| 81 ++ 3 files changed, 109 insertions(+) create mode 100644 drm/n

[Nouveau] [RFC PATCH 20/29] device: enable clk for Maxwell2

2017-09-15 Thread Karol Herbst
Reclokcing will only be enabled by setting NvFanless to true. Signed-off-by: Karol Herbst --- drm/nouveau/nvkm/engine/device/base.c | 3 +++ drm/nouveau/nvkm/subdev/clk/gk104.c | 10 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drm/nouveau/nvkm/engine/device/base.

[Nouveau] [RFC PATCH 22/29] nvif: Add boost info and set operations

2017-09-15 Thread Karol Herbst
v5: Return ENODEV on devices without any vpstates. Fail earlier if not supported. Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/include/nvif/if0001.h | 15 + drm/nouveau/nvkm/engine/device/ctrl.c | 61 +++ 2 files changed,

[Nouveau] [RFC PATCH 12/29] therm: Don't cancel the timer

2017-09-15 Thread Karol Herbst
We will need a always running therm daemon to adjust the voltage/clocks on the fly. Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/nvkm/subdev/therm/base.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drm/nouveau/nvkm/subdev/therm/base.c b

[Nouveau] [RFC PATCH 13/29] therm: Move the temp readout into the alarm

2017-09-15 Thread Karol Herbst
It makes more sense to read out the temperature in the alarm, because we want to do various things with it: 1. adjust the fans 2. notify the clk subdev about the changed temperature Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/subdev/therm.h | 1 + drm/nouveau/nvkm/subdev/therm/ba

[Nouveau] [RFC PATCH 11/29] debugfs: Wake up GPU before doing any reclocking

2017-09-15 Thread Karol Herbst
Fixes various reclocking related issues on prime systems Signed-off-by: Karol Herbst --- drm/nouveau/nouveau_debugfs.c | 4 1 file changed, 4 insertions(+) diff --git a/drm/nouveau/nouveau_debugfs.c b/drm/nouveau/nouveau_debugfs.c index 27281c4e..b0a598f9 100644 --- a/drm/nouveau/nouveau_d

[Nouveau] [RFC PATCH 09/29] clk: Set clocks to pre suspend state after suspend

2017-09-15 Thread Karol Herbst
The idea is to clear out the saved state, because after a resume we can't know what the GPU is clocked to. The reclock is triggered by the call to nvkm_clk_update later in nvkm_clk_init. v2: convert to C style comments Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/nvkm/

[Nouveau] [RFC PATCH 03/29] subdev/volt/gk104: return error when read fails

2017-09-15 Thread Karol Herbst
While my gpu was powered off, hwmon returned 0.6V as the current voltage. If nvkm_rd32 fails for any reason, return the error. With that sensors will display a "N/A" instead of 0.6V. Signed-off-by: Karol Herbst --- drm/nouveau/nvkm/subdev/volt/gk104.c | 7 ++- 1 file changed, 6 insertions(+

[Nouveau] [RFC PATCH 08/29] clk: We should pass the pstate id around not the index in the list

2017-09-15 Thread Karol Herbst
This makes the code easier, because we can compare the id with pstate->pstate and saves us from the trouble of iterating over the pstates to match the index. v2: reword commit message Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/nouveau_debugfs.c | 6 +-- drm/nou

[Nouveau] [RFC PATCH 01/29] therm: split return code and value in nvkm_get_temp

2017-09-15 Thread Karol Herbst
The current hwmon code doesn't check if the returned value was actually an error. Since Kepler temperature sensors are able to report negative values. Since Pascal (and maybe earlier) we have sensors with improved precision. Adjust the nvkm_get_temp method to be able to deal with those changes an

[Nouveau] [RFC PATCH 10/29] core/device: Move therm behind clk

2017-09-15 Thread Karol Herbst
Later therm will depend on clk reporting new temperatures and triggereing reclocks for thermal throttling or therm related voltage/clock adjustments. Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/core/device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drm/nou

[Nouveau] [RFC PATCH 04/29] clk: Rename nvkm_pstate_calc to nvkm_clk_update and export it

2017-09-15 Thread Karol Herbst
This function will be used to update the current clock state. This will happen for various reasons: * Temperature changes * User changes clocking state * Load changes v2: remove parameter name Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/subdev/clk.h | 1 + drm/nouveau/nvkm/

[Nouveau] [RFC PATCH 07/29] clk: Hold information about the current cstate status

2017-09-15 Thread Karol Herbst
Later we will have situations where the expected and the current state isn't the same. Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/include/nvkm/subdev/clk.h | 2 ++ drm/nouveau/nvkm/subdev/clk/base.c| 32 +--- 2 files changed, 27 insert

[Nouveau] [RFC PATCH 02/29] hwmon: properly check for errors

2017-09-15 Thread Karol Herbst
Otherwise hwmon interprets error codes as real values. Signed-off-by: Karol Herbst --- drm/nouveau/nouveau_hwmon.c | 33 ++--- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/drm/nouveau/nouveau_hwmon.c b/drm/nouveau/nouveau_hwmon.c index f1914d9a..0d75

[Nouveau] [RFC PATCH 06/29] clk: Make pstate a pointer to nvkm_pstate

2017-09-15 Thread Karol Herbst
We will access the current cstate at least every second and this saves us some CPU cycles looking them up every second. v2: Rewording commit message. Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/include/nvkm/subdev/clk.h | 4 +++- drm/nouveau/nvkm/engine/device/ctrl.c

[Nouveau] [RFC PATCH 05/29] clk: Remove dstate

2017-09-15 Thread Karol Herbst
We won't need it now, because we will adjust the clocks depending on engine loads later on anyway or a static lookup table. It also simplifies the clocking logic. This code was nowhere used anyway and just a mock up. v2: fixed typo in commit message Signed-off-by: Karol Herbst Reviewed-by: Mart

[Nouveau] [RFC PATCH 00/29] Current State of my clk patches

2017-09-15 Thread Karol Herbst
Just wanted to post updated versions of my last series/patches. Reviews welcomed. It would be also nice if we agree on features I should focus upstreaming, so that this work can be better splitted or reordered. Sadly most of my patches depend on the rather big clk subdev rework and I think those