diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2005-12-13 03:05:03 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-13 03:05:03 -0500 |
commit | 2bd0fa3b62e8565a80f9535e0f2bd51bba46213f (patch) | |
tree | 9364e413a6500cbe47703e50ce6f13e7a2dab756 /drivers/pci/quirks.c | |
parent | e508a391a0705f770ef1c4f1c304678b0e8e4fe8 (diff) |
[PATCH] add boot option to control Intel SATA/PATA combined mode
Combined mode sucks. Especially when both libata and the legacy IDE
drivers try to drive ports on the same device, since that makes DMA
rather difficult.
This patch addresses the problem by allowing the user to control which
driver binds to the ports in a combined mode configuration. In many
cases, they'll probably want the libata driver to control both ports
since it can use DMA for talking with ATAPI devices (when
libata.atapi_enabled=1 of course). It also allows the user to get old
school behavior by letting the legacy IDE driver bind to both ports.
But neither is forced, the patch doesn't change current behavior unless
one of combined_mode=ide or combined_mode=libata is passed
on the boot line. Either of those options may require you to access
your devices via different device nodes (/dev/hd* in the ide case
and /dev/sd* in the libata case), though of course if you have udev
installed nicely you may not notice anything. :)
Let me know if the documentation is too cryptic, I'd be happy to expand
on it if necessary. I think most users will want to boot with
'combined_mode=libata' and add 'options libata atapi_enabled=1'
to their modules.conf to get good DVD playing and disk behavior
(haven't tested CD or DVD writing though).
I'd much rather things behave sanely by default (i.e. DMA for devices on
both ports), but apparently that's difficult given the various chip
bugs and hardware configs out there (not to mention that people's
drives may suddenly change from /dev/hdc to /dev/sdb), so this boot
option may be the correct long term fix.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 3a4f49f4effb..f28ebdd3958a 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1098,6 +1098,23 @@ static void __init quirk_alder_ioapic(struct pci_dev *pdev) | |||
1098 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic ); | 1098 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EESSC, quirk_alder_ioapic ); |
1099 | #endif | 1099 | #endif |
1100 | 1100 | ||
1101 | enum ide_combined_type { COMBINED = 0, IDE = 1, LIBATA = 2 }; | ||
1102 | /* Defaults to combined */ | ||
1103 | static enum ide_combined_type combined_mode; | ||
1104 | |||
1105 | static int __init combined_setup(char *str) | ||
1106 | { | ||
1107 | if (!strncmp(str, "ide", 3)) | ||
1108 | combined_mode = IDE; | ||
1109 | else if (!strncmp(str, "libata", 6)) | ||
1110 | combined_mode = LIBATA; | ||
1111 | else /* "combined" or anything else defaults to old behavior */ | ||
1112 | combined_mode = COMBINED; | ||
1113 | |||
1114 | return 1; | ||
1115 | } | ||
1116 | __setup("combined_mode=", combined_setup); | ||
1117 | |||
1101 | #ifdef CONFIG_SCSI_SATA_INTEL_COMBINED | 1118 | #ifdef CONFIG_SCSI_SATA_INTEL_COMBINED |
1102 | static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev) | 1119 | static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev) |
1103 | { | 1120 | { |
@@ -1164,6 +1181,19 @@ static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev) | |||
1164 | if (prog & comb) | 1181 | if (prog & comb) |
1165 | return; | 1182 | return; |
1166 | 1183 | ||
1184 | /* Don't reserve any so the IDE driver can get them (but only if | ||
1185 | * combined_mode=ide). | ||
1186 | */ | ||
1187 | if (combined_mode == IDE) | ||
1188 | return; | ||
1189 | |||
1190 | /* Grab them both for libata if combined_mode=libata. */ | ||
1191 | if (combined_mode == LIBATA) { | ||
1192 | request_region(0x1f0, 8, "libata"); /* port 0 */ | ||
1193 | request_region(0x170, 8, "libata"); /* port 1 */ | ||
1194 | return; | ||
1195 | } | ||
1196 | |||
1167 | /* SATA port is in legacy mode. Reserve port so that | 1197 | /* SATA port is in legacy mode. Reserve port so that |
1168 | * IDE driver does not attempt to use it. If request_region | 1198 | * IDE driver does not attempt to use it. If request_region |
1169 | * fails, it will be obvious at boot time, so we don't bother | 1199 | * fails, it will be obvious at boot time, so we don't bother |