linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Владимир Дашевский" <vladimir.dashevsky@gmail.com>
To: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jgarzik@pobox.com>, linux-ide@vger.kernel.org
Subject: Re: hot plug on ICH9 with AHCI on
Date: Sun, 22 Mar 2009 15:51:35 +0300	[thread overview]
Message-ID: <49C63457.8040203@gmail.com> (raw)
In-Reply-To: <49C39933.4020501@kernel.org>

Tejun!

Here are my comments on our previous conversation
>> Well, I partially agree. Surely, EMI problems should not break the link
>> forever but I do not agree with the algorithm. When the drive is being
>> removed it gets out during millisectonds. I mean the time between loss
>> of link and detection that port is not populated. So, I can imagine that
>> driver could be going to retry reset one but it had to abort this action
>> once it got the drive is removed at all. Not in 15 second and even not
>> in 5 seconds but in 0.01 second. So, 
> Heh... that will fail any EMI test.  There simply isn't anything to be
> earned by shortening the period.  The only thing that can go wrong
> with longer delay is if the user unplugs the drive, plugs it in
> another host modifies the content and replug it before the detach
> happens.  If the user does that, well, he/she deserves a corrupt
> filesystem.
>   
I think you are not right here. If we are talking about EMI problems I 
can say that the strategy of many retries is worse than one read of port 
present status. EMI noise occurs at the time while software tries to 
re-establish connection with empty link because there is no link 
terminatiion. It's just like a car engine that has lost its muffler. It 
produces lots of noise. It is better to turn the link off as soon as we 
know there is no device on the port. That's why retries should last only 
until that state is reported by hardware. And I think hardware reports 
that state much faster than in 15 or even 5 seconds. In ICH9 it reports 
this just immediately.
>>> That's SCSI sd driver shutting down.  As hot unplugging is
>>> surprise-removal, sd's shutdown sequence arrives after the device is
>>> actually gone and failed immediately.
>>>
>>>       
>> Ok. So, this is notmal. We just need to inform SCSI driver first, isn't it?
>>     
>
> If you hot unplug, how do you notify SCSI driver first?
>   
Well, there are some strange comments in FAQs that older ICH chips (5 to 
8) do not fully support hot plug, while the newer ones have better 
support for this. Then there is an explanation of what is proper hotplug 
support. That explanation says of surprise-removal support. However, I 
do not mind of notifying system before a actually remove the drive. Just 
because it may take a long time to shut down drive activity and it will 
be better to indicate this explicitly to user.
>>
>> Well, some drives store their firmware on disk, so they cannot work with
>> host until fully spinned up. I heard that drive started to spin up in
>> two or more seconds after being inserted. So, what is the indended
>> driver behavior? It simply performs soft resets until drive answer ot
>> this, isn't it? If the drive gets ready faster it will be fewer failed
>> soft resets in log, right?
>>     
>
> The goal is being robust.  With numerous hardware combinations, that's
> about the only way to keep things manageable.  Things don't always
> work as described in the spec.  Again, the only down side is one or
> more failed attempts and log about those.  Why do you care?
>   
It's just because one of my jobs is writing high performance embedded 
real-time software were logs are almost the only way to know what 
happens in hardware. After  several years of  such practice there is a 
habit of suspecting side effects of each stralge log line. That's whay I 
do care :-)
I just want to understand that this softreset failure is a normal 
behavior for that particular case.

> ahci doesn't use PCS to detect dummy ports.  It uses PORT_IMPL ahci
> register.  If PORT_IMPL changes according to which ports are occupied
> that's a BIOS bug.  Can you post the output of "dmidecode"?
>   
Yes, you were right, it was a BIOS bug. I have downloaded latest BIOS 
from the vendor's web site and now PI register allways reports all six 
ports implemented.

>>> echo 1 > /sys/block/sdX/device/delete
>>>  
>>>       
>> Can I be sure this will stop the drive sefely (without of cached data
>> loss)?
>>     
>
> Yes.
>   
Ok. So, one more question. How can I know exactly when device deletion 
has completed after sending this command? For example, consider that 
there some data in cache that needs 3 seconds to be sync-ed to disk. How 
can I know that I must wait for 3 seconds before a can actually remove 
the drive? Should I check the presence of some other filename in 
/sys/block/sdX/ or do something else?

Thank you!

With best regards, Vladimir Dashevsky


  parent reply	other threads:[~2009-03-22 12:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-18 22:12 hot plug on ICH9 with AHCI on Владимир Дашевский
2009-03-20  2:04 ` Tejun Heo
2009-03-20  9:55   ` Владимир Дашевский
     [not found]     ` <49C39933.4020501@kernel.org>
2009-03-20 15:31       ` Владимир Дашевский
2009-03-22 12:51       ` Владимир Дашевский [this message]
2009-03-22 15:08         ` Tejun Heo
2009-03-22 16:07           ` Владимир Дашевский
2009-03-22 16:41             ` Tejun Heo
2009-03-22 18:26               ` Владимир Дашевский
2009-03-23  2:04                 ` Tejun Heo
2009-03-23 11:38                   ` Владимир Дашевский
2009-03-23 12:01                     ` Tejun Heo
2009-03-24  8:26                       ` Владимир Дашевский

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=49C63457.8040203@gmail.com \
    --to=vladimir.dashevsky@gmail.com \
    --cc=jgarzik@pobox.com \
    --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).