Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2306847pxb; Sun, 30 Jan 2022 11:29:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5J76g9JPL16Sd1zp4hSj+g2IXn0ZoBl22V+uC29mCmWwF1a547m8fIRM1ZVSXrPIJ0eTc X-Received: by 2002:a17:907:8a1b:: with SMTP id sc27mr5957604ejc.300.1643570986251; Sun, 30 Jan 2022 11:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643570986; cv=none; d=google.com; s=arc-20160816; b=pv8CWFm94MPLA/EUTPyiasn77FN9i6MzDK3Yi+NI9NKRMPizALDiVMikp+T9KwTtrL xNGSUngp7oa+v1RiHT2Yblf2GpTgmEMZPtBbH28UHvi1EZqWzZaxSSTRzXrWP5ZcZ5EQ 8lYxzVC8ZykGo99gwGb4V2lagfph6yLRHLlPJxEy0admg0ES+7x4VPl+DRq4uqFkbKrn URTUdzjMM0QcAWhwH+zPh9ygjCr/2sKnXYvLds263rHg4PCBzUimYRFAdjiUTJNLJEfO J89B5Nb34j+aB4KeCJA91mdjfbaal+0ZFx2x5pBHlw7ONyy+pUUGatKAT9Ftlt+8sEel Nz2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:dkim-signature; bh=VMl+0VMMPvsG5h3cfHmT6kNK/KxBTAazOFuMjvjuWtk=; b=S2TuJcUGHE3zz4Uoq9ZF7Lqu4zJq/2Cxmz0/1A1nGGelUM7UaqkVNbBHiNY3BCsJnm a19dh/vp/INi8yRfGVuZtHHRXrjKivpxtskx1w22cVyKMmDNUdzoMjPUOsyaONbN+89Y FQVwgIr4CeyF5B4ZN80iEiIRQMrMosT0frGenVPHuy78+DqvmDmlMm/6XdeeYKhtlm26 papNYPXBk21ZFbUVABzj7P9QFHo26Yv10f4dw6BmUaKcVI3BDDwS1qID+BSekZ6Nlz/+ Rh8vIdC6m35y/GPZBjpogSeLWvF3Jjw8mdtpCvXHx4djN2VecblJ/rin2xKwVevnP9Ze BX8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=icjXHmtY; 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=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hg2si4639165ejc.231.2022.01.30.11.29.21; Sun, 30 Jan 2022 11:29:46 -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=@collabora.com header.s=mail header.b=icjXHmtY; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347537AbiA1JNi (ORCPT + 99 others); Fri, 28 Jan 2022 04:13:38 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:33410 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234281AbiA1JNg (ORCPT ); Fri, 28 Jan 2022 04:13:36 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 029441F45DA3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1643361215; bh=1t37Who892UgzGYY1/obVI1c4xg7GCI5hTII7E25RXc=; h=Subject:From:To:Cc:References:Date:In-Reply-To:From; b=icjXHmtYlty4sGUEzqvYYuKTs/KKYuBCXYBiIJKGV1pyFbjQO+zU9XWbOgmB9/v1S UFd2f7F5Lv5p/xtwrJSx94W16cekuZkPoaNq+zfwxX95RrzT9NkvVEsnFyhabpClTD 81HswS6Vi3aZzf5lLfcsHp1JpQTshMri2jR1qzmSoeHQ3IT15oW8T06WKCdWmTLo8R QcLTNK1MvQGUNMh07HHx9xsG5QSKh00VIvTBcrvqrDxyAmFEKcSJvXAUWsn/Mf9+PT 9942P6a51mYZLUhLAHO/PL3ilq8Fh8NbnATnoUQ/rWVsNRukJaUpIGEmKfg1VN14LY ou3MgSVqDEHPA== Subject: Re: [PATCH v3] drm/mediatek: mtk_dsi: Avoid EPROBE_DEFER loop with external bridge From: AngeloGioacchino Del Regno To: Chun-Kuang Hu Cc: 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 References: <20220127143623.123025-1-angelogioacchino.delregno@collabora.com> Message-ID: Date: Fri, 28 Jan 2022 10:13:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 於 >> 2022年1月27日 週四 下午10:36寫道: >>> >>> 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 here: > > 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/mediatek > but rather one that was induced by the new, fixed, probe flow that got > recently documented - and to which drivers should adhere; failing to adhere > to that will produce an endless -EPROBE_DEFER loop, due to other drivers > (as mentioned, for example drm/bridge drivers) having been changed to use > 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+ >> 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