Browse code

linux-esx: fix BAR4 is zero issue

linux-esx always had an issue with IDE probing reporting error message:
"ata_piix 0000:00:07.1: BMDMA: BAR4 is zero, failing back to PIO"

It was caused by initial pci probe optimization which skipped initial
pci_read_bases() for IDE PCI class devices before legacy IDE quirk code.

Restoring it back fixed the problem.

Change-Id: I6e58f224daeb935f9bd59f3256d346611d7ab834
Fixes: #788
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6257
Tested-by: michellew <michellew@vmware.com>
Reviewed-by: Srinidhi Rao <srinidhir@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>

Alexey Makhalov authored on 2018/11/30 06:04:35
Showing 2 changed files
... ...
@@ -3,7 +3,24 @@ From: Alexey Makhalov <amakhalov@vmware.com>
3 3
 Date: Tue, 29 Sep 2015 15:55:49 -0700
4 4
 Subject: [PATCH] pci/probe.c: Hardcodded pci probe.
5 5
 
6
-Added pci=scan_all cmdline parameter to verify hardcodded pci values
6
+PCI probing takes a long time to scan resources for all devices
7
+on PCI bus. Idea of this patch is to hardcode known resources
8
+for known devices. In VMware hypervisor we do not have much
9
+virtual PCI devices.
10
+
11
+is_known_device() has list of known devices and available
12
+resources (BARs) for them.
13
+It returns: 0 if BAR not available for the given device
14
+            1 if available and sz parameter will have BAR size
15
+
16
+guess_bar_count() returns maximum number of BARs for the given
17
+class to do not probe for all 6 bars
18
+
19
+has_rom() returns 0 if given class does not have any ROM BARs,
20
+which allows to skip ROM probing
21
+
22
+Added pci=scan_all cmdline parameter verifies hardcodded pci
23
+values at runtime.
7 24
 ---
8 25
  drivers/pci/pci.c   |   2 +
9 26
  drivers/pci/pci.h   |   2 +
... ...
@@ -456,10 +473,10 @@ diff -ur linux-4.19.1/drivers/pci/probe.c linux-4.19.1_new/drivers/pci/probe.c
456 456
 +
457 457
 +		if (pci_scan_and_verify)
458 458
 +			pci_read_bases(dev, 6, PCI_ROM_ADDRESS);
459
-+		else if (class != PCI_CLASS_STORAGE_IDE)
459
++		else
460 460
 +			pci_read_bases(dev,
461
-+			guess_bar_count(dev->class),
462
-+			has_rom(dev->class, PCI_ROM_ADDRESS));
461
++				guess_bar_count(dev->class),
462
++				has_rom(dev->class, PCI_ROM_ADDRESS));
463 463
  
464 464
  		pci_subsystem_ids(dev, &dev->subsystem_vendor, &dev->subsystem_device);
465 465
  
... ...
@@ -2,7 +2,7 @@
2 2
 Summary:        Kernel
3 3
 Name:           linux-esx
4 4
 Version:        4.19.1
5
-Release:        2%{?dist}
5
+Release:        3%{?dist}
6 6
 License:        GPLv2
7 7
 URL:            http://www.kernel.org/
8 8
 Group:          System Environment/Kernel
... ...
@@ -186,6 +186,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
186 186
 /usr/src/linux-headers-%{uname_r}
187 187
 
188 188
 %changelog
189
+*   Thu Nov 29 2018 Alexey Makhalov <amakhalov@vmware.com> 4.19.1-3
190
+-   Fix BAR4 is zero issue for IDE devices
189 191
 *   Thu Nov 15 2018 Ajay Kaher <akaher@vmware.com> 4.19.1-2
190 192
 -   Adding BuildArch
191 193
 *   Thu Nov 08 2018 Him Kalyan Bordoloi <bordoloih@vmware.com> 4.19.1-1