diff options
Diffstat (limited to 'drivers/ata/libata-acpi.c')
-rw-r--r-- | drivers/ata/libata-acpi.c | 71 |
1 files changed, 30 insertions, 41 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index b4e8be5d292c..d14a48e75f1b 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -294,9 +294,8 @@ static int do_drive_get_GTF(struct ata_port *ap, int ix, | |||
294 | return 0; | 294 | return 0; |
295 | 295 | ||
296 | if (ata_msg_probe(ap)) | 296 | if (ata_msg_probe(ap)) |
297 | ata_dev_printk(atadev, KERN_DEBUG, | 297 | ata_dev_printk(atadev, KERN_DEBUG, "%s: ENTER: port#: %d\n", |
298 | "%s: ENTER: ap->id: %d, port#: %d\n", | 298 | __FUNCTION__, ap->port_no); |
299 | __FUNCTION__, ap->id, ap->port_no); | ||
300 | 299 | ||
301 | if (!ata_dev_enabled(atadev) || (ap->flags & ATA_FLAG_DISABLED)) { | 300 | if (!ata_dev_enabled(atadev) || (ap->flags & ATA_FLAG_DISABLED)) { |
302 | if (ata_msg_probe(ap)) | 301 | if (ata_msg_probe(ap)) |
@@ -456,6 +455,9 @@ static void taskfile_load_raw(struct ata_port *ap, | |||
456 | struct ata_device *atadev, | 455 | struct ata_device *atadev, |
457 | const struct taskfile_array *gtf) | 456 | const struct taskfile_array *gtf) |
458 | { | 457 | { |
458 | struct ata_taskfile tf; | ||
459 | unsigned int err; | ||
460 | |||
459 | if (ata_msg_probe(ap)) | 461 | if (ata_msg_probe(ap)) |
460 | ata_dev_printk(atadev, KERN_DEBUG, "%s: (0x1f1-1f7): hex: " | 462 | ata_dev_printk(atadev, KERN_DEBUG, "%s: (0x1f1-1f7): hex: " |
461 | "%02x %02x %02x %02x %02x %02x %02x\n", | 463 | "%02x %02x %02x %02x %02x %02x %02x\n", |
@@ -468,35 +470,25 @@ static void taskfile_load_raw(struct ata_port *ap, | |||
468 | && (gtf->tfa[6] == 0)) | 470 | && (gtf->tfa[6] == 0)) |
469 | return; | 471 | return; |
470 | 472 | ||
471 | if (ap->ops->qc_issue) { | 473 | ata_tf_init(atadev, &tf); |
472 | struct ata_taskfile tf; | 474 | |
473 | unsigned int err; | 475 | /* convert gtf to tf */ |
474 | 476 | tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; /* TBD */ | |
475 | ata_tf_init(atadev, &tf); | 477 | tf.protocol = atadev->class == ATA_DEV_ATAPI ? |
476 | 478 | ATA_PROT_ATAPI_NODATA : ATA_PROT_NODATA; | |
477 | /* convert gtf to tf */ | 479 | tf.feature = gtf->tfa[0]; /* 0x1f1 */ |
478 | tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; /* TBD */ | 480 | tf.nsect = gtf->tfa[1]; /* 0x1f2 */ |
479 | tf.protocol = atadev->class == ATA_DEV_ATAPI ? | 481 | tf.lbal = gtf->tfa[2]; /* 0x1f3 */ |
480 | ATA_PROT_ATAPI_NODATA : ATA_PROT_NODATA; | 482 | tf.lbam = gtf->tfa[3]; /* 0x1f4 */ |
481 | tf.feature = gtf->tfa[0]; /* 0x1f1 */ | 483 | tf.lbah = gtf->tfa[4]; /* 0x1f5 */ |
482 | tf.nsect = gtf->tfa[1]; /* 0x1f2 */ | 484 | tf.device = gtf->tfa[5]; /* 0x1f6 */ |
483 | tf.lbal = gtf->tfa[2]; /* 0x1f3 */ | 485 | tf.command = gtf->tfa[6]; /* 0x1f7 */ |
484 | tf.lbam = gtf->tfa[3]; /* 0x1f4 */ | 486 | |
485 | tf.lbah = gtf->tfa[4]; /* 0x1f5 */ | 487 | err = ata_exec_internal(atadev, &tf, NULL, DMA_NONE, NULL, 0); |
486 | tf.device = gtf->tfa[5]; /* 0x1f6 */ | 488 | if (err && ata_msg_probe(ap)) |
487 | tf.command = gtf->tfa[6]; /* 0x1f7 */ | 489 | ata_dev_printk(atadev, KERN_ERR, |
488 | 490 | "%s: ata_exec_internal failed: %u\n", | |
489 | err = ata_exec_internal(atadev, &tf, NULL, DMA_NONE, NULL, 0); | 491 | __FUNCTION__, err); |
490 | if (err && ata_msg_probe(ap)) | ||
491 | ata_dev_printk(atadev, KERN_ERR, | ||
492 | "%s: ata_exec_internal failed: %u\n", | ||
493 | __FUNCTION__, err); | ||
494 | } else | ||
495 | if (ata_msg_warn(ap)) | ||
496 | ata_dev_printk(atadev, KERN_WARNING, | ||
497 | "%s: SATA driver is missing qc_issue function" | ||
498 | " entry points\n", | ||
499 | __FUNCTION__); | ||
500 | } | 492 | } |
501 | 493 | ||
502 | /** | 494 | /** |
@@ -521,9 +513,8 @@ static int do_drive_set_taskfiles(struct ata_port *ap, | |||
521 | struct taskfile_array *gtf; | 513 | struct taskfile_array *gtf; |
522 | 514 | ||
523 | if (ata_msg_probe(ap)) | 515 | if (ata_msg_probe(ap)) |
524 | ata_dev_printk(atadev, KERN_DEBUG, | 516 | ata_dev_printk(atadev, KERN_DEBUG, "%s: ENTER: port#: %d\n", |
525 | "%s: ENTER: ap->id: %d, port#: %d\n", | 517 | __FUNCTION__, ap->port_no); |
526 | __FUNCTION__, ap->id, ap->port_no); | ||
527 | 518 | ||
528 | if (noacpi || !(ap->cbl == ATA_CBL_SATA)) | 519 | if (noacpi || !(ap->cbl == ATA_CBL_SATA)) |
529 | return 0; | 520 | return 0; |
@@ -627,9 +618,8 @@ int ata_acpi_push_id(struct ata_port *ap, unsigned int ix) | |||
627 | return 0; | 618 | return 0; |
628 | 619 | ||
629 | if (ata_msg_probe(ap)) | 620 | if (ata_msg_probe(ap)) |
630 | ata_dev_printk(atadev, KERN_DEBUG, | 621 | ata_dev_printk(atadev, KERN_DEBUG, "%s: ix = %d, port#: %d\n", |
631 | "%s: ap->id: %d, ix = %d, port#: %d\n", | 622 | __FUNCTION__, ix, ap->port_no); |
632 | __FUNCTION__, ap->id, ix, ap->port_no); | ||
633 | 623 | ||
634 | /* Don't continue if not a SATA device. */ | 624 | /* Don't continue if not a SATA device. */ |
635 | if (!(ap->cbl == ATA_CBL_SATA)) { | 625 | if (!(ap->cbl == ATA_CBL_SATA)) { |
@@ -685,9 +675,8 @@ int ata_acpi_push_id(struct ata_port *ap, unsigned int ix) | |||
685 | if (err < 0) { | 675 | if (err < 0) { |
686 | if (ata_msg_probe(ap)) | 676 | if (ata_msg_probe(ap)) |
687 | ata_dev_printk(atadev, KERN_DEBUG, | 677 | ata_dev_printk(atadev, KERN_DEBUG, |
688 | "ata%u(%u): %s _SDD error: status = 0x%x\n", | 678 | "%s _SDD error: status = 0x%x\n", |
689 | ap->id, ap->device->devno, | 679 | __FUNCTION__, status); |
690 | __FUNCTION__, status); | ||
691 | } | 680 | } |
692 | 681 | ||
693 | /* always return success */ | 682 | /* always return success */ |