Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp988852rdb; Wed, 6 Dec 2023 05:57:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEC9TFKFD1Sss3GNft5coXxGn8JuB/GSt9SDwh8qU1zcboH83CiW+oRseGNdi2PGqe9dsBL X-Received: by 2002:a17:902:c086:b0:1d0:977e:299f with SMTP id j6-20020a170902c08600b001d0977e299fmr719436pld.24.1701871056607; Wed, 06 Dec 2023 05:57:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701871056; cv=none; d=google.com; s=arc-20160816; b=xWOgVoEct7jUHayVLYlNEcdEPKz6axN8EhAorK5ZbEQB/VxqPrrIow512MqUps7Bdd 1bR/HXRPbfF5+gRLS+6rzy1kfnQ8DTI0LMlxNYsRF/2dxtfH6PVQLPZM1A0E8m/RgHbQ rQ/5FXlYPVdvnqBJHZJXsuHkhEgl7XsgRZCMVomnhn5LWTVy1PjZe17IiPay39a5Y4Hq dlFnPMQ0bIEB/oVvVCxDOIB3cpgy35ejjajSjgk5X8Tuf825DJgr9TA0XPhBFD7dc+b7 d/yeSHVergIRk1pKE525x+qvbuacWxmuvybpfSMar/A5q93caMp9bnR5xd5CBKGDGZK2 Ssfw== 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=i6leibc9KVGhDFO57vzUjuEC1g9Shhhw6R6lNbUnfvA=; fh=y9O85gpSlRnlnUAUR10NeVsgFPHgwv9MZqCI0LvWjdw=; b=ZiX64B2iU8WcNzXBCfBYBQgwvyG9FpMLfKhpybBNbVkfrvq49M0TOEIGH+7p71WfOp hSerQcQUOuorZZHBW0Cs3ws5XhAUDbUTHoWyLXdxuDnvySSpu88NuNCWS9gWk4j5GU3l 5WH0xuhwIUp2GExGm1zk3LoQLdvD93SqQEF71cbRTJTXS1I5GDck/sw8R+nsRLNkwP82 Y1T0VJm7OyoxqOl1FRdzhMldZh/RzTtYYT16XDTKbi8/Vta9+q/opjWS/Bv2Y7BHyNz/ 0GtoZhpoTdquYQlkP6fW35hEwNXF8DPYqqDs7OXK6j3ISauKOtIEELpkIdtJ+aXsApb7 ZwUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="i449a/e+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id w8-20020a170902904800b001cff3cae848si11343193plz.37.2023.12.06.05.57.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 05:57:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="i449a/e+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5436C8325D3C; Wed, 6 Dec 2023 05:57:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378655AbjLFN5O (ORCPT + 99 others); Wed, 6 Dec 2023 08:57:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378633AbjLFN5N (ORCPT ); Wed, 6 Dec 2023 08:57:13 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3757AA4 for ; Wed, 6 Dec 2023 05:57:19 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-54cd2281ccbso4042996a12.2 for ; Wed, 06 Dec 2023 05:57:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1701871037; x=1702475837; darn=vger.kernel.org; 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=i6leibc9KVGhDFO57vzUjuEC1g9Shhhw6R6lNbUnfvA=; b=i449a/e+vxx/uHSii/PeMuJHEg499UyYhNk7YmtND6C7n577pds4XkKsf6rECSlnzL /UvJpBLlCP24EA96a2ECi/ugyr8zSgBsGpu2g2yCa4Hbc0+6oWMY0DUcS4cAP5S/BDbf /Hfh59KJvDuWw7oM4SimI3I1ULfqtKxF8PIg8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701871037; x=1702475837; 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=i6leibc9KVGhDFO57vzUjuEC1g9Shhhw6R6lNbUnfvA=; b=vHcnFlB7QVT2+/vynsNElOToF5VITZlNqkjOzF4CuWYA+yGXU9XhG+FiBfHGgRWHbc sNWcadGSeGS80qT6GU151zWn/zsS8nDR6gluUKhUixpebrWnodGTwpTNW4zJbdeqyIhO X/tc3ncfN+1rELU4KufUu+uih8tmHFeOAxChraINsa1d0NfwgRYKwddCIOJ7LocpkZF7 fydZ/HzzlNhohlAe86YYs1BnSFewqDACO0Wp26aJswqvUdwLOF1XxpFaolg6QNfEr34p cIQ4TjmgpStJ7NB1H3Fq8DjKtFGsLwlfwdhdamu3uhZ0LGqyj7Ff0K8dQS7x4SfdSsSC qMVg== X-Gm-Message-State: AOJu0YzEpFOsgbE30aPRbwW6GaLPLGoLtLwV9Ep98SM/CckzWZQcQhLe lpvA5U7Giz7g503UhxFVcfg54tMubIqPg23mTtOJnw== X-Received: by 2002:a17:906:3f08:b0:a14:d6e2:fb1f with SMTP id c8-20020a1709063f0800b00a14d6e2fb1fmr615826ejj.10.1701871037673; Wed, 06 Dec 2023 05:57:17 -0800 (PST) MIME-Version: 1.0 References: <20231205105341.4100896-1-dario.binacchi@amarulasolutions.com> <20231205105341.4100896-3-dario.binacchi@amarulasolutions.com> In-Reply-To: From: Michael Nazzareno Trimarchi Date: Wed, 6 Dec 2023 14:57:06 +0100 Message-ID: Subject: Re: [PATCH v4 02/10] drm/bridge: Fix a use case in the bridge disable logic To: Jagan Teki Cc: Dario Binacchi , Dave Stevenson , linux-kernel@vger.kernel.org, Amarula patchwork , Andrzej Hajda , Daniel Vetter , David Airlie , Frieder Schrempf , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Robert Foss , Thomas Zimmermann , dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 06 Dec 2023 05:57:33 -0800 (PST) Hi Jagan On Wed, Dec 6, 2023 at 2:31=E2=80=AFPM Jagan Teki wrote: > > Hi Dario, > > On Wed, Dec 6, 2023 at 6:57=E2=80=AFPM Dario Binacchi > wrote: > > > > Hi Dave and Jagan, > > > > On Tue, Dec 5, 2023 at 4:39=E2=80=AFPM Dave Stevenson > > wrote: > > > > > > Hi Dario > > > > > > On Tue, 5 Dec 2023 at 10:54, Dario Binacchi > > > wrote: > > > > > > > > The patch fixes the code for finding the next bridge with the > > > > "pre_enable_prev_first" flag set to false. In case this condition i= s > > > > not verified, i. e. there is no subsequent bridge with the flag set= to > > > > false, the whole bridge list is traversed, invalidating the "next" > > > > variable. > > > > > > > > The use of a new iteration variable (i. e. "iter") ensures that the= value > > > > of the "next" variable is not invalidated. > > > > > > We already have https://patchwork.freedesktop.org/patch/529288/ that > > > has been reviewed (but not applied) to resolve this. What does this > > > version do differently and why? > > > > My patches only affect drm_atomic_bridge_chain_post_disable(), whereas > > Jagan's patch affects both > > drm_atomic_bridge_chain_post_disable() and drm_atomic_bridge_chain_pre_= enable(). > > I tested Jagan's patch on my system with success and I reviewed with > > Michael Trimarchi the > > drm_atomic_bridge_chain_pre_enable() fixing and we think it's okay. > > We also believe that our changes to post_disable() are better, as we > > set the 'next' variable only when required, > > and the code is more optimized since the list_is_last() is not called > > within the loop. > > Would it be possible to use Jagan's patch for fixing > > drm_atomic_bridge_chain_pre_enable() and mine for > > fixing drm_atomic_bridge_chain_post_disable()? > > > > Can you please share the post-disabled bridge chain list with the > below example before and after your change? We have already git commit the description in how the patch affects the post_disable. As Dario reported your patch is ok even in our use case. We don't have a real use case as the one you describe. Can we know how you test it in this use case here? Can you test our patches of post_disable? Thanks Michael > > Example: > - Panel > - Bridge 1 > - Bridge 2 pre_enable_prev_first > - Bridge 3 > - Bridge 4 pre_enable_prev_first > - Bridge 5 pre_enable_prev_first > - Bridge 6 > - Encoder > > Thanks, > Jagan.