Re: [PATCH] drm/i2c: tda998x: don't register the connector

From: Russell King - ARM Linux
Date: Thu Sep 22 2016 - 10:24:44 EST

On Thu, Sep 22, 2016 at 02:38:45PM +0100, Brian Starkey wrote:
> However, without patching all three drivers in the same commit, there
> would always be some breakage. HDLCD and Mali-DP call
> drm_dev_register() before binding the components - this was needed to
> work with tda998x, which needed the device to be already registered
> before its bind callback runs.

I guess that is because drm_connector_register() relies on
drm_minor_register() having been previously run, which is rather
unfortunate. That brings up the question about whether eliminating
the load callback is really such a wise move.

tda998x works fine either with or without the drm_connector_register()
call if it's bound within drm_dev_register(), which happens after the
minors have been registered.

> It's more proper to call drm_dev_register() as the very last thing
> (i.e. after component_bind_all()) to avoid races with userspace - but
> I couldn't do that without this change in tda998x first.

Actually, what you're saying is that you need to change tda998x in
lock-step with your drivers - if you have only the tda998x patch
applied, then you break. If you apply the patch for your drivers,
you break.

That's really not good, and can be worked around by providing the
legacy ->load method, which just does the component_bind_all() call.
That makes you independent of the tda998x change, just like other
DRM drivers such as armada and tilcdc.

RMK's Patch system:
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to