linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: "Владимир Дашевский" <vladimir.dashevsky@gmail.com>
Cc: Jeff Garzik <jgarzik@pobox.com>, linux-ide@vger.kernel.org
Subject: Re: hot plug on ICH9 with AHCI on
Date: Fri, 20 Mar 2009 11:04:37 +0900	[thread overview]
Message-ID: <49C2F9B5.90000@kernel.org> (raw)
In-Reply-To: <49C171D7.1080706@gmail.com>

Hello,

Владимир Дашевский wrote:
> This log is strange for me. It seems that system missed the point that
> the drives was going out. First it tried to reinitialize the SATA link
> for three times.

That's the intended behavior.  Oh PHY event, libata EH tries to revive
the link at least for 15 secs so that transient PHY glitch doesn't
kill your root fs.

> Then, it tried to sync caches and stop the drive when it has
> actually lost connection with HBA.

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.

> Then disk was returned to the slot and its softreset failed. Why? I
> suspect the drive did not fully start when the host tried to
> establish connection to it.

Yeah, it sometimes depends on the spin up time.  Sometimes some
controllers just can't get things working for the first trial and so
on.  The timeout mechanism is there to achieve acceptable delay even
when devices slightly malfunction, so the timeouts are a bit
aggressive.

> Another thing happened when I extracted the drive from one slot and
> pushed it back into its neigbor that was empty during linux boot up.
> Kernel desided this slot is dummy:
> ---
> ahci 0000:00:1f.2: version 3.0
> ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 17 (level, low) -> IRQ 17
> ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0xb impl SATA
> mode
> ahci 0000:00:1f.2: flags: 64bit ncq sntf led clo pmp pio slum part
> PCI: Setting latency timer of device 0000:00:1f.2 to 64
> scsi0 : ahci
> scsi1 : ahci
> scsi2 : ahci
> scsi3 : ahci
> scsi4 : ahci
> scsi5 : ahci
> ata1: SATA max UDMA/133 abar m2048@0xd8601000 port 0xd8601100 irq 1275
> ata2: SATA max UDMA/133 abar m2048@0xd8601000 port 0xd8601180 irq 1275
> ata3: DUMMY
> ata4: SATA max UDMA/133 abar m2048@0xd8601000 port 0xd8601280 irq 1275
> ata5: DUMMY
> ata6: DUMMY

DUMMY ports are determined by the BIOS and dummy state is recorded in
an ahci register.  Does your board have all six ports exposed?

> So,  even if I put the drive as ata3 device kernel does nothing to start
> it.
> 
> Now my questions:
> 1. Is it possible to force all ports to be potentially populated during
> startup. I would prefer that all ICH9 SATA ports will have their own
> fixed names, eg. /dev/sata0, ..., /dev/sata5. For now I have 3 drives
> and they allways get names /dev/sda /dev/sdb /dev/sdc even if there is
> some empty port as shown above. This is not convenient because enclosure
> management is linked to physical ports, not to only populated ones.

If you have exposed ports which are marked dummy by the ahci driver.
It's a BIOS bug.  It either needs to be quirked and reported to the
motherboard vendor.

> 2. How can I remove SATA drive safely? I mean the behavior similar to
> USB drives removing. I'd like to notify the system that i wish to remove
> the drive. Then it performs some actions as closing all current
> connections, stopping new connections, flushing caches etc. After all
> that it updates indicators on backplane showing me that the drive is
> ready to be removed. As I see, some portions of this procedure can be
> done using hdparm -f -F -Y, but not all.

echo 1 > /sys/block/sdX/device/delete

Thanks.

-- 
tejun

  reply	other threads:[~2009-03-20  2:04 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 [this message]
2009-03-20  9:55   ` Владимир Дашевский
     [not found]     ` <49C39933.4020501@kernel.org>
2009-03-20 15:31       ` Владимир Дашевский
2009-03-22 12:51       ` Владимир Дашевский
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=49C2F9B5.90000@kernel.org \
    --to=tj@kernel.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=vladimir.dashevsky@gmail.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 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).