From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Vladimir Zapolskiy <vz@mleia.com>
Cc: Rob Herring <robh@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] driver core: flush async calls before testing driver removal
Date: Sat, 10 Dec 2016 14:04:04 +0100 [thread overview]
Message-ID: <20161210130404.GB8145@kroah.com> (raw)
In-Reply-To: <4c1eb9e4-3e49-660a-e3c2-d048d3189a26@mleia.com>
On Sat, Dec 10, 2016 at 02:38:41PM +0200, Vladimir Zapolskiy wrote:
> Hello Greg,
>
> On 12/10/2016 09:32 AM, Greg Kroah-Hartman wrote:
> > On Sat, Dec 10, 2016 at 02:15:19AM +0200, Vladimir Zapolskiy wrote:
> >> If CONFIG_DEBUG_TEST_DRIVER_REMOVE option is enabled a number of false
> >> positives are reported for ATA controller drivers, because ATA port
> >> probes are done asynchronously, and the same problem may also touch
> >> other asynchronously probed drivers.
> >>
> >> To reduce the rate of false reports on boot call async_synchronize_full()
> >> before attempting to remove a driver, the same is done in delete_module()
> >> syscall for all possible drivers and in __device_release_driver() function
> >> for asynchronously probed drivers.
> >
> > __device_release_driver() already calls this function, why call it
> > again?
> >
>
> __device_release_driver() is not called on test removal of drivers, if
> CONFIG_DEBUG_TEST_DRIVER_REMOVE option is enabled.
>
> This opens a possibility to races like one I've discovered:
>
> https://www.spinics.net/lists/linux-ide/msg53473.html
>
> Next, async_synchronize_full() from __device_release_driver() is not
> called in case of removal of ATA controller drivers, because
> driver_allows_async_probing(drv) return value is false.
Hm, how does this not also get hit if you unbind/bind/unbind/bind/etc.
from userspace as well? I don't think this is a
CONFIG_DEBUG_TEST_DRIVER_REMOVE issue, but just that this option finds
the problem corner cases as you are finding out :)
thanks,
greg k-h
next prev parent reply other threads:[~2016-12-10 13:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-10 0:15 [PATCH] driver core: flush async calls before testing driver removal Vladimir Zapolskiy
2016-12-10 1:59 ` Dmitry Torokhov
2016-12-10 12:57 ` Vladimir Zapolskiy
2016-12-10 7:32 ` Greg Kroah-Hartman
2016-12-10 12:38 ` Vladimir Zapolskiy
2016-12-10 13:04 ` Greg Kroah-Hartman [this message]
2016-12-11 1:44 ` Vladimir Zapolskiy
2016-12-12 17:50 ` Tejun Heo
2016-12-12 18:33 ` Rob Herring
2016-12-12 18:46 ` Tejun Heo
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=20161210130404.GB8145@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=vz@mleia.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.