Skip to content

Commit 5f6b0f2

Browse files
Sergey ShtylyovDamien Le Moal
authored andcommitted
ata: pata_hpt37x: fix PCI clock detection
The f_CNT register (at the PCI config. address 0x78) is 16-bit, not 8-bit! The bug was there from the very start... :-( Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Fixes: 669a5db ("[libata] Add a bunch of PATA drivers.") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
1 parent c8ea23d commit 5f6b0f2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/ata/pata_hpt37x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,14 +950,14 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
950950

951951
if ((freq >> 12) != 0xABCDE) {
952952
int i;
953-
u8 sr;
953+
u16 sr;
954954
u32 total = 0;
955955

956956
dev_warn(&dev->dev, "BIOS has not set timing clocks\n");
957957

958958
/* This is the process the HPT371 BIOS is reported to use */
959959
for (i = 0; i < 128; i++) {
960-
pci_read_config_byte(dev, 0x78, &sr);
960+
pci_read_config_word(dev, 0x78, &sr);
961961
total += sr & 0x1FF;
962962
udelay(15);
963963
}

0 commit comments

Comments
 (0)