[PATCH 2/2 v2] drm/amd/powerplay/hwmgr: don't add invalid voltage

2016-04-17 Thread Moritz Kühner
if atomctrl_get_voltage_evv_on_sclk returns non zero (fail) in the expansion of the PP_ASSERT_WITH_CODE macro the continue will actually do nothing (The macro uses a do ... while(0) as scope, which eats the continue). Based on the code I don't think this was the intent. Unfortunately fixing this re

[PATCH 1/2 v2] drm/amd/powerplay/hwmgr: prevent VDDC from exceeding 2V

2016-04-17 Thread Moritz Kühner
If the tonga gpu is controlled by SVID2 tonga_get_evv_voltage will only print an error if the voltage exceeds 2V although a comment clearly states that it needs be less than 2V. v2: added signed of by Signed-off-by: Moritz Kühner --- drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | 3 +-- 1

[PATCH 0/2 v2] tonga_get_evv_voltage error handling fixes

2016-04-17 Thread Moritz Kühner
I got myself a 380X recently and started reading random mesa and kernel code in the hopes that I would find something that I can fix or improve, and something actually caught my eye. Some of the error handling in tonga_get_evv_voltage just seemed of and based on the comments I think the patches pro

[PATCH 2/2] drm/amd/powerplay/hwmgr: don't add invalid voltage

2016-04-14 Thread Moritz Kühner
if atomctrl_get_voltage_evv_on_sclk returns non zero (fail) in the expansion of the PP_ASSERT_WITH_CODE macro the continue will actually do nothing (The macro uses a do ... while(0) as scope, which eats the continue). Based on the code I don't think this was the intent. Unfortunately fixing this re

[PATCH 1/2] drm/amd/powerplay/hwmgr: prevent VDDC from exceeding 2V

2016-04-14 Thread Moritz Kühner
If the tonga gpu is controlled by SVID2 tonga_get_evv_voltage will only print an error if the voltage exceeds 2V although a comment clearly states that it needs be less than 2V. --- drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --gi

[PATCH 0/2] tonga_get_evv_voltage error handling fixes

2016-04-14 Thread Moritz Kühner
I got myself a 380X recently and started reading random mesa and kernel code in the hopes that I would find something that I can fix or improve, and something actually caught my eye. Some of the error handling in tonga_get_evv_voltage just seemed of and based on the comments I think the patches pro