All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] fix dell wyse 3040 poweroff
@ 2022-12-10 18:01 ` Alexey Lukyanchuk
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Lukyanchuk @ 2022-12-10 18:01 UTC (permalink / raw)
  To: tvrtko.ursulin
  Cc: Alexey Lukyanchuk, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	David Airlie, Daniel Vetter, Greg Kroah-Hartman, intel-gfx,
	dri-devel, linux-kernel

Dell wyse 3040 cat't poweroff aftet kernel 5.11.
It happens  because i915_driver_shutdown function.
Disabling of this function mitigate this problem.

Fixes: 440b354f3 ("drivers/gpu/drm:power off troubles on dell wyse 3040") 
Signed-off-by: Alexey Lukyanchuk <skif@skif-web.ru> 
---
There is trouble with i915_driver_shutdown function. After some diving I found that trouble looks like race condition in drm_atomic_get_connector_state function (drivers/gpu/drm/drm_atomic.c), maybe it linked to iterators. Now I fully exclude i915_driver_shutdown for wyse 3040 device.

Can any one comment on this one please ? 
---
 drivers/gpu/drm/i915/display/intel_quirks.c | 25 +++++++++++++++++++++
 drivers/gpu/drm/i915/i915_driver.c          |  3 +++
 drivers/gpu/drm/i915/i915_drv.h             |  1 +
 3 files changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
index e415cd7c0..a6a549d48 100644
--- a/drivers/gpu/drm/i915/display/intel_quirks.c
+++ b/drivers/gpu/drm/i915/display/intel_quirks.c
@@ -60,6 +60,12 @@ static void quirk_no_pps_backlight_power_hook(struct drm_i915_private *i915)
 	drm_info(&i915->drm, "Applying no pps backlight power quirk\n");
 }
 
+static void quirk_wyse_3040_shutdown_fix(struct drm_i915_private *i915)
+{
+	i915->quirks |= QUIRK_WYSE_3040_SHUTDOWN_FIX;
+	drm_info(&i915->drm, "Applying wyse 3040 shutdown fix\n");
+}
+
 struct intel_quirk {
 	int device;
 	int subsystem_vendor;
@@ -85,6 +91,12 @@ static int intel_dmi_no_pps_backlight(const struct dmi_system_id *id)
 	return 1;
 }
 
+static int wyse_3040_shutdown_fix(const struct dmi_system_id *id)
+{
+	DRM_INFO("This device need help with poweroff %s\n", id->ident);
+	return 1;
+}
+
 static const struct intel_dmi_quirk intel_dmi_quirks[] = {
 	{
 		.dmi_id_list = &(const struct dmi_system_id[]) {
@@ -131,6 +143,19 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = {
 		},
 		.hook = quirk_no_pps_backlight_power_hook,
 	},
+	{
+		.dmi_id_list = &(const struct dmi_system_id[]) {
+			{
+				.callback = wyse_3040_shutdown_fix,
+				.ident = "Dell Inc. 0G56C0",
+				.matches = {DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Dell Inc."),
+					    DMI_EXACT_MATCH(DMI_BOARD_NAME, "0G56C0"),
+				},
+			},
+			{ }
+		},
+		.hook = quirk_wyse_3040_shutdown_fix,
+	},
 };
 
 static struct intel_quirk intel_quirks[] = {
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index deb8a8b76..af60fb79a 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -1079,6 +1079,9 @@ static void intel_shutdown_encoders(struct drm_i915_private *dev_priv)
 
 void i915_driver_shutdown(struct drm_i915_private *i915)
 {
+	if (!(i915->quirks & QUIRK_WYSE_3040_SHUTDOWN_FIX))
+		return;
+
 	disable_rpm_wakeref_asserts(&i915->runtime_pm);
 	intel_runtime_pm_disable(&i915->runtime_pm);
 	intel_power_domains_disable(i915);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 086bbe894..fdd6866e7 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -200,6 +200,7 @@ struct drm_i915_display_funcs {
 #define QUIRK_INCREASE_T12_DELAY (1<<6)
 #define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7)
 #define QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK (1<<8)
+#define QUIRK_WYSE_3040_SHUTDOWN_FIX (1<<9)
 
 struct i915_suspend_saved_registers {
 	u32 saveDSPARB;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH RFC] fix dell wyse 3040 poweroff
@ 2022-12-10 18:01 ` Alexey Lukyanchuk
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Lukyanchuk @ 2022-12-10 18:01 UTC (permalink / raw)
  To: tvrtko.ursulin
  Cc: Alexey Lukyanchuk, Greg Kroah-Hartman, intel-gfx, linux-kernel,
	dri-devel, Rodrigo Vivi

Dell wyse 3040 cat't poweroff aftet kernel 5.11.
It happens  because i915_driver_shutdown function.
Disabling of this function mitigate this problem.

Fixes: 440b354f3 ("drivers/gpu/drm:power off troubles on dell wyse 3040") 
Signed-off-by: Alexey Lukyanchuk <skif@skif-web.ru> 
---
There is trouble with i915_driver_shutdown function. After some diving I found that trouble looks like race condition in drm_atomic_get_connector_state function (drivers/gpu/drm/drm_atomic.c), maybe it linked to iterators. Now I fully exclude i915_driver_shutdown for wyse 3040 device.

Can any one comment on this one please ? 
---
 drivers/gpu/drm/i915/display/intel_quirks.c | 25 +++++++++++++++++++++
 drivers/gpu/drm/i915/i915_driver.c          |  3 +++
 drivers/gpu/drm/i915/i915_drv.h             |  1 +
 3 files changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
index e415cd7c0..a6a549d48 100644
--- a/drivers/gpu/drm/i915/display/intel_quirks.c
+++ b/drivers/gpu/drm/i915/display/intel_quirks.c
@@ -60,6 +60,12 @@ static void quirk_no_pps_backlight_power_hook(struct drm_i915_private *i915)
 	drm_info(&i915->drm, "Applying no pps backlight power quirk\n");
 }
 
+static void quirk_wyse_3040_shutdown_fix(struct drm_i915_private *i915)
+{
+	i915->quirks |= QUIRK_WYSE_3040_SHUTDOWN_FIX;
+	drm_info(&i915->drm, "Applying wyse 3040 shutdown fix\n");
+}
+
 struct intel_quirk {
 	int device;
 	int subsystem_vendor;
@@ -85,6 +91,12 @@ static int intel_dmi_no_pps_backlight(const struct dmi_system_id *id)
 	return 1;
 }
 
+static int wyse_3040_shutdown_fix(const struct dmi_system_id *id)
+{
+	DRM_INFO("This device need help with poweroff %s\n", id->ident);
+	return 1;
+}
+
 static const struct intel_dmi_quirk intel_dmi_quirks[] = {
 	{
 		.dmi_id_list = &(const struct dmi_system_id[]) {
@@ -131,6 +143,19 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = {
 		},
 		.hook = quirk_no_pps_backlight_power_hook,
 	},
+	{
+		.dmi_id_list = &(const struct dmi_system_id[]) {
+			{
+				.callback = wyse_3040_shutdown_fix,
+				.ident = "Dell Inc. 0G56C0",
+				.matches = {DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Dell Inc."),
+					    DMI_EXACT_MATCH(DMI_BOARD_NAME, "0G56C0"),
+				},
+			},
+			{ }
+		},
+		.hook = quirk_wyse_3040_shutdown_fix,
+	},
 };
 
 static struct intel_quirk intel_quirks[] = {
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index deb8a8b76..af60fb79a 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -1079,6 +1079,9 @@ static void intel_shutdown_encoders(struct drm_i915_private *dev_priv)
 
 void i915_driver_shutdown(struct drm_i915_private *i915)
 {
+	if (!(i915->quirks & QUIRK_WYSE_3040_SHUTDOWN_FIX))
+		return;
+
 	disable_rpm_wakeref_asserts(&i915->runtime_pm);
 	intel_runtime_pm_disable(&i915->runtime_pm);
 	intel_power_domains_disable(i915);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 086bbe894..fdd6866e7 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -200,6 +200,7 @@ struct drm_i915_display_funcs {
 #define QUIRK_INCREASE_T12_DELAY (1<<6)
 #define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7)
 #define QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK (1<<8)
+#define QUIRK_WYSE_3040_SHUTDOWN_FIX (1<<9)
 
 struct i915_suspend_saved_registers {
 	u32 saveDSPARB;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Intel-gfx] [PATCH RFC] fix dell wyse 3040 poweroff
@ 2022-12-10 18:01 ` Alexey Lukyanchuk
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Lukyanchuk @ 2022-12-10 18:01 UTC (permalink / raw)
  To: tvrtko.ursulin
  Cc: Alexey Lukyanchuk, Greg Kroah-Hartman, intel-gfx, linux-kernel,
	dri-devel, Daniel Vetter, Rodrigo Vivi, David Airlie

Dell wyse 3040 cat't poweroff aftet kernel 5.11.
It happens  because i915_driver_shutdown function.
Disabling of this function mitigate this problem.

Fixes: 440b354f3 ("drivers/gpu/drm:power off troubles on dell wyse 3040") 
Signed-off-by: Alexey Lukyanchuk <skif@skif-web.ru> 
---
There is trouble with i915_driver_shutdown function. After some diving I found that trouble looks like race condition in drm_atomic_get_connector_state function (drivers/gpu/drm/drm_atomic.c), maybe it linked to iterators. Now I fully exclude i915_driver_shutdown for wyse 3040 device.

Can any one comment on this one please ? 
---
 drivers/gpu/drm/i915/display/intel_quirks.c | 25 +++++++++++++++++++++
 drivers/gpu/drm/i915/i915_driver.c          |  3 +++
 drivers/gpu/drm/i915/i915_drv.h             |  1 +
 3 files changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
index e415cd7c0..a6a549d48 100644
--- a/drivers/gpu/drm/i915/display/intel_quirks.c
+++ b/drivers/gpu/drm/i915/display/intel_quirks.c
@@ -60,6 +60,12 @@ static void quirk_no_pps_backlight_power_hook(struct drm_i915_private *i915)
 	drm_info(&i915->drm, "Applying no pps backlight power quirk\n");
 }
 
+static void quirk_wyse_3040_shutdown_fix(struct drm_i915_private *i915)
+{
+	i915->quirks |= QUIRK_WYSE_3040_SHUTDOWN_FIX;
+	drm_info(&i915->drm, "Applying wyse 3040 shutdown fix\n");
+}
+
 struct intel_quirk {
 	int device;
 	int subsystem_vendor;
@@ -85,6 +91,12 @@ static int intel_dmi_no_pps_backlight(const struct dmi_system_id *id)
 	return 1;
 }
 
+static int wyse_3040_shutdown_fix(const struct dmi_system_id *id)
+{
+	DRM_INFO("This device need help with poweroff %s\n", id->ident);
+	return 1;
+}
+
 static const struct intel_dmi_quirk intel_dmi_quirks[] = {
 	{
 		.dmi_id_list = &(const struct dmi_system_id[]) {
@@ -131,6 +143,19 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = {
 		},
 		.hook = quirk_no_pps_backlight_power_hook,
 	},
+	{
+		.dmi_id_list = &(const struct dmi_system_id[]) {
+			{
+				.callback = wyse_3040_shutdown_fix,
+				.ident = "Dell Inc. 0G56C0",
+				.matches = {DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Dell Inc."),
+					    DMI_EXACT_MATCH(DMI_BOARD_NAME, "0G56C0"),
+				},
+			},
+			{ }
+		},
+		.hook = quirk_wyse_3040_shutdown_fix,
+	},
 };
 
 static struct intel_quirk intel_quirks[] = {
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index deb8a8b76..af60fb79a 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -1079,6 +1079,9 @@ static void intel_shutdown_encoders(struct drm_i915_private *dev_priv)
 
 void i915_driver_shutdown(struct drm_i915_private *i915)
 {
+	if (!(i915->quirks & QUIRK_WYSE_3040_SHUTDOWN_FIX))
+		return;
+
 	disable_rpm_wakeref_asserts(&i915->runtime_pm);
 	intel_runtime_pm_disable(&i915->runtime_pm);
 	intel_power_domains_disable(i915);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 086bbe894..fdd6866e7 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -200,6 +200,7 @@ struct drm_i915_display_funcs {
 #define QUIRK_INCREASE_T12_DELAY (1<<6)
 #define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7)
 #define QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK (1<<8)
+#define QUIRK_WYSE_3040_SHUTDOWN_FIX (1<<9)
 
 struct i915_suspend_saved_registers {
 	u32 saveDSPARB;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC] fix dell wyse 3040 poweroff
  2022-12-10 18:01 ` Alexey Lukyanchuk
  (?)
@ 2022-12-12  9:15   ` Jani Nikula
  -1 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2022-12-12  9:15 UTC (permalink / raw)
  To: Alexey Lukyanchuk, tvrtko.ursulin
  Cc: Alexey Lukyanchuk, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	Daniel Vetter, Greg Kroah-Hartman, intel-gfx, dri-devel,
	linux-kernel

On Sat, 10 Dec 2022, Alexey Lukyanchuk <skif@skif-web.ru> wrote:
> Dell wyse 3040 cat't poweroff aftet kernel 5.11.
> It happens  because i915_driver_shutdown function.
> Disabling of this function mitigate this problem.
>
> Fixes: 440b354f3 ("drivers/gpu/drm:power off troubles on dell wyse 3040") 

Fixes: is supposed to reference an existing commit.

> Signed-off-by: Alexey Lukyanchuk <skif@skif-web.ru> 
> ---
> There is trouble with i915_driver_shutdown function. After some diving I found that trouble looks like race condition in drm_atomic_get_connector_state function (drivers/gpu/drm/drm_atomic.c), maybe it linked to iterators. Now I fully exclude i915_driver_shutdown for wyse 3040 device.
>
> Can any one comment on this one please ? 

Bypassing the entire shutdown function is not an acceptable quirk.

Please file a bug over at fdo gitlab [1]. Add drm.debug=0xe module
parameter, and attach dmesg from boot to reproducing the problem. Add
log_buf_len=8M or similar as necessary to get the complete dmesg.

Have you tried the more recent kernels?

BR,
Jani.


[1] https://gitlab.freedesktop.org/drm/intel/wikis/How-to-file-i915-bugs


> ---
>  drivers/gpu/drm/i915/display/intel_quirks.c | 25 +++++++++++++++++++++
>  drivers/gpu/drm/i915/i915_driver.c          |  3 +++
>  drivers/gpu/drm/i915/i915_drv.h             |  1 +
>  3 files changed, 29 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
> index e415cd7c0..a6a549d48 100644
> --- a/drivers/gpu/drm/i915/display/intel_quirks.c
> +++ b/drivers/gpu/drm/i915/display/intel_quirks.c
> @@ -60,6 +60,12 @@ static void quirk_no_pps_backlight_power_hook(struct drm_i915_private *i915)
>  	drm_info(&i915->drm, "Applying no pps backlight power quirk\n");
>  }
>  
> +static void quirk_wyse_3040_shutdown_fix(struct drm_i915_private *i915)
> +{
> +	i915->quirks |= QUIRK_WYSE_3040_SHUTDOWN_FIX;
> +	drm_info(&i915->drm, "Applying wyse 3040 shutdown fix\n");
> +}
> +
>  struct intel_quirk {
>  	int device;
>  	int subsystem_vendor;
> @@ -85,6 +91,12 @@ static int intel_dmi_no_pps_backlight(const struct dmi_system_id *id)
>  	return 1;
>  }
>  
> +static int wyse_3040_shutdown_fix(const struct dmi_system_id *id)
> +{
> +	DRM_INFO("This device need help with poweroff %s\n", id->ident);
> +	return 1;
> +}
> +
>  static const struct intel_dmi_quirk intel_dmi_quirks[] = {
>  	{
>  		.dmi_id_list = &(const struct dmi_system_id[]) {
> @@ -131,6 +143,19 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = {
>  		},
>  		.hook = quirk_no_pps_backlight_power_hook,
>  	},
> +	{
> +		.dmi_id_list = &(const struct dmi_system_id[]) {
> +			{
> +				.callback = wyse_3040_shutdown_fix,
> +				.ident = "Dell Inc. 0G56C0",
> +				.matches = {DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Dell Inc."),
> +					    DMI_EXACT_MATCH(DMI_BOARD_NAME, "0G56C0"),
> +				},
> +			},
> +			{ }
> +		},
> +		.hook = quirk_wyse_3040_shutdown_fix,
> +	},
>  };
>  
>  static struct intel_quirk intel_quirks[] = {
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index deb8a8b76..af60fb79a 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -1079,6 +1079,9 @@ static void intel_shutdown_encoders(struct drm_i915_private *dev_priv)
>  
>  void i915_driver_shutdown(struct drm_i915_private *i915)
>  {
> +	if (!(i915->quirks & QUIRK_WYSE_3040_SHUTDOWN_FIX))
> +		return;
> +
>  	disable_rpm_wakeref_asserts(&i915->runtime_pm);
>  	intel_runtime_pm_disable(&i915->runtime_pm);
>  	intel_power_domains_disable(i915);
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 086bbe894..fdd6866e7 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -200,6 +200,7 @@ struct drm_i915_display_funcs {
>  #define QUIRK_INCREASE_T12_DELAY (1<<6)
>  #define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7)
>  #define QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK (1<<8)
> +#define QUIRK_WYSE_3040_SHUTDOWN_FIX (1<<9)
>  
>  struct i915_suspend_saved_registers {
>  	u32 saveDSPARB;

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC] fix dell wyse 3040 poweroff
@ 2022-12-12  9:15   ` Jani Nikula
  0 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2022-12-12  9:15 UTC (permalink / raw)
  To: Alexey Lukyanchuk, tvrtko.ursulin
  Cc: Alexey Lukyanchuk, Greg Kroah-Hartman, intel-gfx, linux-kernel,
	dri-devel, Rodrigo Vivi

On Sat, 10 Dec 2022, Alexey Lukyanchuk <skif@skif-web.ru> wrote:
> Dell wyse 3040 cat't poweroff aftet kernel 5.11.
> It happens  because i915_driver_shutdown function.
> Disabling of this function mitigate this problem.
>
> Fixes: 440b354f3 ("drivers/gpu/drm:power off troubles on dell wyse 3040") 

Fixes: is supposed to reference an existing commit.

> Signed-off-by: Alexey Lukyanchuk <skif@skif-web.ru> 
> ---
> There is trouble with i915_driver_shutdown function. After some diving I found that trouble looks like race condition in drm_atomic_get_connector_state function (drivers/gpu/drm/drm_atomic.c), maybe it linked to iterators. Now I fully exclude i915_driver_shutdown for wyse 3040 device.
>
> Can any one comment on this one please ? 

Bypassing the entire shutdown function is not an acceptable quirk.

Please file a bug over at fdo gitlab [1]. Add drm.debug=0xe module
parameter, and attach dmesg from boot to reproducing the problem. Add
log_buf_len=8M or similar as necessary to get the complete dmesg.

Have you tried the more recent kernels?

BR,
Jani.


[1] https://gitlab.freedesktop.org/drm/intel/wikis/How-to-file-i915-bugs


> ---
>  drivers/gpu/drm/i915/display/intel_quirks.c | 25 +++++++++++++++++++++
>  drivers/gpu/drm/i915/i915_driver.c          |  3 +++
>  drivers/gpu/drm/i915/i915_drv.h             |  1 +
>  3 files changed, 29 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
> index e415cd7c0..a6a549d48 100644
> --- a/drivers/gpu/drm/i915/display/intel_quirks.c
> +++ b/drivers/gpu/drm/i915/display/intel_quirks.c
> @@ -60,6 +60,12 @@ static void quirk_no_pps_backlight_power_hook(struct drm_i915_private *i915)
>  	drm_info(&i915->drm, "Applying no pps backlight power quirk\n");
>  }
>  
> +static void quirk_wyse_3040_shutdown_fix(struct drm_i915_private *i915)
> +{
> +	i915->quirks |= QUIRK_WYSE_3040_SHUTDOWN_FIX;
> +	drm_info(&i915->drm, "Applying wyse 3040 shutdown fix\n");
> +}
> +
>  struct intel_quirk {
>  	int device;
>  	int subsystem_vendor;
> @@ -85,6 +91,12 @@ static int intel_dmi_no_pps_backlight(const struct dmi_system_id *id)
>  	return 1;
>  }
>  
> +static int wyse_3040_shutdown_fix(const struct dmi_system_id *id)
> +{
> +	DRM_INFO("This device need help with poweroff %s\n", id->ident);
> +	return 1;
> +}
> +
>  static const struct intel_dmi_quirk intel_dmi_quirks[] = {
>  	{
>  		.dmi_id_list = &(const struct dmi_system_id[]) {
> @@ -131,6 +143,19 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = {
>  		},
>  		.hook = quirk_no_pps_backlight_power_hook,
>  	},
> +	{
> +		.dmi_id_list = &(const struct dmi_system_id[]) {
> +			{
> +				.callback = wyse_3040_shutdown_fix,
> +				.ident = "Dell Inc. 0G56C0",
> +				.matches = {DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Dell Inc."),
> +					    DMI_EXACT_MATCH(DMI_BOARD_NAME, "0G56C0"),
> +				},
> +			},
> +			{ }
> +		},
> +		.hook = quirk_wyse_3040_shutdown_fix,
> +	},
>  };
>  
>  static struct intel_quirk intel_quirks[] = {
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index deb8a8b76..af60fb79a 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -1079,6 +1079,9 @@ static void intel_shutdown_encoders(struct drm_i915_private *dev_priv)
>  
>  void i915_driver_shutdown(struct drm_i915_private *i915)
>  {
> +	if (!(i915->quirks & QUIRK_WYSE_3040_SHUTDOWN_FIX))
> +		return;
> +
>  	disable_rpm_wakeref_asserts(&i915->runtime_pm);
>  	intel_runtime_pm_disable(&i915->runtime_pm);
>  	intel_power_domains_disable(i915);
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 086bbe894..fdd6866e7 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -200,6 +200,7 @@ struct drm_i915_display_funcs {
>  #define QUIRK_INCREASE_T12_DELAY (1<<6)
>  #define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7)
>  #define QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK (1<<8)
> +#define QUIRK_WYSE_3040_SHUTDOWN_FIX (1<<9)
>  
>  struct i915_suspend_saved_registers {
>  	u32 saveDSPARB;

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-gfx] [PATCH RFC] fix dell wyse 3040 poweroff
@ 2022-12-12  9:15   ` Jani Nikula
  0 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2022-12-12  9:15 UTC (permalink / raw)
  To: Alexey Lukyanchuk, tvrtko.ursulin
  Cc: Alexey Lukyanchuk, Greg Kroah-Hartman, intel-gfx, linux-kernel,
	dri-devel, Daniel Vetter, Rodrigo Vivi, David Airlie

On Sat, 10 Dec 2022, Alexey Lukyanchuk <skif@skif-web.ru> wrote:
> Dell wyse 3040 cat't poweroff aftet kernel 5.11.
> It happens  because i915_driver_shutdown function.
> Disabling of this function mitigate this problem.
>
> Fixes: 440b354f3 ("drivers/gpu/drm:power off troubles on dell wyse 3040") 

Fixes: is supposed to reference an existing commit.

> Signed-off-by: Alexey Lukyanchuk <skif@skif-web.ru> 
> ---
> There is trouble with i915_driver_shutdown function. After some diving I found that trouble looks like race condition in drm_atomic_get_connector_state function (drivers/gpu/drm/drm_atomic.c), maybe it linked to iterators. Now I fully exclude i915_driver_shutdown for wyse 3040 device.
>
> Can any one comment on this one please ? 

Bypassing the entire shutdown function is not an acceptable quirk.

Please file a bug over at fdo gitlab [1]. Add drm.debug=0xe module
parameter, and attach dmesg from boot to reproducing the problem. Add
log_buf_len=8M or similar as necessary to get the complete dmesg.

Have you tried the more recent kernels?

BR,
Jani.


[1] https://gitlab.freedesktop.org/drm/intel/wikis/How-to-file-i915-bugs


> ---
>  drivers/gpu/drm/i915/display/intel_quirks.c | 25 +++++++++++++++++++++
>  drivers/gpu/drm/i915/i915_driver.c          |  3 +++
>  drivers/gpu/drm/i915/i915_drv.h             |  1 +
>  3 files changed, 29 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
> index e415cd7c0..a6a549d48 100644
> --- a/drivers/gpu/drm/i915/display/intel_quirks.c
> +++ b/drivers/gpu/drm/i915/display/intel_quirks.c
> @@ -60,6 +60,12 @@ static void quirk_no_pps_backlight_power_hook(struct drm_i915_private *i915)
>  	drm_info(&i915->drm, "Applying no pps backlight power quirk\n");
>  }
>  
> +static void quirk_wyse_3040_shutdown_fix(struct drm_i915_private *i915)
> +{
> +	i915->quirks |= QUIRK_WYSE_3040_SHUTDOWN_FIX;
> +	drm_info(&i915->drm, "Applying wyse 3040 shutdown fix\n");
> +}
> +
>  struct intel_quirk {
>  	int device;
>  	int subsystem_vendor;
> @@ -85,6 +91,12 @@ static int intel_dmi_no_pps_backlight(const struct dmi_system_id *id)
>  	return 1;
>  }
>  
> +static int wyse_3040_shutdown_fix(const struct dmi_system_id *id)
> +{
> +	DRM_INFO("This device need help with poweroff %s\n", id->ident);
> +	return 1;
> +}
> +
>  static const struct intel_dmi_quirk intel_dmi_quirks[] = {
>  	{
>  		.dmi_id_list = &(const struct dmi_system_id[]) {
> @@ -131,6 +143,19 @@ static const struct intel_dmi_quirk intel_dmi_quirks[] = {
>  		},
>  		.hook = quirk_no_pps_backlight_power_hook,
>  	},
> +	{
> +		.dmi_id_list = &(const struct dmi_system_id[]) {
> +			{
> +				.callback = wyse_3040_shutdown_fix,
> +				.ident = "Dell Inc. 0G56C0",
> +				.matches = {DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Dell Inc."),
> +					    DMI_EXACT_MATCH(DMI_BOARD_NAME, "0G56C0"),
> +				},
> +			},
> +			{ }
> +		},
> +		.hook = quirk_wyse_3040_shutdown_fix,
> +	},
>  };
>  
>  static struct intel_quirk intel_quirks[] = {
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index deb8a8b76..af60fb79a 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -1079,6 +1079,9 @@ static void intel_shutdown_encoders(struct drm_i915_private *dev_priv)
>  
>  void i915_driver_shutdown(struct drm_i915_private *i915)
>  {
> +	if (!(i915->quirks & QUIRK_WYSE_3040_SHUTDOWN_FIX))
> +		return;
> +
>  	disable_rpm_wakeref_asserts(&i915->runtime_pm);
>  	intel_runtime_pm_disable(&i915->runtime_pm);
>  	intel_power_domains_disable(i915);
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 086bbe894..fdd6866e7 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -200,6 +200,7 @@ struct drm_i915_display_funcs {
>  #define QUIRK_INCREASE_T12_DELAY (1<<6)
>  #define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7)
>  #define QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK (1<<8)
> +#define QUIRK_WYSE_3040_SHUTDOWN_FIX (1<<9)
>  
>  struct i915_suspend_saved_registers {
>  	u32 saveDSPARB;

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BUILD: failure for fix dell wyse 3040 poweroff
  2022-12-10 18:01 ` Alexey Lukyanchuk
                   ` (2 preceding siblings ...)
  (?)
@ 2022-12-15 21:11 ` Patchwork
  -1 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2022-12-15 21:11 UTC (permalink / raw)
  To: Alexey Lukyanchuk; +Cc: intel-gfx

== Series Details ==

Series: fix dell wyse 3040 poweroff
URL   : https://patchwork.freedesktop.org/series/111987/
State : failure

== Summary ==

Error: patch https://patchwork.freedesktop.org/api/1.0/series/111987/revisions/1/mbox/ not applied
Applying: fix dell wyse 3040 poweroff
Using index info to reconstruct a base tree...
M	drivers/gpu/drm/i915/display/intel_quirks.c
M	drivers/gpu/drm/i915/i915_driver.c
M	drivers/gpu/drm/i915/i915_drv.h
Falling back to patching base and 3-way merge...
Auto-merging drivers/gpu/drm/i915/i915_drv.h
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/i915_drv.h
Auto-merging drivers/gpu/drm/i915/i915_driver.c
Auto-merging drivers/gpu/drm/i915/display/intel_quirks.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 fix dell wyse 3040 poweroff
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-15 21:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-10 18:01 [PATCH RFC] fix dell wyse 3040 poweroff Alexey Lukyanchuk
2022-12-10 18:01 ` [Intel-gfx] " Alexey Lukyanchuk
2022-12-10 18:01 ` Alexey Lukyanchuk
2022-12-12  9:15 ` Jani Nikula
2022-12-12  9:15   ` [Intel-gfx] " Jani Nikula
2022-12-12  9:15   ` Jani Nikula
2022-12-15 21:11 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork

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.