linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: jeff@garzik.org, akpm@osdl.org, linux-ide@vger.kernel.org
Subject: [PATCH] pata_atiixp: Don't disable
Date: Wed, 30 Apr 2008 18:26:45 +0100	[thread overview]
Message-ID: <20080430182645.47e66c47@core> (raw)

A couple of distributions (Fedora, Ubuntu) were having weird problems
with the ATI IXP series PATA controllers being reported as simplex. At the
heart of the problem is that both distros ignored the recommendations to
load pata_acpi and ata_generic *AFTER* specific host drivers.

The underlying cause however is that if you D3 and then D0 an ATI IXP it
helpfully throws away some configuration and won't let you rewrite it.

Add checks to ata_generic and pata_acpi to pin ATIIXP devices. Possibly
the real answer here is to quirk them and pin them, but right now we
can't do that before they've been pcim_enable()'d by a driver.

I'm indebted to David Gero for this. His bug report not only reported the
problem but identified the cause correctly and he had tested the right
values to prove what was going on

[If you backport this for 2.6.24 you will need to pull in the 2.6.25
removal of the bogus WARN_ON() in pcim_enagle]

Signed-off-by: Alan Cox <alan@redhat.com>
Tested-by: David Gero <davidg@havidave.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-mm1/drivers/ata/ata_generic.c linux-2.6.25-mm1/drivers/ata/ata_generic.c
--- linux.vanilla-2.6.25-mm1/drivers/ata/ata_generic.c	2008-04-28 11:36:48.000000000 +0100
+++ linux-2.6.25-mm1/drivers/ata/ata_generic.c	2008-04-29 20:18:47.000000000 +0100
@@ -152,6 +152,12 @@
 	if (dev->vendor == PCI_VENDOR_ID_AL)
 		ata_pci_bmdma_clear_simplex(dev);
 
+	if (dev->vendor == PCI_VENDOR_ID_ATI) {
+		int rc = pcim_enable_device(pdev);
+		if (rc < 0)
+			return rc;
+		pcim_pin_device(pdev);
+	}
 	return ata_pci_sff_init_one(dev, ppi, &generic_sht, NULL);
 }
 
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-mm1/drivers/ata/pata_acpi.c linux-2.6.25-mm1/drivers/ata/pata_acpi.c
--- linux.vanilla-2.6.25-mm1/drivers/ata/pata_acpi.c	2008-04-28 11:36:48.000000000 +0100
+++ linux-2.6.25-mm1/drivers/ata/pata_acpi.c	2008-04-29 20:20:04.000000000 +0100
@@ -259,6 +259,12 @@
 		.port_ops	= &pacpi_ops,
 	};
 	const struct ata_port_info *ppi[] = { &info, NULL };
+	if (pdev->vendor == PCI_VENDOR_ID_ATI) {
+		int rc = pcim_enable_device(pdev);
+		if (rc < 0)
+			return rc;
+		pcim_pin_device(pdev);
+	}
 	return ata_pci_sff_init_one(pdev, ppi, &pacpi_sht, NULL);
 }
 
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-mm1/drivers/ata/pata_atiixp.c linux-2.6.25-mm1/drivers/ata/pata_atiixp.c
--- linux.vanilla-2.6.25-mm1/drivers/ata/pata_atiixp.c	2008-04-28 11:36:48.000000000 +0100
+++ linux-2.6.25-mm1/drivers/ata/pata_atiixp.c	2008-04-29 20:14:01.000000000 +0100
@@ -243,9 +243,6 @@
 		.port_ops = &atiixp_port_ops
 	};
 	const struct ata_port_info *ppi[] = { &info, NULL };
-	/* Some of the quirk reconfiguration messes up the simplex flag, so
-	   clear it again */
-	ata_pci_bmdma_clear_simplex(dev);
 	return ata_pci_sff_init_one(dev, ppi, &atiixp_sht, NULL);
 }
 

                 reply	other threads:[~2008-04-30 17:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080430182645.47e66c47@core \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@osdl.org \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).