* [PATCH #upstream-fixes] ahci: don't attach if ICH6 is in combined mode
@ 2007-12-06 6:09 Tejun Heo
2007-12-07 20:30 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2007-12-06 6:09 UTC (permalink / raw)
To: Jeff Garzik, IDE/ATA development list, notting
ICH6 R/Ms share PCI ID between piix and ahci modes and we've been
allowing ahci to attach regardless of how BIOS configured it.
However, enabling AHCI mode when the controller is in combined mode
can result in unexpected behavior. Don't attach if the controller is
in combined mode.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Bill Nottingham <notting@redhat.com>
---
drivers/ata/ahci.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
Index: work/drivers/ata/ahci.c
===================================================================
--- work.orig/drivers/ata/ahci.c
+++ work/drivers/ata/ahci.c
@@ -193,6 +193,8 @@ enum {
ATA_FLAG_ACPI_SATA | ATA_FLAG_AN |
ATA_FLAG_IPM,
AHCI_LFLAG_COMMON = ATA_LFLAG_SKIP_D2H_BSY,
+
+ ICH_MAP = 0x90, /* ICH MAP register */
};
struct ahci_cmd_hdr {
@@ -2273,6 +2275,22 @@ static int ahci_init_one(struct pci_dev
if (rc)
return rc;
+ if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
+ (pdev->device == 0x2652 || pdev->device == 0x2653)) {
+ u8 map;
+
+ /* ICH6s share the same PCI ID for both piix and ahci
+ * modes. Enabling ahci mode while MAP indicates
+ * combined mode is a bad idea. Yield to ata_piix.
+ */
+ pci_read_config_byte(pdev, ICH_MAP, &map);
+ if (map & 0x3) {
+ dev_printk(KERN_INFO, &pdev->dev, "controller is in "
+ "combined mode, can't enable AHCI mode\n");
+ return -ENODEV;
+ }
+ }
+
hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
if (!hpriv)
return -ENOMEM;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH #upstream-fixes] ahci: don't attach if ICH6 is in combined mode
2007-12-06 6:09 [PATCH #upstream-fixes] ahci: don't attach if ICH6 is in combined mode Tejun Heo
@ 2007-12-07 20:30 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-12-07 20:30 UTC (permalink / raw)
To: Tejun Heo; +Cc: IDE/ATA development list, notting
Tejun Heo wrote:
> ICH6 R/Ms share PCI ID between piix and ahci modes and we've been
> allowing ahci to attach regardless of how BIOS configured it.
> However, enabling AHCI mode when the controller is in combined mode
> can result in unexpected behavior. Don't attach if the controller is
> in combined mode.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> Cc: Bill Nottingham <notting@redhat.com>
> ---
> drivers/ata/ahci.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
applied both ahci fixes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-07 20:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-06 6:09 [PATCH #upstream-fixes] ahci: don't attach if ICH6 is in combined mode Tejun Heo
2007-12-07 20:30 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).