Skip to content

Commit

Permalink
pata_hpt{37x,3x2n}: add debounce delay to cable detection methods
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Jeff Garzik committed Dec 3, 2009
1 parent f3b1cf4 commit 10a9c96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/ata/pata_hpt37x.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ static int hpt37x_cable_detect(struct ata_port *ap)

pci_read_config_byte(pdev, 0x5B, &scr2);
pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01);

udelay(10); /* debounce */

/* Cable register now active */
pci_read_config_byte(pdev, 0x5A, &ata66);
/* Restore state */
Expand Down
3 changes: 3 additions & 0 deletions drivers/ata/pata_hpt3x2n.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ static int hpt3x2n_cable_detect(struct ata_port *ap)

pci_read_config_byte(pdev, 0x5B, &scr2);
pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01);

udelay(10); /* debounce */

/* Cable register now active */
pci_read_config_byte(pdev, 0x5A, &ata66);
/* Restore state */
Expand Down

0 comments on commit 10a9c96

Please sign in to comment.