Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp234252rwd; Wed, 14 Jun 2023 15:12:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4foPSgEgPfY5JEHAd3jFCyqmf39PdJ9VWxz/tRo5ycJOX2zovneYNOq8bWQ0l+n4KnKQQF X-Received: by 2002:a17:907:d09:b0:982:2aaa:9c12 with SMTP id gn9-20020a1709070d0900b009822aaa9c12mr6679058ejc.77.1686780778611; Wed, 14 Jun 2023 15:12:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686780778; cv=none; d=google.com; s=arc-20160816; b=NsRD+O5+qPpLOS0mfK2MjkHCi3l4Z2EFK1imNvhuB2Y7o8TVT9eL2YQYJzVbO5rLdk LcfePishy1p+irisqkMipo+DbqTcXubpTgafs5Dj0YcO3aH8DPLxi0BL9G3Kkock9ab3 gKnarvj8h0yXthYjItsMxEyOg2Y4TpqSsKoxc1aVnL7mGlZ1WfNiFxntBxtlIBaVhZfT /uuOkLWf128oY3pfHRJRhfwYEIIR1LC0FX7QtUwCBWTtjYT/VIIyHb5IKRTJCz7v/qtY akelLEKWltAJWQMuNoqvxq/DGoKfHPLA3ZrJuYycPM360MkZFmhtjxnNhMQ+2c53COc+ 1SXg== 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=oh5nWE0pGFkoodtEGgImAH9t2K0gwbTAJWDqrg/URHU=; b=ZqtQUQVv5jFSxE2CZNEik7j4/JOJ0c0b3HiTRfKWX4ncRX44CGeE2DfdO5bHsIK9Ts 2lYrc8tQKbParp8Rf+EmT8+RuSJxjEJspxXeIsRvtmcP1UWDNhN7AL3SYbowICcgTV7O 0Ol9gMkgEL7NPh5jbR9km66UPypNpD1IL1VBsoOU9MOFlWTt9kZv6/OepycY2qfZ+REP wOr1pQKEECJZJrf4c0DV4WbEPHAJTJnEVb5AxPkhxSRj1jUEn7wGeRfXw1NorWNUu1IM LOP+EXacfkc2grWb++p2HLY1VVWLZxmeqo3/K59FX/h7PAakGdZC2ewK2Egu43ujcf9q afCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oe5fklyG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz3-20020a170906f2c300b009745b803068si8733267ejb.619.2023.06.14.15.12.33; Wed, 14 Jun 2023 15:12:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oe5fklyG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231550AbjFNVbe (ORCPT + 99 others); Wed, 14 Jun 2023 17:31:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjFNVbd (ORCPT ); Wed, 14 Jun 2023 17:31:33 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7536C1FFA for ; Wed, 14 Jun 2023 14:31:31 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id 4fb4d7f45d1cf-5193c97ecbbso1328729a12.1 for ; Wed, 14 Jun 2023 14:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1686778290; x=1689370290; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oh5nWE0pGFkoodtEGgImAH9t2K0gwbTAJWDqrg/URHU=; b=oe5fklyGZLgQ6D0RFP6eEND/P7lS17P9niXlv2SXjRSeAq0nNPRJOsJKm9ky5lB+4h dqN8oELynrplFPva4JtuIUIC8+l2or4QtrKbv1QeNgsxje2kWaHlyiP4n7e2mT39W+Kv JwZ0CVVaOgHg4ciW1x+Bw9v2mv4SlRlXuENBU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686778290; x=1689370290; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oh5nWE0pGFkoodtEGgImAH9t2K0gwbTAJWDqrg/URHU=; b=KbgpYsXjjyKVr/G8q2/cVm6YUdux8feePYt+1RP0o+IhxN5vmPYuNoNmVUlV/P9qj0 WpUyCFSoSYBIsM8yGKcy2uazsfGNOXuE2Q/9orZ96wMr2gmUToGAeb1mYDYF9+RnGakx 8tqMALjzjK8Jk7OZ+9lxnPcOIn2I71th5cWHeDHGZVMPMrBfCsWqjSBDYKyOUUcWja1/ QapE9ahnbXs4n9Tha7NECpQOXAwvaJK+r/rqRgPqsMLHe9Z/kRjykZq53/8WQTRNicUB vOheFeWanl0A7Q/bupoqOWqtD8xI2tu1UFOVKOZIyG6fpqf7Y0nae3Qsi+Gz2x7AK6+S rYdA== X-Gm-Message-State: AC+VfDyUyvLC4Wpah7o5WSytby+08mXym0E0Oy0BKHOMnuLIrXsy7jqJ AKN0DotjNTJMVKyW3668VH5bQn+vPo2m+NWKuYHbS0TUgHA= X-Received: by 2002:a17:906:9b85:b0:96f:dd14:f749 with SMTP id dd5-20020a1709069b8500b0096fdd14f749mr13939870ejc.23.1686778289917; Wed, 14 Jun 2023 14:31:29 -0700 (PDT) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com. [209.85.208.47]) by smtp.gmail.com with ESMTPSA id d18-20020a170906371200b0098282bb8effsm888822ejc.196.2023.06.14.14.31.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jun 2023 14:31:29 -0700 (PDT) Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-516500163b2so959a12.1 for ; Wed, 14 Jun 2023 14:31:29 -0700 (PDT) X-Received: by 2002:a50:9e65:0:b0:51a:2012:5b34 with SMTP id z92-20020a509e65000000b0051a20125b34mr1137ede.4.1686778289380; Wed, 14 Jun 2023 14:31:29 -0700 (PDT) MIME-Version: 1.0 References: <20230612163256.1.I7b8f60b3fbfda068f9bf452d584dc934494bfbfa@changeid> <86ad3ffb-fbe2-9bed-751d-684994b71e9d@collabora.com> In-Reply-To: <86ad3ffb-fbe2-9bed-751d-684994b71e9d@collabora.com> From: Doug Anderson Date: Wed, 14 Jun 2023 14:31:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/bridge: ps8640: Drop the ability of ps8640 to fetch the EDID To: AngeloGioacchino Del Regno Cc: dri-devel@lists.freedesktop.org, Maxime Ripard , Laurent Pinchart , Pin-yen Lin , Sam Ravnborg , Icenowy Zheng , linux-mediatek@lists.infradead.org, Andrzej Hajda , Daniel Vetter , Dave Stevenson , David Airlie , Jernej Skrabec , Jonas Karlman , Matthias Brugger , Neil Armstrong , Robert Foss , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Jun 14, 2023 at 1:22=E2=80=AFAM AngeloGioacchino Del Regno wrote: > > Il 13/06/23 01:32, Douglas Anderson ha scritto: > > In order to read the EDID from an eDP panel, you not only need to > > power on the bridge chip itself but also the panel. In the ps8640 > > driver, this was made to work by having the bridge chip manually power > > the panel on by calling pre_enable() on everything connectorward on > > the bridge chain. This worked OK, but... > > > > ...when trying to do the same thing on ti-sn65dsi86, feedback was that > > this wasn't a great idea. As a result, we designed the "DP AUX" > > bus. With the design we ended up with the panel driver itself was in > > charge of reading the EDID. The panel driver could power itself on and > > the bridge chip was able to power itself on because it implemented the > > DP AUX bus. > > > > Despite the fact that we came up with a new scheme, implemented in on > > ti-sn65dsi86, and even implemented it on parade-ps8640, we still kept > > the old code around. This was because the new scheme required a DT > > change. Previously the panel was a simple "platform_device" and in DT > > at the top level. With the new design the panel needs to be listed in > > DT under the DP controller node. The old code allowed us to properly > > fetch EDIDs with ps8640 with the old DTs. > > > > Unfortunately, the old code stopped working as of commit 102e80d1fa2c > > ("drm/bridge: ps8640: Use atomic variants of drm_bridge_funcs"). There > > are cases at bootup where connector->state->state is NULL and the > > kernel crashed at: > > * drm_atomic_bridge_chain_pre_enable > > * drm_atomic_get_old_bridge_state > > * drm_atomic_get_old_private_obj_state > > > > A bit of digging was done to see if there was an easy fix but there > > was nothing obvious. Instead, the only device using ps8640 the "old" > > way had its DT updated so that the panel was no longer a simple > > "platform_deice". See commit c2d94f72140a ("arm64: dts: mediatek: > > mt8173-elm: Move display to ps8640 auxiliary bus") and commit > > 113b5cc06f44 ("arm64: dts: mediatek: mt8173-elm: remove panel model > > number in DT"). > > > > Let's delete the old, crashing code so nobody gets tempted to copy it > > or figure out how it works (since it doesn't). > > > > NOTE: from a device tree "purist" point of view, we're supposed to > > keep old device trees working and this patch is technically "against > > policy". Reasons I'm still proposing it anyway: > > 1. Officially, old mt8173-elm device trees worked via the "little > > white lie" approach. The DT would list an arbitrary/representative > > panel that would be used for power sequencing. The mode information > > in the panel driver would then be ignored / overridden by the EDID > > reading code in ps8640. I don't feel too terrible breaking DTs that > > contained the wrong "compatible" string to begin with. NOTE that > > any old device trees that _didn't_ lie about their compatible will > > still work because the mode information will come from the > > hardcoded panels in panel-edp. > > 2. The only users of the old code were Chromebooks and Chromebooks > > don't bake their DTs into the BIOS (they are bundled with the > > kernel). Thus we don't need to worry about breaking someone using > > an old DT with a new kernel. > > 3. The old code was crashing anyway. If someone wants to fix the old > > code instead of deleting it then they have my blessing, but without > > a proper fix the old code isn't useful. > > > > I'll list this as "Fixing" the code that made the old code start > > failing. There's not lots of reason to bring this back any further > > than that. > > Hoping to see removal of non-aux EDID reading code from all drivers that = can > support aux-bus is exactly why I moved Elm to the proper... aux-bus.. so.= .. > > Yes! Let's go! > > > > > Fixes: 102e80d1fa2c ("drm/bridge: ps8640: Use atomic variants of drm_br= idge_funcs") > > ...but this Fixes tag will cause this commit to be backported to kernel v= ersions > before my commit moving Elm to aux-bus, and break display on those. > > I would suggest to either find a different Fixes tag, or don't add any, s= ince > technically this is a deprecation commit. We could imply that the old tec= hnique > is deprecated since kernel version X.Y and get away with it. > > Otherwise, if you want it backported *anyway*, the safest way would be to= Cc it > to stable and explicitly say which versions should it be backported to. The problem is that, as I understand it, as of commit 102e80d1fa2c ("drm/bridge: ps8640: Use atomic variants of drm_bridge_funcs"), things are broken anyway and you'll get a crash at bootup. However, if you start at that commit and apply ${SUBJECT} patch, things actually end up being less broken. It won't crash anymore and on any boards that actually have the display that's specified in the DT compatible the screen should actually work. Thus even without your patch to move things over to the aux-bus it's still an improvement to take ${SUBJECT} patch on any kernels that have that commit. I don't have an 'elm' device easily accessible, but I can figure out how to get one if needed to confirm that's true. However, maybe it's easy for you or Pin-Yen to confirm. If my understanding is incorrect, I have no objection to removing the Fixes tag. I'd probably have to update the commit message a bunch too because that was part of my justification for landing the patch in the first place.