From patchwork Sat Feb 10 03:05:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 199194 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1269459dyd; Fri, 9 Feb 2024 19:10:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFE6f4cEowouCq4fU96DMtW9FyB5ep7ZIAWb6zNhlsOEs4Uyv2osXEDX75u9jjVxUJSXijJ X-Received: by 2002:a05:6870:b09:b0:219:7535:8d50 with SMTP id lh9-20020a0568700b0900b0021975358d50mr1227110oab.23.1707534622781; Fri, 09 Feb 2024 19:10:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707534622; cv=pass; d=google.com; s=arc-20160816; b=bzgPqIJ1jidt7EszOPiGfUCaYqwzIeKC1JT/f/iYBfK4XNfjJGrz1nUQHLdAyUXVzB 8KCjnryWYEMIebnNUcJRhRrO2N82QTbJ9jctNj6js090/01g1vRJ22pHcEKZf5tpcZ34 j21Fbyh8+ckyk98hxY/lgyBh5yNNsvJd/5r9GHH882kJmRsPYe+SORnkedzEOYrvb3wx JCRJw8CfWUaVoKMVoyrKXn0JJfZNlXI76epCts4NAx1HVeC+dlP08FNHtXF/wFoPm9ZQ z+aqoL9jOauSAi7Ra2UmZ0nG0TJrS2neC3C0Yxu+d2DLBoKD8zbNFJ8DrMd4t8gkGLpk XKvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :dkim-signature; bh=F5s7UC2LI5606ztlkySRh4zEDw9ZNIX2+7Suzh+XsVU=; fh=eU2TmqA+mlKzZolEgybrglSaKKYm7+CF7qZjR1/qO0g=; b=d0aD36XQEB14wUOYdoGn9gZA7Lx3PopR5Ww/Ws7eClOonbDwKK44PspyxZWpdqcg1l NNJ6vbyO37pzYJEG/IrnuUyU6aohaBH767rLCfjsHpniVWj3BYMSI1lpkqIj+Ne9lwo2 JDGUZJqD1SrnUakkMV05jq7Oo2UZq75JraIWtijXFD4JJoK3LfN5k1skw8gvpioD3v9p JuBInNT3TsYrJe1Y4/p/VjSIZOpG5e5Wc5ADikCUTYBPVAr9xcQHeYdEMqVf5lF7h3in Bwea3aVLsFV0kdv8k1C1cpMmz5viwJf34IFYY3ghu6Nx2UhUUgaHa8yK7VFmAkReVH3p JlLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=pvopdkzM; arc=pass (i=1 spf=pass spfdomain=flex--saravanak.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-60260-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60260-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCVKU3iY9mrxhBe88ASvYT6NMtM0cTflofBVIIb8c/qCiJIwd/p1zgcY3IpYY5iJ81Fj/NMWkr6DtfXc9i1cyaiRNqZmxg== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id f18-20020a637552000000b005dc42c4775csi2671144pgn.822.2024.02.09.19.10.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 19:10:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60260-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=pvopdkzM; arc=pass (i=1 spf=pass spfdomain=flex--saravanak.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-60260-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60260-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A055EB2792F for ; Sat, 10 Feb 2024 03:07:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50A0B32C9C; Sat, 10 Feb 2024 03:06:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pvopdkzM" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 023EF29D03 for ; Sat, 10 Feb 2024 03:06:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707534372; cv=none; b=tNZuROkC2iW7xdmNik6qBDbS7INf6kqHuO2dRMPkvotnWDlGFTLxq9tV1Hc6XevRCbtO+eDAJGrI1sEY6jOLAVzxbdGVNlC/GsDFGHMSxjsHx6myh2BEWJVm8QovKCqzqRkbP4SOylWiUSn/krJLVPN6YyNMuMMNNEe5Rv2Kkqs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707534372; c=relaxed/simple; bh=09nOuvy1xCjK1iYqCopDQXrnPVKpNm2a5rJaJXsm9lU=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Cc:Content-Type; b=V62XNQCNaSyQs0APOrTIRyAdFp5qKgLp/ECrs9ap1hd4NgZqVylNQijGT+GHg8JlBCW1odd3sWPTAoim3bP35ifb5By7CAXRjhQIykicoKAyFXp5ibnzUt3UA3zdDlPNYtRi2V5fPugfkX41IccSzj/ziUYQbjQXnKLCSYTddmQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--saravanak.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=pvopdkzM; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--saravanak.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dc647f65573so2774481276.2 for ; Fri, 09 Feb 2024 19:06:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707534370; x=1708139170; darn=vger.kernel.org; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=F5s7UC2LI5606ztlkySRh4zEDw9ZNIX2+7Suzh+XsVU=; b=pvopdkzMyY7gcSDnmuhMe1Lrbk1BKJR51rbeNR4MJLexjtGVOpCgs29lJ/dds4s8ZQ ECWW/fQO6z9RAjRwBm4vQXP9XTyrPdmqm+UIvEAkCwh680T3W4TY9rOHlqDbQULHo7aK g7eAqBA1kpjkaqgGNM2mPe1eqhWyqI0bcmpk7BTziBBYJsFEzyqzit+Otvz/EhnFxzxq U9Dj4wP6V25ucXHOLUR4KAD0yvVCfiFo8CKXfTDB8zWUE/WicBMsrE/XfxJwTnUK54HR wr+m7byxq6mJw9Vsgvdq0s5oOMMrcpRmKd61MAX3ws+RdxKOpydJtWCE3ct4Jq3ELdbn nRmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707534370; x=1708139170; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=F5s7UC2LI5606ztlkySRh4zEDw9ZNIX2+7Suzh+XsVU=; b=Rb6o34L9ahejux1xxZRlV62Ni64Ojrxo8jYdKz4Zd+QgiqB2KCneexTEbxIaFKlPEw CHHRRTeTUwtZZBGrL7oox4KOjBpIcE3lQ7d3pOX6aM/EY/r6cksU6naqEm41PTHNKb6S 2/lbVwM1LUwt0lTFTJMircBumcWGZN1NfbjphyENuxhSB3O7mj0L/qc5DbVSzKycTjMr f4TdDYuiz5m8qtSVMunOgvhc7dkRlxwa0RUsMsI3pgfLTnDZ/BRfgUSBWfLn8QZIyYJg RCwL5+FMSQM4GtOyaYFxyzmF9zkWvg79pGlt/+omE/uJg7Yy1z/WD5HyG+ZSHlxV/U60 pdCQ== X-Gm-Message-State: AOJu0Yw5OBeITHvg/4pBU5CcFCSTjXicV+4FvylRAc4p1ycPjx7dDEKS r+dIDP2AOQQYD710jU8iSV27czNGOsg9A3dEtHSMd9sehrdOpfXgoA8RkwzNo8XknIFCC7zhE3h LzMF03J7uz6JDtw== X-Received: from saravanak.san.corp.google.com ([2620:15c:2d:3:6b44:91e7:13e1:5d92]) (user=saravanak job=sendgmr) by 2002:a05:6902:1006:b0:dc6:ee88:ced2 with SMTP id w6-20020a056902100600b00dc6ee88ced2mr254743ybt.12.1707534369357; Fri, 09 Feb 2024 19:06:09 -0800 (PST) Date: Fri, 9 Feb 2024 19:05:47 -0800 In-Reply-To: <20240210030549.4048795-1-saravanak@google.com> Message-Id: <20240210030549.4048795-5-saravanak@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240210030549.4048795-1-saravanak@google.com> X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Subject: [PATCH v1 4/4] of: property: fw_devlink: Add support for "post-init-supplier" property From: Saravana Kannan To: Saravana Kannan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , "Rafael J. Wysocki" , Ard Biesheuvel , Frank Rowand , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Len Brown Cc: kernel-team@android.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-efi@vger.kernel.org, linux-acpi@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790479824964970722 X-GMAIL-MSGID: 1790479824964970722 Add support for this property so that dependency cycles can be broken and fw_devlink can do better probe/suspend/resume ordering between devices in a dependency cycle. Signed-off-by: Saravana Kannan --- drivers/of/property.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/of/property.c b/drivers/of/property.c index 751c11a28f33..dce451161c99 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1066,7 +1066,8 @@ of_fwnode_device_get_match_data(const struct fwnode_handle *fwnode, } static void of_link_to_phandle(struct device_node *con_np, - struct device_node *sup_np) + struct device_node *sup_np, + u8 flags) { struct device_node *tmp_np = of_node_get(sup_np); @@ -1085,7 +1086,8 @@ static void of_link_to_phandle(struct device_node *con_np, tmp_np = of_get_next_parent(tmp_np); } - fwnode_link_add(of_fwnode_handle(con_np), of_fwnode_handle(sup_np), 0); + fwnode_link_add(of_fwnode_handle(con_np), of_fwnode_handle(sup_np), + flags); } /** @@ -1198,6 +1200,8 @@ static struct device_node *parse_##fname(struct device_node *np, \ * to a struct device, implement this ops so fw_devlink can use it * to find the true consumer. * @optional: Describes whether a supplier is mandatory or not + * @fwlink_flags: Optional fwnode link flags to use when creating a fwnode link + * for this property. * * Returns: * parse_prop() return values are @@ -1210,6 +1214,7 @@ struct supplier_bindings { const char *prop_name, int index); struct device_node *(*get_con_dev)(struct device_node *np); bool optional; + u8 fwlink_flags; }; DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells") @@ -1240,6 +1245,7 @@ DEFINE_SIMPLE_PROP(leds, "leds", NULL) DEFINE_SIMPLE_PROP(backlight, "backlight", NULL) DEFINE_SIMPLE_PROP(panel, "panel", NULL) DEFINE_SIMPLE_PROP(msi_parent, "msi-parent", "#msi-cells") +DEFINE_SIMPLE_PROP(post_init_supplier, "post-init-supplier", NULL) DEFINE_SUFFIX_PROP(regulators, "-supply", NULL) DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells") @@ -1349,6 +1355,10 @@ static const struct supplier_bindings of_supplier_bindings[] = { { .parse_prop = parse_regulators, }, { .parse_prop = parse_gpio, }, { .parse_prop = parse_gpios, }, + { + .parse_prop = parse_post_init_supplier, + .fwlink_flags = FWLINK_FLAG_IGNORE, + }, {} }; @@ -1393,7 +1403,8 @@ static int of_link_property(struct device_node *con_np, const char *prop_name) : of_node_get(con_np); matched = true; i++; - of_link_to_phandle(con_dev_np, phandle); + of_link_to_phandle(con_dev_np, phandle, + s->fwlink_flags); of_node_put(phandle); of_node_put(con_dev_np); }