1 From ca5907f43313b2274d62cb0948c5422d8cf97e80 Mon Sep 17 00:00:00 2001
2 From: Tomi Valkeinen <tomi.valkeinen@ti.com>
3 Date: Fri, 11 Jan 2019 05:50:33 +0200
4 Subject: drm/omap: dsi: Fix crash in DSI debug dumps
6 [ Upstream commit 4df04ac9b37f278c48bb696289aff8f81226af4b ]
8 Reading any of the DSI debugfs files results in a crash, as wrong
9 pointer is passed to the dump functions, and the dump functions use a
10 wrong pointer. This patch fixes DSI debug dumps.
12 Fixes: f3ed97f9ae7d ("drm/omap: dsi: Simplify debugfs implementation")
13 Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
14 Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
15 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
16 Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
17 Link: https://patchwork.freedesktop.org/patch/msgid/20190111035120.20668-3-laurent.pinchart@ideasonboard.com
18 Signed-off-by: Sasha Levin <sashal@kernel.org>
20 drivers/gpu/drm/omapdrm/dss/dsi.c | 12 ++++++------
21 1 file changed, 6 insertions(+), 6 deletions(-)
23 diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
24 index 00a9c2ab9e6c..277f9dd2ec8c 100644
25 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
26 +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
27 @@ -1406,7 +1406,7 @@ static void dsi_pll_disable(struct dss_pll *pll)
29 static int dsi_dump_dsi_clocks(struct seq_file *s, void *p)
31 - struct dsi_data *dsi = p;
32 + struct dsi_data *dsi = s->private;
33 struct dss_pll_clock_info *cinfo = &dsi->pll.cinfo;
34 enum dss_clk_source dispc_clk_src, dsi_clk_src;
35 int dsi_module = dsi->module_id;
36 @@ -1467,7 +1467,7 @@ static int dsi_dump_dsi_clocks(struct seq_file *s, void *p)
37 #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
38 static int dsi_dump_dsi_irqs(struct seq_file *s, void *p)
40 - struct dsi_data *dsi = p;
41 + struct dsi_data *dsi = s->private;
43 struct dsi_irq_stats stats;
45 @@ -1558,7 +1558,7 @@ static int dsi_dump_dsi_irqs(struct seq_file *s, void *p)
47 static int dsi_dump_dsi_regs(struct seq_file *s, void *p)
49 - struct dsi_data *dsi = p;
50 + struct dsi_data *dsi = s->private;
52 if (dsi_runtime_get(dsi))
54 @@ -5083,15 +5083,15 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
56 snprintf(name, sizeof(name), "dsi%u_regs", dsi->module_id + 1);
57 dsi->debugfs.regs = dss_debugfs_create_file(dss, name,
58 - dsi_dump_dsi_regs, &dsi);
59 + dsi_dump_dsi_regs, dsi);
60 #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
61 snprintf(name, sizeof(name), "dsi%u_irqs", dsi->module_id + 1);
62 dsi->debugfs.irqs = dss_debugfs_create_file(dss, name,
63 - dsi_dump_dsi_irqs, &dsi);
64 + dsi_dump_dsi_irqs, dsi);
66 snprintf(name, sizeof(name), "dsi%u_clks", dsi->module_id + 1);
67 dsi->debugfs.clks = dss_debugfs_create_file(dss, name,
68 - dsi_dump_dsi_clocks, &dsi);
69 + dsi_dump_dsi_clocks, dsi);