linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] drm/komeda: Improve IRQ error event prints
@ 2019-11-07 11:42 Mihail Atanassov
  2019-11-07 11:42 ` [PATCH v2 1/5] drm/komeda: Add debugfs node to control error verbosity Mihail Atanassov
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Mihail Atanassov @ 2019-11-07 11:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Mihail Atanassov, nd, Mihail Atanassov, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, Liviu Dudau, Brian Starkey,
	David Airlie, Daniel Vetter,
	james qian wang (Arm Technology China),
	Lowry Li (Arm Technology China),
	linux-kernel

Hi everyone,

Sending out a v2 of the series since I had missed out a couple of issues
checkpatch caught.

Changes since v1 [https://patchwork.freedesktop.org/series/68325/]:
 - Fixed a couple of checkpatch issues in 2/5 and 5/5

v1's cover letter:

This is a smallish series that tries to remove some build-time
configurability in komeda and replace it with a debugfs control. Later
patches in the series add some extra functionality which I found useful
during my debugging sessions, so I figured I'd bake it in.

I've preserved the default behaviour as if CONFIG_KOMEDA_ERROR_PRINT
were enabled, so production kernels can have some feedback from the
driver when things are going south.

1: Introduce the err_verbosity debugfs node for komeda; this keeps the
   default of printing error events once per frame.
2: Drop CONFIG_KOMEDA_ERROR_PRINT since output can be disabled at
   runtime
3: Add a drm state dump on event. It's quite chatty so I left it only
   for error events; printing all that once per frame every vsync floods my
   serial terminal, so no info + state combination.
4: Add lower-severity categories to the event printer
5: Normally these events fire only once per pageflip, but sometimes it's
   useful to see them all as they come in.

These patches are overall quite tiny, and I was considering just
squashing them into one, but I opted to keep them separate for an easier
review experience; please let me know whether you prefer a single patch.
Thanks!

Mihail Atanassov (5):
  drm/komeda: Add debugfs node to control error verbosity
  drm/komeda: Remove CONFIG_KOMEDA_ERROR_PRINT
  drm/komeda: Optionally dump DRM state on interrupts
  drm/komeda: Add option to print WARN- and INFO-level IRQ events
  drm/komeda: add rate limiting disable to err_verbosity

 drivers/gpu/drm/arm/display/Kconfig           |  6 ----
 drivers/gpu/drm/arm/display/komeda/Makefile   |  5 ++--
 .../gpu/drm/arm/display/komeda/komeda_dev.c   |  4 +++
 .../gpu/drm/arm/display/komeda/komeda_dev.h   | 30 +++++++++++++++----
 .../gpu/drm/arm/display/komeda/komeda_event.c | 23 +++++++++++---
 .../gpu/drm/arm/display/komeda/komeda_kms.c   |  2 +-
 6 files changed, 51 insertions(+), 19 deletions(-)

-- 
2.23.0


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

* [PATCH v2 1/5] drm/komeda: Add debugfs node to control error verbosity
  2019-11-07 11:42 [PATCH v2 0/5] drm/komeda: Improve IRQ error event prints Mihail Atanassov
@ 2019-11-07 11:42 ` Mihail Atanassov
  2019-11-11 15:52   ` Liviu Dudau
  2019-11-07 11:42 ` [PATCH v2 2/5] drm/komeda: Remove CONFIG_KOMEDA_ERROR_PRINT Mihail Atanassov
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Mihail Atanassov @ 2019-11-07 11:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Mihail Atanassov, nd, Mihail Atanassov, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, Liviu Dudau, Brian Starkey,
	David Airlie, Daniel Vetter,
	james qian wang (Arm Technology China),
	Lowry Li (Arm Technology China),
	linux-kernel

Named 'err_verbosity', currently with only 1 active bit in that
replicates the existing level - print error events once per flip.

Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
---
 drivers/gpu/drm/arm/display/komeda/komeda_dev.c   |  4 ++++
 drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 14 ++++++++++++--
 drivers/gpu/drm/arm/display/komeda/komeda_event.c |  9 +++++++--
 drivers/gpu/drm/arm/display/komeda/komeda_kms.c   |  2 +-
 4 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
index 14d5c5da9e3b..4e46f650fddf 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
@@ -58,6 +58,8 @@ static void komeda_debugfs_init(struct komeda_dev *mdev)
 	mdev->debugfs_root = debugfs_create_dir("komeda", NULL);
 	debugfs_create_file("register", 0444, mdev->debugfs_root,
 			    mdev, &komeda_register_fops);
+	debugfs_create_x16("err_verbosity", 0664, mdev->debugfs_root,
+			   &mdev->err_verbosity);
 }
 #endif
 
@@ -273,6 +275,8 @@ struct komeda_dev *komeda_dev_create(struct device *dev)
 		goto err_cleanup;
 	}
 
+	mdev->err_verbosity = KOMEDA_DEV_PRINT_ERR_EVENTS;
+
 #ifdef CONFIG_DEBUG_FS
 	komeda_debugfs_init(mdev);
 #endif
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
index 414200233b64..b5bd3d5898ee 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
@@ -202,6 +202,14 @@ struct komeda_dev {
 
 	/** @debugfs_root: root directory of komeda debugfs */
 	struct dentry *debugfs_root;
+	/**
+	 * @err_verbosity: bitmask for how much extra info to print on error
+	 *
+	 * See KOMEDA_DEV_* macros for details.
+	 */
+	u16 err_verbosity;
+	/* Print a single line per error per frame with error events. */
+#define KOMEDA_DEV_PRINT_ERR_EVENTS BIT(0)
 };
 
 static inline bool
@@ -219,9 +227,11 @@ void komeda_dev_destroy(struct komeda_dev *mdev);
 struct komeda_dev *dev_to_mdev(struct device *dev);
 
 #ifdef CONFIG_DRM_KOMEDA_ERROR_PRINT
-void komeda_print_events(struct komeda_events *evts);
+void komeda_print_events(struct komeda_events *evts, struct drm_device *dev);
 #else
-static inline void komeda_print_events(struct komeda_events *evts) {}
+static inline void komeda_print_events(struct komeda_events *evts,
+				       struct drm_device *dev)
+{}
 #endif
 
 int komeda_dev_resume(struct komeda_dev *mdev);
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
index a36fb86cc054..575ed4df74ed 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
@@ -107,10 +107,12 @@ static bool is_new_frame(struct komeda_events *a)
 	       (KOMEDA_EVENT_FLIP | KOMEDA_EVENT_EOW);
 }
 
-void komeda_print_events(struct komeda_events *evts)
+void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
 {
-	u64 print_evts = KOMEDA_ERR_EVENTS;
+	u64 print_evts = 0;
 	static bool en_print = true;
+	struct komeda_dev *mdev = dev->dev_private;
+	u16 const err_verbosity = mdev->err_verbosity;
 
 	/* reduce the same msg print, only print the first evt for one frame */
 	if (evts->global || is_new_frame(evts))
@@ -118,6 +120,9 @@ void komeda_print_events(struct komeda_events *evts)
 	if (!en_print)
 		return;
 
+	if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
+		print_evts |= KOMEDA_ERR_EVENTS;
+
 	if ((evts->global | evts->pipes[0] | evts->pipes[1]) & print_evts) {
 		char msg[256];
 		struct komeda_str str;
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
index d49772de93e0..e30a5b43caa9 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
@@ -48,7 +48,7 @@ static irqreturn_t komeda_kms_irq_handler(int irq, void *data)
 	memset(&evts, 0, sizeof(evts));
 	status = mdev->funcs->irq_handler(mdev, &evts);
 
-	komeda_print_events(&evts);
+	komeda_print_events(&evts, drm);
 
 	/* Notify the crtc to handle the events */
 	for (i = 0; i < kms->n_crtcs; i++)
-- 
2.23.0


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

* [PATCH v2 2/5] drm/komeda: Remove CONFIG_KOMEDA_ERROR_PRINT
  2019-11-07 11:42 [PATCH v2 0/5] drm/komeda: Improve IRQ error event prints Mihail Atanassov
  2019-11-07 11:42 ` [PATCH v2 1/5] drm/komeda: Add debugfs node to control error verbosity Mihail Atanassov
@ 2019-11-07 11:42 ` Mihail Atanassov
  2019-11-07 11:42 ` [PATCH v2 3/5] drm/komeda: Optionally dump DRM state on interrupts Mihail Atanassov
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Mihail Atanassov @ 2019-11-07 11:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Mihail Atanassov, nd, Mihail Atanassov, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, Liviu Dudau, Brian Starkey,
	David Airlie, Daniel Vetter,
	james qian wang (Arm Technology China),
	Lowry Li (Arm Technology China),
	linux-kernel

Now that there's a debugfs node to control the same, remove the
config option.

Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
---
 drivers/gpu/drm/arm/display/Kconfig             | 6 ------
 drivers/gpu/drm/arm/display/komeda/Makefile     | 5 ++---
 drivers/gpu/drm/arm/display/komeda/komeda_dev.h | 6 ------
 3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/Kconfig b/drivers/gpu/drm/arm/display/Kconfig
index e87ff8623076..cec0639e3aa1 100644
--- a/drivers/gpu/drm/arm/display/Kconfig
+++ b/drivers/gpu/drm/arm/display/Kconfig
@@ -12,9 +12,3 @@ config DRM_KOMEDA
 	  Processor driver. It supports the D71 variants of the hardware.
 
 	  If compiled as a module it will be called komeda.
-
-config DRM_KOMEDA_ERROR_PRINT
-	bool "Enable komeda error print"
-	depends on DRM_KOMEDA
-	help
-	  Choose this option to enable error printing.
diff --git a/drivers/gpu/drm/arm/display/komeda/Makefile b/drivers/gpu/drm/arm/display/komeda/Makefile
index f095a1c68ac7..1931a7fa1a14 100644
--- a/drivers/gpu/drm/arm/display/komeda/Makefile
+++ b/drivers/gpu/drm/arm/display/komeda/Makefile
@@ -16,12 +16,11 @@ komeda-y := \
 	komeda_crtc.o \
 	komeda_plane.o \
 	komeda_wb_connector.o \
-	komeda_private_obj.o
+	komeda_private_obj.o \
+	komeda_event.o
 
 komeda-y += \
 	d71/d71_dev.o \
 	d71/d71_component.o
 
-komeda-$(CONFIG_DRM_KOMEDA_ERROR_PRINT) += komeda_event.o
-
 obj-$(CONFIG_DRM_KOMEDA) += komeda.o
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
index b5bd3d5898ee..831c375180f8 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
@@ -226,13 +226,7 @@ void komeda_dev_destroy(struct komeda_dev *mdev);
 
 struct komeda_dev *dev_to_mdev(struct device *dev);
 
-#ifdef CONFIG_DRM_KOMEDA_ERROR_PRINT
 void komeda_print_events(struct komeda_events *evts, struct drm_device *dev);
-#else
-static inline void komeda_print_events(struct komeda_events *evts,
-				       struct drm_device *dev)
-{}
-#endif
 
 int komeda_dev_resume(struct komeda_dev *mdev);
 int komeda_dev_suspend(struct komeda_dev *mdev);
-- 
2.23.0


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

* [PATCH v2 3/5] drm/komeda: Optionally dump DRM state on interrupts
  2019-11-07 11:42 [PATCH v2 0/5] drm/komeda: Improve IRQ error event prints Mihail Atanassov
  2019-11-07 11:42 ` [PATCH v2 1/5] drm/komeda: Add debugfs node to control error verbosity Mihail Atanassov
  2019-11-07 11:42 ` [PATCH v2 2/5] drm/komeda: Remove CONFIG_KOMEDA_ERROR_PRINT Mihail Atanassov
@ 2019-11-07 11:42 ` Mihail Atanassov
  2019-11-07 11:42 ` [PATCH v2 4/5] drm/komeda: Add option to print WARN- and INFO-level IRQ events Mihail Atanassov
  2019-11-07 11:42 ` [PATCH v2 5/5] drm/komeda: add rate limiting disable to err_verbosity Mihail Atanassov
  4 siblings, 0 replies; 12+ messages in thread
From: Mihail Atanassov @ 2019-11-07 11:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Mihail Atanassov, nd, Mihail Atanassov, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, Liviu Dudau, Brian Starkey,
	David Airlie, Daniel Vetter,
	james qian wang (Arm Technology China),
	Lowry Li (Arm Technology China),
	linux-kernel

It's potentially useful information when diagnosing error/warn IRQs, so
dump it to dmesg with a drm_info_printer. Hide this extra debug dumping
behind another komeda_dev->err_verbosity bit.

Note that there's not much sense in dumping it for INFO events,
since the VSYNC event will swamp the log.

Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
---

 v2: Clean up continuation line warning from checkpatch.

 drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 5 ++++-
 drivers/gpu/drm/arm/display/komeda/komeda_event.c | 8 +++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
index 831c375180f8..4809000c1efb 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
@@ -205,11 +205,14 @@ struct komeda_dev {
 	/**
 	 * @err_verbosity: bitmask for how much extra info to print on error
 	 *
-	 * See KOMEDA_DEV_* macros for details.
+	 * See KOMEDA_DEV_* macros for details. Low byte contains the debug
+	 * level categories, the high byte contains extra debug options.
 	 */
 	u16 err_verbosity;
 	/* Print a single line per error per frame with error events. */
 #define KOMEDA_DEV_PRINT_ERR_EVENTS BIT(0)
+	/* Dump DRM state on an error or warning event. */
+#define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8)
 };
 
 static inline bool
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
index 575ed4df74ed..de99a588ed75 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
@@ -4,6 +4,7 @@
  * Author: James.Qian.Wang <james.qian.wang@arm.com>
  *
  */
+#include <drm/drm_atomic.h>
 #include <drm/drm_print.h>
 
 #include "komeda_dev.h"
@@ -113,6 +114,7 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
 	static bool en_print = true;
 	struct komeda_dev *mdev = dev->dev_private;
 	u16 const err_verbosity = mdev->err_verbosity;
+	u64 evts_mask = evts->global | evts->pipes[0] | evts->pipes[1];
 
 	/* reduce the same msg print, only print the first evt for one frame */
 	if (evts->global || is_new_frame(evts))
@@ -123,9 +125,10 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
 	if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
 		print_evts |= KOMEDA_ERR_EVENTS;
 
-	if ((evts->global | evts->pipes[0] | evts->pipes[1]) & print_evts) {
+	if (evts_mask & print_evts) {
 		char msg[256];
 		struct komeda_str str;
+		struct drm_printer p = drm_info_printer(dev->dev);
 
 		str.str = msg;
 		str.sz  = sizeof(msg);
@@ -139,6 +142,9 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
 		evt_str(&str, evts->pipes[1]);
 
 		DRM_ERROR("err detect: %s\n", msg);
+		if ((err_verbosity & KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT) &&
+		    (evts_mask & (KOMEDA_ERR_EVENTS | KOMEDA_WARN_EVENTS)))
+			drm_state_dump(dev, &p);
 
 		en_print = false;
 	}
-- 
2.23.0


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

* [PATCH v2 4/5] drm/komeda: Add option to print WARN- and INFO-level IRQ events
  2019-11-07 11:42 [PATCH v2 0/5] drm/komeda: Improve IRQ error event prints Mihail Atanassov
                   ` (2 preceding siblings ...)
  2019-11-07 11:42 ` [PATCH v2 3/5] drm/komeda: Optionally dump DRM state on interrupts Mihail Atanassov
@ 2019-11-07 11:42 ` Mihail Atanassov
  2019-11-07 11:42 ` [PATCH v2 5/5] drm/komeda: add rate limiting disable to err_verbosity Mihail Atanassov
  4 siblings, 0 replies; 12+ messages in thread
From: Mihail Atanassov @ 2019-11-07 11:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Mihail Atanassov, nd, Mihail Atanassov, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, Liviu Dudau, Brian Starkey,
	David Airlie, Daniel Vetter,
	james qian wang (Arm Technology China),
	Lowry Li (Arm Technology China),
	linux-kernel

Extra detail (normally off) almost never hurts.

Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
---
 drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 11 +++++++++++
 drivers/gpu/drm/arm/display/komeda/komeda_event.c |  4 ++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
index 4809000c1efb..d9fc9c48859a 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
@@ -51,6 +51,13 @@
 
 #define KOMEDA_WARN_EVENTS	KOMEDA_ERR_CSCE
 
+#define KOMEDA_INFO_EVENTS ({0 \
+			    | KOMEDA_EVENT_VSYNC \
+			    | KOMEDA_EVENT_FLIP \
+			    | KOMEDA_EVENT_EOW \
+			    | KOMEDA_EVENT_MODE \
+			    })
+
 /* malidp device id */
 enum {
 	MALI_D71 = 0,
@@ -211,6 +218,10 @@ struct komeda_dev {
 	u16 err_verbosity;
 	/* Print a single line per error per frame with error events. */
 #define KOMEDA_DEV_PRINT_ERR_EVENTS BIT(0)
+	/* Print a single line per warning per frame with error events. */
+#define KOMEDA_DEV_PRINT_WARN_EVENTS BIT(1)
+	/* Print a single line per info event per frame with error events. */
+#define KOMEDA_DEV_PRINT_INFO_EVENTS BIT(2)
 	/* Dump DRM state on an error or warning event. */
 #define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8)
 };
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
index de99a588ed75..7fd624761a2b 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
@@ -124,6 +124,10 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
 
 	if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
 		print_evts |= KOMEDA_ERR_EVENTS;
+	if (err_verbosity & KOMEDA_DEV_PRINT_WARN_EVENTS)
+		print_evts |= KOMEDA_WARN_EVENTS;
+	if (err_verbosity & KOMEDA_DEV_PRINT_INFO_EVENTS)
+		print_evts |= KOMEDA_INFO_EVENTS;
 
 	if (evts_mask & print_evts) {
 		char msg[256];
-- 
2.23.0


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

* [PATCH v2 5/5] drm/komeda: add rate limiting disable to err_verbosity
  2019-11-07 11:42 [PATCH v2 0/5] drm/komeda: Improve IRQ error event prints Mihail Atanassov
                   ` (3 preceding siblings ...)
  2019-11-07 11:42 ` [PATCH v2 4/5] drm/komeda: Add option to print WARN- and INFO-level IRQ events Mihail Atanassov
@ 2019-11-07 11:42 ` Mihail Atanassov
  2019-11-11 15:53   ` Liviu Dudau
  4 siblings, 1 reply; 12+ messages in thread
From: Mihail Atanassov @ 2019-11-07 11:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Mihail Atanassov, nd, Mihail Atanassov, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, Liviu Dudau, Brian Starkey,
	David Airlie, Daniel Vetter,
	james qian wang (Arm Technology China),
	Lowry Li (Arm Technology China),
	linux-kernel

It's possible to get multiple events in a single frame/flip, so add an
option to print them all.

Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
---

 v2: Clean up continuation line warning from checkpatch.

 drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 2 ++
 drivers/gpu/drm/arm/display/komeda/komeda_event.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
index d9fc9c48859a..15f52e304c08 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
@@ -224,6 +224,8 @@ struct komeda_dev {
 #define KOMEDA_DEV_PRINT_INFO_EVENTS BIT(2)
 	/* Dump DRM state on an error or warning event. */
 #define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8)
+	/* Disable rate limiting of event prints (normally one per commit) */
+#define KOMEDA_DEV_PRINT_DISABLE_RATELIMIT BIT(12)
 };
 
 static inline bool
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
index 7fd624761a2b..bf269683f811 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
@@ -119,7 +119,7 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
 	/* reduce the same msg print, only print the first evt for one frame */
 	if (evts->global || is_new_frame(evts))
 		en_print = true;
-	if (!en_print)
+	if (!(err_verbosity & KOMEDA_DEV_PRINT_DISABLE_RATELIMIT) && !en_print)
 		return;
 
 	if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
-- 
2.23.0


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

* Re: [PATCH v2 1/5] drm/komeda: Add debugfs node to control error verbosity
  2019-11-07 11:42 ` [PATCH v2 1/5] drm/komeda: Add debugfs node to control error verbosity Mihail Atanassov
@ 2019-11-11 15:52   ` Liviu Dudau
  0 siblings, 0 replies; 12+ messages in thread
From: Liviu Dudau @ 2019-11-11 15:52 UTC (permalink / raw)
  To: Mihail Atanassov
  Cc: dri-devel, nd, Maarten Lankhorst, Maxime Ripard, Sean Paul,
	Brian Starkey, David Airlie, Daniel Vetter,
	james qian wang (Arm Technology China),
	Lowry Li (Arm Technology China),
	linux-kernel

On Thu, Nov 07, 2019 at 11:42:28AM +0000, Mihail Atanassov wrote:
> Named 'err_verbosity', currently with only 1 active bit in that
> replicates the existing level - print error events once per flip.
> 
> Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
> Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> ---
>  drivers/gpu/drm/arm/display/komeda/komeda_dev.c   |  4 ++++
>  drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 14 ++++++++++++--
>  drivers/gpu/drm/arm/display/komeda/komeda_event.c |  9 +++++++--
>  drivers/gpu/drm/arm/display/komeda/komeda_kms.c   |  2 +-
>  4 files changed, 24 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> index 14d5c5da9e3b..4e46f650fddf 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> @@ -58,6 +58,8 @@ static void komeda_debugfs_init(struct komeda_dev *mdev)
>  	mdev->debugfs_root = debugfs_create_dir("komeda", NULL);
>  	debugfs_create_file("register", 0444, mdev->debugfs_root,
>  			    mdev, &komeda_register_fops);
> +	debugfs_create_x16("err_verbosity", 0664, mdev->debugfs_root,
> +			   &mdev->err_verbosity);
>  }
>  #endif
>  
> @@ -273,6 +275,8 @@ struct komeda_dev *komeda_dev_create(struct device *dev)
>  		goto err_cleanup;
>  	}
>  
> +	mdev->err_verbosity = KOMEDA_DEV_PRINT_ERR_EVENTS;
> +
>  #ifdef CONFIG_DEBUG_FS
>  	komeda_debugfs_init(mdev);
>  #endif
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> index 414200233b64..b5bd3d5898ee 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> @@ -202,6 +202,14 @@ struct komeda_dev {
>  
>  	/** @debugfs_root: root directory of komeda debugfs */
>  	struct dentry *debugfs_root;
> +	/**
> +	 * @err_verbosity: bitmask for how much extra info to print on error
> +	 *
> +	 * See KOMEDA_DEV_* macros for details.
> +	 */
> +	u16 err_verbosity;
> +	/* Print a single line per error per frame with error events. */
> +#define KOMEDA_DEV_PRINT_ERR_EVENTS BIT(0)
>  };
>  
>  static inline bool
> @@ -219,9 +227,11 @@ void komeda_dev_destroy(struct komeda_dev *mdev);
>  struct komeda_dev *dev_to_mdev(struct device *dev);
>  
>  #ifdef CONFIG_DRM_KOMEDA_ERROR_PRINT
> -void komeda_print_events(struct komeda_events *evts);
> +void komeda_print_events(struct komeda_events *evts, struct drm_device *dev);
>  #else
> -static inline void komeda_print_events(struct komeda_events *evts) {}
> +static inline void komeda_print_events(struct komeda_events *evts,
> +				       struct drm_device *dev)
> +{}
>  #endif
>  
>  int komeda_dev_resume(struct komeda_dev *mdev);
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> index a36fb86cc054..575ed4df74ed 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> @@ -107,10 +107,12 @@ static bool is_new_frame(struct komeda_events *a)
>  	       (KOMEDA_EVENT_FLIP | KOMEDA_EVENT_EOW);
>  }
>  
> -void komeda_print_events(struct komeda_events *evts)
> +void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
>  {
> -	u64 print_evts = KOMEDA_ERR_EVENTS;
> +	u64 print_evts = 0;
>  	static bool en_print = true;
> +	struct komeda_dev *mdev = dev->dev_private;
> +	u16 const err_verbosity = mdev->err_verbosity;
>  
>  	/* reduce the same msg print, only print the first evt for one frame */
>  	if (evts->global || is_new_frame(evts))
> @@ -118,6 +120,9 @@ void komeda_print_events(struct komeda_events *evts)
>  	if (!en_print)
>  		return;
>  
> +	if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
> +		print_evts |= KOMEDA_ERR_EVENTS;
> +
>  	if ((evts->global | evts->pipes[0] | evts->pipes[1]) & print_evts) {
>  		char msg[256];
>  		struct komeda_str str;
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> index d49772de93e0..e30a5b43caa9 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> @@ -48,7 +48,7 @@ static irqreturn_t komeda_kms_irq_handler(int irq, void *data)
>  	memset(&evts, 0, sizeof(evts));
>  	status = mdev->funcs->irq_handler(mdev, &evts);
>  
> -	komeda_print_events(&evts);
> +	komeda_print_events(&evts, drm);
>  
>  	/* Notify the crtc to handle the events */
>  	for (i = 0; i < kms->n_crtcs; i++)
> -- 
> 2.23.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

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

* Re: [PATCH v2 5/5] drm/komeda: add rate limiting disable to err_verbosity
  2019-11-07 11:42 ` [PATCH v2 5/5] drm/komeda: add rate limiting disable to err_verbosity Mihail Atanassov
@ 2019-11-11 15:53   ` Liviu Dudau
  2019-11-12 13:00     ` Mihail Atanassov
  0 siblings, 1 reply; 12+ messages in thread
From: Liviu Dudau @ 2019-11-11 15:53 UTC (permalink / raw)
  To: Mihail Atanassov
  Cc: dri-devel, nd, Maarten Lankhorst, Maxime Ripard, Sean Paul,
	Brian Starkey, David Airlie, Daniel Vetter,
	james qian wang (Arm Technology China),
	Lowry Li (Arm Technology China),
	linux-kernel

On Thu, Nov 07, 2019 at 11:42:44AM +0000, Mihail Atanassov wrote:
> It's possible to get multiple events in a single frame/flip, so add an
> option to print them all.
> 
> Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
> Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>

For the whole series:

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> ---
> 
>  v2: Clean up continuation line warning from checkpatch.
> 
>  drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 2 ++
>  drivers/gpu/drm/arm/display/komeda/komeda_event.c | 2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> index d9fc9c48859a..15f52e304c08 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> @@ -224,6 +224,8 @@ struct komeda_dev {
>  #define KOMEDA_DEV_PRINT_INFO_EVENTS BIT(2)
>  	/* Dump DRM state on an error or warning event. */
>  #define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8)
> +	/* Disable rate limiting of event prints (normally one per commit) */
> +#define KOMEDA_DEV_PRINT_DISABLE_RATELIMIT BIT(12)
>  };
>  
>  static inline bool
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> index 7fd624761a2b..bf269683f811 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> @@ -119,7 +119,7 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
>  	/* reduce the same msg print, only print the first evt for one frame */
>  	if (evts->global || is_new_frame(evts))
>  		en_print = true;
> -	if (!en_print)
> +	if (!(err_verbosity & KOMEDA_DEV_PRINT_DISABLE_RATELIMIT) && !en_print)
>  		return;
>  
>  	if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
> -- 
> 2.23.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

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

* Re: [PATCH v2 5/5] drm/komeda: add rate limiting disable to err_verbosity
  2019-11-11 15:53   ` Liviu Dudau
@ 2019-11-12 13:00     ` Mihail Atanassov
  2019-11-12 18:24       ` Daniel Vetter
  0 siblings, 1 reply; 12+ messages in thread
From: Mihail Atanassov @ 2019-11-12 13:00 UTC (permalink / raw)
  To: Liviu Dudau
  Cc: nd, dri-devel, nd, Maarten Lankhorst, Maxime Ripard, Sean Paul,
	Brian Starkey, David Airlie, Daniel Vetter,
	james qian wang (Arm Technology China),
	Lowry Li (Arm Technology China),
	linux-kernel

On Monday, 11 November 2019 15:53:14 GMT Liviu Dudau wrote:
> On Thu, Nov 07, 2019 at 11:42:44AM +0000, Mihail Atanassov wrote:
> > It's possible to get multiple events in a single frame/flip, so add an
> > option to print them all.
> > 
> > Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
> > Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
> 
> For the whole series:
> 
> Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Thanks, applied to drm-misc-next.

> 
> Best regards,
> Liviu
> 
> > ---
> > 
> >  v2: Clean up continuation line warning from checkpatch.
> > 
> >  drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 2 ++
> >  drivers/gpu/drm/arm/display/komeda/komeda_event.c | 2 +-
> >  2 files changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > index d9fc9c48859a..15f52e304c08 100644
> > --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > @@ -224,6 +224,8 @@ struct komeda_dev {
> >  #define KOMEDA_DEV_PRINT_INFO_EVENTS BIT(2)
> >  	/* Dump DRM state on an error or warning event. */
> >  #define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8)
> > +	/* Disable rate limiting of event prints (normally one per commit) */
> > +#define KOMEDA_DEV_PRINT_DISABLE_RATELIMIT BIT(12)
> >  };
> >  
> >  static inline bool
> > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > index 7fd624761a2b..bf269683f811 100644
> > --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > @@ -119,7 +119,7 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
> >  	/* reduce the same msg print, only print the first evt for one frame */
> >  	if (evts->global || is_new_frame(evts))
> >  		en_print = true;
> > -	if (!en_print)
> > +	if (!(err_verbosity & KOMEDA_DEV_PRINT_DISABLE_RATELIMIT) && !en_print)
> >  		return;
> >  
> >  	if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
> > -- 
> > 2.23.0
> > 
> 
> -- 
> ====================
> | I would like to |
> | fix the world,  |
> | but they're not |
> | giving me the   |
>  \ source code!  /
>   ---------------
>     ¯\_(ツ)_/¯
> 


-- 
Mihail




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

* Re: [PATCH v2 5/5] drm/komeda: add rate limiting disable to err_verbosity
  2019-11-12 13:00     ` Mihail Atanassov
@ 2019-11-12 18:24       ` Daniel Vetter
  2019-11-13  1:42         ` james qian wang (Arm Technology China)
  2019-11-13 13:43         ` Mihail Atanassov
  0 siblings, 2 replies; 12+ messages in thread
From: Daniel Vetter @ 2019-11-12 18:24 UTC (permalink / raw)
  To: Mihail Atanassov
  Cc: Liviu Dudau, nd, dri-devel, Maarten Lankhorst, Maxime Ripard,
	Sean Paul, Brian Starkey, David Airlie,
	james qian wang (Arm Technology China),
	Lowry Li (Arm Technology China),
	linux-kernel

On Tue, Nov 12, 2019 at 2:00 PM Mihail Atanassov
<Mihail.Atanassov@arm.com> wrote:
>
> On Monday, 11 November 2019 15:53:14 GMT Liviu Dudau wrote:
> > On Thu, Nov 07, 2019 at 11:42:44AM +0000, Mihail Atanassov wrote:
> > > It's possible to get multiple events in a single frame/flip, so add an
> > > option to print them all.
> > >
> > > Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
> > > Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
> >
> > For the whole series:
> >
> > Acked-by: Liviu Dudau <liviu.dudau@arm.com>
>
> Thanks, applied to drm-misc-next.

And now komeda doesn't even compile anymore. I'm ... impressed.

I mean generally people break other people's driver, not their own.
-Daniel

> >
> > Best regards,
> > Liviu
> >
> > > ---
> > >
> > >  v2: Clean up continuation line warning from checkpatch.
> > >
> > >  drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 2 ++
> > >  drivers/gpu/drm/arm/display/komeda/komeda_event.c | 2 +-
> > >  2 files changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > > index d9fc9c48859a..15f52e304c08 100644
> > > --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > > @@ -224,6 +224,8 @@ struct komeda_dev {
> > >  #define KOMEDA_DEV_PRINT_INFO_EVENTS BIT(2)
> > >     /* Dump DRM state on an error or warning event. */
> > >  #define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8)
> > > +   /* Disable rate limiting of event prints (normally one per commit) */
> > > +#define KOMEDA_DEV_PRINT_DISABLE_RATELIMIT BIT(12)
> > >  };
> > >
> > >  static inline bool
> > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > > index 7fd624761a2b..bf269683f811 100644
> > > --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > > @@ -119,7 +119,7 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
> > >     /* reduce the same msg print, only print the first evt for one frame */
> > >     if (evts->global || is_new_frame(evts))
> > >             en_print = true;
> > > -   if (!en_print)
> > > +   if (!(err_verbosity & KOMEDA_DEV_PRINT_DISABLE_RATELIMIT) && !en_print)
> > >             return;
> > >
> > >     if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
> > > --
> > > 2.23.0
> > >
> >
> > --
> > ====================
> > | I would like to |
> > | fix the world,  |
> > | but they're not |
> > | giving me the   |
> >  \ source code!  /
> >   ---------------
> >     ¯\_(ツ)_/¯
> >
>
>
> --
> Mihail
>
>
>


-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH v2 5/5] drm/komeda: add rate limiting disable to err_verbosity
  2019-11-12 18:24       ` Daniel Vetter
@ 2019-11-13  1:42         ` james qian wang (Arm Technology China)
  2019-11-13 13:43         ` Mihail Atanassov
  1 sibling, 0 replies; 12+ messages in thread
From: james qian wang (Arm Technology China) @ 2019-11-13  1:42 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Mihail Atanassov, Liviu Dudau, nd, dri-devel, Maarten Lankhorst,
	Maxime Ripard, Sean Paul, Brian Starkey, David Airlie,
	Lowry Li (Arm Technology China),
	linux-kernel

On Tue, Nov 12, 2019 at 07:24:16PM +0100, Daniel Vetter wrote:
> On Tue, Nov 12, 2019 at 2:00 PM Mihail Atanassov
> <Mihail.Atanassov@arm.com> wrote:
> >
> > On Monday, 11 November 2019 15:53:14 GMT Liviu Dudau wrote:
> > > On Thu, Nov 07, 2019 at 11:42:44AM +0000, Mihail Atanassov wrote:
> > > > It's possible to get multiple events in a single frame/flip, so add an
> > > > option to print them all.
> > > >
> > > > Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
> > > > Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
> > >
> > > For the whole series:
> > >
> > > Acked-by: Liviu Dudau <liviu.dudau@arm.com>
> >
> > Thanks, applied to drm-misc-next.
> 
> And now komeda doesn't even compile anymore. I'm ... impressed.
> 
> I mean generally people break other people's driver, not their own.
> -Daniel

Hi Daniel:

Real Real sorry, we will find a way to avoid such stupid problem.

And the fix is: https://patchwork.freedesktop.org/series/69386/

Best regards,
James
> > >
> > > Best regards,
> > > Liviu
> > >
> > > > ---
> > > >
> > > >  v2: Clean up continuation line warning from checkpatch.
> > > >
> > > >  drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 2 ++
> > > >  drivers/gpu/drm/arm/display/komeda/komeda_event.c | 2 +-
> > > >  2 files changed, 3 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > > > index d9fc9c48859a..15f52e304c08 100644
> > > > --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > > > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > > > @@ -224,6 +224,8 @@ struct komeda_dev {
> > > >  #define KOMEDA_DEV_PRINT_INFO_EVENTS BIT(2)
> > > >     /* Dump DRM state on an error or warning event. */
> > > >  #define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8)
> > > > +   /* Disable rate limiting of event prints (normally one per commit) */
> > > > +#define KOMEDA_DEV_PRINT_DISABLE_RATELIMIT BIT(12)
> > > >  };
> > > >
> > > >  static inline bool
> > > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > > > index 7fd624761a2b..bf269683f811 100644
> > > > --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > > > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > > > @@ -119,7 +119,7 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
> > > >     /* reduce the same msg print, only print the first evt for one frame */
> > > >     if (evts->global || is_new_frame(evts))
> > > >             en_print = true;
> > > > -   if (!en_print)
> > > > +   if (!(err_verbosity & KOMEDA_DEV_PRINT_DISABLE_RATELIMIT) && !en_print)
> > > >             return;
> > > >
> > > >     if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
> > > > --
> > > > 2.23.0
> > > >
> > >
> > > --
> > > ====================
> > > | I would like to |
> > > | fix the world,  |
> > > | but they're not |
> > > | giving me the   |
> > >  \ source code!  /
> > >   ---------------
> > >     ¯\_(ツ)_/¯
> > >
> >
> >
> > --
> > Mihail
> >
> >
> >
> 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH v2 5/5] drm/komeda: add rate limiting disable to err_verbosity
  2019-11-12 18:24       ` Daniel Vetter
  2019-11-13  1:42         ` james qian wang (Arm Technology China)
@ 2019-11-13 13:43         ` Mihail Atanassov
  1 sibling, 0 replies; 12+ messages in thread
From: Mihail Atanassov @ 2019-11-13 13:43 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: nd, Liviu Dudau, nd, dri-devel, Maarten Lankhorst, Maxime Ripard,
	Sean Paul, Brian Starkey, David Airlie,
	james qian wang (Arm Technology China),
	Lowry Li (Arm Technology China),
	linux-kernel

On Tuesday, 12 November 2019 18:24:16 GMT Daniel Vetter wrote:
> On Tue, Nov 12, 2019 at 2:00 PM Mihail Atanassov
> <Mihail.Atanassov@arm.com> wrote:
> >
> > On Monday, 11 November 2019 15:53:14 GMT Liviu Dudau wrote:
> > > On Thu, Nov 07, 2019 at 11:42:44AM +0000, Mihail Atanassov wrote:
> > > > It's possible to get multiple events in a single frame/flip, so add an
> > > > option to print them all.
> > > >
> > > > Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
> > > > Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
> > >
> > > For the whole series:
> > >
> > > Acked-by: Liviu Dudau <liviu.dudau@arm.com>
> >
> > Thanks, applied to drm-misc-next.
> 
> And now komeda doesn't even compile anymore. I'm ... impressed.
> 

Mea culpa! Sorry about the breakage, I did build-test but apparently
not the right checkout :/. I'll adjust my workflow to make sure this
doesn't happen again.

> I mean generally people break other people's driver, not their own.
> -Daniel
> 
> > >
> > > Best regards,
> > > Liviu
> > >
> > > > ---
> > > >
> > > >  v2: Clean up continuation line warning from checkpatch.
> > > >
> > > >  drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 2 ++
> > > >  drivers/gpu/drm/arm/display/komeda/komeda_event.c | 2 +-
> > > >  2 files changed, 3 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > > > index d9fc9c48859a..15f52e304c08 100644
> > > > --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > > > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> > > > @@ -224,6 +224,8 @@ struct komeda_dev {
> > > >  #define KOMEDA_DEV_PRINT_INFO_EVENTS BIT(2)
> > > >     /* Dump DRM state on an error or warning event. */
> > > >  #define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8)
> > > > +   /* Disable rate limiting of event prints (normally one per commit) */
> > > > +#define KOMEDA_DEV_PRINT_DISABLE_RATELIMIT BIT(12)
> > > >  };
> > > >
> > > >  static inline bool
> > > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > > > index 7fd624761a2b..bf269683f811 100644
> > > > --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > > > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> > > > @@ -119,7 +119,7 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
> > > >     /* reduce the same msg print, only print the first evt for one frame */
> > > >     if (evts->global || is_new_frame(evts))
> > > >             en_print = true;
> > > > -   if (!en_print)
> > > > +   if (!(err_verbosity & KOMEDA_DEV_PRINT_DISABLE_RATELIMIT) && !en_print)
> > > >             return;
> > > >
> > > >     if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
> > > > --
> > > > 2.23.0
> > > >
> > >
> > > --
> > > ====================
> > > | I would like to |
> > > | fix the world,  |
> > > | but they're not |
> > > | giving me the   |
> > >  \ source code!  /
> > >   ---------------
> > >     ¯\_(ツ)_/¯
> > >
> >
> >
> > --
> > Mihail
> >
> >
> >
> 
> 
> 


-- 
Mihail




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

end of thread, other threads:[~2019-11-13 13:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 11:42 [PATCH v2 0/5] drm/komeda: Improve IRQ error event prints Mihail Atanassov
2019-11-07 11:42 ` [PATCH v2 1/5] drm/komeda: Add debugfs node to control error verbosity Mihail Atanassov
2019-11-11 15:52   ` Liviu Dudau
2019-11-07 11:42 ` [PATCH v2 2/5] drm/komeda: Remove CONFIG_KOMEDA_ERROR_PRINT Mihail Atanassov
2019-11-07 11:42 ` [PATCH v2 3/5] drm/komeda: Optionally dump DRM state on interrupts Mihail Atanassov
2019-11-07 11:42 ` [PATCH v2 4/5] drm/komeda: Add option to print WARN- and INFO-level IRQ events Mihail Atanassov
2019-11-07 11:42 ` [PATCH v2 5/5] drm/komeda: add rate limiting disable to err_verbosity Mihail Atanassov
2019-11-11 15:53   ` Liviu Dudau
2019-11-12 13:00     ` Mihail Atanassov
2019-11-12 18:24       ` Daniel Vetter
2019-11-13  1:42         ` james qian wang (Arm Technology China)
2019-11-13 13:43         ` Mihail Atanassov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).