From: Jyri Sarha <jsarha@ti.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: airlied@linux.ie, tomi.valkeinen@ti.com,
thierry.reding@gmail.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 0/2] drm/panel: Add device link in drm_panel_attach()
Date: Thu, 1 Mar 2018 19:42:53 +0200 [thread overview]
Message-ID: <d1dd3a8e-e5d5-b5a9-7692-644ae1c136f0@ti.com> (raw)
In-Reply-To: <20180228194749.GC27565@wunner.de>
On 28/02/18 21:47, Lukas Wunner wrote:
> On Wed, Feb 28, 2018 at 01:09:28PM +0200, Jyri Sarha wrote:
>> The device_link_del() is still there in drm_panel_detach(), despite
>> Lukas Wunner's comment[1]. In the usual (currently all) cases things
>> would work perfectly without the call too, because
>> device_links_driver_cleanup() will eventually remove all orphaned
>> links. However, this would cause an error in the situation where a drm
>> device would like to detach a panel but remain operational, since the
>> drm device would be unbound for no good reason if the detached panel
>> is later unbound.
>
> Okay, in that case I'd suggest dropping the DL_FLAG_AUTOREMOVE flag
> and keep the device_link_del(). That gives you the flexibility to
> detach a panel at runtime and drop the device link, but also have
> the DRM driver unbound once the panel driver is unbound.
>
> If you have things like optional panels that can be detached without
> the necessity to unbind the DRM driver, you need something else instead
> of or on top of device links. Perhaps some kind of notifier block.
> And perhaps two drm_panel_attach/detach() helpers in the DRM library,
> one with device link and one with notifier.
>
> As stated in the device links documentation, optional dependencies
> are "beyond the scope of device links."
>
I think the "optional panel" usage pattern is quite unlikely to ever
exist, but still it sound wrong to me to leave the links behind when
there is an apparent symmetry of detach and attach functions.
The situation would be different if we would get rid of the detach call
all together. After all the function in its current form is pretty
useless. The only purpose for its existence is marking the panel
available for other drm devices to use, which would suggest that the
"optional panel"-pattern is supported.
I think my current approach is fine (after removing the
DL_FLAG_AUTOREMOVE, I had not really understood its purpose before) if
we accept that the device link is there only as a precaution. But I am
also fine with removing the drm_panel_detach() function and laeving the
DL_FLAG_AUTOREMOVE flag there.
Best regards,
Jyri
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2018-03-01 17:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 11:09 [PATCH v2 0/2] drm/panel: Add device link in drm_panel_attach() Jyri Sarha
2018-02-28 11:09 ` [PATCH v2 1/2] drm/panel: Remove drm_panel_detach() calls from all panel drives Jyri Sarha
2018-02-28 18:53 ` Thierry Reding
2018-02-28 21:31 ` Jyri Sarha
2018-03-06 10:03 ` Daniel Vetter
2018-02-28 11:09 ` [PATCH v2 2/2] drm/panel: Add device_link from panel device to drm device Jyri Sarha
2018-02-28 18:14 ` Eric Anholt
2018-03-01 17:53 ` Jyri Sarha
2018-02-28 19:32 ` Lukas Wunner
2018-02-28 19:47 ` [PATCH v2 0/2] drm/panel: Add device link in drm_panel_attach() Lukas Wunner
2018-03-01 17:42 ` Jyri Sarha [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d1dd3a8e-e5d5-b5a9-7692-644ae1c136f0@ti.com \
--to=jsarha@ti.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=lukas@wunner.de \
--cc=thierry.reding@gmail.com \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox