On Fri, 11 Oct 2019 15:54:53 +0200 Andrzej Hajda a.hajda@samsung.com wrote:
On 26.08.2019 17:26, Boris Brezillon wrote:
The encoder->enable() can't report errors and is expected to always succeed. If we call pm_runtime_put() in the exynos_dsi_enable() error path (as currently done) we'll have unbalanced get/put calls when encoder->disable() is called.
True
The situation is not ideal since drm_panel_{prepare,enable}() can theoretically return an error (even if in practice I don't think any panel driver does that).
So why do you want to fix it at all, if you think return value is always 0 :) ?
git grep -p -A30 '_prepare' drivers/gpu/drm/panel/ shows that many of them can return errors.
Then I was wrong :-).
Putting a WARN_ON() is the best we can do, unfortunately.
I guess optimally we should use DRM_MODE_LINK_STATUS_BAD, but I am not sure how exactly it should be handled.
You mean call drm_connector_set_link_status_property(DRM_MODE_LINK_STATUS_BAD) ?
Note that -ENOSYS is actually a valid case, it just means the panel driver does not implement the hook.
It would be good then to fix it in panel framework, ie without hook drm_panel_* function should return 0, ENOSYS makes no sense here.
I'm fine with that. Thierry, Sam, any opinion?