From mboxrd@z Thu Jan 1 00:00:00 1970 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 D211DC4321E for ; Thu, 24 Nov 2022 12:25:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229507AbiKXMZL (ORCPT ); Thu, 24 Nov 2022 07:25:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229700AbiKXMZF (ORCPT ); Thu, 24 Nov 2022 07:25:05 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76A48D906B; Thu, 24 Nov 2022 04:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669292701; x=1700828701; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=KrpjK4F7jdU1QpIQ8SnZenQcGxWFonbm3xOqctiSeP0=; b=VmrG2TAyOI1rQbt/Sj1qiXTqaqNwKfs21ATwpT0dR8o3yuvX+QuyTLBq qAUGbL3ScpKJIo8XP8vWKuoAL9IE9ho6Eked4m5B28k4eRSdkYjD1Nb3j ukdjKUVXTmdSMPCCBpDQ+ZbA9i1a0+lJKiHeJSCG8q333q2cE8UFaj35W IwyuHSjgidBWrWij4kqaVPZKE3iS/0AI0xNB9Uj9BWDrZsILOY/vccV8Q NtbH2Wzle4H72XL2NfNpqpi/9PetLh71PsNr+LS2ZJ2c14xz3MzBs03e4 TkABhvWYRoOTvU5S4o4fzOEAdBiYssuYLpqb2yh7IcOVqnbx9yPWQ+Mvj g==; X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="297649364" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="297649364" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 04:25:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="592905313" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="592905313" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP; 24 Nov 2022 04:24:52 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oyBHd-00Gjxg-1Q; Thu, 24 Nov 2022 14:24:49 +0200 Date: Thu, 24 Nov 2022 14:24:49 +0200 From: Andy Shevchenko To: Pin-yen Lin 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 , Javier Martinez Canillas , Stephen Boyd , dri-devel@lists.freedesktop.org, Hsin-Yi Wang , Thomas Zimmermann , devicetree@vger.kernel.org, chrome-platform@lists.linux.dev, linux-acpi@vger.kernel.org, Marek Vasut , Xin Ji , Lyude Paul , =?iso-8859-1?Q?N=EDcolas_F_=2E_R_=2E_A_=2E?= Prado , AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, Allen Chen Subject: Re: [PATCH v6 2/7] platform/chrome: cros_ec_typec: Purge blocking switch devlinks Message-ID: References: <20221124102056.393220-1-treapking@chromium.org> <20221124102056.393220-3-treapking@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221124102056.393220-3-treapking@chromium.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Thu, Nov 24, 2022 at 06:20:51PM +0800, Pin-yen Lin wrote: > From: Prashant Malani > > When using OF graph, the fw_devlink code will create links between the > individual port driver (cros-ec-typec here) and the parent device for > a Type-C switch (like mode-switch). Since the mode-switch will in turn > have the usb-c-connector (i.e the child of the port driver) as a > supplier, fw_devlink will not be able to resolve the cyclic dependency > correctly. > > As a result, the mode-switch driver probe() never runs, so mode-switches > are never registered. Because of that, the port driver probe constantly > fails with -EPROBE_DEFER, because the Type-C connector class requires all > switch devices to be registered prior to port registration. > > To break this deadlock and allow the mode-switch registration to occur, > purge all the usb-c-connector nodes' absent suppliers. This eliminates > the connector as a supplier for a switch and allows it to be probed. ... > + /* > + * OF graph may have set up some device links with switches, since connectors have their > + * own compatible. Purge these to avoid a deadlock in switch probe (the switch mistakenly > + * assumes the connector is a supplier). > + */ A bit too long lines... > + if (dev->of_node) Why do you need this check? > + device_for_each_child_node(dev, fwnode) > + fw_devlink_purge_absent_suppliers(fwnode); -- With Best Regards, Andy Shevchenko