[POWERPC] Only offer CONFIG_BRIQ_PANEL if CONFIG_PPC_CHRP is enabled
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / scsi / ahci.c
index f059467777183f0463d604eefb3860c3884a3d36..904c25fb4ba4a26678bf81e9b8bc4315714bed5f 100644 (file)
@@ -940,14 +940,8 @@ static void ahci_host_intr(struct ata_port *ap)
                return;
 
        /* ignore interim PIO setup fis interrupts */
-       if (ata_tag_valid(ap->active_tag)) {
-               struct ata_queued_cmd *qc =
-                       ata_qc_from_tag(ap, ap->active_tag);
-
-               if (qc && qc->tf.protocol == ATA_PROT_PIO &&
-                   (status & PORT_IRQ_PIOS_FIS))
-                       return;
-       }
+       if (ata_tag_valid(ap->active_tag) && (status & PORT_IRQ_PIOS_FIS)) 
+               return;
 
        if (ata_ratelimit())
                ata_port_printk(ap, KERN_INFO, "spurious interrupt "
@@ -1052,7 +1046,7 @@ static void ahci_thaw(struct ata_port *ap)
 
 static void ahci_error_handler(struct ata_port *ap)
 {
-       if (!(ap->flags & ATA_FLAG_FROZEN)) {
+       if (!(ap->pflags & ATA_PFLAG_FROZEN)) {
                /* restart engine */
                ahci_stop_engine(ap);
                ahci_start_engine(ap);
@@ -1323,6 +1317,17 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        if (!printed_version++)
                dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
 
+       /* JMicron-specific fixup: make sure we're in AHCI mode */
+       /* This is protected from races with ata_jmicron by the pci probe
+          locking */
+       if (pdev->vendor == PCI_VENDOR_ID_JMICRON) {
+               /* AHCI enable, AHCI on function 0 */
+               pci_write_config_byte(pdev, 0x41, 0xa1);
+               /* Function 1 is the PATA controller */
+               if (PCI_FUNC(pdev->devfn))
+                       return -ENODEV;
+       }
+
        rc = pci_enable_device(pdev);
        if (rc)
                return rc;
@@ -1371,17 +1376,13 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        probe_ent->port_ops     = ahci_port_info[board_idx].port_ops;
 
                probe_ent->irq = pdev->irq;
-               probe_ent->irq_flags = SA_SHIRQ;
+               probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->mmio_base = mmio_base;
        probe_ent->private_data = hpriv;
 
        if (have_msi)
                hpriv->flags |= AHCI_FLAG_MSI;
 
-       /* JMicron-specific fixup: make sure we're in AHCI mode */
-       if (pdev->vendor == 0x197b)
-               pci_write_config_byte(pdev, 0x41, 0xa1);
-
        /* initialize adapter */
        rc = ahci_host_init(probe_ent);
        if (rc)