linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org
Subject: Re: libata hotplug question
Date: Tue, 01 Dec 2009 16:17:27 +1100	[thread overview]
Message-ID: <1259644647.2076.204.camel@pasglop> (raw)
In-Reply-To: <1259635420.2076.180.camel@pasglop>

On Tue, 2009-12-01 at 13:43 +1100, Benjamin Herrenschmidt wrote:
> > Oh... yeah, that was the original intention when adding those
> > functions but you wouldn't need them for hot plug/unplug.  Just set
> > probe mask and freeze the port.  EH will do the right thing.

 .../...

> But for that to work right, I need to be able to prevent probing when
> setting up the host, when I know that the bay is empty, which the link
> stuff would cover nicely too, don't you think ? Or do you have a better
> idea ?
> 
> I also have to be careful of a possible race if the hotplug callback
> since it can potentially happen as soon as I enter my driver->probe()
> (it comes from the macio "bus" layer). What is the harm of triggering a
> hotplug if nothing was actually unplugged ? Will libata silently just
> keep things as they were ?

So I tried with implementing the link_online and link_offline callbacks
and it doesn't fly very high.

When I unplug the bay, it displays:

ata3: exception Emask 0x10 SAct 0x0 SErr 0x0 action 0xe frozen
ata3: EH complete

and doesn't really "unplug" it (ie, trying to access the device then
causes all sorts of errors to pile up in the log). Plugging it back then
causes it to soft reset and restore the DMA timings and it works again.

But it's overall sub optimal. Comparatively, it worked better without
the link callbacks though I would call it sub-optimal :-)

What would be the best way to tell libata to just remove the device and
not bother poking the HW again on an unplug and do as it does today on a
plug without the link callbacks ?

Cheers,
Ben.


  parent reply	other threads:[~2009-12-01  5:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30  6:04 libata hotplug question Benjamin Herrenschmidt
2009-11-30 23:44 ` Benjamin Herrenschmidt
2009-11-30 23:48   ` Tejun Heo
2009-12-01  0:05     ` Benjamin Herrenschmidt
2009-12-01  2:43     ` Benjamin Herrenschmidt
2009-12-01  4:51       ` Tejun Heo
2009-12-01  5:24         ` Benjamin Herrenschmidt
2009-12-01  5:17       ` Benjamin Herrenschmidt [this message]
2009-12-01  5:22         ` Tejun Heo
2009-12-01  5:30           ` Benjamin Herrenschmidt
2009-12-01  5:34             ` Tejun Heo
2009-12-01  5:39               ` Benjamin Herrenschmidt
2009-12-01  5:57                 ` Benjamin Herrenschmidt
2009-12-01  5:35           ` Benjamin Herrenschmidt
2009-11-30 23: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=1259644647.2076.204.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=tj@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).