linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saravana Kannan <saravanak@google.com>
To: Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>
Cc: Saravana Kannan <saravanak@google.com>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	kernel-team@android.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v1] of: property: Don't retry device_link_add() upon failure
Date: Thu, 16 Apr 2020 13:58:38 -0700	[thread overview]
Message-ID: <20200416205838.161894-1-saravanak@google.com> (raw)
In-Reply-To: <c48a3baef99f3d74e7904498c4054221ec384b36.camel@suse.de>

When of_link_to_phandle() was implemented initially, there was no way to
tell if device_link_add() was failing because the supplier device hasn't
been parsed yet, hasn't been added yet, the links were creating a cycle,
etc. Some of these were transient errors that'd go away at a later
point.

However, with the current set of improved checks, if device_link_add()
fails, it'll only be for permanent errors like cycles or out-of-memory
errors.

Also, with the addition of DL_FLAG_SYNC_STATE_ONLY flag [1] to device
links, all the valid dependency cycles due to "proxy" device links
(needed for correctness of sync_state() device callback) will never fail
device_link_add() due to cycles.

So, continuing to retry failing device links (by returning -EAGAIN) is
no longer useful. At worst, it prevents platforms from setting
fw_devlink=on (or better) because it prevents proper boot up. So, let's
not do that anymore.

[1] - https://lore.kernel.org/lkml/20191028220027.251605-1-saravanak@google.com/
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Saravana Kannan <saravanak@google.com>
---
 drivers/of/property.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 252e4f600155..ee1bc267f975 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1074,7 +1074,7 @@ static int of_link_to_phandle(struct device *dev, struct device_node *sup_np,
 		return -EAGAIN;
 	}
 	if (!device_link_add(dev, sup_dev, dl_flags))
-		ret = -EAGAIN;
+		ret = -EINVAL;
 	put_device(sup_dev);
 	return ret;
 }
-- 
2.26.1.301.g55bc3eb7cb9-goog


  parent reply	other threads:[~2020-04-16 20:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 15:05 [PATCH 0/4] of: property: fw_devlink misc fixes Nicolas Saenz Julienne
2020-04-15 15:05 ` [PATCH 1/4] of: property: Fix create device links for all child-supplier dependencies Nicolas Saenz Julienne
2020-04-15 18:20   ` Saravana Kannan
2020-04-15 18:22   ` Saravana Kannan
2020-04-16 11:32     ` Nicolas Saenz Julienne
2020-04-15 15:05 ` [PATCH 2/4] of: property: Do not link to disabled devices Nicolas Saenz Julienne
2020-04-15 18:30   ` Saravana Kannan
2020-04-16 11:37     ` Nicolas Saenz Julienne
2020-04-16 20:56       ` Saravana Kannan
2020-04-15 15:05 ` [PATCH 3/4] of: property: Move of_link_to_phandle() Nicolas Saenz Julienne
2020-04-15 15:05 ` [PATCH 4/4] of: property: Avoid linking devices with circular dependencies Nicolas Saenz Julienne
2020-04-15 18:52   ` Saravana Kannan
2020-04-16 16:01     ` Nicolas Saenz Julienne
2020-04-16 20:57       ` Saravana Kannan
2020-04-16 20:58       ` Saravana Kannan [this message]
2020-04-17 16:50         ` [PATCH v1] of: property: Don't retry device_link_add() upon failure Nicolas Saenz Julienne
2020-04-17 18:16         ` Rob Herring
2020-04-17 20:30           ` Saravana Kannan
2020-04-28 17:11         ` Rob Herring
2020-04-15 18:17 ` [PATCH 0/4] of: property: fw_devlink misc fixes Saravana Kannan
2020-04-16 11:02   ` Nicolas Saenz Julienne
2020-04-16 20:56     ` Saravana Kannan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200416205838.161894-1-saravanak@google.com \
    --to=saravanak@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsaenzjulienne@suse.de \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).