Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp539025pxb; Mon, 25 Oct 2021 13:19:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMiF5a6fukldLrMIkdR/Eg48lYy4K89OLtPAEKU6j4iYD05uwu1OIfXFjErWH0d7fGP2xv X-Received: by 2002:a17:90a:4fa1:: with SMTP id q30mr21130868pjh.12.1635193146267; Mon, 25 Oct 2021 13:19:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1635193146; cv=pass; d=google.com; s=arc-20160816; b=lLwZMEQep+CbiiZK8OmXF3hvuMivH50NdSJcgSMnGIalW+usxYMCVPKDl3aVHKrR7S Pj16+eFfmZZ7xueTtp3QtK7zjcgWmPFDlzarCNLx48Eu82o7SuQW5vhmvwyFTCGmzdxV SdPrOabWpnY0n9LXWHwKzLnMOwP9gOEGSlzjJmJJG8KtTv15aIVeL4ItRunZpw10gzLF N80rd0iiaQFdvjcZjnEGS3JP/r/l5oAOWWPq1ZfUUhef7/BymSKnLwb1amQ0Kq8NQkbP D38gHx0/4lyDy3cHZd3TnwpIP1X6D6Mpm5aWO0b5E0d3ezBed7Fbsxb4/+DvY+sswyGQ Fy6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:organization:from:references:cc:to:content-language :subject:user-agent:date:message-id:dkim-signature; bh=mcHxrjTvCYXVPXmSadQ4+EkDRmLxhB6f336voCpXnu0=; b=I8pFOL/vRno+WYixZ4vEAMgn9sr+MRoj80gvku8uXr7WS4q1SBTGjq+bwbEsYsCNMA l8nBhQt9Kt55p5zyrE7f+Jxsb/gaegne6DbMfZirUo7W1LRB2a+C8/MU28QdDHN89ERj l/oYyx0DqidwA9MryXq3g27GtfNdXABm02wx8JFoynolVvT+GgHq7he4hD/SBx0b327Y DZh8u6kkWSQmf/iPmVObs0C6u5KvEOa4mY7dW+ZFlHgU52EhHY1ue+Tw1lYhWLqQ8Afw QstsW+zWRWCfoIHkFrHgV3F3K2gakY46gehjWowUCV7EN4sXxI0gf5blNjaniOp5gdxj vZAw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=yO1KyXAC; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si28760624plk.409.2021.10.25.13.18.46; Mon, 25 Oct 2021 13:19:06 -0700 (PDT) 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=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=yO1KyXAC; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235156AbhJYUTG (ORCPT + 99 others); Mon, 25 Oct 2021 16:19:06 -0400 Received: from mga11.intel.com ([192.55.52.93]:25879 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232799AbhJYUS4 (ORCPT ); Mon, 25 Oct 2021 16:18:56 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="227206846" X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="227206846" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 13:12:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="446783083" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga003.jf.intel.com with ESMTP; 25 Oct 2021 13:12:05 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 25 Oct 2021 13:12:04 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 25 Oct 2021 13:12:04 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 25 Oct 2021 13:12:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lyfzeU16u8HYnNTHCftpal904rEXZRdVNQjzjt47BgN0LWvgM14U++dBFMIlQ8pdC/gtIAqx0vQmLhv5S0dBim7SbdXeDBbOvxGjsfFlf9kfzqMO7TGtfZYnO3Pg8Esmehft+SZoclFE7jR6vL+DKMn3LNiFKsiREm+JMTxfoAeGQ5k7QM+bkRIA6/TLphUxX9mQ+ONLHNQ+NyodlNhPc3zjECRUBmnWZCxmID55v3cefuWXH2qjQtvm/ESIA3YukhR3ZchkDnAR7NBd9yfgU3Xpkx5ZKKtaUIqQVP6zTbL2bzRr/iUwY8b72IZn8SL7vHICBDxk3bW7dfSh6WVZeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mcHxrjTvCYXVPXmSadQ4+EkDRmLxhB6f336voCpXnu0=; b=MGh4c4TV8mLiHF0kJN2fJKzHyrKfe+6VIUTRHnqCCWFnCLzDOfyjbXgh2hY8/GHi4Hd+CU4ZLmAprfKVfLvgxrEoxVXZBq7ZlwfvCgfXKzz5P8RfZf0ke7hM8qbKxEB+CrdXWmdf1qo6OP53HfCyWMSo0cSuzXg26spWBbWUNajil1QQihicx589zmISLXflT6mJxjTIgOjFuvs+E672CcQqrp0OaDuPzeTTT54MDZZ2xh6Ui4jvPyE+Ns+6RfpIVmXTzIB6hl7uxCAZ+qGZw6XnGTDknGzCpoWLFAEzVj1FX/SUunW7JLbGGqEK/tvZrDZa1Z/QA1X1Wurp4LuiOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mcHxrjTvCYXVPXmSadQ4+EkDRmLxhB6f336voCpXnu0=; b=yO1KyXACPWeSd2487cR/sWPuFp2ErrzKb6RL46sCk8YMxww4lYV4t6ZYtHaWx+Eu/AEUwirkgtgMIIohKDa1eF9NkKrKpYB5uoEXFL1Y1KQiiURZWsJ5Z/xqKDckzQNnRhjpvbr125qnqBwEWXu2gzoXE+ghDV6FxOXRUUOnJqg= Authentication-Results: ideasonboard.com; dkim=none (message not signed) header.d=none;ideasonboard.com; dmarc=none action=none header.from=intel.com; Received: from DM6PR11MB3180.namprd11.prod.outlook.com (2603:10b6:5:9::13) by DM4PR11MB5488.namprd11.prod.outlook.com (2603:10b6:5:39d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18; Mon, 25 Oct 2021 20:11:54 +0000 Received: from DM6PR11MB3180.namprd11.prod.outlook.com ([fe80::3856:7f41:e399:f907]) by DM6PR11MB3180.namprd11.prod.outlook.com ([fe80::3856:7f41:e399:f907%7]) with mapi id 15.20.4628.020; Mon, 25 Oct 2021 20:11:54 +0000 Message-ID: <0e17993d-1e9f-2673-7fee-abf3787de431@intel.com> Date: Mon, 25 Oct 2021 22:11:47 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.2.1 Subject: Re: [PATCH] drm/bridge: Fix the bridge chain order for pre_enable / post_disable Content-Language: en-US To: Laurent Pinchart CC: Sam Ravnborg , Douglas Anderson , , Philip Chen , Boris Brezillon , Daniel Vetter , David Airlie , Jagan Teki , Maarten Lankhorst , Maxime Ripard , "Neil Armstrong" , Robert Foss , Thomas Zimmermann , References: <20211021122719.1.I56d382006dea67ed8f30729a751fbc75434315b2@changeid> From: Andrzej Hajda Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB6P195CA0010.EURP195.PROD.OUTLOOK.COM (2603:10a6:4:cb::20) To DM6PR11MB3180.namprd11.prod.outlook.com (2603:10b6:5:9::13) MIME-Version: 1.0 Received: from [192.168.0.29] (95.160.158.79) by DB6P195CA0010.EURP195.PROD.OUTLOOK.COM (2603:10a6:4:cb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16 via Frontend Transport; Mon, 25 Oct 2021 20:11:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9136e544-14b3-4c5a-5cd6-08d997f3b09c X-MS-TrafficTypeDiagnostic: DM4PR11MB5488: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8hazej9Ky/UoeVhCHTPDPETTEOSPlas33WkPjJHo19RNm2hiPSU1HECve2qP4KKuK1f3x1oi8kBuACqfUXyF8nNWoFCiHmvxXrPO1udwagtcz2okw/JaSn3qDG3JuS0QEky+S0waXaNl1NVUf/rNnFkuGeGWFRBksLE1VbbSEcn1GS63WCjnS4KwMxcVQyLmq14PJCa2n2ShJu7d84/0Q0PR5pN7fdLSNdG1xHOR+YbDRokXvhQ/R6ynE3ENbBwTyOhGZIhUpSreMhF6H8AtCS56/tBhHyvjBpoCGd7zQu+/ceiA3ZpXbjPc3HTTFw1v1FdXZmmS7df0x3y1RovLInYp6oGakH45dK0IlBWyZBgP94AughJogLT31TV4TlWvk22vpOPlXWuwuIWsVsunGqzjhjvTXidWUQvS41VvXsB1C3YtMeWBFaqBJ06KL1hyW37FGwVmqvwTEID6rr+yaLKTl/EOa38PmUe63Ov86nP5eRXeidjXBMWIjlv70lXtlNE7JAzbG9W7tFrZWGZIDlqBfvDIumnTo+k+GAesTzM7PtXJBK07qeuNcvOC6uXBYrQeJ2sk3TpPmMQ5Mq6NwPxyU7a0HZT7s49ukpoqPwVNaS6EJcdzu1LcDBBeqAoThpAmvGoM4gayFzhm4XVkqrWxGDcISL+xrMBoc4efPTJscApJfeLr3GUja63Pygjz4ytYiJngNBavpMRwgsrsgVQsiqk2CyyvvM0pjWxDJ5OOYOZdXxgjCfouF9B0mZ8yVxBueBK1bUFOxXtnsvloBgDCSYpZv4JA8AX7Yk44fcbGcLJU5uFiwbTO8WSS8XZP X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3180.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(7416002)(2906002)(966005)(66556008)(16576012)(4326008)(66946007)(66476007)(44832011)(86362001)(8936002)(31696002)(54906003)(956004)(53546011)(36916002)(83380400001)(6486002)(82960400001)(6666004)(5660300002)(26005)(316002)(508600001)(30864003)(36756003)(31686004)(38100700002)(8676002)(6916009)(186003)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SEVJTGZubDdqcFFmelVUWSsyOGpQeFNIRkVLRzhSbk43RWswcURIZDRGK04x?= =?utf-8?B?Rmx2ZGNSZ2VFMzJOUmlzMmtPbVNYY0xBM1RRenVFQm1QdEI5eEhicTJmNEpp?= =?utf-8?B?OVRhT0JzUkFIUE9NdjJ5bk83VW5ZSGlDMThMRjRXUXNwZ3QrckxudjR4d2pG?= =?utf-8?B?bWE0RzkxOW0zUjI1V3FLbituaDYzSW5SMGdwb1E4TURyK0Ewb2JjbWZQWUp4?= =?utf-8?B?QjhSWkhCQVFrSGllNWRHMWFYZk16RXBBK3JWaWVsWndjMm9wK0tRclVvYzdC?= =?utf-8?B?Qkd3dE9mYzFjM1hQbFA5U2JTL3gxMlloT2pRcEhmOXE4TlJDbk9FdzJTTGFz?= =?utf-8?B?c21RWklhVHFRSnhVbzJ5QnM0cFh5YW9RZHpNTFk1UXEwZythRWV4OUszSi9q?= =?utf-8?B?dTVSNkRNMWRySVF0WTVwbSttalFiTngwNm4wRGdmZXRxMFFYZ1JJODZ4dWlX?= =?utf-8?B?UGVDSXhmalN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prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2021 20:11:54.7759 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2D8CCttp5RualF8/G1U+oW0jySA44I6ZYFahOmaFd8y55lVO6nKKA7cPEFw14HXMxIq/fb2KFgl362zV6VT6Tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5488 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 25.10.2021 13:21, Laurent Pinchart wrote: > Hello, > > On Mon, Oct 25, 2021 at 01:00:10PM +0200, Andrzej Hajda wrote: >> On 21.10.2021 22:21, Sam Ravnborg wrote: >>> On Thu, Oct 21, 2021 at 12:29:01PM -0700, Douglas Anderson wrote: >>>> Right now, the chaining order of >>>> pre_enable/enable/disable/post_disable looks like this: >>>> >>>> pre_enable: start from connector and move to encoder >>>> enable: start from encoder and move to connector >>>> disable: start from connector and move to encoder >>>> post_disable: start from encoder and move to connector >>>> >>>> In the above, it can be seen that at least pre_enable() and >>>> post_disable() are opposites of each other and enable() and disable() >>>> are opposites. However, it seems broken that pre_enable() and enable() >>>> would not move in the same direction. In other parts of Linux you can >>>> see that various stages move in the same order. For instance, during >>>> system suspend the "early" calls run in the same order as the normal >>>> calls run in the same order as the "late" calls run in the same order >>>> as the "noirq" calls. >>>> >>>> Let fix the above so that it makes more sense. Now we'll have: >>>> >>>> pre_enable: start from encoder and move to connector >>>> enable: start from encoder and move to connector >>>> disable: start from connector and move to encoder >>>> post_disable: start from connector and move to encoder >>>> >>>> This order is chosen because if there are parent-child relationships >>>> anywhere I would expect that the encoder would be a parent and the >>>> connector a child--not the other way around. >>> This makes good sense as you describe it. I hope others can add more >>> useful feedback. >>> Added Andrzej Hajda to the mail, as he have >>> expressed concerns with the chain of bridges before. >> Thanks Sam, but I am not sure about useful feedback - when I see bridge >> chain issues it automatically triggers "whining mode" in my head :) >> >>>> This can be important when using the DP AUX bus to instantiate a >>>> panel. The DP AUX bus is likely part of a bridge driver and is a >>>> parent of the panel. We'd like the bridge to be pre_enabled before the >>>> panel and the panel to be post_disabled before the >>>> bridge. Specifically, this allows pm_runtime_put_sync_suspend() in a >>>> bridge driver's post_suspend to work properly even a panel is under >>>> it. >>>> >>>> NOTE: it's entirely possible that this change could break someone who >>>> was relying on the old order. Hopefully this isn't the case, but if >>>> this does break someone it seems like it's better to do it sonner >>>> rather than later so we can fix everyone to handle the order that >>>> makes the most sense. >> It will break for sure. So the question is: if it is worth changing? >> >> New order seems good for eDP, DSI sinks [1], probably other as well. >> >> Old order is better for example for THC63LVD1024 [2 p. 20], I guess for >> many other sinks as well. >> >> I am not even sure if it is protocol specific (LVDS, RGB, HDMI,...), or >> it depends on specific hw pairs (source->sink). >> >> This is why I complain about the bridge chain - assumption that one >> fixed call order will work for all setups seems to me ridiculous. >> >> Going back to the question - changing the order from fixed one to >> another fixed one will not solve general issue. >> >> What can we do then? >> >> 1. Configurable call order? Probably doable: every chain element should >> expose info if it's call should be before or after source, then some >> core helper will create queue of callbacks. Seems quite complicated, >> hides the logic from implementer and not fully flexible (for example, >> there are protocols which require to perform sth on source, then on >> sink, then again on the source). >> >> 2. Stop using bridge chain and call sink ops directly from the source >> (this is what Exynos and VC4 do): is flexible and straightforward, gives >> full control to the source. > And breaks interoperability, because different sources end up calling > operations in different orders. We end up having different sinks that > expect calls in different ways, and divide the world in sink/source > groups that don't interoperate :-( I have an impression you describe current status :) More seriously, it is matter of proper specification/documentation/implementations of the operations. If we really need strict constraints we could try to implement them on protocol level. > >> 3. Use different abstractions to enforce proper initialization order >> (like extending mipi_dsi_host_ops): requires existence of transport bus >> abstraction (only DSI at the moment(?)). > A real bus seems overkill, but we could have drm_bridge operations > specific to particular hardware interfaces. > >> ... other ideas? > I don't like it because of the amount of work it would require to switch > to such a model, but I'm really starting to think that a variation of > the second option would be best, where the sink controls the source > instead of having the source controlling the sink. It's the sink that > knows about its enabling/disabling sequence, and about how the source > needs to be controlled to match it. I am afraid it depends on the protocol and cross-calls (source->sink, sink->source) can be hard to avoid in case of some protocols. > >> Another idea, connected to the subject - some protocols require some >> negotiations between source and sink bus format, or more steps than >> pre_enable, enable ops to establish link. I wonder if encapsulating >> drm_bridge in some protocol specific struct wouldn't be a solution, it >> can be helpful as well in case of the subject. >> >> For example: >> >> struct drm_bridge_edp { >> >>     const struct drm_bridge_edp_funcs *funcs; >> >>     struct drm_bridge base; >> >>     ... >> >> }; >> >> Then source could promote bridge pointer to bridge_edp pointer (if >> applicable) and perform edp specific stuff. To make it working well >> pre-enable order should be as proposed in this patchsets (encoder -> >> connector), as the source should initiate negotiations. >> >> Btw this encapsulation stuff above asks to rename drm_bridge to >> drm_sink, otherwise it would be confusing as bridges have two ends. > drm_sink would be equally confusing when used for devices that have a > sink and a source :-) I'm not against a rename though, if we can find a > better name. But in this case we are interested only in sink part of the bridge (OR panel). If source is looking for specific bridge or panel (drm_of_find_panel_or_bridge), it is in fact looking for sink. Regards Andrzej > >> Regards >> >> Andrzej >> >> >> [1]: I use term sink as short equivalent for 'bridges AND panels' >> (another issue in DRMs). >> >> [2]: https://www.mouser.com/datasheet/2/286/THC63LVD1024-1396205.pdf >> >>>> A FURTHER NOTE: Looking closer at commit 4e5763f03e10 ("drm/bridge: >>>> ti-sn65dsi86: Wrap panel with panel-bridge") you can see that patch >>>> inadvertently changed the order of things. The order used to be >>>> correct (panel prepare was at the tail of the bridge enable) but it >>>> became backwards. We'll restore the original order with this patch. >>>> >>>> Fixes: 4e5763f03e10 ("drm/bridge: ti-sn65dsi86: Wrap panel with panel-bridge") >>>> Fixes: 05193dc38197 ("drm/bridge: Make the bridge chain a double-linked list") >>>> Signed-off-by: Douglas Anderson >>> To make the patch complete the descriptions in drm_bridge_funcs >>> need to be updated to reflect the new reality. >>> >>>> --- >>>> >>>> drivers/gpu/drm/drm_bridge.c | 28 ++++++++++++++-------------- >>>> 1 file changed, 14 insertions(+), 14 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c >>>> index c96847fc0ebc..98808af59afd 100644 >>>> --- a/drivers/gpu/drm/drm_bridge.c >>>> +++ b/drivers/gpu/drm/drm_bridge.c >>>> @@ -583,18 +583,14 @@ EXPORT_SYMBOL(drm_bridge_chain_mode_set); >>>> void drm_bridge_chain_pre_enable(struct drm_bridge *bridge) >>> If you, or someone else, could r-b or ack the pending patches to remove >>> this function, this part of the patch would no longer be needed. >>> >>>> { >>>> struct drm_encoder *encoder; >>>> - struct drm_bridge *iter; >>>> >>>> if (!bridge) >>>> return; >>>> >>>> encoder = bridge->encoder; >>>> - list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) { >>>> - if (iter->funcs->pre_enable) >>>> - iter->funcs->pre_enable(iter); >>>> - >>>> - if (iter == bridge) >>>> - break; >>>> + list_for_each_entry_from(bridge, &encoder->bridge_chain, chain_node) { >>>> + if (bridge->funcs->pre_enable) >>>> + bridge->funcs->pre_enable(bridge); >>>> } >>>> } >>>> EXPORT_SYMBOL(drm_bridge_chain_pre_enable); >>>> @@ -684,26 +680,30 @@ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge, >>>> struct drm_atomic_state *old_state) >>>> { >>>> struct drm_encoder *encoder; >>>> + struct drm_bridge *iter; >>> s/iter/bridge/ would make the patch simpler >>> And then the bridge argument could be last_bridge or something. >>> This would IMO increase readability of the code and make the patch smaller. >>>> >>>> if (!bridge) >>>> return; >>>> >>>> encoder = bridge->encoder; >>>> - list_for_each_entry_from(bridge, &encoder->bridge_chain, chain_node) { >>>> - if (bridge->funcs->atomic_post_disable) { >>>> + list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) { >>>> + if (iter->funcs->atomic_post_disable) { >>>> struct drm_bridge_state *old_bridge_state; >>>> >>>> old_bridge_state = >>>> drm_atomic_get_old_bridge_state(old_state, >>>> - bridge); >>>> + iter); >>>> if (WARN_ON(!old_bridge_state)) >>>> return; >>>> >>>> - bridge->funcs->atomic_post_disable(bridge, >>>> - old_bridge_state); >>>> - } else if (bridge->funcs->post_disable) { >>>> - bridge->funcs->post_disable(bridge); >>>> + iter->funcs->atomic_post_disable(iter, >>>> + old_bridge_state); >>>> + } else if (iter->funcs->post_disable) { >>>> + iter->funcs->post_disable(iter); >>>> } >>>> + >>>> + if (iter == bridge) >>>> + break; >>> I cannot see why this is needed, we are at the end of the list here >>> anyway. >>> >>>> } >>>> } >>>> EXPORT_SYMBOL(drm_atomic_bridge_chain_post_disable);