Skip to contentSkip to conversation

tests/device_reset: Work around for driver unbind issue with audio

PATCH In review Uma Shankar 2 participants 3 messages Sep 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/device_reset: Work around for driver unbind issue with audio

Unbinding the i915 driver on some Haswell and Broadwell platforms with Azalia audio results in a kernel WARNING on "i915 raw-wakerefs=1 wakelocks=1 on cleanup". The issue can be worked around by manually enabling runtime power management for the conflicting audio adapter. Use that method but also display a warning to preserve visibility of the issue. Also tag the workaround with a FIXME comment.

---
 tests/device_reset.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/device_reset.c +11 -0
index b1181b3b..9cb59ee4 100644
@@ -232,9 +232,20 @@ static void set_device_filter(const char* dev_path)
 
 static void unbind_reset_rebind(struct device_fds *dev)
 {
+	uint32_t devid = intel_get_drm_devid(dev->fds.dev);
 	igt_debug("close the device\n");
 	close_if_opened(&dev->fds.dev);
 
+	/**
+	 * FIXME: Unbinding the i915 driver on some platforms with Azalia audio
+	 * results in a kernel WARN on "i915 raw-wakerefs=1 wakelocks=1 on cleanup".
+	 * The below CI friendly user level workaround prevents the warning from
+	 * appearing. Drop this hack as soon as this is fixed in the kernel.
+	 */
+	if (igt_warn_on_f((bool) IS_HASWELL(devid) || IS_BROADWELL(devid),
+	    "Manually enabling audio PM to work around a kernel WARN\n"))
+		igt_pm_enable_audio_runtime_pm();
+
 	driver_unbind(dev);
 
 	initiate_device_reset(dev);
Signature · 6 lines
2.19.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Reviewed-by on v1 1/1
#1 lore raw

Hi Uma,

Quoted 10 lines · Uma Shankar

Unbinding the i915 driver on some Haswell and Broadwell platforms with Azalia audio results in a kernel WARNING on "i915 raw-wakerefs=1 wakelocks=1 on cleanup". The issue can be worked around by manually enabling runtime power management for the conflicting audio adapter. Use that method but also display a warning to preserve visibility of the issue. Also tag the workaround with a FIXME comment.

---

Even if the code looks the same as in my patch against core_hotunplug, this is a separate submission so I think you can drop drop my S-o-b, or replace it with a Suggested-by:, then add my

Thanks,
Janusz

Quoted 18 lines
 tests/device_reset.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/device_reset.c +4 -0
index b1181b3b..9cb59ee4 100644
@@ -232,9 +232,20 @@ static void set_device_filter(const char* dev_path)
 
 static void unbind_reset_rebind(struct device_fds *dev)
 {
+	uint32_t devid = intel_get_drm_devid(dev->fds.dev);
 	igt_debug("close the device\n");
 	close_if_opened(&dev->fds.dev);
 
+	/**
+	 * FIXME: Unbinding the i915 driver on some platforms with Azalia audio
+	 * results in a kernel WARN on "i915 raw-wakerefs=1 wakelocks=1 on cleanup".

tests/device_reset.c static void set_device_filter(const char* dev_path) · line 251

Quoted 10 lines
tests/device_reset.c +7 -0
+	 * The below CI friendly user level workaround prevents the warning from
+	 * appearing. Drop this hack as soon as this is fixed in the kernel.
+	 */
+	if (igt_warn_on_f((bool) IS_HASWELL(devid) || IS_BROADWELL(devid),
+	    "Manually enabling audio PM to work around a kernel WARN\n"))
+		igt_pm_enable_audio_runtime_pm();
+
 	driver_unbind(dev);
 
 	initiate_device_reset(dev);

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw
Quoted 21 lines

-----Original Message-----
From: Janusz Krzysztofik <[email protected]>
Sent: Monday, September 14, 2020 5:56 PM
To: Shankar, Uma <[email protected]>; [email protected]
Cc: Bernatowicz, Marcin <[email protected]>; Deak, Imre <[email protected]>
Subject: Re: [PATCH i-g-t] tests/device_reset: Work around for driver unbind issue with audio

Hi Uma,

Quoted 7 lines · Uma Shankar

Unbinding the i915 driver on some Haswell and Broadwell platforms with Azalia audio results in a kernel WARNING on "i915 raw-wakerefs=1 wakelocks=1 on cleanup". The issue can be worked around by manually enabling runtime power management for the conflicting audio adapter. Use that method but also display a warning to preserve visibility of the issue. Also tag the workaround with a FIXME comment.

Quoted 8 lines
Quoted 3 lines

---

Even if the code looks the same as in my patch against core_hotunplug, this is a separate submission so I think you can drop drop my S-o-b, or replace it with a Suggested-by:, then add my

Sure Janusz, will do the needful. Thanks for the pointers.

Regards,
Uma Shankar

Quoted 36 lines

Thanks,
Janusz

Quoted 8 lines
 tests/device_reset.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/device_reset.c index renamed from tests/device_reset.c +0 -0

b1181b3b..9cb59ee4 100644

tests/device_reset.c static void set_device_filter(const char* · line 241

Quoted 10 lines
tests/device_reset.c +4 -0
@@ -232,9 +232,20 @@ static void set_device_filter(const char*
 dev_path)
 
 static void unbind_reset_rebind(struct device_fds *dev)  {
+	uint32_t devid = intel_get_drm_devid(dev->fds.dev);
 	igt_debug("close the device\n");
 	close_if_opened(&dev->fds.dev);
 
+	/**
+	 * FIXME: Unbinding the i915 driver on some platforms with Azalia audio
+	 * results in a kernel WARN on "i915 raw-wakerefs=1 wakelocks=1 on

cleanup".

tests/device_reset.c static void set_device_filter(const char* · line 242

Quoted 1 line
tests/device_reset.c +1 -0
+	 * The below CI friendly user level workaround prevents the warning

from

Quoted 8 lines
tests/device_reset.c +6 -0
+	 * appearing. Drop this hack as soon as this is fixed in the kernel.
+	 */
+	if (igt_warn_on_f((bool) IS_HASWELL(devid) || IS_BROADWELL(devid),
+	    "Manually enabling audio PM to work around a kernel WARN\n"))
+		igt_pm_enable_audio_runtime_pm();
+
 	driver_unbind(dev);
 
Quoted 1 line

tests/device_reset.c static void set_device_filter(const char* dev_path) · line 251

Quoted 1 line
tests/device_reset.c +0 -0
 	initiate_device_reset(dev);

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev