Commit 10a9c969 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Jeff Garzik

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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent f3b1cf40
...@@ -316,6 +316,9 @@ static int hpt37x_cable_detect(struct ata_port *ap) ...@@ -316,6 +316,9 @@ static int hpt37x_cable_detect(struct ata_port *ap)
pci_read_config_byte(pdev, 0x5B, &scr2); pci_read_config_byte(pdev, 0x5B, &scr2);
pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01); pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01);
udelay(10); /* debounce */
/* Cable register now active */ /* Cable register now active */
pci_read_config_byte(pdev, 0x5A, &ata66); pci_read_config_byte(pdev, 0x5A, &ata66);
/* Restore state */ /* Restore state */
......
...@@ -128,6 +128,9 @@ static int hpt3x2n_cable_detect(struct ata_port *ap) ...@@ -128,6 +128,9 @@ static int hpt3x2n_cable_detect(struct ata_port *ap)
pci_read_config_byte(pdev, 0x5B, &scr2); pci_read_config_byte(pdev, 0x5B, &scr2);
pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01); pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01);
udelay(10); /* debounce */
/* Cable register now active */ /* Cable register now active */
pci_read_config_byte(pdev, 0x5A, &ata66); pci_read_config_byte(pdev, 0x5A, &ata66);
/* Restore state */ /* Restore state */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment