Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAAAFC678D5 for ; Wed, 8 Mar 2023 10:25:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbjCHKZX (ORCPT ); Wed, 8 Mar 2023 05:25:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230383AbjCHKZS (ORCPT ); Wed, 8 Mar 2023 05:25:18 -0500 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DEEEB4829 for ; Wed, 8 Mar 2023 02:25:12 -0800 (PST) Received: by mail-io1-xd31.google.com with SMTP id f14so6589735iow.5 for ; Wed, 08 Mar 2023 02:25:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1678271111; 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=vk4eRG0LrzbHDKK00dsD4iBuyY/4ZAQyp3TpAqYJX3Q=; b=EftcY01/oCV/raNvODG0Gy7CAtfgmEemBydzNyAQ/5Z8JDAjqoXLq8pFoIQpGEcWYn nu75sxupN/sQVT1eTmTNkYDC4NGXFqPitKQCL4odiDhzr0iZEhGrzCytxWkP57LBugz1 ovgS6RvevaA0mF6dPaeC7GeF5zW7+oi9/DjqY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678271111; 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=vk4eRG0LrzbHDKK00dsD4iBuyY/4ZAQyp3TpAqYJX3Q=; b=1kfWmxUbiVejgVh7DQTsPFPy3ZmR5/S5ETJGlgOEwT9T7ofJFWpx3ZchpSbJrvAFEr yDlX86HW8vjuvDDChqgYt0yvAI53uzG9PPxoBAR6z+4bK7PZLyAG4hQcnAyb9eyHlMM3 0gySZ+A9uDG9Md9v4Ae56SxJfSBH90dhG9gCh0PVsXICmC75uN5BdeyzT3eS/Xtas0HS 3MNeNPb0J4JSye+0xVrr0P5lrplbTT0IztM8vgQeqU4eaBS3a/CrpdGDdE/tY9187IZQ NhieMCgNvoyp7Vb+tmXyawotEKnNypn1DnnsLPRvpLBjsTOwOpZ4+mLM31sosvjwJigJ rh4g== X-Gm-Message-State: AO0yUKWq74Qh+SrPbaTjEiuXvgUL2UgCuX2/ihJSyjNRA0QsXXmV4TgQ fFZm00yzs+WP6ry8dmzZT1ed+KFIQMkOHVLs+v8l2A== X-Google-Smtp-Source: AK7set+QhdrKShMQqdGse4Hq6359ifcnSCbtiqiWfe6LuBFF3HsmSOEUtWdcF89t709UweFPbwi9ZG1akiBqjkVk2co= X-Received: by 2002:a05:6602:154:b0:74c:8243:9290 with SMTP id v20-20020a056602015400b0074c82439290mr8204213iot.4.1678271111488; Wed, 08 Mar 2023 02:25:11 -0800 (PST) MIME-Version: 1.0 References: <20230303143350.815623-1-treapking@chromium.org> <20230303143350.815623-6-treapking@chromium.org> In-Reply-To: From: Pin-yen Lin Date: Wed, 8 Mar 2023 18:25:00 +0800 Message-ID: Subject: Re: [PATCH v13 05/10] drm/bridge: anx7625: Check for Type-C during panel registration To: Andy Shevchenko Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J . Wysocki" , Prashant Malani , Benson Leung , Guenter Roeck , Xin Ji , Javier Martinez Canillas , Lyude Paul , linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , chrome-platform@lists.linux.dev, =?UTF-8?B?TsOtY29sYXMgRiAuIFIgLiBBIC4gUHJhZG8=?= , Marek Vasut , Hsin-Yi Wang , devicetree@vger.kernel.org, Allen Chen , dri-devel@lists.freedesktop.org, Thomas Zimmermann , Stephen Boyd , linux-acpi@vger.kernel.org, =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HI Andy, On Mon, Mar 6, 2023 at 7:52=E2=80=AFPM Andy Shevchenko wrote: > > On Fri, Mar 03, 2023 at 10:33:45PM +0800, Pin-yen Lin wrote: > > The output port endpoints can be connected to USB-C connectors. > > Running drm_of_find_panel_or_bridge() with such endpoints leads to > > a continuous return value of -EPROBE_DEFER, even though there is > > no panel present. > > > > To avoid this, check for the existence of a "mode-switch" property in > > the port endpoint, and skip panel registration completely if so. > > ... > > > + port_node =3D of_graph_get_port_by_id(np, 1); > > + count =3D typec_mode_switch_node_count(&port_node->fwnode); > > Do you need to drop reference count here? > (I don't know myself, so, please check this) > > If no, patch LGTM. The helper completes the for-loop of fwnode_for_each_child_node, which drops the reference count whenever the next node is get. So we don't need drop the reference count here. > > > + if (count) > > + return 0; > > -- > With Best Regards, > Andy Shevchenko > > Best regards, Pin-yen