2006-02-22 22:10:59

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH 9/13] ATA ACPI: check SATA/PATA more carefully

From: Randy Dunlap <[email protected]>

Use 'legacy_mode' to check for SATA vs. PATA mode.

Signed-off-by: Randy Dunlap <[email protected]>
---
drivers/scsi/libata-acpi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2616-rc4-ata.orig/drivers/scsi/libata-acpi.c
+++ linux-2616-rc4-ata/drivers/scsi/libata-acpi.c
@@ -437,7 +437,7 @@ int do_drive_get_GTF(struct ata_port *ap

/* Don't continue if device has no _ADR method.
* _GTF is intended for known motherboard devices. */
- if (ata_id_is_ata(atadev->id)) {
+ if (ap->legacy_mode) {
err = pata_get_dev_handle(dev, &dev_handle, &pcidevfn);
if (err < 0) {
if (ata_msg_probe(ap))
@@ -459,7 +459,7 @@ int do_drive_get_GTF(struct ata_port *ap

/* Get this drive's _ADR info. if not already known. */
if (!atadev->obj_handle) {
- if (ata_id_is_ata(atadev->id)) {
+ if (ap->legacy_mode) {
/* get child objects of dev_handle == channel objects,
* + _their_ children == drive objects */
/* channel is ap->hard_port_no */
@@ -655,7 +655,7 @@ int do_drive_set_taskfiles(struct ata_po

if (noacpi)
return 0;
- if (!ata_id_is_sata(atadev->id)) {
+ if (ap->legacy_mode) {
printk(KERN_DEBUG "%s: skipping non-SATA drive\n",
__FUNCTION__);
return 0;


2006-02-23 00:26:05

by Alan

[permalink] [raw]
Subject: Re: [PATCH 9/13] ATA ACPI: check SATA/PATA more carefully

On Mer, 2006-02-22 at 14:00 -0800, Randy Dunlap wrote:
> + if (ap->legacy_mode) {
> err = pata_get_dev_handle(dev, &dev_handle, &pcidevfn);
> if (err < 0) {
> if (ata_msg_probe(ap))

ap->legacy mode tells you if one of a subset of PCI controllers is in
native or legacy compatibility mode. It tells you nothing about whether
the controller is SATA or PATA. In fact it may even be both at once as
there may be a SATA bridge on one channel in some configurations. The
field is also meaningless for PCI controllers that are not class IDE.

The cable type field will tell you in some situations if we are PATA or
SATA but we actually don't always know at the moment. We probably have
the info for 99.9% of cases if needed it just isnt ap->legacy_mode, its
cable type plus the PATA/SATA bridge knobbling check.

Alan