Skip to content

Commit

Permalink
drm/omap: dsi: Fix crash in DSI debug dumps
Browse files Browse the repository at this point in the history
Reading any of the DSI debugfs files results in a crash, as wrong
pointer is passed to the dump functions, and the dump functions use a
wrong pointer. This patch fixes DSI debug dumps.

Fixes: f3ed97f ("drm/omap: dsi: Simplify debugfs implementation")
Signed-off-by: Tomi Valkeinen <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Signed-off-by: Laurent Pinchart <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
tomba committed Feb 6, 2019
1 parent b14e945 commit 4df04ac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/gpu/drm/omapdrm/dss/dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ static void dsi_pll_disable(struct dss_pll *pll)

static int dsi_dump_dsi_clocks(struct seq_file *s, void *p)
{
struct dsi_data *dsi = p;
struct dsi_data *dsi = s->private;
struct dss_pll_clock_info *cinfo = &dsi->pll.cinfo;
enum dss_clk_source dispc_clk_src, dsi_clk_src;
int dsi_module = dsi->module_id;
Expand Down Expand Up @@ -1467,7 +1467,7 @@ static int dsi_dump_dsi_clocks(struct seq_file *s, void *p)
#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
static int dsi_dump_dsi_irqs(struct seq_file *s, void *p)
{
struct dsi_data *dsi = p;
struct dsi_data *dsi = s->private;
unsigned long flags;
struct dsi_irq_stats stats;

Expand Down Expand Up @@ -1558,7 +1558,7 @@ static int dsi_dump_dsi_irqs(struct seq_file *s, void *p)

static int dsi_dump_dsi_regs(struct seq_file *s, void *p)
{
struct dsi_data *dsi = p;
struct dsi_data *dsi = s->private;

if (dsi_runtime_get(dsi))
return 0;
Expand Down Expand Up @@ -5083,15 +5083,15 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)

snprintf(name, sizeof(name), "dsi%u_regs", dsi->module_id + 1);
dsi->debugfs.regs = dss_debugfs_create_file(dss, name,
dsi_dump_dsi_regs, &dsi);
dsi_dump_dsi_regs, dsi);
#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
snprintf(name, sizeof(name), "dsi%u_irqs", dsi->module_id + 1);
dsi->debugfs.irqs = dss_debugfs_create_file(dss, name,
dsi_dump_dsi_irqs, &dsi);
dsi_dump_dsi_irqs, dsi);
#endif
snprintf(name, sizeof(name), "dsi%u_clks", dsi->module_id + 1);
dsi->debugfs.clks = dss_debugfs_create_file(dss, name,
dsi_dump_dsi_clocks, &dsi);
dsi_dump_dsi_clocks, dsi);

return 0;
}
Expand Down

0 comments on commit 4df04ac

Please sign in to comment.