From: Tony Battersby <tonyb@cybernetics.com>
To: Tejun Heo <tj@kernel.org>
Cc: Robert Hancock <hancockr@shaw.ca>,
Jeff Garzik <jgarzik@pobox.com>,
IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: Re: AHCI problem with hotplug
Date: Fri, 09 Jan 2009 11:30:05 -0500 [thread overview]
Message-ID: <49677B8D.7060807@cybernetics.com> (raw)
In-Reply-To: <496696B2.7010006@shaw.ca>
Robert Hancock wrote:
> Tony Battersby wrote:
>
>> Tejun Heo wrote:
>>
>>> Hello,
>>>
>>> Tony Battersby wrote:
>>>
>>>
>>>> Sorry it took so long. I have attached the output of lspci when booting
>>>> without a SATA disk attached, and also when booting with a SATA disk
>>>> attached.
>>>>
>>>>
>>> 00:1f.2 SATA controller [0106]: Intel Corporation 82801GR/GH (ICH7 Family) SATA AHCI Controller [8086:27c1] (rev 01) (prog-if 01 [AHCI 1.0])
>>> ...
>>> 90: 40 00 11 10 80 01 00 40 00 00 00 00 00 00 00 00
>>> ^^^^^
>>> PCS 0x1011
>>>
>>> Port 0 and 4 enabled and 4 present. Does "setpci -s 1f.2 93b=f" fix
>>> hotplugging?
>>>
>>>
>>>
>> setpci gives the following error:
>>
>> pcilib: sysfs_write: tried to write 1 bytes at 2363, but only 0 succeeded
>>
>> lspci shows no difference before and after.
>>
>
> I assume that was done as root?
>
>
Yes, done as root.
I am not really familiar with setpci, but apparently 93b and 93.b mean
different things, and I suspect you probably meant 93.b. Also, if the
goal is to set the indicated PCS register to the same value it has when
hotplugging does work, then the command that does that is "setpci -s
1f.2 92.b=01" or "setpci -s 1f.2 92.b=11". However, this command still
does not help. Below are some more details of what I tried.
boot with disk plugged into first SATA port
lspci -nxxx -s 1f.2
HEXDUMP #1
00:1f.2 0106: 8086:27c1 (rev 01)
00: 86 80 c1 27 07 04 b0 02 01 01 06 01 00 00 00 00
10: 99 68 00 00 7d 68 00 00 91 68 00 00 79 68 00 00
20: 81 68 00 00 00 04 00 ed 00 00 00 00 d9 15 80 77
30: 00 00 00 00 80 00 00 00 00 00 00 00 0a 02 00 00
40: 07 a3 00 80 00 00 00 00 01 00 01 00 00 00 00 00
50: 00 00 00 00 11 10 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 01 00 02 40 00 00 00 00 00 00 00 00 00 00 00 00
80: 05 70 01 00 0c 30 e0 fe 89 41 00 00 00 00 00 00
90: 40 00 11 10 80 01 00 40 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 86 0f 01 00 00 00 00 00
unplug disk; hot unplug detected
lspci -nxxx -s 1f.2
HEXDUMP #2 (diff to HEXDUMP #1)
-90: 40 00 11 10 80 01 00 40 00 00 00 00 00 00 00 00
+90: 40 00 01 10 80 01 00 40 00 00 00 00 00 00 00 00
plug disk back into first SATA port; hotplug detected
lspci -nxxx -s 1f.2
(identical to HEXDUMP #1)
boot with disk not plugged in
lspci -nxxx -s 1f.2
HEXDUMP #3
00:1f.2 0106: 8086:27c1 (rev 01)
00: 86 80 c1 27 07 04 b0 02 01 01 06 01 00 00 00 00
10: 99 68 00 00 7d 68 00 00 91 68 00 00 79 68 00 00
20: 81 68 00 00 00 04 00 ed 00 00 00 00 d9 15 80 77
30: 00 00 00 00 80 00 00 00 00 00 00 00 0a 02 00 00
40: 00 80 00 80 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 01 00 02 40 00 00 00 00 00 00 00 00 00 00 00 00
80: 05 70 01 00 0c 30 e0 fe 89 41 00 00 00 00 00 00
90: 40 00 0f 10 80 01 00 40 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 86 0f 01 00 00 00 00 00
diff between HEXDUMP #1 and HEXDUMP #3
-40: 07 a3 00 80 00 00 00 00 01 00 01 00 00 00 00 00
+40: 00 80 00 80 00 00 00 00 00 00 00 00 00 00 00 00
-50: 00 00 00 00 11 10 00 00 00 00 00 00 00 00 00 00
+50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-90: 40 00 11 10 80 01 00 40 00 00 00 00 00 00 00 00
+90: 40 00 0f 10 80 01 00 40 00 00 00 00 00 00 00 00
plug disk into first SATA port; no hotplug detected
lspci -nxxx -s 1f.2
HEXDUMP #4 (diff to HEXDUMP #3)
-90: 40 00 0f 10 80 01 00 40 00 00 00 00 00 00 00 00
+90: 40 00 1f 10 80 01 00 40 00 00 00 00 00 00 00 00
However, unplugging the disk does not clear the bit that was set by
plugging in the disk. Also, /proc/interrupts shows 0 AHCI interrupts.
Reboot with disk not plugged in to clear the bit that was set by
plugging in the disk.
lspci -nxxx -s 1f.2
identical to HEXDUMP #3
setpci -s 1f.2 92.b=01
lspci -nxxx -s 1f.2
HEXDUMP #5 (diff to HEXDUMP #3)
-90: 40 00 0f 10 80 01 00 40 00 00 00 00 00 00 00 00
+90: 40 00 01 10 80 01 00 40 00 00 00 00 00 00 00 00
plug disk into first SATA port; no hotplug detected
lspci -nxxx -s 1f.2
HEXDUMP #6 (diff to HEXDUMP #5)
-90: 40 00 01 10 80 01 00 40 00 00 00 00 00 00 00 00
+90: 40 00 11 10 80 01 00 40 00 00 00 00 00 00 00 00
comparing this to HEXDUMP #1:
-40: 07 a3 00 80 00 00 00 00 01 00 01 00 00 00 00 00
+40: 00 80 00 80 00 00 00 00 00 00 00 00 00 00 00 00
-50: 00 00 00 00 11 10 00 00 00 00 00 00 00 00 00 00
+50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
So the PCS register is the same, but still no hotplug detected.
However, unplugging the disk does not clear the bit that was set by
plugging in the disk. Also, /proc/interrupts shows 0 ahci interrupts.
I also tried the following, without knowing what it would do:
setpci -s 1f.2 40.b=07
setpci -s 1f.2 41.b=a3
setpci -s 1f.2 48.b=01
setpci -s 1f.2 4a.b=01
setpci -s 1f.2 54.b=11
setpci -s 1f.2 55.b=10
setpci -s 1f.2 92.b=01
lspci -nxxx -s 1f.2 is now identical to HEXDUMP #1
However, disk hotplug is still not detected, and /proc/interrupts still
shows 0 ahci interrupts.
Tony
next prev parent reply other threads:[~2009-01-09 16:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-11 20:32 AHCI problem with hotplug Tony Battersby
2008-12-12 16:03 ` Alan Cox
2008-12-29 8:17 ` Tejun Heo
2008-12-29 14:51 ` Tony Battersby
2008-12-29 18:29 ` Robert Hancock
2008-12-30 0:38 ` Tejun Heo
2009-01-02 3:12 ` Tejun Heo
2009-01-07 15:39 ` Tony Battersby
2009-01-08 2:06 ` Tejun Heo
2009-01-08 14:20 ` Tony Battersby
2009-01-09 0:13 ` Robert Hancock
2009-01-09 16:30 ` Tony Battersby [this message]
2009-01-14 6:33 ` Tejun Heo
2009-01-14 21:38 ` Tony Battersby
2009-01-15 1:31 ` Tejun Heo
2009-01-15 4:42 ` Robert Hancock
2009-01-20 22:56 ` Tony Battersby
2008-12-30 13:41 ` raz ben yehuda
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=49677B8D.7060807@cybernetics.com \
--to=tonyb@cybernetics.com \
--cc=hancockr@shaw.ca \
--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).