All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pata_atiixp: propogate cable detection hack from drivers/ide to the new driver
@ 2007-01-31 17:10 Alan
  2007-02-02 16:54 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Alan @ 2007-01-31 17:10 UTC (permalink / raw)
  To: akpm, linux-kernel, jgarzik

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

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc6-mm3/drivers/ata/pata_atiixp.c linux-2.6.20-rc6-mm3/drivers/ata/pata_atiixp.c
--- linux.vanilla-2.6.20-rc6-mm3/drivers/ata/pata_atiixp.c	2007-01-31 14:20:10.000000000 +0000
+++ linux-2.6.20-rc6-mm3/drivers/ata/pata_atiixp.c	2007-01-31 15:05:11.000000000 +0000
@@ -36,15 +36,22 @@
 static int atiixp_pre_reset(struct ata_port *ap)
 {
 	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
-	static struct pci_bits atiixp_enable_bits[] = {
+	static const struct pci_bits atiixp_enable_bits[] = {
 		{ 0x48, 1, 0x01, 0x00 },
 		{ 0x48, 1, 0x08, 0x00 }
 	};
+	u8 udma;
 
 	if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no]))
 		return -ENOENT;
 
-	ap->cbl = ATA_CBL_PATA80;
+	/* Hack from drivers/ide/pci. Really we want to know how to do the
+	   raw detection not play follow the bios mode guess */
+	pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap->port_no, &udma);
+	if ((udma & 0x07) >= 0x04 || (udma & 0x70) >= 0x40)
+		ap->cbl = ATA_CBL_PATA80;
+	else
+		ap->cbl = ATA_CBL_PATA40;
 	return ata_std_prereset(ap);
 }
 

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

* Re: [PATCH] pata_atiixp: propogate cable detection hack from drivers/ide to the new driver
  2007-01-31 17:10 [PATCH] pata_atiixp: propogate cable detection hack from drivers/ide to the new driver Alan
@ 2007-02-02 16:54 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-02-02 16:54 UTC (permalink / raw)
  To: Alan; +Cc: akpm, linux-kernel

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

applied


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

end of thread, other threads:[~2007-02-02 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-31 17:10 [PATCH] pata_atiixp: propogate cable detection hack from drivers/ide to the new driver Alan
2007-02-02 16:54 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.