diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-03-09 10:54:42 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 14:15:59 -0400 |
commit | 8cdfb29c0cd8018f92214c11c631d8926f4cb032 (patch) | |
tree | d4a74d25c301e4c045ca21c45dbcbeadde234548 /drivers/pci/quirks.c | |
parent | e424675f152572d8d2365e351b90bfd81686a150 (diff) |
libata/IDE: remove combined mode quirk
Both old-IDE and libata should be able handle all controllers and
devices found using normal resource reservation methods.
This eliminates the awful, low-performing split-driver configuration
where old-IDE drove the PATA portion of a PCI device, in PIO-only mode,
and libata drove the SATA portion of the /same/ PCI device, in DMA mode.
Typically vendors would ship SATA hard drive / PATA optical
configuration, which would lend itself to slow (PIO-only) CD-ROM
performance.
For Intel users running in combined mode, it is now wholly dependent on
your driver choice (potentially link order, if you compile both drivers
in) whether old-IDE or libata will drive your hardware.
In either case, you will get full performance from both SATA and PATA
ports now, without having to pass a kernel command line parameter.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 65d6f23ead41..3411483240cd 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1303,119 +1303,6 @@ static void __init quirk_alder_ioapic(struct pci_dev *pdev) | |||
1303 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic ); | 1303 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic ); |
1304 | #endif | 1304 | #endif |
1305 | 1305 | ||
1306 | enum ide_combined_type { COMBINED = 0, IDE = 1, LIBATA = 2 }; | ||
1307 | /* Defaults to combined */ | ||
1308 | static enum ide_combined_type combined_mode; | ||
1309 | |||
1310 | static int __init combined_setup(char *str) | ||
1311 | { | ||
1312 | if (!strncmp(str, "ide", 3)) | ||
1313 | combined_mode = IDE; | ||
1314 | else if (!strncmp(str, "libata", 6)) | ||
1315 | combined_mode = LIBATA; | ||
1316 | else /* "combined" or anything else defaults to old behavior */ | ||
1317 | combined_mode = COMBINED; | ||
1318 | |||
1319 | return 1; | ||
1320 | } | ||
1321 | __setup("combined_mode=", combined_setup); | ||
1322 | |||
1323 | #ifdef CONFIG_SATA_INTEL_COMBINED | ||
1324 | static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev) | ||
1325 | { | ||
1326 | u8 prog, comb, tmp; | ||
1327 | int ich = 0; | ||
1328 | |||
1329 | /* | ||
1330 | * Narrow down to Intel SATA PCI devices. | ||
1331 | */ | ||
1332 | switch (pdev->device) { | ||
1333 | /* PCI ids taken from drivers/scsi/ata_piix.c */ | ||
1334 | case 0x24d1: | ||
1335 | case 0x24df: | ||
1336 | case 0x25a3: | ||
1337 | case 0x25b0: | ||
1338 | ich = 5; | ||
1339 | break; | ||
1340 | case 0x2651: | ||
1341 | case 0x2652: | ||
1342 | case 0x2653: | ||
1343 | case 0x2680: /* ESB2 */ | ||
1344 | ich = 6; | ||
1345 | break; | ||
1346 | case 0x27c0: | ||
1347 | case 0x27c4: | ||
1348 | ich = 7; | ||
1349 | break; | ||
1350 | case 0x2828: /* ICH8M */ | ||
1351 | ich = 8; | ||
1352 | break; | ||
1353 | default: | ||
1354 | /* we do not handle this PCI device */ | ||
1355 | return; | ||
1356 | } | ||
1357 | |||
1358 | /* | ||
1359 | * Read combined mode register. | ||
1360 | */ | ||
1361 | pci_read_config_byte(pdev, 0x90, &tmp); /* combined mode reg */ | ||
1362 | |||
1363 | if (ich == 5) { | ||
1364 | tmp &= 0x6; /* interesting bits 2:1, PATA primary/secondary */ | ||
1365 | if (tmp == 0x4) /* bits 10x */ | ||
1366 | comb = (1 << 0); /* SATA port 0, PATA port 1 */ | ||
1367 | else if (tmp == 0x6) /* bits 11x */ | ||
1368 | comb = (1 << 2); /* PATA port 0, SATA port 1 */ | ||
1369 | else | ||
1370 | return; /* not in combined mode */ | ||
1371 | } else { | ||
1372 | WARN_ON((ich != 6) && (ich != 7) && (ich != 8)); | ||
1373 | tmp &= 0x3; /* interesting bits 1:0 */ | ||
1374 | if (tmp & (1 << 0)) | ||
1375 | comb = (1 << 2); /* PATA port 0, SATA port 1 */ | ||
1376 | else if (tmp & (1 << 1)) | ||
1377 | comb = (1 << 0); /* SATA port 0, PATA port 1 */ | ||
1378 | else | ||
1379 | return; /* not in combined mode */ | ||
1380 | } | ||
1381 | |||
1382 | /* | ||
1383 | * Read programming interface register. | ||
1384 | * (Tells us if it's legacy or native mode) | ||
1385 | */ | ||
1386 | pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog); | ||
1387 | |||
1388 | /* if SATA port is in native mode, we're ok. */ | ||
1389 | if (prog & comb) | ||
1390 | return; | ||
1391 | |||
1392 | /* Don't reserve any so the IDE driver can get them (but only if | ||
1393 | * combined_mode=ide). | ||
1394 | */ | ||
1395 | if (combined_mode == IDE) | ||
1396 | return; | ||
1397 | |||
1398 | /* Grab them both for libata if combined_mode=libata. */ | ||
1399 | if (combined_mode == LIBATA) { | ||
1400 | request_region(0x1f0, 8, "libata"); /* port 0 */ | ||
1401 | request_region(0x170, 8, "libata"); /* port 1 */ | ||
1402 | return; | ||
1403 | } | ||
1404 | |||
1405 | /* SATA port is in legacy mode. Reserve port so that | ||
1406 | * IDE driver does not attempt to use it. If request_region | ||
1407 | * fails, it will be obvious at boot time, so we don't bother | ||
1408 | * checking return values. | ||
1409 | */ | ||
1410 | if (comb == (1 << 0)) | ||
1411 | request_region(0x1f0, 8, "libata"); /* port 0 */ | ||
1412 | else | ||
1413 | request_region(0x170, 8, "libata"); /* port 1 */ | ||
1414 | } | ||
1415 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_intel_ide_combined ); | ||
1416 | #endif /* CONFIG_SATA_INTEL_COMBINED */ | ||
1417 | |||
1418 | |||
1419 | int pcie_mch_quirk; | 1306 | int pcie_mch_quirk; |
1420 | EXPORT_SYMBOL(pcie_mch_quirk); | 1307 | EXPORT_SYMBOL(pcie_mch_quirk); |
1421 | 1308 | ||