linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pata_amd: Check enable bits on Nvidia
@ 2006-09-12 16:14 Alan Cox
  2006-09-13 19:12 ` Krzysztof Halasa
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2006-09-12 16:14 UTC (permalink / raw)
  To: akpm, jgarzik, linux-kernel, linux-ide

A couple of people reported long delays on probe with the newer kernels
and Nvidia PATA. This turned out to be because the Nvidia path forgot to
check the enable bits so probed empty ports.

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc6-mm1/drivers/ata/pata_amd.c linux-2.6.18-rc6-mm1/drivers/ata/pata_amd.c
--- linux.vanilla-2.6.18-rc6-mm1/drivers/ata/pata_amd.c	2006-09-11 17:00:08.000000000 +0100
+++ linux-2.6.18-rc6-mm1/drivers/ata/pata_amd.c	2006-09-11 17:17:19.000000000 +0100
@@ -25,7 +25,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME "pata_amd"
-#define DRV_VERSION "0.2.2"
+#define DRV_VERSION "0.2.3"
 
 /**
  *	timing_setup		-	shared timing computation and load
@@ -253,11 +253,22 @@
 
 static int nv_pre_reset(struct ata_port *ap) {
 	static const u8 bitmask[2] = {0x03, 0xC0};
+	static const struct pci_bits nv_enable_bits[] = {
+		{ 0x50, 1, 0x02, 0x02 },
+		{ 0x50, 1, 0x01, 0x01 }
+	};
 
 	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
 	u8 ata66;
 	u16 udma;
 
+	if (!pci_test_config_bits(pdev, &nv_enable_bits[ap->port_no])) {
+		ata_port_disable(ap);
+		printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
+		return 0;
+	}
+
+
 	pci_read_config_byte(pdev, 0x52, &ata66);
 	if (ata66 & bitmask[ap->port_no])
 		ap->cbl = ATA_CBL_PATA80;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] pata_amd: Check enable bits on Nvidia
  2006-09-12 16:14 [PATCH] pata_amd: Check enable bits on Nvidia Alan Cox
@ 2006-09-13 19:12 ` Krzysztof Halasa
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Halasa @ 2006-09-13 19:12 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, jgarzik, linux-kernel, linux-ide

Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

> +++ linux-2.6.18-rc6-mm1/drivers/ata/pata_amd.c	2006-09-11 17:17:19.000000000 +0100
> @@ -25,7 +25,7 @@
>  #include <linux/libata.h>
>  
>  #define DRV_NAME "pata_amd"
> -#define DRV_VERSION "0.2.2"
> +#define DRV_VERSION "0.2.3"
>  
>  /**
>   *	timing_setup		-	shared timing computation and load
> @@ -253,11 +253,22 @@
>  
>  static int nv_pre_reset(struct ata_port *ap) {
>  	static const u8 bitmask[2] = {0x03, 0xC0};
> +	static const struct pci_bits nv_enable_bits[] = {
> +		{ 0x50, 1, 0x02, 0x02 },
> +		{ 0x50, 1, 0x01, 0x01 }
> +	};
>  
>  	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
>  	u8 ata66;
>  	u16 udma;
>  
> +	if (!pci_test_config_bits(pdev, &nv_enable_bits[ap->port_no])) {
> +		ata_port_disable(ap);
> +		printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
> +		return 0;
> +	}
> +
> +

Well, it's now a bit better :-)

ata4: port disabled. ignoring.
ata4: SRST failed (status 0xFF)
ata4: SRST failed (err_mask=0x100)
ata4: softreset failed, retrying in 5 secs
ata4: SRST failed (status 0xFF)
ata4: SRST failed (err_mask=0x100)
ata4: softreset failed, retrying in 5 secs
ata4: SRST failed (status 0xFF)
ata4: SRST failed (err_mask=0x100)
ata4: reset failed, giving up
-- 
Krzysztof Halasa

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-13 19:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-12 16:14 [PATCH] pata_amd: Check enable bits on Nvidia Alan Cox
2006-09-13 19:12 ` Krzysztof Halasa

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).