aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-11-19 14:31:31 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-12-03 02:46:35 -0500
commit10a9c969222de5302cff0bb41dd7f114f9aa8e5d (patch)
tree27f9feaf8ab5b255d384c5bf1734c0458a68f25d
parentf3b1cf40d4012351d793793b2965aca57cc9fdd5 (diff)
pata_hpt{37x,3x2n}: add debounce delay to cable detection methods
Alan Cox reported that cable detection sometimes works unreliably for HPT3xxN and that the issue is fixed by adding debounce delay as used by the vendor driver. Sergei Shtylyov also noticed that debounce delay is needed for all HPT37x and HPT3xxN chipsets according to vendor drivers. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/ata/pata_hpt37x.c3
-rw-r--r--drivers/ata/pata_hpt3x2n.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index 0921e8b30a08..9f5189c700bb 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -316,6 +316,9 @@ static int hpt37x_cable_detect(struct ata_port *ap)
316 316
317 pci_read_config_byte(pdev, 0x5B, &scr2); 317 pci_read_config_byte(pdev, 0x5B, &scr2);
318 pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01); 318 pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01);
319
320 udelay(10); /* debounce */
321
319 /* Cable register now active */ 322 /* Cable register now active */
320 pci_read_config_byte(pdev, 0x5A, &ata66); 323 pci_read_config_byte(pdev, 0x5A, &ata66);
321 /* Restore state */ 324 /* Restore state */
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
index 2ab9fd6c597f..8d63eba782ff 100644
--- a/drivers/ata/pata_hpt3x2n.c
+++ b/drivers/ata/pata_hpt3x2n.c
@@ -128,6 +128,9 @@ static int hpt3x2n_cable_detect(struct ata_port *ap)
128 128
129 pci_read_config_byte(pdev, 0x5B, &scr2); 129 pci_read_config_byte(pdev, 0x5B, &scr2);
130 pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01); 130 pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01);
131
132 udelay(10); /* debounce */
133
131 /* Cable register now active */ 134 /* Cable register now active */
132 pci_read_config_byte(pdev, 0x5A, &ata66); 135 pci_read_config_byte(pdev, 0x5A, &ata66);
133 /* Restore state */ 136 /* Restore state */