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 ACB3CC3DA7A for ; Thu, 5 Jan 2023 15:34:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229979AbjAEPeL (ORCPT ); Thu, 5 Jan 2023 10:34:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234277AbjAEPeC (ORCPT ); Thu, 5 Jan 2023 10:34:02 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A60F14A960; Thu, 5 Jan 2023 07:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672932840; x=1704468840; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=d9qCGfnbvV19YiK+oGf2OAoM9AmsakV5jBBNht6wFH0=; b=IFBsva+pwFcMnFXmF6WqtBpxmXCkyLXn+93jkotoqT0Y5l7dC6dHu5VE c4SrYSR89Q1OxRJdT+yLOf06/CtexDWMRllLZr/bc3tejspHMOZBHRadq TkdFtP9TmezNQRJ8cV7uYq994fL6b1vbLy68PNi64eArxr9FG07TEiQGs asucxoVj1lwhPmVNxsT92FQvUSADmP6uT0P1U/WUnbQ30X6WOakdrD3bk jlh7ivskkNGcxJOIYbeKTDwa8Xh01uYhd6cqCBTLFRL3K3JBEaw3dxC7U uFritCUC5ml9nBgAQY4TXQ3iLmW/ZG0Ty4uX7baxYPH9rEquJeD8jaR2B w==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="349448702" X-IronPort-AV: E=Sophos;i="5.96,303,1665471600"; d="scan'208";a="349448702" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2023 07:33:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="797964616" X-IronPort-AV: E=Sophos;i="5.96,303,1665471600"; d="scan'208";a="797964616" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP; 05 Jan 2023 07:33:03 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pDSEl-004oxQ-31; Thu, 05 Jan 2023 17:32:59 +0200 Date: Thu, 5 Jan 2023 17:32:59 +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 , =?iso-8859-1?Q?N=EDcolas_F_=2E_R_=2E_A_=2E?= Prado , Xin Ji , AngeloGioacchino Del Regno , Thomas Zimmermann , Hsin-Yi Wang , linux-kernel@vger.kernel.org, Allen Chen , linux-acpi@vger.kernel.org, Lyude Paul , dri-devel@lists.freedesktop.org, chrome-platform@lists.linux.dev, Javier Martinez Canillas , Marek Vasut , devicetree@vger.kernel.org, Stephen Boyd Subject: Re: [PATCH v7 2/9] platform/chrome: cros_ec_typec: Purge blocking switch devlinks Message-ID: References: <20230105132457.4125372-1-treapking@chromium.org> <20230105132457.4125372-3-treapking@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230105132457.4125372-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, Jan 05, 2023 at 09:24:50PM +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. > Signed-off-by: Prashant Malani > > Signed-off-by: Pin-yen Lin Tag block mustn't have the blank line(s). ... > + /* > + * 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). > + */ Perhaps even /* * 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). */ ? > + if (dev->of_node) I would use if (dev_of_node(dev)), but it's up to you and maintainers. > + device_for_each_child_node(dev, fwnode) > + fw_devlink_purge_absent_suppliers(fwnode); -- With Best Regards, Andy Shevchenko