All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Vladimir Zapolskiy <vz@mleia.com>
Cc: Rob Herring <robh@kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	linux-ide@vger.kernel.org
Subject: Re: [PATCH] ata: disable port while unloading ATA controller driver
Date: Tue, 29 Nov 2016 17:29:41 -0500	[thread overview]
Message-ID: <20161129222941.GA17732@htj.duckdns.org> (raw)
In-Reply-To: <b33224b4-0f20-9c8d-38e3-2e6b2e8882a9@mleia.com>

Hello,

On Wed, Nov 30, 2016 at 12:15:50AM +0200, Vladimir Zapolskiy wrote:
> in case if I haven't tired you out yet, I verified you solution and it
> works perfectly, there is no problem in ATA subsystem which I can point
> out:
> 
> diff --git a/drivers/base/dd.c b/drivers/base/dd.c
> index d76cd97..a4feecf 100644
> --- a/drivers/base/dd.c
> +++ b/drivers/base/dd.c
> @@ -384,6 +384,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
>  	if (test_remove) {
>  		test_remove = false;
>  
> +		async_synchronize_full();
> +
>  		if (dev->bus->remove)
>  			dev->bus->remove(dev);
>  		else if (drv->remove)

Yeah, this should do it.

> In my understanding the code under "if (test_remove)" branch should be
> close to the code of __device_release_driver() function, but here it
> is slightly different on purpose --- driver_allows_async_probing(drv)
> returns false in case of the ATA controller driver(s), here async
> probing is not a functional part of a driver, but it is embedded into
> the ATA subsystem by means of generic async_port_probe(). Not sure if
> __device_release_driver() or driver_allows_async_probing() should be
> corrected respecting this case, and hence I'm not going to touch it.

Currently, we depend on the fact that there is guaranteed to be a
synchronization point before unloading, so adding that to test code
seems like the right thing to do to me.

Thanks.

-- 
tejun

      reply	other threads:[~2016-11-29 22:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-27 23:18 [PATCH] ata: disable port while unloading ATA controller driver Vladimir Zapolskiy
2016-11-27 23:30 ` Vladimir Zapolskiy
2016-11-28 18:34 ` Tejun Heo
2016-11-28 23:51   ` Vladimir Zapolskiy
2016-11-29 18:54     ` Vladimir Zapolskiy
2016-11-29 19:00       ` Tejun Heo
2016-11-29 20:04         ` Vladimir Zapolskiy
2016-11-29 20:44           ` Tejun Heo
2016-11-29 22:15             ` Vladimir Zapolskiy
2016-11-29 22:29               ` Tejun Heo [this message]

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=20161129222941.GA17732@htj.duckdns.org \
    --to=tj@kernel.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=linux-ide@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.