Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2736534pxb; Mon, 31 Jan 2022 03:14:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJydlGXCxb+GuJoHaUK03Hov87Bf39Ux+kA7IGq5LnC3R8MO5FfXQGIFh5oHzRzp5QZJs3+W X-Received: by 2002:a17:907:d26:: with SMTP id gn38mr16135650ejc.53.1643627663909; Mon, 31 Jan 2022 03:14:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643627663; cv=none; d=google.com; s=arc-20160816; b=GVRfInXnCBxNnTEd+7LtatsVasTx20t7tXRJfsKkgMI0MEoLoTmvegsddt18x+d5PS 2sjs50WOXb7xQNYaZkPhXdOLq/upNDFryBmMMOJdbTII/hIsYNjofrlMofT+OIjxhdaH qgpQ1+Msn72mSQOrr0sDlr+2XND1aeTr7rU73CkJ8poQuGQyvs9AX/G+XKJHwb6kXQT6 niktXlJYr61M+MrqLE4trsMh3MyfJ8KjD0e1LYXdPk0N44hKKCFpLlBAD77c3yfNBoeK bNMu94p0HjiIEpnPRMn8bO9bNFsyO/7M/rdTGBoPMiJOnANHQmRGQai2E0Gnm9ZlcYyB 0BEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=yHplSUgjfVfhELmE4lB39BPgXfAyCxTkkwddRs17120=; b=lsJdThT6TY1JN/XS3+F3lCYMAgN0kgMcuRK4gUSGKIp+CouSIIzUKW4pGWwhWDcmjR 3GD+lUubWkuRUZHvFDtyf6hKTwB9FVNFk5PrsyTHH/HMs6dPZVEe+N/o71cLyp4s66cu bEvU/24Yktksau4+BFR/oIZnefVtokLyi8777CuTB6KUfyk50YZ2L3fGVAHRYARpu81U heqh6bBEhqQwhCWAs6ODnCpERPoPdtpBxCpMAvc4eIAni8sOIcjCCLR2qYiLawscfxWa /3ONTT0qCHecE64Em2r7xZccystI0DKljmNpLNVKFVP0cy1mP6tlbKeAkNVb6ObXsWdZ CMsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VNz1du+T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ba11si7120272edb.327.2022.01.31.03.13.59; Mon, 31 Jan 2022 03:14:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VNz1du+T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349752AbiA1P5p (ORCPT + 99 others); Fri, 28 Jan 2022 10:57:45 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:43052 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349744AbiA1P5o (ORCPT ); Fri, 28 Jan 2022 10:57:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 51E9961EA8 for ; Fri, 28 Jan 2022 15:57:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADAB5C340EE for ; Fri, 28 Jan 2022 15:57:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643385463; bh=IQ8hvyw1pDAvDp94xvG8YbiEIf7ZBPJyDu22r8ISfVw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VNz1du+TBjld4PhPZ+jkdPNJiAVgrFEcCQMeV1IqW4tQxuagjbz750OUKZYNO9Wqe 5Ramldm2aALYNHOqEtVoUe/KzJ+9j2fGR2FHzVonemL+LT3wGtyfYuZ6CteNb1hqTF OXI2GJLwBTYodJGgenkJ6c2FIYeid+gulDzFkbqEcdM9UXwjgYV+Aow9Dm0eumZinc Ns4nKSiQ0vomivo5dR6fLv+zTujyFIhazzVts2vMEKKYc+krpOzL8M7yY5gLfh66s4 7w0URWeLM3EXoEIfmJupi3xQTR4hPuaX1NsYY+SJIt0fUn0KJJJHkR7/jetdjWLdEV 8j7gPnfuljTGg== Received: by mail-ej1-f45.google.com with SMTP id ka4so17346858ejc.11 for ; Fri, 28 Jan 2022 07:57:43 -0800 (PST) X-Gm-Message-State: AOAM533SKy2xg2m/6aX51KQZxlhCtxqoeephHpzy+i7kHG8uogpDhzq0 d6b8pzjiBlbx8wn43eKojQT6SchfJRB+tuLnGA== X-Received: by 2002:a17:907:3ea8:: with SMTP id hs40mr7443689ejc.48.1643385461799; Fri, 28 Jan 2022 07:57:41 -0800 (PST) MIME-Version: 1.0 References: <20220127143623.123025-1-angelogioacchino.delregno@collabora.com> In-Reply-To: From: Chun-Kuang Hu Date: Fri, 28 Jan 2022 23:57:30 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] drm/mediatek: mtk_dsi: Avoid EPROBE_DEFER loop with external bridge To: AngeloGioacchino Del Regno Cc: Chun-Kuang Hu , DRI Development , David Airlie , linux-kernel , andrzej.hajda@intel.com, "moderated list:ARM/Mediatek SoC support" , Jagan Teki , Matthias Brugger , Collabora Kernel ML , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org AngeloGioacchino Del Regno =E6=96= =BC 2022=E5=B9=B41=E6=9C=8828=E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=885:1= 3=E5=AF=AB=E9=81=93=EF=BC=9A > > Il 27/01/22 16:46, AngeloGioacchino Del Regno ha scritto: > > Il 27/01/22 16:21, Chun-Kuang Hu ha scritto: > >> Hi, Angelo: > >> > >> AngeloGioacchino Del Regno = =E6=96=BC > >> 2022=E5=B9=B41=E6=9C=8827=E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8B=E5=8D= =8810:36=E5=AF=AB=E9=81=93=EF=BC=9A > >>> > >>> 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). > >>> > >>> Fixes: 209264a85707 ("drm/bridge: Document the probe issue with MIPI-= DSI bridges") > >> > >> The fixed tag should indicate the patch which cause the bug, but why a > >> patch just adding document would cause bug? > >> So no any patch cause bug? This patch just want to prevent a possible = bug? > >> > > > > I think you've missed my previous message on v2, so I will paste it her= e: > > > > unfortunately I couldn't find a valid commit for a Fixes tag. This > > started being an issue at some point, when the DRM was changed to > > adhere to the documented probe sequence: the MediaTek DSI driver was > > not the only one that got broken/affected by these changes. > > > > If you have any advice on which commit should be tagged, I'm open for > > any kind of suggestion. > > > > > > I tried to check on other drivers which got fixed for the same behavior= , > > for example drm/msm, but none of them had a Fixes tag. > > When the DRM got changed to adhere to this sequence, some drm/bridge > > drivers were also changed; this has created some incompatibilities with > > some drm drivers, including drm/msm and drm/mediatek. > > > > This commit is not fixing a latent bug that was introduced in drm/media= tek > > but rather one that was induced by the new, fixed, probe flow that got > > recently documented - and to which drivers should adhere; failing to ad= here > > to that will produce an endless -EPROBE_DEFER loop, due to other driver= s > > (as mentioned, for example drm/bridge drivers) having been changed to u= se > > that probe sequence. > > > > > > Regards, > > Angelo > > > > I've been thinking about another solution to this issue. > > Would it be fine if I send a v4 that removes the Fixes tag, but adds the = following? > > Cc: stable@kernel.org # v5.15+ It's ok to me. According to the documented format [1], I think this should = be Cc: # 5.15.x [1] https://www.kernel.org/doc/html/v5.16/process/stable-kernel-rules.html Regards, Chun-Kuang. > > >> Regards, > >> Chun-Kuang. > >> > >>> Signed-off-by: AngeloGioacchino Del Regno > >>> Reviewed-by: Andrzej Hajda > >>> Reviewed-by: Jagan Teki > >>> > >>> --- > >>> drivers/gpu/drm/mediatek/mtk_dsi.c | 167 +++++++++++++++-----------= --- > >>> 1 file changed, 84 insertions(+), 83 deletions(-) > >>> > > > -- > AngeloGioacchino Del Regno > Software Engineer > > Collabora Ltd. > Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK > Registered in England & Wales, no. 5513718