Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jun 2008 11:30:01 +0400
From:      "Andrey V. Elsukov" <bu7cher@yandex.ru>
To:        freebsd-hackers@freebsd.org
Cc:        =?UTF-8?B?U8O4cmVuIFNjaG1pZHQ=?= <sos@FreeBSD.org>
Subject:   [RFC] patch to AHCI device detection code
Message-ID:  <484F7EF9.5080602@yandex.ru>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------030902080904070105070406
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi, Soren.

I'm found solution for AHCI that solve ATAPI device detection for me.
I just added waiting loop on PxTFD after reset and now my SATA DVD
detected well. Waiting time (in my case) may vary from 1ms to 900 ms.

Also AHCI spec says:

10.4.2 Port Reset
...
When PxSCTL.DET is set to 0h, upon receiving a COMINIT from
the attached device, PxTFD.STS.BSY shall be set to ’1’ by the HBA.

So we can wait until PxTFD.STS.BSY resets to zero and then
read PxSIG.

Any comments?

-- 
WBR, Andrey V. Elsukov

--------------030902080904070105070406
Content-Type: text/plain;
 name="ata_wait_ready_tfd_after_reset.diff.txt"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="ata_wait_ready_tfd_after_reset.diff.txt"

SW5kZXg6IHNyYy9zeXMvZGV2L2F0YS9hdGEtY2hpcHNldC5jCj09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNT
IGZpbGU6IC9uY3ZzL3NyYy9zeXMvZGV2L2F0YS9hdGEtY2hpcHNldC5jLHYKcmV0cmlldmlu
ZyByZXZpc2lvbiAxLjIxOQpkaWZmIC11IC1iIC1wIC1yMS4yMTkgYXRhLWNoaXBzZXQuYwot
LS0gc3JjL3N5cy9kZXYvYXRhL2F0YS1jaGlwc2V0LmMJMjEgQXByIDIwMDggMTA6NTE6Mzgg
LTAwMDAJMS4yMTkKKysrIHNyYy9zeXMvZGV2L2F0YS9hdGEtY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wogICAgIGlmIChib290dmVyYm9zZSkKIAlkZXZp
Y2VfcHJpbnRmKGRldiwgIkJVU1kgd2FpdCB0aW1lPSVkbXNcbiIsIHRpbWVvdXQpOwotI2Vu
ZGlmCiAgICAgcmV0dXJuIEFUQV9JTkwoY3Rsci0+cl9yZXMyLCBBVEFfQUhDSV9QX1NJRyAr
IG9mZnNldCk7CiB9CiAK
--------------030902080904070105070406--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?484F7EF9.5080602>