From patchwork Tue Feb 7 01:41:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 5042 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2582215wrn; Mon, 6 Feb 2023 17:44:23 -0800 (PST) X-Google-Smtp-Source: AK7set+UQnsx6ncHG7i9I8WqFQbkoMN5biaqQBfrZzZ1VyChrLWsB1GoRI9CRCEVpXFJJQoAlR57 X-Received: by 2002:a17:902:ea0d:b0:198:a845:fb96 with SMTP id s13-20020a170902ea0d00b00198a845fb96mr1313497plg.20.1675734263288; Mon, 06 Feb 2023 17:44:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675734263; cv=none; d=google.com; s=arc-20160816; b=cAfvptaLfpREhD0ysCRvXdb+YmR9MCHu1Mw0xAuzW4NLLmcXc1pkT2CQ/11oqAfiPQ l3Ri8eWy8v6oZFG6v3zbX8pS53/0NDgQin7b1FKrGGgNqIlWZLz6CVIxeUicti9+OXmY WhBNTkgU/9wRofX/CJF5UBvLUS0/Qr2NWLv6KYGG/XkC1P2f17dCl21m4cPCek2g4KzP mOjEKZdLtejlWW3vjRyzirFKdLYgx30ZWklChyDfwMzVH0ecEDNtAUeHRnqEDvKXuMNb kWvtDfcmto+lnbieugKHT7MjwbpCB+tOmMWzf63RnRoBHc5kVKMSGQwlER4uLlFZ8Zom oL6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=5Lzwmfi68lbdrUMbtc6adBz2FR099zCl1IbhLNZPH1k=; b=OsAVgr288XEl1fNmXodn/ffv4dY2K95igxP4/QuMQ5HYQZ8YahQUYkIj3uGcUasMmd vML22nidUsIvdGB1ZZ51jcUdK5kPqNK0em9L+ZdC2O9uWqiETBCZoT78m3dReCtHN1pR sIYLSmjK2uxNMHEWRQY5vbmXF2ZbCGOJSW/BLQzUu3waHnl5pSkCHlLgbPMcnU6yPYVv tlYoquX4NH5rwYg6T2+WffdLxPKUTZJ5ceqcz2nKG2K5tXgwmV4NS8oQVOsf3KidO73o lIkwhFgvNcFVWu4N6G6VdoCGMArB8ocsmzCjZ/H6r28pWpkdEN7I/u4sT/FXcQrxuM5v Tc2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AiCfxSp7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d10-20020a170902ceca00b00192e272f71dsi14150551plg.192.2023.02.06.17.44.10; Mon, 06 Feb 2023 17:44:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AiCfxSp7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230191AbjBGBmQ (ORCPT + 99 others); Mon, 6 Feb 2023 20:42:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbjBGBmN (ORCPT ); Mon, 6 Feb 2023 20:42:13 -0500 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 548C310A9A for ; Mon, 6 Feb 2023 17:42:11 -0800 (PST) Received: by mail-pf1-x449.google.com with SMTP id 144-20020a621896000000b0059e73803cdcso3164457pfy.12 for ; Mon, 06 Feb 2023 17:42:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=5Lzwmfi68lbdrUMbtc6adBz2FR099zCl1IbhLNZPH1k=; b=AiCfxSp7rvYdlgl0hl4blBlUcDhKmP2ipQWAy9D+v4OffGK0tOAZAVe6vj1m5Qqb1N EjVKK0seT/KHqRY31wLEaQnNOfPf2YnCeLt3UYVQcttmFjIdZOKxHDXNZbOFbd6VC/Qs YNWCMN8S77uoudgWgBuiUlIQHmrkrOS93xAFfs/JCgWixMPTZKa7k1u41pU7om9nNL9z xPGzdgebPBxzGe2RJ+Q4NwYLmakenKFtNcj/xZeImi7KWdRpF2+9iQmiJWyzIbJMCV4D E4rbGyjlteWJX7skmBf/WRPXHpbjKXCwbF2v1IQwRsB/gvBU/gqaLXL7ZiasmH3GDDgW 1JOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5Lzwmfi68lbdrUMbtc6adBz2FR099zCl1IbhLNZPH1k=; b=d4h0L1sdVIuUFdFnVViP0rR0K3B8+1x36tREmKSfX6KMZiOIPQ67TSj5JNpFl6H1i9 MlAjX2ppDvK2MZKGBmNlDRcnR/nGtZQNMxs9hfYnPo9VEKYapoRelfOcU5r3PWUf8N+L AHbeliMX0cJxWFxWvzL1ea/QFRECmbhn7rPYyuOUEvCzZuQF8DnV8x3rvU3EU6u2cFd8 bWxDK7Z9kw4bdVx+Atjx4W8GDBsVgSHAgc+8dm51LP255PhAlz00iOepDUYTrrSo4Nmk pZaoKxps3LHsOwmOhOfDcNUELSqh1nohI6lKa6fxx9K6aHHdi2NahTPhGgxAHG5+JOm6 FMmA== X-Gm-Message-State: AO0yUKVdiiW0vzN4hyfBOVsItovAX0UVsj9b8jye08fw6UHn0fX4Xw+O 68wKNXAJse48OP/G85fW5A8LBfuApRAKv8I= X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:ae1:aba6:f21c:4a94]) (user=saravanak job=sendgmr) by 2002:a17:90a:5a05:b0:22c:46e:6510 with SMTP id b5-20020a17090a5a0500b0022c046e6510mr459339pjd.9.1675734130693; Mon, 06 Feb 2023 17:42:10 -0800 (PST) Date: Mon, 6 Feb 2023 17:41:52 -0800 Message-Id: <20230207014207.1678715-1-saravanak@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog Subject: [PATCH v3 00/12] fw_devlink improvements From: Saravana Kannan To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Sudeep Holla , Cristian Marussi , Linus Walleij , Bartosz Golaszewski , Thomas Gleixner , Marc Zyngier , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Frank Rowand , Geert Uytterhoeven , Magnus Damm , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Len Brown , Saravana Kannan , " =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= " Cc: Abel Vesa , Alexander Stein , Tony Lindgren , Geert Uytterhoeven , John Stultz , Doug Anderson , Guenter Roeck , Dmitry Baryshkov , Maxim Kiselev , Maxim Kochetkov , Luca Weiss , Colin Foster , Martin Kepplinger , Jean-Philippe Brucker , Vladimir Oltean , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-acpi@vger.kernel.org X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756132498214039817?= X-GMAIL-MSGID: =?utf-8?q?1757134730811581207?= Naresh, Tony, Abel, Geert, Dmitry, Maxim(s), Miquel, Luca, Doug, Martin, Jean-Philippe, Can I get your Tested-by's for this v3 series please? Vladimir, Ccing you because DSA's and fw_devlink have known/existing problems (still in my TODOs to fix). But I want to make sure this series doesn't cause additional problems for DSA. All, This patch series improves fw_devlink in the following ways: 1. It no longer cares about a fwnode having a "compatible" property. It figures this out more dynamically. The only expectation is that fwnodes that are converted to devices actually get probed by a driver for the dependencies to be enforced correctly. 2. Finer grained dependency tracking. fw_devlink will now create device links from the consumer to the actual resource's device (if it has one, Eg: gpio_device) instead of the parent supplier device. This improves things like async suspend/resume ordering, potentially remove the need for frameworks to create device links, more parallelized async probing, and better sync_state() tracking. 3. Handle hardware/software quirks where a child firmware node gets populated as a device before its parent firmware node AND actually supplies a non-optional resource to the parent firmware node's device. 4. Way more robust at cycle handling (see patch for the insane cases). 5. Stops depending on OF_POPULATED to figure out some corner cases. 6. Simplifies the work that needs to be done by the firmware specific code. The v3 series has gone through my usual testing on my end and looks good to me. Thanks, Saravana [1] - https://lore.kernel.org/lkml/20220810060040.321697-1-saravanak@google.com/ [2] - https://lore.kernel.org/lkml/CAGETcx-JUV1nj8wBJrTPfyvM7=Mre5j_vkVmZojeiumUGG6QZQ@mail.gmail.com/ v1 -> v2: - Fixed Patch 1 to handle a corner case discussed in [2]. - New patch 10 to handle "fsl,imx8mq-gpc" being initialized by 2 drivers. - New patch 11 to add fw_devlink support for SCMI devices. v2 -> v3: - Addressed most of Andy's comments in v2 - Added Colin and Sudeep's Tested-by for the series (except the imx and renesas patches) - Added Sudeep's Acked-by for the scmi patch. - Added Geert's Reviewed-by for the renesas patch. - Fixed gpiolib crash reported by Naresh. - Patch 6: Fix __fwnode_links_move_consumers() to preserve fwnode link flags. - New Patch 12 to fix nvmem-cells issue reported by Maxim(s)/Miquel. - Deleted some stale function doc in Patch 8 Cc: Abel Vesa Cc: Alexander Stein Cc: Tony Lindgren Cc: Sudeep Holla Cc: Geert Uytterhoeven Cc: John Stultz Cc: Doug Anderson Cc: Guenter Roeck Cc: Dmitry Baryshkov Cc: Maxim Kiselev Cc: Maxim Kochetkov Cc: Miquel Raynal Cc: Luca Weiss Cc: Colin Foster Cc: Martin Kepplinger Cc: Jean-Philippe Brucker Cc: Vladimir Oltean Saravana Kannan (12): driver core: fw_devlink: Don't purge child fwnode's consumer links driver core: fw_devlink: Improve check for fwnode with no device/driver soc: renesas: Move away from using OF_POPULATED for fw_devlink gpiolib: Clear the gpio_device's fwnode initialized flag before adding driver core: fw_devlink: Add DL_FLAG_CYCLE support to device links driver core: fw_devlink: Allow marking a fwnode link as being part of a cycle driver core: fw_devlink: Consolidate device link flag computation driver core: fw_devlink: Make cycle detection more robust of: property: Simplify of_link_to_phandle() irqchip/irq-imx-gpcv2: Mark fwnode device as not initialized firmware: arm_scmi: Set fwnode for the scmi_device mtd: mtdpart: Don't create platform device that'll never probe drivers/base/core.c | 449 +++++++++++++++++++++----------- drivers/firmware/arm_scmi/bus.c | 3 +- drivers/gpio/gpiolib.c | 7 + drivers/irqchip/irq-imx-gpcv2.c | 1 + drivers/mtd/mtdpart.c | 10 + drivers/of/property.c | 84 +----- drivers/soc/imx/gpcv2.c | 2 +- drivers/soc/renesas/rcar-sysc.c | 2 +- include/linux/device.h | 1 + include/linux/fwnode.h | 12 +- 10 files changed, 344 insertions(+), 227 deletions(-) Tested-by: Luca Weiss # qcom/sm7225-fairphone-fp4 Tested-by: Douglas Anderson Tested-by: Geert Uytterhoeven Tested-by: Jean-Philippe Brucker Tested-by: Dmitry Baryshkov # Qualcomm RB3