From: Sasha Levin Date: Thu, 3 Mar 2022 21:33:06 +0000 (-0500) Subject: Fixes for 4.19 X-Git-Tag: v4.9.305~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57736280c4e1a93727a81f4f3832a28dd6468884;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/ata-pata_hpt37x-fix-pci-clock-detection.patch b/queue-4.19/ata-pata_hpt37x-fix-pci-clock-detection.patch new file mode 100644 index 00000000000..b0501bb25b0 --- /dev/null +++ b/queue-4.19/ata-pata_hpt37x-fix-pci-clock-detection.patch @@ -0,0 +1,45 @@ +From 454a9992876b5b5de772d28bfd9aa937775c77a2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 19 Feb 2022 23:04:29 +0300 +Subject: ata: pata_hpt37x: fix PCI clock detection + +From: Sergey Shtylyov + +[ 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 +Fixes: 669a5db411d8 ("[libata] Add a bunch of PATA drivers.") +Cc: stable@vger.kernel.org +Signed-off-by: Damien Le Moal +Signed-off-by: Sasha Levin +--- + drivers/ata/pata_hpt37x.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c +index f44136a3a1635..c2ee0ba2fbc67 100644 +--- a/drivers/ata/pata_hpt37x.c ++++ b/drivers/ata/pata_hpt37x.c +@@ -961,14 +961,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); + } +-- +2.34.1 + diff --git a/queue-4.19/series b/queue-4.19/series index 260a6c4311f..ffc559675f6 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -11,3 +11,4 @@ i2c-qup-allow-compile_test.patch net-usb-cdc_mbim-avoid-altsetting-toggling-for-telit.patch usb-gadget-don-t-release-an-existing-dev-buf.patch usb-gadget-clear-related-members-when-goto-fail.patch +ata-pata_hpt37x-fix-pci-clock-detection.patch