hpt366: add debounce delay to cable_detect() method

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

While at it, get rid of unneeded parens/space in the vicinity...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Sergei Shtylyov 2010-09-27 11:00:40 -07:00 committed by David S. Miller
parent b18cae4224
commit 5d3f1a493e

View file

@ -1173,8 +1173,9 @@ static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)
u16 mcr; u16 mcr;
pci_read_config_word(dev, mcr_addr, &mcr); pci_read_config_word(dev, mcr_addr, &mcr);
pci_write_config_word(dev, mcr_addr, (mcr | 0x8000)); pci_write_config_word(dev, mcr_addr, mcr | 0x8000);
/* now read cable id register */ /* Debounce, then read cable ID register */
udelay(10);
pci_read_config_byte(dev, 0x5a, &scr1); pci_read_config_byte(dev, 0x5a, &scr1);
pci_write_config_word(dev, mcr_addr, mcr); pci_write_config_word(dev, mcr_addr, mcr);
} else if (chip_type >= HPT370) { } else if (chip_type >= HPT370) {
@ -1185,8 +1186,9 @@ static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)
u8 scr2 = 0; u8 scr2 = 0;
pci_read_config_byte(dev, 0x5b, &scr2); pci_read_config_byte(dev, 0x5b, &scr2);
pci_write_config_byte(dev, 0x5b, (scr2 & ~1)); pci_write_config_byte(dev, 0x5b, scr2 & ~1);
/* now read cable id register */ /* Debounce, then read cable ID register */
udelay(10);
pci_read_config_byte(dev, 0x5a, &scr1); pci_read_config_byte(dev, 0x5a, &scr1);
pci_write_config_byte(dev, 0x5b, scr2); pci_write_config_byte(dev, 0x5b, scr2);
} else } else