]> git.karo-electronics.de Git - karo-tx-linux.git/commit
driver core: Move deferred devices to the end of dpm_list before probing
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 5 Jul 2012 13:04:44 +0000 (14:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Jul 2012 01:05:45 +0000 (18:05 -0700)
commit8153584e3fdf78753bf653d5f583b6ecb86e5e70
tree34c5cc5b62d52ea9957919f938446f23161c2eb4
parent5a7689fd5b4f2094e7a32beae67f290f8619b042
driver core: Move deferred devices to the end of dpm_list before probing

When deferred probe was originally added the idea was that devices which
defer their probes would move themselves to the end of dpm_list in order
to try to keep the assumptions that we're making about the list being in
roughly the order things should be suspended correct. However this hasn't
been what's been happening and doing it requires a lot of duplicated code
to do the moves.

Instead take a simple, brute force solution and have the deferred probe
code push devices to the end of dpm_list before it retries the probe. This
does mean we lock the dpm_list a bit more often but it's very simple and
the code shouldn't be a fast path. We do the move with the deferred mutex
dropped since doing things with fewer locks held simultaneously seems like
a good idea.

This approach was most recently suggested by Grant Likely.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Grant Likely <grant.likely@secretlab.ca>,
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/dd.c