From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9ED9EEB64D7 for ; Fri, 23 Jun 2023 16:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bYMp+6ibu89wK+UFXraFIZJ/+52xjVM1tLc0tibUhjE=; b=mIeL2IjRWTozr0 Vml2y5r1J5XTq3M33apG1yHGLXDRA9TinjCvu2k59kaPlopCcdjU10w9jR8AuymyNPRGGYbdJ/81P SOMwyJpEMlayOsAC2sddBYofdqhzQZ6ZPkAtOEozXOkdJQVlMBjoWWL5Gqr8BgCSFQ/OeJuj4Oah9 7sdec3exJ3W9ZgCSL2Y5hGOogyDIQGtdI+RpYSCJoqX2Xv3YP1i/Kx8zCfa3yGM2aRHJBj60VytJW 41Eb8dI09DRPEHRqh2pdUejN9zGwJi+fBndYLrxSJiauQMqMKGEWORj7ZA/0/p8ogxd1GtHVLl0+E J88kO4PDvMmuvtScMBLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qCjYW-00442p-1y; Fri, 23 Jun 2023 16:22:40 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qCjYT-00441S-0N; Fri, 23 Jun 2023 16:22:38 +0000 Received: from notapiano (unknown [IPv6:2600:4041:5b1a:cd00:524d:e95d:1a9c:492a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 0F11E6606FAE; Fri, 23 Jun 2023 17:22:31 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687537353; bh=7ufh3QSQZelZlqE69nvYEFnEQlmgPF5ndR8aBdUl7RA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Zm83n3TmlG6sdOLSGE2tstkFReGP+gabya/uv7ySYx6QCRUKEeqFAHNrrewZbJB2M 6RnU3WnaBJgqimnGRHudjaSsJ9SK/0kOkdBTyP8j1UZHe+IaoMPexshrDBXwIeWyCK ytj8n5/eQLckiazFKkg3ATnTEMQj1HWiKpxlFLUTRR3oKNbg+ya9g2wyU8dt+xyuch SVxj9jC9u4gCJErPDKAdGavlALWaykQDnX6ohEecE5VemfyDx21aIHyXaTdeP4MUIl BaE4mii3r/svmXRTAML7XtGZWcExsrvfSdwxnZ7Z0u6VHRziDGrkswxj7xt3jcG5V/ ew/+sYJZcGeyg== Date: Fri, 23 Jun 2023 12:22:27 -0400 From: =?utf-8?B?TsOtY29sYXMgRi4gUi4gQS4=?= Prado To: AngeloGioacchino Del Regno Cc: chunkuang.hu@kernel.org, p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, wenst@chromium.org Subject: Re: [PATCH v3 9/9] drm/mediatek: dp: Add support for embedded DisplayPort aux-bus Message-ID: References: <20230404104800.301150-1-angelogioacchino.delregno@collabora.com> <20230404104800.301150-10-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230404104800.301150-10-angelogioacchino.delregno@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230623_092237_347969_CCA79B8F X-CRM114-Status: GOOD ( 31.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Apr 04, 2023 at 12:48:00PM +0200, AngeloGioacchino Del Regno wrote: > For the eDP case we can support using aux-bus on MediaTek DP: this > gives us the possibility to declare our panel as generic "panel-edp" > which will automatically configure the timings and available modes > via the EDID that we read from it. > = > To do this, move the panel parsing at the end of the probe function > so that the hardware is initialized beforehand and also initialize > the DPTX AUX block and power both on as, when we populate the > aux-bus, the panel driver will trigger an EDID read to perform > panel detection. > = > Last but not least, since now the AUX transfers can happen in the > separated aux-bus, it was necessary to add an exclusion for the > cable_plugged_in check in `mtk_dp_aux_transfer()` and the easiest > way to do this is to simply ignore checking that when the bridge > type is eDP. > = > Signed-off-by: AngeloGioacchino Del Regno > --- > drivers/gpu/drm/mediatek/mtk_dp.c | 61 ++++++++++++++++++++++++++----- > 1 file changed, 51 insertions(+), 10 deletions(-) > = > diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek= /mtk_dp.c > index a67143c22024..8109f5b4392b 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dp.c > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c [..] > @@ -2571,6 +2585,33 @@ static int mtk_dp_probe(struct platform_device *pd= ev) > mtk_dp->need_debounce =3D true; > timer_setup(&mtk_dp->debounce_timer, mtk_dp_debounce_timer, 0); > = > + if (mtk_dp->bridge.type =3D=3D DRM_MODE_CONNECTOR_eDP) { > + /* Initialize, reset and poweron the DPTX AUX block */ > + mtk_dp_initialize_aux_settings(mtk_dp); > + mtk_dp_power_enable(mtk_dp); > + > + /* Power on the panel to allow EDID read from aux-bus */ > + mtk_dp_aux_panel_poweron(mtk_dp, true); > + > + ret =3D devm_of_dp_aux_populate_bus(&mtk_dp->aux, NULL); > + > + /* If the panel is present, detection is done: power off! */ > + mtk_dp_aux_panel_poweron(mtk_dp, false); > + mtk_dp_power_disable(mtk_dp); > + > + /* We ignore -ENODEV error, as the panel may not be on aux-bus */ > + if (ret && ret !=3D -ENODEV) > + return ret; > + > + /* > + * Here we don't ignore any error, as if there's no panel to > + * link, eDP is not configured correctly and will be unusable. > + */ > + ret =3D mtk_dp_edp_link_panel(&mtk_dp->aux); This call might return EDEFER_PROBE if the panel hasn't probed yet. That's a problem, because during this probe you register a device for the dp-phy, so you'll be retriggering defer probes every time you probe until the panel pr= obes. But if this driver was builtin and the panel a module, then this loop will = go on forever. You should make use of the done_probing callback in devm_of_dp_aux_populate_bus() and do the panel linking there. This way you = can exit successfully from this probe and avoid the loop. I had to do the same = thing for anx7625.c [1]. Thanks, N=EDcolas [1] https://lore.kernel.org/all/20230518193902.891121-1-nfraprado@collabora= .com/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel