mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: CK Hu <ck.hu@mediatek.com>, dri-devel@lists.freedesktop.org
Cc: chunkuang.hu@kernel.org, airlied@linux.ie,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	andrzej.hajda@intel.com, linux-mediatek@lists.infradead.org,
	Jagan Teki <jagan@amarulasolutions.com>,
	matthias.bgg@gmail.com, kernel@collabora.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4] drm/mediatek: mtk_dsi: Avoid EPROBE_DEFER loop with external bridge
Date: Tue, 8 Feb 2022 10:03:58 +0100	[thread overview]
Message-ID: <bf486a23-4322-328e-abdc-962a66792f23@collabora.com> (raw)
In-Reply-To: <b886b9a8a3368127be7357e8921e18358987033d.camel@mediatek.com>

Il 08/02/22 09:32, CK Hu ha scritto:
> Hi, Angelo:
> 
> On Tue, 2022-02-08 at 16:20 +0800, CK Hu wrote:
>> Hi, Angelo:
>>
>> On Mon, 2022-01-31 at 09:55 +0100, AngeloGioacchino Del Regno wrote:
>>> DRM bridge drivers are now attaching their DSI device at probe
>>> time,
>>> which requires us to register our DSI host in order to let the
>>> bridge
>>> to probe: this recently started producing an endless -EPROBE_DEFER
>>> loop on some machines that are using external bridges, like the
>>> parade-ps8640, found on the ACER Chromebook R13.
>>>
>>> Now that the DSI hosts/devices probe sequence is documented, we can
>>> do adjustments to the mtk_dsi driver as to both fix now and make
>>> sure
>>> to avoid this situation in the future: for this, following what is
>>> documented in drm_bridge.c, move the mtk_dsi component_add() to the
>>> mtk_dsi_ops.attach callback and delete it in the detach callback;
>>> keeping in mind that we are registering a drm_bridge for our DSI,
>>> which is only used/attached if the DSI Host is bound, it wouldn't
>>> make sense to keep adding our bridge at probe time (as it would
>>> be useless to have it if mtk_dsi_ops.attach() fails!), so also move
>>> that one to the dsi host attach function (and remove it in detach).
>>>
>>> Cc: <stable@vger.kernel.org> # 5.15.x
>>> Signed-off-by: AngeloGioacchino Del Regno <
>>> angelogioacchino.delregno@collabora.com>
>>> Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
>>> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
>>>
>>> ---
>>>   drivers/gpu/drm/mediatek/mtk_dsi.c | 167 +++++++++++++++----------
>>> ----
>>>   1 file changed, 84 insertions(+), 83 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c
>>> b/drivers/gpu/drm/mediatek/mtk_dsi.c
>>> index 5d90d2eb0019..bced4c7d668e 100644
>>> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
>>> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
>>> @@ -786,18 +786,101 @@ void mtk_dsi_ddp_stop(struct device *dev)
>>>   	mtk_dsi_poweroff(dsi);
>>>   }
>>>   
>>>
>>
>> [snip]
>>
>>> +
>>>   static int mtk_dsi_host_attach(struct mipi_dsi_host *host,
>>>   			       struct mipi_dsi_device *device)
>>>   {
>>>   	struct mtk_dsi *dsi = host_to_dsi(host);
>>> +	struct device *dev = host->dev;
>>> +	int ret;
>>>   
>>>   	dsi->lanes = device->lanes;
>>>   	dsi->format = device->format;
>>>   	dsi->mode_flags = device->mode_flags;
>>> +	dsi->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0,
>>> 0);
>>
>> The original would process panel. Why do you remove the panel part?
>> It's better that someone has a platform of DSI->Panel to test this
>> patch.
> 
> Sorry, devm_drm_of_get_bridge() has processed the panel part, so for
> this patch,
> 
> Reviewed-by: CK Hu <ck.hu@mediatek.com>
> 

No worries! Thanks for the review/approval.

Regards,
Angelo

>>
>> Regards,
>> CK
>>

  reply	other threads:[~2022-02-08  9:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31  8:55 AngeloGioacchino Del Regno
2022-02-08  8:20 ` CK Hu
2022-02-08  8:32   ` CK Hu
2022-02-08  9:03     ` AngeloGioacchino Del Regno [this message]
2022-02-09 14:48 ` Nícolas F. R. A. Prado
2022-02-09 15:06 ` Chun-Kuang Hu

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=bf486a23-4322-328e-abdc-962a66792f23@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=airlied@linux.ie \
    --cc=andrzej.hajda@intel.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=ck.hu@mediatek.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jagan@amarulasolutions.com \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=stable@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®