Commit 834009170986f295c5eca37c76c59f1b28670d69

Authored by Aaron Lu
Committed by Jeff Garzik
1 parent 389cd78496

[libata] acpi: call ata_acpi_gtm during ata port init time

Commit 30dcf76acc695cbd2fa919e294670fe9552e16e7 mistakenly dropped
the code to get an initial gtm for the IDE channel. This caused the
following problem for Sergei:
http://marc.info/?l=linux-kernel&m=134484963618457&w=2

Fix this by adding the call back in ata_acpi_bind_host, and due to
this, the ata_ap_acpi_handle is modified accordingly.

Tested-by: Sergei Trofimovich <slyich@gmail.com>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

Showing 1 changed file with 4 additions and 11 deletions Side-by-side Diff

drivers/ata/libata-acpi.c
... ... @@ -60,17 +60,7 @@
60 60 if (ap->flags & ATA_FLAG_ACPI_SATA)
61 61 return NULL;
62 62  
63   - /*
64   - * If acpi bind operation has already happened, we can get the handle
65   - * for the port by checking the corresponding scsi_host device's
66   - * firmware node, otherwise we will need to find out the handle from
67   - * its parent's acpi node.
68   - */
69   - if (ap->scsi_host)
70   - return DEVICE_ACPI_HANDLE(&ap->scsi_host->shost_gendev);
71   - else
72   - return acpi_get_child(DEVICE_ACPI_HANDLE(ap->host->dev),
73   - ap->port_no);
  63 + return acpi_get_child(DEVICE_ACPI_HANDLE(ap->host->dev), ap->port_no);
74 64 }
75 65 EXPORT_SYMBOL(ata_ap_acpi_handle);
76 66  
... ... @@ -1100,6 +1090,9 @@
1100 1090  
1101 1091 if (!*handle)
1102 1092 return -ENODEV;
  1093 +
  1094 + if (ata_acpi_gtm(ap, &ap->__acpi_init_gtm) == 0)
  1095 + ap->pflags |= ATA_PFLAG_INIT_GTM_VALID;
1103 1096  
1104 1097 return 0;
1105 1098 }