[PATCH v4 2/2] drm/panel: Add device_link from panel device to drm device

Andrzej Hajda a.hajda at samsung.com
Fri Aug 31 10:08:07 UTC 2018


On 31.08.2018 10:56, Linus Walleij wrote:
> On Thu, Aug 30, 2018 at 4:41 PM Andrzej Hajda <a.hajda at samsung.com> wrote:
>> [Me]
>>> This happens because the connector struct device is the
>>> same as the bridge struct device, I suppose.
>> I guess it is rather because the code tries to make circular dependency:
>> 1. panel depends on dsi-host because it is MIPI-DSI child device.
>> 2. dsi-host probably depends on drm parent device (connector->dev->dev)
>> - what drm driver do you use?
> The driver is added in this patch, it's at this uncomfortable stage
> where I have to make a big upfront design for a new DRM driver
> and everything is shaky and unreviewed.
>
> So to get it out for proper review it needs to be working and to
> get it working I need review :D DRM development catch 22.
>
> But here is the patch adding it all, in some in-flight state:
> https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson.git/commit/?h=ux500-mcde
>
> Thanks a lot for these notes, I hope I can figure it out!
>
>> 3. drm parent dev depends on panel: this patch adds this dependency.
>>
>> If 2nd point is true it becomes circular dependency, but please verify it.
> I tried to not make the DRM parent dev depend on the panel.
>
> AFAICT (1) is true, (2) is true but not (3).

See code of drm_panel_attach after subject patch [1]:
    panel->link = device_link_add(connector->dev->dev, panel->dev, 0);

It is quite clear that connector->dev->dev is 'drm_device parent device'
so you have drm-parent depends on panel->dev.
IMO this is incorrect dependency, and the cause of error, it is not
drm_device parent who depends on the panel, but drm_device itself.

[1]:
https://elixir.bootlin.com/linux/v4.19-rc1/source/drivers/gpu/drm/drm_panel.c#L108

Regards
Andrzej

>
> Yours,
> Linus Walleij
>
>



More information about the dri-devel mailing list