Skip to contentSkip to conversation

drm/i915: Increase OpRegion timeout

PATCH In review Daniel Vetter 6 participants 14 messages Jan 31, 2014 – Feb 4, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Increase OpRegion timeout

I have a machine here which hits this (a g33):

[   13.368536] excessive driver sleep timeout (DSPL) 1024

Apparently people love pot numbers, and one second isn't that unreasonable (for a bios writer at least) I guess.

---
 drivers/gpu/drm/i915/intel_opregion.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_opregion.c +2 -2
index 3da259e280ba..3c7e38c7ed87 100644
@@ -261,10 +261,10 @@ static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 		/* The spec says 2ms should be the default, but it's too small
 		 * for some machines. */
 		dslp = 50;
-	} else if (dslp > 500) {
+	} else if (dslp > 1500) {
 		/* Hey bios, trust must be earned. */
 		WARN_ONCE(1, "excessive driver sleep timeout (DSPL) %u\n", dslp);
-		dslp = 500;
+		dslp = 1500;
 	}
 
 	/* The spec tells us to do this, but we are the only user... */
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 6 lines · Daniel Vetter

I have a machine here which hits this (a g33):

[   13.368536] excessive driver sleep timeout (DSPL) 1024

Apparently people love pot numbers, and one second isn't that unreasonable (for a bios writer at least) I guess.

Reference https://bugs.freedesktop.org/show_bug.cgi?id=74266
excessive driver sleep timeout (DSPL) 1280

Quirks are DRM_INFO not full blown oops!
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#2 lore raw

PATCH 1/1 drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO

The WARN is a bit too verbose, make it a DRM_INFO that gets printed once.

While at it, fix the typo in DSLP.

---
 drivers/gpu/drm/i915/intel_opregion.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_opregion.c +5 -1
index 46d288055345..0fae017c4c7b 100644
@@ -263,7 +263,11 @@ static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 		dslp = 50;
 	} else if (dslp > 1500) {
 		/* Hey bios, trust must be earned. */
-		WARN_ONCE(1, "excessive driver sleep timeout (DSPL) %u\n", dslp);
+		static bool warned;
+		if (!warned) {
+			DRM_INFO("excessive driver sleep timeout (DSLP) %u\n", dslp);
+			warned = true;
+		}
 		dslp = 1500;
 	}
 
Signature · 1 line
1.7.9.5
#3 lore raw

Re: [PATCH] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO

Quoted 16 lines · Jani Nikula

The WARN is a bit too verbose, make it a DRM_INFO that gets printed once.

While at it, fix the typo in DSLP.

---
 drivers/gpu/drm/i915/intel_opregion.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_opregion.c +0 -0
index 46d288055345..0fae017c4c7b 100644

drivers/gpu/drm/i915/intel_opregion.c static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out) · line 270

Quoted 9 lines
drivers/gpu/drm/i915/intel_opregion.c +5 -1
@@ -263,7 +263,11 @@ static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 		dslp = 50;
 	} else if (dslp > 1500) {
 		/* Hey bios, trust must be earned. */
-		WARN_ONCE(1, "excessive driver sleep timeout (DSPL) %u\n", dslp);
+		static bool warned;
+		if (!warned) {
+			DRM_INFO("excessive driver sleep timeout (DSLP) %u\n", dslp);
+			warned = true;
+		}

This is the second "print once" thing I've seen in a few days. Seems like we should add DRM_INFO_ONCE() & co. to hide the ugliness a bit.

Quoted 10 lines
drivers/gpu/drm/i915/intel_opregion.c +0 -0
 		dslp = 1500;
 	}
 
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä
Intel OTC
#4 lore raw

Re: [PATCH] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO

Quoted 21 lines · Ville Syrjälä
Quoted 20 lines · Jani Nikula

The WARN is a bit too verbose, make it a DRM_INFO that gets printed once.

While at it, fix the typo in DSLP.

---
 drivers/gpu/drm/i915/intel_opregion.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_opregion.c +0 -1
index 46d288055345..0fae017c4c7b 100644
@@ -263,7 +263,11 @@ static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 		dslp = 50;
 	} else if (dslp > 1500) {
 		/* Hey bios, trust must be earned. */
-		WARN_ONCE(1, "excessive driver sleep timeout (DSPL) %u\n", dslp);
Quoted 8 lines

drivers/gpu/drm/i915/intel_opregion.c static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out) · line 270

Quoted 5 lines
drivers/gpu/drm/i915/intel_opregion.c +5 -0
+		static bool warned;
+		if (!warned) {
+			DRM_INFO("excessive driver sleep timeout (DSLP) %u\n", dslp);
+			warned = true;
+		}

This is the second "print once" thing I've seen in a few days. Seems like we should add DRM_INFO_ONCE() & co. to hide the ugliness a bit.

I'm adding DRM_INFO_ONCE() in the next version, but if you're referring to

commit 53a4c6b26ddef1f2969f8bc17178bcda4782d18d

Author: Chris Wilson <[email protected]>
Date:   Thu Jan 30 14:38:15 2014 +0000

drm/i915: Only print information for filing bug reports once

it's probably better to keep that as it is.

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

Re: [PATCH] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO

Quoted 34 lines · Jani Nikula
Quoted 21 lines · Ville Syrjälä
Quoted 20 lines · Jani Nikula

The WARN is a bit too verbose, make it a DRM_INFO that gets printed once.

While at it, fix the typo in DSLP.

---
 drivers/gpu/drm/i915/intel_opregion.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_opregion.c +0 -1
index 46d288055345..0fae017c4c7b 100644
@@ -263,7 +263,11 @@ static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 		dslp = 50;
 	} else if (dslp > 1500) {
 		/* Hey bios, trust must be earned. */
-		WARN_ONCE(1, "excessive driver sleep timeout (DSPL) %u\n", dslp);
Quoted 8 lines

drivers/gpu/drm/i915/intel_opregion.c static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out) · line 270

Quoted 5 lines
drivers/gpu/drm/i915/intel_opregion.c +5 -0
+		static bool warned;
+		if (!warned) {
+			DRM_INFO("excessive driver sleep timeout (DSLP) %u\n", dslp);
+			warned = true;
+		}

This is the second "print once" thing I've seen in a few days. Seems like we should add DRM_INFO_ONCE() & co. to hide the ugliness a bit.

I'm adding DRM_INFO_ONCE() in the next version, but if you're referring to

Quoted 7 lines

commit 53a4c6b26ddef1f2969f8bc17178bcda4782d18d

Author: Chris Wilson <[email protected]>
Date:   Thu Jan 30 14:38:15 2014 +0000

drm/i915: Only print information for filing bug reports once

it's probably better to keep that as it is.

Oh right that's multiple DRM_INFO()s. Can't it be done with one DRM_INFO(), or would that exceed some limit?

Signature · 2 lines
Ville Syrjälä
Intel OTC
#6 lore raw

PATCH 1/2 drm: add DRM_INFO_ONCE() to print a one-time DRM_INFO() message

In reply to Jani Nikula

Just like DRM_INFO(), but only do it once.

---
 include/drm/drmP.h |    3 +++
 1 file changed, 3 insertions(+)
include/drm/drmP.h +3 -0
index 04086c5be930..04a7f31301f8 100644
@@ -199,6 +199,9 @@ int drm_err(const char *func, const char *format, ...);
 #define DRM_INFO(fmt, ...)				\
 	printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
 
+#define DRM_INFO_ONCE(fmt, ...)				\
+	printk_once(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
+
 /**
  * Debug output.
  *
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH 2/2 drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO_ONCE

The WARN_ONCE is a bit too verbose, make it a DRM_INFO_ONCE.

While at it, add a #define for MAX_DSLP and make the message a bit more informative.

v2: use DRM_INFO_ONCE, add MAX_DSLP, pimp the message.

---
 drivers/gpu/drm/i915/intel_opregion.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_opregion.c +6 -3
index 46d288055345..68459605bd12 100644
@@ -227,6 +227,8 @@ struct opregion_asle {
 #define ACPI_DIGITAL_OUTPUT (3<<8)
 #define ACPI_LVDS_OUTPUT (4<<8)
 
+#define MAX_DSLP	1500
+
 #ifdef CONFIG_ACPI
 static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 {
@@ -261,10 +263,11 @@ static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 		/* The spec says 2ms should be the default, but it's too small
 		 * for some machines. */
 		dslp = 50;
-	} else if (dslp > 1500) {
+	} else if (dslp > MAX_DSLP) {
 		/* Hey bios, trust must be earned. */
-		WARN_ONCE(1, "excessive driver sleep timeout (DSPL) %u\n", dslp);
-		dslp = 1500;
+		DRM_INFO_ONCE("ACPI BIOS requests an excessive sleep of %u ms, "
+			      "using %u ms instead\n", dslp, MAX_DSLP);
+		dslp = MAX_DSLP;
 	}
 
 	/* The spec tells us to do this, but we are the only user... */
Signature · 1 line
1.7.9.5
#8 lore raw

Re: [PATCH 2/2] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO_ONCE

Quoted 9 lines · Jani Nikula

The WARN_ONCE is a bit too verbose, make it a DRM_INFO_ONCE.

While at it, add a #define for MAX_DSLP and make the message a bit more informative.

v2: use DRM_INFO_ONCE, add MAX_DSLP, pimp the message.

Both Reviewed-by: Chris Wilson <[email protected]> -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#9 lore raw

Re: [PATCH 2/2] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO_ONCE

Quoted 11 lines · Chris Wilson
Quoted 9 lines · Jani Nikula

The WARN_ONCE is a bit too verbose, make it a DRM_INFO_ONCE.

While at it, add a #define for MAX_DSLP and make the message a bit more informative.

v2: use DRM_INFO_ONCE, add MAX_DSLP, pimp the message.

Both Reviewed-by: Chris Wilson <[email protected]>

Both merged to -fixes with Dave's ack on the drm pach. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#10 lore raw

Re: [PATCH] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO

In reply to Jani Nikula
Quoted 16 lines · Jani Nikula

The WARN is a bit too verbose, make it a DRM_INFO that gets printed once.

While at it, fix the typo in DSLP.

---
 drivers/gpu/drm/i915/intel_opregion.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_opregion.c +0 -0
index 46d288055345..0fae017c4c7b 100644

drivers/gpu/drm/i915/intel_opregion.c static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out) · line 268

Quoted 7 lines
drivers/gpu/drm/i915/intel_opregion.c +3 -1
@@ -263,7 +263,11 @@ static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 		dslp = 50;
 	} else if (dslp > 1500) {
 		/* Hey bios, trust must be earned. */
-		WARN_ONCE(1, "excessive driver sleep timeout (DSPL) %u\n", dslp);
+		static bool warned;
+		if (!warned) {
+			DRM_INFO("excessive driver sleep timeout (DSLP) %u\n", dslp);

DRM_INFO("ACPI BIOS requests an excessive sleep of %d ms, using %d instead\n", dslp, MAX_DSLP);

Quoted 8 lines
drivers/gpu/drm/i915/intel_opregion.c +2 -0
+			warned = true;
+		}
 		dslp = 1500;
 	}
 
Signature · 1 line
1.7.9.5
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#11 lore raw

Re: [PATCH] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO

Quoted 12 lines · Chris Wilson
Quoted 11 lines · Jani Nikula

The WARN is a bit too verbose, make it a DRM_INFO that gets printed once.

While at it, fix the typo in DSLP.

---
 drivers/gpu/drm/i915/intel_opregion.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Quoted 14 lines

drivers/gpu/drm/i915/intel_opregion.c static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out) · line 268

Quoted 12 lines
drivers/gpu/drm/i915/intel_opregion.c +3 -1
index 46d288055345..0fae017c4c7b 100644
@@ -263,7 +263,11 @@ static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 		dslp = 50;
 	} else if (dslp > 1500) {
 		/* Hey bios, trust must be earned. */
-		WARN_ONCE(1, "excessive driver sleep timeout (DSPL) %u\n", dslp);
+		static bool warned;
+		if (!warned) {
+			DRM_INFO("excessive driver sleep timeout (DSLP) %u\n", dslp);

DRM_INFO("ACPI BIOS requests an excessive sleep of %d ms, using %d instead\n", dslp, MAX_DSLP);

You're just saying that because I didn't dare to write the new value back to opregion! :p

Quoted 12 lines
Quoted 9 lines
drivers/gpu/drm/i915/intel_opregion.c +2 -0
+			warned = true;
+		}
 		dslp = 1500;
 	}
 
Signature · 1 line
1.7.9.5
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
#12 lore raw

Re: [PATCH] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO

Quoted 28 lines · Jani Nikula
Quoted 12 lines · Chris Wilson
Quoted 11 lines · Jani Nikula

The WARN is a bit too verbose, make it a DRM_INFO that gets printed once.

While at it, fix the typo in DSLP.

---
 drivers/gpu/drm/i915/intel_opregion.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Quoted 14 lines

drivers/gpu/drm/i915/intel_opregion.c static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out) · line 268

Quoted 12 lines
drivers/gpu/drm/i915/intel_opregion.c +3 -1
index 46d288055345..0fae017c4c7b 100644
@@ -263,7 +263,11 @@ static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 		dslp = 50;
 	} else if (dslp > 1500) {
 		/* Hey bios, trust must be earned. */
-		WARN_ONCE(1, "excessive driver sleep timeout (DSPL) %u\n", dslp);
+		static bool warned;
+		if (!warned) {
+			DRM_INFO("excessive driver sleep timeout (DSLP) %u\n", dslp);

DRM_INFO("ACPI BIOS requests an excessive sleep of %d ms, using %d instead\n", dslp, MAX_DSLP);

Quoted 2 lines

You're just saying that because I didn't dare to write the new value back to opregion! :p

I'm just trying to clarify that it is not our fault we want to sleep for several seconds during startup, but the manufacturer...

But yes, you are a coward. ;-)
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
maintainer Reviewed-by on v1 1/1
#13 lore raw
In reply to Daniel Vetter
Quoted 6 lines · Daniel Vetter

I have a machine here which hits this (a g33):

[   13.368536] excessive driver sleep timeout (DSPL) 1024

Apparently people love pot numbers, and one second isn't that unreasonable (for a bios writer at least) I guess.

Quoted 29 lines
---
 drivers/gpu/drm/i915/intel_opregion.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_opregion.c +2 -2
index 3da259e280ba..3c7e38c7ed87 100644
@@ -261,10 +261,10 @@ static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 		/* The spec says 2ms should be the default, but it's too small
 		 * for some machines. */
 		dslp = 50;
-	} else if (dslp > 500) {
+	} else if (dslp > 1500) {
 		/* Hey bios, trust must be earned. */
 		WARN_ONCE(1, "excessive driver sleep timeout (DSPL) %u\n", dslp);
-		dslp = 500;
+		dslp = 1500;
 	}
 
 	/* The spec tells us to do this, but we are the only user... */
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center