public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Saravana Kannan <saravanak@google.com>
Cc: Frank Rowand <frowand.list@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	kernel-team@android.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	John Stultz <john.stultz@linaro.org>
Subject: Re: [PATCH v2 2/2] of: property: Improve cycle detection when one of the devices is never added
Date: Wed, 17 Jun 2020 16:12:21 -0600	[thread overview]
Message-ID: <20200617221221.GA2923473@bogus> (raw)
In-Reply-To: <20200610011934.49795-3-saravanak@google.com>

On Tue, 09 Jun 2020 18:19:34 -0700, Saravana Kannan wrote:
> Consider this example where -> means LHS device is a consumer of RHS
> device and indentation represents "child of" of the previous device.
> 
> Device A -> Device C
> 
> Device B -> Device A
> 	Device C
> 
> Without this commit:
> 1. Device A is added.
> 2. Device A is added to waiting for supplier list (Device C)
> 3. Device B is added
> 4. Device B is linked as a consumer to Device A
> 5. Device A doesn't probe because it's waiting for Device C to be added.
> 6. Device B doesn't probe because Device A hasn't probed.
> 7. Device C will never be added because it's parent hasn't probed.
> 
> So, Device A, B and C will be in a probe/add deadlock.
> 
> This commit detects this scenario and stops trying to create a device
> link between Device A and Device C since doing so would create the
> following cycle:
> Device A -> Devic C -(parent)-> Device B -> Device A.
> 
> With this commit:
> 1. Device A is added.
> 3. Device B is added
> 4. Device B is linked as a consumer to Device A
> 5. Device A probes.
> 6. Device B probes because Device A has probed.
> 7. Device C is added and probed.
> 
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> ---
>  drivers/of/property.c | 62 ++++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 56 insertions(+), 6 deletions(-)
> 

Both patches applied.

Rob

  reply	other threads:[~2020-06-17 22:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10  1:19 [PATCH v2 0/2] fw_devlink: Improve cycle detection in DT Saravana Kannan
2020-06-10  1:19 ` [PATCH v2 1/2] driver core: Add device_is_dependent() to linux/device.h Saravana Kannan
2020-06-10  1:19 ` [PATCH v2 2/2] of: property: Improve cycle detection when one of the devices is never added Saravana Kannan
2020-06-17 22:12   ` Rob Herring [this message]
2020-06-18  1:13     ` Saravana Kannan
2020-06-10  4:47 ` [PATCH v2 0/2] fw_devlink: Improve cycle detection in DT John Stultz

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=20200617221221.GA2923473@bogus \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=saravanak@google.com \
    /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