summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorSergey Shtylyov <s.shtylyov@omp.ru>2022-02-19 23:04:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-08 19:12:33 +0100
commitb2a3068d5f152c027a4615413e2d162859183bfb (patch)
tree8602980b4d9336cf75b51bec8068f7ac4efcefc9 /drivers/ata
parente0bcd6b5779352aed88f2e538a82a39f1a7715bb (diff)
downloadlinux-stable-b2a3068d5f152c027a4615413e2d162859183bfb.tar.gz
linux-stable-b2a3068d5f152c027a4615413e2d162859183bfb.tar.bz2
linux-stable-b2a3068d5f152c027a4615413e2d162859183bfb.zip
ata: pata_hpt37x: fix PCI clock detection
[ Upstream commit 5f6b0f2d037c8864f20ff15311c695f65eb09db5 ] 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: 669a5db411d8 ("[libata] Add a bunch of PATA drivers.") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_hpt37x.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index ae8375e9d268..9d371859e81e 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -964,14 +964,14 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
if ((freq >> 12) != 0xABCDE) {
int i;
- u8 sr;
+ u16 sr;
u32 total = 0;
pr_warn("BIOS has not set timing clocks\n");
/* This is the process the HPT371 BIOS is reported to use */
for (i = 0; i < 128; i++) {
- pci_read_config_byte(dev, 0x78, &sr);
+ pci_read_config_word(dev, 0x78, &sr);
total += sr & 0x1FF;
udelay(15);
}