gpu: host1x: Fix MLOCK's debug info
authorDmitry Osipenko <digetx@gmail.com>
Sun, 28 Jun 2015 19:27:02 +0000 (22:27 +0300)
committerThierry Reding <treding@nvidia.com>
Fri, 2 Oct 2015 12:40:12 +0000 (14:40 +0200)
MLOCK's debug info, spewed on CDMA timeout, contains meaningless MLOCK
owner channel ID because HOST1X_SYNC_MLOCK_OWNER_CHID_F() returns shifted
value, while unshifted should be used. Fix it by changing '_F' to '_V'.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-By: Terje Bergstrom <tbergstrom@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/host1x/hw/debug_hw.c
drivers/gpu/host1x/hw/hw_host1x01_sync.h
drivers/gpu/host1x/hw/hw_host1x02_sync.h
drivers/gpu/host1x/hw/hw_host1x04_sync.h

index 791de9351eebff26946919c6b7b3e747489d2579..cc3f1825c735e5cf10aad66ff72c11003bc15737 100644 (file)
@@ -298,7 +298,7 @@ static void host1x_debug_show_mlocks(struct host1x *host, struct output *o)
                        host1x_sync_readl(host, HOST1X_SYNC_MLOCK_OWNER(i));
                if (HOST1X_SYNC_MLOCK_OWNER_CH_OWNS_V(owner))
                        host1x_debug_output(o, "%d: locked by channel %d\n",
-                               i, HOST1X_SYNC_MLOCK_OWNER_CHID_F(owner));
+                               i, HOST1X_SYNC_MLOCK_OWNER_CHID_V(owner));
                else if (HOST1X_SYNC_MLOCK_OWNER_CPU_OWNS_V(owner))
                        host1x_debug_output(o, "%d: locked by cpu\n", i);
                else
index ac704e5799778044af4b441f33b3ceecee06bb54..31238c285d46258fa4af73599ef0f7c999080091 100644 (file)
@@ -131,12 +131,12 @@ static inline u32 host1x_sync_mlock_owner_r(unsigned int id)
 }
 #define HOST1X_SYNC_MLOCK_OWNER(id) \
        host1x_sync_mlock_owner_r(id)
-static inline u32 host1x_sync_mlock_owner_chid_f(u32 v)
+static inline u32 host1x_sync_mlock_owner_chid_v(u32 v)
 {
-       return (v & 0xf) << 8;
+       return (v >> 8) & 0xf;
 }
-#define HOST1X_SYNC_MLOCK_OWNER_CHID_F(v) \
-       host1x_sync_mlock_owner_chid_f(v)
+#define HOST1X_SYNC_MLOCK_OWNER_CHID_V(v) \
+       host1x_sync_mlock_owner_chid_v(v)
 static inline u32 host1x_sync_mlock_owner_cpu_owns_v(u32 r)
 {
        return (r >> 1) & 0x1;
index 4495401525e8a075b2b63946072fa55a3e371f7a..540c7b65995fb6565975ab125165b7fc0d14537e 100644 (file)
@@ -131,12 +131,12 @@ static inline u32 host1x_sync_mlock_owner_r(unsigned int id)
 }
 #define HOST1X_SYNC_MLOCK_OWNER(id) \
        host1x_sync_mlock_owner_r(id)
-static inline u32 host1x_sync_mlock_owner_chid_f(u32 v)
+static inline u32 host1x_sync_mlock_owner_chid_v(u32 v)
 {
-       return (v & 0xf) << 8;
+       return (v >> 8) & 0xf;
 }
-#define HOST1X_SYNC_MLOCK_OWNER_CHID_F(v) \
-       host1x_sync_mlock_owner_chid_f(v)
+#define HOST1X_SYNC_MLOCK_OWNER_CHID_V(v) \
+       host1x_sync_mlock_owner_chid_v(v)
 static inline u32 host1x_sync_mlock_owner_cpu_owns_v(u32 r)
 {
        return (r >> 1) & 0x1;
index ef2275b5407a01ad36d02c5d8c20ba7f93212cf9..3d6c8ec65934c8cef655a106adccf02b98637d5e 100644 (file)
@@ -131,12 +131,12 @@ static inline u32 host1x_sync_mlock_owner_r(unsigned int id)
 }
 #define HOST1X_SYNC_MLOCK_OWNER(id) \
        host1x_sync_mlock_owner_r(id)
-static inline u32 host1x_sync_mlock_owner_chid_f(u32 v)
+static inline u32 host1x_sync_mlock_owner_chid_v(u32 v)
 {
-       return (v & 0xf) << 8;
+       return (v >> 8) & 0xf;
 }
-#define HOST1X_SYNC_MLOCK_OWNER_CHID_F(v) \
-       host1x_sync_mlock_owner_chid_f(v)
+#define HOST1X_SYNC_MLOCK_OWNER_CHID_V(v) \
+       host1x_sync_mlock_owner_chid_v(v)
 static inline u32 host1x_sync_mlock_owner_cpu_owns_v(u32 r)
 {
        return (r >> 1) & 0x1;