All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qing Huang <qing.huang@oracle.com>
To: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Grant Likely <grant.likely@linaro.org>,
	Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] device probe: add self triggered delayed work request
Date: Tue, 9 Aug 2016 13:57:47 -0700	[thread overview]
Message-ID: <57AA43CB.5050209@oracle.com> (raw)
In-Reply-To: <20160809101122.GA30759@shamir-linux.uk.oracle.com>



On 08/09/2016 03:11 AM, Shamir Rabinovitch wrote:
> On Mon, Aug 08, 2016 at 05:10:05PM -0700, Qing Huang wrote:
>> Not sure if I understood your scenario. Why there is a deadlock here?
>>
>   CPU0                                                   | CPU1
> ---------------------------------------------------------------------------------------------
>   driver_deferred_probe_add                              | driver_deferred_probe_trigger_wrapper
>    mutex_lock(&deferred_probe_mutex)                     |  driver_deferred_probe_trigger
>     cancel_delayed_work(&deferred_probe_trigger_work)    |   mutex_lock(&deferred_probe_mutex)
>      wait for "driver_deferred_probe_trigger_wrapper"    |    wait for "deferred_probe_mutex"
>
> is this possible scenario with this patch?
>
> if yes then CPU0 will wait for CPU1 to finish the delayed work whith
> mutex deferred_probe_mutex held while CPU1 will try to finish the
> delayed work and will wait for the same mutex forever.

CPU0 will not wait for "driver_deferred_probe_trigger_wrapper" to 
finish, it simply puts the work request onto the queue and returns.

Qing

>
> it seems like dead lock scenario to me.
>
> please say if this scenario is possible.
>
> BR, Shamir Rabinovitch

  reply	other threads:[~2016-08-09 20:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 10:42 [PATCH] device probe: add self triggered delayed work request Shamir Rabinovitch
2016-08-09  0:10 ` Qing Huang
2016-08-09 10:11   ` Shamir Rabinovitch
2016-08-09 20:57     ` Qing Huang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-07-30  5:39 Qing Huang
2016-08-08 20:44 ` Frank Rowand
2016-08-08 21:51   ` Qing Huang
2016-08-09  1:11     ` Frank Rowand
2016-08-09  1:15       ` Santosh Shilimkar
2016-08-09  7:16         ` Frank Rowand

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=57AA43CB.5050209@oracle.com \
    --to=qing.huang@oracle.com \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=santosh.shilimkar@oracle.com \
    --cc=shamir.rabinovitch@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.