~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to drivers/ata/sata_sil24.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
268
268
        struct sil24_atapi_block atapi;
269
269
};
270
270
 
271
 
static struct sil24_cerr_info {
 
271
static const struct sil24_cerr_info {
272
272
        unsigned int err_mask, action;
273
273
        const char *desc;
274
274
} sil24_cerr_db[] = {
694
694
        return 0;
695
695
 
696
696
 err:
697
 
        ata_link_printk(link, KERN_ERR, "softreset failed (%s)\n", reason);
 
697
        ata_link_err(link, "softreset failed (%s)\n", reason);
698
698
        return -EIO;
699
699
}
700
700
 
714
714
         * This happens often after PM DMA CS errata.
715
715
         */
716
716
        if (pp->do_port_rst) {
717
 
                ata_port_printk(ap, KERN_WARNING, "controller in dubious "
718
 
                                "state, performing PORT_RST\n");
 
717
                ata_port_warn(ap,
 
718
                              "controller in dubious state, performing PORT_RST\n");
719
719
 
720
720
                writel(PORT_CS_PORT_RST, port + PORT_CTRL_STAT);
721
721
                ata_msleep(ap, 10);
773
773
                goto retry;
774
774
        }
775
775
 
776
 
        ata_link_printk(link, KERN_ERR, "hardreset failed (%s)\n", reason);
 
776
        ata_link_err(link, "hardreset failed (%s)\n", reason);
777
777
        return -EIO;
778
778
}
779
779
 
925
925
 
926
926
        if (sata_pmp_gscr_vendor(gscr) == 0x11ab &&
927
927
            sata_pmp_gscr_devid(gscr) == 0x4140) {
928
 
                ata_port_printk(ap, KERN_INFO,
 
928
                ata_port_info(ap,
929
929
                        "disabling NCQ support due to sil24-mv4140 quirk\n");
930
930
                ap->flags &= ~ATA_FLAG_NCQ;
931
931
        }
946
946
 
947
947
        rc = sil24_init_port(link->ap);
948
948
        if (rc) {
949
 
                ata_link_printk(link, KERN_ERR,
950
 
                                "hardreset failed (port not ready)\n");
 
949
                ata_link_err(link, "hardreset failed (port not ready)\n");
951
950
                return rc;
952
951
        }
953
952
 
1020
1019
 
1021
1020
        /* deal with command error */
1022
1021
        if (irq_stat & PORT_IRQ_ERROR) {
1023
 
                struct sil24_cerr_info *ci = NULL;
 
1022
                const struct sil24_cerr_info *ci = NULL;
1024
1023
                unsigned int err_mask = 0, action = 0;
1025
1024
                u32 context, cerr;
1026
1025
                int pmp;
1141
1140
 
1142
1141
        /* spurious interrupts are expected if PCIX_IRQ_WOC */
1143
1142
        if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit())
1144
 
                ata_port_printk(ap, KERN_INFO, "spurious interrupt "
1145
 
                        "(slot_stat 0x%x active_tag %d sactive 0x%x)\n",
 
1143
                ata_port_info(ap,
 
1144
                        "spurious interrupt (slot_stat 0x%x active_tag %d sactive 0x%x)\n",
1146
1145
                        slot_stat, ap->link.active_tag, ap->link.sactive);
1147
1146
}
1148
1147
 
1256
1255
                                                PORT_CS_PORT_RST,
1257
1256
                                                PORT_CS_PORT_RST, 10, 100);
1258
1257
                        if (tmp & PORT_CS_PORT_RST)
1259
 
                                dev_printk(KERN_ERR, host->dev,
1260
 
                                           "failed to clear port RST\n");
 
1258
                                dev_err(host->dev,
 
1259
                                        "failed to clear port RST\n");
1261
1260
                }
1262
1261
 
1263
1262
                /* configure port */
1271
1270
static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1272
1271
{
1273
1272
        extern int __MARKER__sil24_cmd_block_is_sized_wrongly;
1274
 
        static int printed_version;
1275
1273
        struct ata_port_info pi = sil24_port_info[ent->driver_data];
1276
1274
        const struct ata_port_info *ppi[] = { &pi, NULL };
1277
1275
        void __iomem * const *iomap;
1283
1281
        if (sizeof(union sil24_cmd_block) != PAGE_SIZE)
1284
1282
                __MARKER__sil24_cmd_block_is_sized_wrongly = 1;
1285
1283
 
1286
 
        if (!printed_version++)
1287
 
                dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
 
1284
        ata_print_version_once(&pdev->dev, DRV_VERSION);
1288
1285
 
1289
1286
        /* acquire resources */
1290
1287
        rc = pcim_enable_device(pdev);
1302
1299
        if (pi.flags & SIL24_FLAG_PCIX_IRQ_WOC) {
1303
1300
                tmp = readl(iomap[SIL24_HOST_BAR] + HOST_CTRL);
1304
1301
                if (tmp & (HOST_CTRL_TRDY | HOST_CTRL_STOP | HOST_CTRL_DEVSEL))
1305
 
                        dev_printk(KERN_INFO, &pdev->dev,
1306
 
                                   "Applying completion IRQ loss on PCI-X "
1307
 
                                   "errata fix\n");
 
1302
                        dev_info(&pdev->dev,
 
1303
                                 "Applying completion IRQ loss on PCI-X errata fix\n");
1308
1304
                else
1309
1305
                        pi.flags &= ~SIL24_FLAG_PCIX_IRQ_WOC;
1310
1306
        }
1322
1318
                if (rc) {
1323
1319
                        rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
1324
1320
                        if (rc) {
1325
 
                                dev_printk(KERN_ERR, &pdev->dev,
1326
 
                                           "64-bit DMA enable failed\n");
 
1321
                                dev_err(&pdev->dev,
 
1322
                                        "64-bit DMA enable failed\n");
1327
1323
                                return rc;
1328
1324
                        }
1329
1325
                }
1330
1326
        } else {
1331
1327
                rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
1332
1328
                if (rc) {
1333
 
                        dev_printk(KERN_ERR, &pdev->dev,
1334
 
                                   "32-bit DMA enable failed\n");
 
1329
                        dev_err(&pdev->dev, "32-bit DMA enable failed\n");
1335
1330
                        return rc;
1336
1331
                }
1337
1332
                rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
1338
1333
                if (rc) {
1339
 
                        dev_printk(KERN_ERR, &pdev->dev,
1340
 
                                   "32-bit consistent DMA enable failed\n");
 
1334
                        dev_err(&pdev->dev,
 
1335
                                "32-bit consistent DMA enable failed\n");
1341
1336
                        return rc;
1342
1337
                }
1343
1338
        }
1350
1345
        sil24_init_controller(host);
1351
1346
 
1352
1347
        if (sata_sil24_msi && !pci_enable_msi(pdev)) {
1353
 
                dev_printk(KERN_INFO, &pdev->dev, "Using MSI\n");
 
1348
                dev_info(&pdev->dev, "Using MSI\n");
1354
1349
                pci_intx(pdev, 0);
1355
1350
        }
1356
1351