Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1539831

Re: [PATCH] driver core: flush async calls before testing driver removal

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] driver core: flush async calls before testing driver removal
Date 2016-12-10 14:10 +0100
Message-ID <sMPzz-2EG-7@gated-at.bofh.it> (permalink)
References <sMDyp-1x9-3@gated-at.bofh.it> <sMKqe-67B-7@gated-at.bofh.it> <sMP6y-2g7-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] driver core: flush async calls before testing driver removal Vladimir Zapolskiy <vz@mleia.com> - 2016-12-10 01:20 +0100
  Re: [PATCH] driver core: flush async calls before testing driver removal Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-12-10 03:00 +0100
    Re: [PATCH] driver core: flush async calls before testing driver  removal Vladimir Zapolskiy <vz@mleia.com> - 2016-12-10 14:00 +0100
  Re: [PATCH] driver core: flush async calls before testing driver  removal Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-12-10 08:40 +0100
    Re: [PATCH] driver core: flush async calls before testing driver  removal Vladimir Zapolskiy <vz@mleia.com> - 2016-12-10 13:40 +0100
      Re: [PATCH] driver core: flush async calls before testing driver  removal Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-12-10 14:10 +0100
        Re: [PATCH] driver core: flush async calls before testing driver  removal Vladimir Zapolskiy <vz@mleia.com> - 2016-12-11 02:50 +0100
          Re: [PATCH] driver core: flush async calls before testing driver  removal Tejun Heo <tj@kernel.org> - 2016-12-12 19:00 +0100
            Re: [PATCH] driver core: flush async calls before testing driver removal Rob Herring <robh@kernel.org> - 2016-12-12 19:40 +0100
              Re: [PATCH] driver core: flush async calls before testing driver  removal Tejun Heo <tj@kernel.org> - 2016-12-12 19:50 +0100

csiph-web