]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Thu, 3 Mar 2022 21:33:07 +0000 (16:33 -0500)
committerSasha Levin <sashal@kernel.org>
Thu, 3 Mar 2022 21:33:07 +0000 (16:33 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/ata-pata_hpt37x-fix-pci-clock-detection.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/ata-pata_hpt37x-fix-pci-clock-detection.patch b/queue-4.14/ata-pata_hpt37x-fix-pci-clock-detection.patch
new file mode 100644 (file)
index 0000000..930015a
--- /dev/null
@@ -0,0 +1,45 @@
+From 5c5b76d9bfb0739b965040fd478e88847762667b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 19 Feb 2022 23:04:29 +0300
+Subject: ata: pata_hpt37x: fix PCI clock detection
+
+From: Sergey Shtylyov <s.shtylyov@omp.ru>
+
+[ 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>
+---
+ 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 821fc1f2324c8..44cc02afaa8bd 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);
+               }
+-- 
+2.34.1
+
index fd9ec84c21a8d9ee2643497082723dae11f05485..3b01afd79636fad5eb7ad3ad8bd07631ae56ba0f 100644 (file)
@@ -9,3 +9,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