diff options
author | Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com> | 2017-05-15 10:58:19 +0200 |
---|---|---|
committer | Klaus Goger <klaus.goger@theobroma-systems.com> | 2017-05-24 11:34:23 +0200 |
commit | 020d7749c10116a394ced9c646b1add22e6dc6d2 (patch) | |
tree | e6524e4b7fb171b97d840e043da013ac54ccfa3b | |
parent | c3412d22ab7bbb2ba0535aa30fd603ecca4759c4 (diff) |
drm/rockchip: dw-mipi: add error reporting and break infinite loop in mipi-dsi probe
This used to loop indefinitely with EPROBE_DEFER if it could not find a panel.
This patch aborts the probe after 10 tries.
Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
-rw-r--r-- | drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c index 38e4811be728..c5dc3766e932 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -1094,6 +1094,8 @@ static struct drm_connector_funcs dw_mipi_dsi_atomic_connector_funcs = { .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; +static int deferred_cnt = 0; + static int dw_mipi_dsi_register(struct drm_device *drm, struct dw_mipi_dsi *dsi) { @@ -1110,8 +1112,15 @@ static int dw_mipi_dsi_register(struct drm_device *drm, * not been registered yet. Defer probing, and hope that * the required CRTC is added later. */ - if (encoder->possible_crtcs == 0) + if (encoder->possible_crtcs == 0) { + if ( deferred_cnt > 10 ) { + printk(KERN_ERR "%s:%d: !possible_crtcs: returning ENODEV\n", __FUNCTION__, __LINE__); + return -ENODEV; + } + deferred_cnt++; + printk(KERN_INFO "%s:%d: !possible_crtcs: returning EPROBE_DEFER #%d\n", __FUNCTION__, __LINE__, deferred_cnt++); return -EPROBE_DEFER; + } drm_encoder_helper_add(&dsi->encoder, &dw_mipi_dsi_encoder_helper_funcs); @@ -1200,8 +1209,15 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master, struct resource *res; int ret; - if (!dsi->panel) + if (!dsi->panel) { + if ( deferred_cnt > 10 ) { + printk(KERN_ERR "%s:%d: !panel: returning ENODEV\n", __FUNCTION__, __LINE__); + return -ENODEV; + } + deferred_cnt++; + printk(KERN_INFO "%s:%d: !panel: returning EPROBE_DEFER #%d\n", __FUNCTION__, __LINE__, deferred_cnt); return -EPROBE_DEFER; + } ret = rockchip_mipi_parse_dt(dsi); if (ret) |