devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Stuebner <heiko@sntech.de>
To: Andrzej Hajda <a.hajda@samsung.com>
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
	briannorris@chromium.org, hoegsberg@gmail.com,
	philippe.cornu@st.com, dri-devel@lists.freedesktop.org,
	yannick.fertre@st.com, linux-rockchip@lists.infradead.org,
	nickey.yang@rock-chips.com, robh+dt@kernel.org,
	thierry.reding@gmail.com, laurent.pinchart@ideasonboard.com,
	mka@chromium.org
Subject: Re: [PATCH v3 3/8] drm/bridge/synopsys: dsi: add ability to check dsi-device attachment
Date: Tue, 14 Aug 2018 09:49:34 +0200	[thread overview]
Message-ID: <9080604.jluIWsTyFA@phil> (raw)
In-Reply-To: <20180813102323eucas1p123c92168767f5b39171ae51acbb15504~KapMWOZgT3012630126eucas1p1B@eucas1p1.samsung.com>

Hi Andrzej,

Am Montag, 13. August 2018, 12:23:21 CEST schrieb Andrzej Hajda:
> On 13.08.2018 10:44, Heiko Stuebner wrote:
> > Am Montag, 13. August 2018, 10:28:39 CEST schrieb Andrzej Hajda:
> >> On 09.07.2018 15:48, Heiko Stuebner wrote:
> >>> +bool dw_mipi_dsi_device_attached(struct dw_mipi_dsi *dsi)
> >>> +{
> >>> +	bool output;
> >>> +
> >>> +	mutex_lock(&dsi->panel_mutex);
> >>> +	output = !!dsi->panel_bridge;
> >>> +	mutex_unlock(&dsi->panel_mutex);
> >>> +
> >>> +	return output;
> >>> +}
> >>> +EXPORT_SYMBOL_GPL(dw_mipi_dsi_device_attached);
> >> The function does not make sense. After releasing panel_mutex device can
> >> be detached/(re-)attached multiple times. Ie it reports useless
> >> information. Of course in most cases it will work as expected, but for
> >> sure it is not bulletproof.
> > Ok. Can you suggest how we should check for the described case?
> > I.e. initially I tried to simply defer in dw_mipi_dsi_bridge_attach [0]
> > where you suggested to do that in probe.
> >
> > I moved the check to bind - see patch 5 - to fix the issue regarding
> > panel only probing after the dsi bus gets created, so this function
> > is a means to check if the panel has finished attaching, or to defer
> > binding - see dw_mipi_dsi_rockchip_bind in patch 5.
> >
> > So I'm somewhat out of ideas right now, how to do this right.
> 
> I am just after vacation, so please be kind if I write sth stupid :)
> 
> I would stick to the rule "do not expose functionality until you gather
> required resources".
> With this in mind I would try this way:
> 1. In bridge probe create mipi bus, but do not expose drm_bridge and do
> not call component_add - because we still do not have the sink
> (downstream panel or bridge).
> 2. In mipi_dsi_host_attach callback gather sink resource and then expose
> drm_bridge and the component (by calling component_add) - it will work
> with assumption the sink is registered/added before attaching to dsi bus

I think that is the general consensus in all kernel parts, like when you
request an irq, the driver should be able to handle it firing 
immediately, so similarly a dsi-sink should in a position to be directly
usable after it attached to the dsi host.


> [*].
> 3. Similar way it should be done in remove path.
> 
> This way in bind callback all resources should be there.

You're a genius ... That seems to work like a charm :-D .

v4 following shortly :-)


> [*]: This could be seen as sth against the rule "first resources, then
> exposition", but since panel/bridge framework does not provide
> notification about appearance of the objects, it works as a workaround
> for missing notification system.

Actually I'd say it follows that paradigm way better now, as the
component framework only tries to bring up the component hierarchy
after all resources are in place.

And now I even don't get any deferrals at all, where it was around 2
deferrals waiting for the panel before. So in terms of being deterministic
this feels like a plus :-)


Heiko


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-08-14  7:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 13:48 [PATCH v3 0/8] drm/rockchip: migrate to common dw-mipi-dsi bridge and dual-dsi Heiko Stuebner
2018-07-09 13:48 ` [PATCH v3 1/8] drm/bridge/synopsys: dsi: move mipi_dsi_host_unregister to __dw_mipi_dsi_remove Heiko Stuebner
2018-07-09 13:48 ` [PATCH v3 2/8] drm/bridge/synopsys: dsi: don't call __dw_mipi_dsi_probe from dw_mipi_dsi_bind Heiko Stuebner
2018-08-13  8:07   ` Andrzej Hajda
2018-07-09 13:48 ` [PATCH v3 3/8] drm/bridge/synopsys: dsi: add ability to check dsi-device attachment Heiko Stuebner
2018-08-13  8:28   ` Andrzej Hajda
2018-08-13  8:44     ` Heiko Stuebner
2018-08-13 10:23       ` Andrzej Hajda
2018-08-14  7:49         ` Heiko Stuebner [this message]
2018-07-09 13:48 ` [PATCH v3 4/8] dt-bindings: display: rockchip: update DSI controller Heiko Stuebner
2018-07-09 13:48 ` [PATCH v3 5/8] drm/rockchip: dsi: migrate to use dw-mipi-dsi bridge driver Heiko Stuebner
2018-07-09 13:48 ` [PATCH v3 6/8] drm/dsi: add helper function to find the second host in a dual-dsi setup Heiko Stuebner
     [not found] ` <20180709134834.11035-1-heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2018-07-09 13:48   ` [PATCH v3 7/8] drm/bridge/synopsys: dsi: add dual-dsi support Heiko Stuebner
2018-07-09 13:48   ` [PATCH v3 8/8] drm/rockchip: dsi: add dual mipi support Heiko Stuebner

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=9080604.jluIWsTyFA@phil \
    --to=heiko@sntech.de \
    --cc=a.hajda@samsung.com \
    --cc=briannorris@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hoegsberg@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=mka@chromium.org \
    --cc=nickey.yang@rock-chips.com \
    --cc=philippe.cornu@st.com \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=yannick.fertre@st.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;
as well as URLs for NNTP newsgroup(s).