Refuse to load if power cable are not connected
v3 cover Refuse to load if power cable are not connected
Added config override for power checks.
Mark Menzynski (4):
bios/gpio: sort gpios by values
gpio: fail if gpu external power is missing
gpio: check the gpio function 16 in the power check as well
gpio: check function 76 in the power check as well
drm/nouveau/include/nvkm/subdev/bios/gpio.h | 5 +++- drm/nouveau/nvkm/subdev/gpio/base.c | 32 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-)
Signature · 6 lines
2.21.0 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): 20190718080741.3147-1-mmenzyns-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
PATCH v3 1/4 bios/gpio: sort gpios by values
One gpio was in wrong place, moved it for better readability.
--- drm/nouveau/include/nvkm/subdev/bios/gpio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drm/nouveau/include/nvkm/subdev/bios/gpio.h +1 -1
@@ -3,9 +3,9 @@#define __NVBIOS_GPIO_H__enum dcb_gpio_func_name {DCB_GPIO_PANEL_POWER =0x01 , +DCB_GPIO_FAN =0x09 ,DCB_GPIO_TVDAC0 =0x0c ,DCB_GPIO_TVDAC1 =0x2d , -DCB_GPIO_FAN =0x09 ,DCB_GPIO_FAN_SENSE =0x3d ,DCB_GPIO_LOGO_LED_PWM =0x84 ,DCB_GPIO_UNUSED =0xff ,
Signature · 6 lines
2.21.0 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
PATCH v3 2/4 gpio: fail if gpu external power is missing
In reply to a message not in the archiveCurrently, nouveau doesn't check if GPU is missing power. This patch makes nouveau fail when this happens on latest GPUs.
It checks GPIO function 121 (External Power Emergency), which should detect power problems on GPU initialization.
This can be disabled with nouveau.config=NvPowerChecks=1
Tested on TU104, GP106 and GF100.
v3:
* Add config override for disabling power checks
--- drm/nouveau/include/nvkm/subdev/bios/gpio.h | 1 + drm/nouveau/nvkm/subdev/gpio/base.c | 30 +++++++++++++++++++++ 2 files changed, 31 insertions(+)
drm/nouveau/include/nvkm/subdev/bios/gpio.h +1 -0
@@ -7,6 +7,7 @@ enum dcb_gpio_func_name {DCB_GPIO_TVDAC0 =0x0c ,DCB_GPIO_TVDAC1 =0x2d ,DCB_GPIO_FAN_SENSE =0x3d , +DCB_GPIO_EXT_POWER_LOW =0x79 ,DCB_GPIO_LOGO_LED_PWM =0x84 ,DCB_GPIO_UNUSED =0xff , DCB_GPIO_VID0 = 0x04,
drm/nouveau/nvkm/subdev/gpio/base.c +30 -0
@@ -23,6 +23,7 @@*/ #include "priv.h" +#include <core/option.h> #include <core/notify.h> static int
@@ -182,12 +183,41 @@ static const struct dmi_system_id gpio_reset_ids[] = { { } }; +static enum dcb_gpio_func_name power_checks[] = { +DCB_GPIO_EXT_POWER_LOW , +}; +static int nvkm_gpio_init (struct nvkm_subdev *subdev) {struct nvkm_gpio *gpio =nvkm_gpio (subdev); +struct dcb_gpio_func func; +int ret; +int i; +if (dmi_check_system (gpio_reset_ids))nvkm_gpio_reset (gpio,DCB_GPIO_UNUSED ); + +if (nvkm_boolopt (subdev->device->cfgopt,"NvPowerChecks" , true)) + { +for (i =0 ; i <ARRAY_SIZE (power_checks); ++i) + { + ret =nvkm_gpio_find (gpio,0 , power_checks[i], +DCB_GPIO_UNUSED , &func); +if (ret) +continue ; + + ret =nvkm_gpio_get (gpio,0 , func.func, func.line); +if (!ret) +continue ; + +nvkm_error (&gpio->subdev, +"GPU is missing power, check its power cables. " +"Boot with nouveau.config=NvPowerChecks=0 to disable.\n" ); +return -EINVAL ; + } + } +return 0 ; }
Signature · 6 lines
2.21.0 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
PATCH v3 3/4 gpio: check the gpio function 16 in the power check as well
In reply to a message not in the archiveAdded GPIO is "Thermal and External Power Detect". It's uncertain if this GPIO is set on GPU initialization or only if a change is detected by the GPU at runtime.
This GPIO can be found in Rankine and Curie and rarely on Tesla GPUs VBIOS.
Untested, wrote according to documentation.
--- drm/nouveau/include/nvkm/subdev/bios/gpio.h | 1 + drm/nouveau/nvkm/subdev/gpio/base.c | 1 + 2 files changed, 2 insertions(+)
drm/nouveau/include/nvkm/subdev/bios/gpio.h +1 -0
@@ -5,6 +5,7 @@ enum dcb_gpio_func_name {DCB_GPIO_PANEL_POWER =0x01 ,DCB_GPIO_FAN =0x09 ,DCB_GPIO_TVDAC0 =0x0c , +DCB_GPIO_THERM_EXT_POWER_EVENT =0x10 ,DCB_GPIO_TVDAC1 =0x2d ,DCB_GPIO_FAN_SENSE =0x3d , DCB_GPIO_EXT_POWER_LOW = 0x79,
drm/nouveau/nvkm/subdev/gpio/base.c +1 -0
@@ -184,6 +184,7 @@ static const struct dmi_system_id gpio_reset_ids[] = { };static enum dcb_gpio_func_name power_checks[] = { +DCB_GPIO_THERM_EXT_POWER_EVENT ,DCB_GPIO_EXT_POWER_LOW , };
Signature · 6 lines
2.21.0 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
PATCH v3 4/4 gpio: check function 76 in the power check as well
In reply to a message not in the archiveAdded GPIO is "Power Alert". It's uncertain if this
GPIO is set on GPU initialization or only if a change is detected by the GPU at runtime.
This GPIO can be found on Tesla and sometimes on Fermi GPUs.
Untested, wrote according to documentation.
--- drm/nouveau/include/nvkm/subdev/bios/gpio.h | 1 + drm/nouveau/nvkm/subdev/gpio/base.c | 1 + 2 files changed, 2 insertions(+)
drm/nouveau/include/nvkm/subdev/bios/gpio.h +1 -0
@@ -8,6 +8,7 @@ enum dcb_gpio_func_name {DCB_GPIO_THERM_EXT_POWER_EVENT =0x10 ,DCB_GPIO_TVDAC1 =0x2d ,DCB_GPIO_FAN_SENSE =0x3d , +DCB_GPIO_POWER_ALERT =0x4c ,DCB_GPIO_EXT_POWER_LOW =0x79 ,DCB_GPIO_LOGO_LED_PWM =0x84 , DCB_GPIO_UNUSED = 0xff,
drm/nouveau/nvkm/subdev/gpio/base.c +1 -0
@@ -185,6 +185,7 @@ static const struct dmi_system_id gpio_reset_ids[] = {static enum dcb_gpio_func_name power_checks[] = {DCB_GPIO_THERM_EXT_POWER_EVENT , +DCB_GPIO_POWER_ALERT ,DCB_GPIO_EXT_POWER_LOW , };
Signature · 6 lines
2.21.0 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
Ben Skeggs
AppliedI've merged these patches to my tree.
Thank you,
Ben.
Quoted 13 lines · Mark Menzynski
Added config override for power checks.
Mark Menzynski (4):
bios/gpio: sort gpios by values
gpio: fail if gpu external power is missing
gpio: check the gpio function 16 in the power check as well
gpio: check function 76 in the power check as welldrm/nouveau/include/nvkm/subdev/bios/gpio.h | 5 +++- drm/nouveau/nvkm/subdev/gpio/base.c | 32 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-)
Quoted 7 lines
--
2.21.0_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau