Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/pci



Hi.

On 2019/01/28 4:05, Frank Kardel wrote:
Hi,

that made all devices being recognized during boot with UEFI - good.


We seem closer, but not there yet (for my main board at least).

There is still an issue with interrupts (or dma - see missing bus master in pci differences).

It seems device interrupts via ioapic don't get interrupts/data at all or not reliably. This affects following devices AFAICS on my system:
     com*
     wm1 (PCIe network card)
         radeon (see errors below)

MSI/X using devices seem to do fine.

Interrupt allocation is the same in both environments:

UEFI & CSM
interrupt id    device name(s)
ioapic0 pin 9   acpi SCI
ioapic0 pin 1   pckbc1 kbd
msix0 vec 0     nvme0 adminq
msix0 vec 1     nvme0 ioq1
msix0 vec 2     nvme0 ioq2
msix0 vec 3     nvme0 ioq3
msix0 vec 4     nvme0 ioq4
msix0 vec 5     nvme0 ioq5
msix0 vec 6     nvme0 ioq6
msix0 vec 7     nvme0 ioq7
msi1 vec 0      xhci0
msi2 vec 0      ahcisata0
msix3 vec 0     wm0TXRX0
msix3 vec 1     wm0TXRX1
msix3 vec 2     wm0LINK
ioapic1 pin 10  wm1, com5
ioapic1 pin 11  com2, ahd0
ioapic1 pin 8   com3
ioapic1 pin 9   com4
msi4 vec 0      hdaudio0
msi5 vec 0      mpii0
msi6 vec 0      xhci1
msi7 vec 0      ahcisata1
msi8 vec 0      hdaudio1
ioapic0 pin 4   com0
ioapic1 pin 30  radeon0

Other hickups seen:
   keyboard input (PS/2) is sometimes repeateddddd
   glxgears regularly stalls for a seconds and does not really run smoothly.
   llinfo entries for wm1 fail, arp resolution on wm1 fail
   wm1 seems completely broken - no packets are received there

dmesg differences are from efi presence, minor difference memory size, different usb detection sequence. nothing critical.

The main difference is the radeon* fails to properly initialize giving these diagnostics:
  kern info: [drm] radeon: irq initialized.
kern info: [drm] ring test on 0 succeeded in 0 usecs
kern info: [drm] ring test on 3 succeeded in 3 usecs
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c:345)uvd_v1_0_start] *ERROR* UVD not responding, trying to reset the VCPU!!!
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c:345)uvd_v1_0_start] *ERROR* UVD not responding, trying to reset the VCPU!!!
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c:345)uvd_v1_0_start] *ERROR* UVD not responding, trying to reset the VCPU!!!
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c:345)uvd_v1_0_start] *ERROR* UVD not responding, trying to reset the VCPU!!!
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c:345)uvd_v1_0_start] *ERROR* UVD not responding, trying to reset the VCPU!!!
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c:345)uvd_v1_0_start] *ERROR* UVD not responding, trying to reset the VCPU!!!
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c:345)uvd_v1_0_start] *ERROR* UVD not responding, trying to reset the VCPU!!!
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c:345)uvd_v1_0_start] *ERROR* UVD not responding, trying to reset the VCPU!!!
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c:345)uvd_v1_0_start] *ERROR* UVD not responding, trying to reset the VCPU!!!
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c:345)uvd_v1_0_start] *ERROR* UVD not responding, trying to reset the VCPU!!!
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c:354)uvd_v1_0_start] *ERROR* UVD not responding, giving up!!!
kern error: [drm:(/src/NetBSD/cur/src/sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen.c:5688)evergreen_startup] *ERROR* radeon: error initializing UVD (-1).
kern info: [drm] ib test on ring 0 succeeded in 0 usecs
kern info: [drm] ib test on ring 3 succeeded in 0 usecs

Differences between pci configs (lspic -v)
--- lspci-csm-20190127    2019-01-27 14:42:57.454117956 +0100
+++ lspci-uefi-20190127    2019-01-27 14:51:27.003880544 +0100
@@ -4,7 +4,7 @@

  00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Device 1451
      Subsystem: Advanced Micro Devices, Inc. [AMD] Device 1451
-    Flags: bus master, fast devsel, latency 0, IRQ 255
+    Flags: fast devsel, IRQ 255
      Capabilities: [40] Secure device <?>
      Capabilities: [64] MSI: Enable- Count=1/4 Maskable- 64bit+
      Capabilities: [74] HyperTransport: MSI Mapping Enable+ Fixed+
@@ -213,7 +213,7 @@
      Capabilities: [100] Advanced Error Reporting

  1d:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 43b4 (rev 02) (prog-if 00 [Normal decode])
-    Flags: bus master, fast devsel, latency 0, IRQ 11
+    Flags: fast devsel, IRQ 11
      Bus: primary=1d, secondary=1e, subordinate=1e, sec-latency=0
      I/O behind bridge: None
      Memory behind bridge: None
@@ -241,7 +241,7 @@
      Capabilities: [400] L1 PM Substates

  1d:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 43b4 (rev 02) (prog-if 00 [Normal decode])
-    Flags: bus master, fast devsel, latency 0, IRQ 5
+    Flags: fast devsel, IRQ 5
      Bus: primary=1d, secondary=20, subordinate=20, sec-latency=0
      I/O behind bridge: 0000c000-0000cfff [size=4K]
      Memory behind bridge: fcd00000-fcdfffff [size=1M]
@@ -255,7 +255,7 @@
      Capabilities: [400] L1 PM Substates

  1d:03.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 43b4 (rev 02) (prog-if 00 [Normal decode])
-    Flags: bus master, fast devsel, latency 0, IRQ 11
+    Flags: fast devsel, IRQ 11
      Bus: primary=1d, secondary=21, subordinate=21, sec-latency=0
      I/O behind bridge: 0000b000-0000bfff [size=4K]
      Memory behind bridge: fcc00000-fccfffff [size=1M]
@@ -269,7 +269,7 @@
      Capabilities: [400] L1 PM Substates

  1d:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 43b4 (rev 02) (prog-if 00 [Normal decode])
-    Flags: bus master, fast devsel, latency 0, IRQ 11
+    Flags: fast devsel, IRQ 11
      Bus: primary=1d, secondary=22, subordinate=22, sec-latency=0
      I/O behind bridge: None
      Memory behind bridge: None
@@ -283,7 +283,7 @@
      Capabilities: [400] L1 PM Substates

  1d:06.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 43b4 (rev 02) (prog-if 00 [Normal decode])
-    Flags: bus master, fast devsel, latency 0, IRQ 5
+    Flags: fast devsel, IRQ 5
      Bus: primary=1d, secondary=24, subordinate=24, sec-latency=0
      I/O behind bridge: 0000a000-0000afff [size=4K]
      Memory behind bridge: fcb00000-fcbfffff [size=1M]
@@ -339,7 +339,7 @@

  21:00.0 Serial controller: MosChip Semiconductor Technology Ltd. 4-Port PCIe Serial Adapter (prog-if 02 [16550])
      Subsystem: Device a000:1000
-    Flags: bus master, fast devsel, latency 0, IRQ 11
+    Flags: fast devsel, IRQ 11
      I/O ports at b030
      Memory at fcc07000 (32-bit, non-prefetchable)
      Memory at fcc06000 (32-bit, non-prefetchable)
@@ -351,7 +351,7 @@

  21:00.1 Serial controller: MosChip Semiconductor Technology Ltd. 4-Port PCIe Serial Adapter (prog-if 02 [16550])
      Subsystem: Device a000:1000
-    Flags: bus master, fast devsel, latency 0, IRQ 11
+    Flags: fast devsel, IRQ 11
      I/O ports at b020
      Memory at fcc05000 (32-bit, non-prefetchable)
      Memory at fcc04000 (32-bit, non-prefetchable)
@@ -362,7 +362,7 @@

  21:00.2 Serial controller: MosChip Semiconductor Technology Ltd. 4-Port PCIe Serial Adapter (prog-if 02 [16550])
      Subsystem: Device a000:1000
-    Flags: bus master, fast devsel, latency 0, IRQ 10
+    Flags: fast devsel, IRQ 10
      I/O ports at b010
      Memory at fcc03000 (32-bit, non-prefetchable)
      Memory at fcc02000 (32-bit, non-prefetchable)
@@ -373,7 +373,7 @@

  21:00.3 Serial controller: MosChip Semiconductor Technology Ltd. 4-Port PCIe Serial Adapter (prog-if 02 [16550])
      Subsystem: Device a000:1000
-    Flags: bus master, fast devsel, latency 0, IRQ 5
+    Flags: fast devsel, IRQ 5
      I/O ports at b000
      Memory at fcc01000 (32-bit, non-prefetchable)
      Memory at fcc00000 (32-bit, non-prefetchable)
@@ -384,7 +384,7 @@

  24:00.0 System peripheral: Meinberg Funkuhren GPS180PEX GPS Receiver (PCI Express) (rev 01)
      Subsystem: Meinberg Funkuhren GPS180PEX GPS Receiver (PCI Express)
-    Flags: bus master, fast devsel, latency 0, IRQ 5
+    Flags: fast devsel, IRQ 5
      I/O ports at a000
      Memory at fcb00000 (32-bit, non-prefetchable)
      Capabilities: [50] MSI: Enable- Count=1/4 Maskable- 64bit+
@@ -465,7 +465,7 @@

  29:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Device 145a
      Subsystem: Advanced Micro Devices, Inc. [AMD] Device 145a
-    Flags: bus master, fast devsel, latency 0, IRQ 255
+    Flags: fast devsel, IRQ 255
      Capabilities: [48] Vendor Specific Information: Len=08 <?>
      Capabilities: [50] Power Management version 3
      Capabilities: [64] Express Endpoint, MSI 00
@@ -476,9 +476,9 @@

  29:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Device 1456
      Subsystem: Advanced Micro Devices, Inc. [AMD] Device 1456
-    Flags: bus master, fast devsel, latency 0, IRQ 11
-    Memory at fd100000 (32-bit, non-prefetchable)
-    Memory at fd200000 (32-bit, non-prefetchable)
+    Flags: fast devsel, IRQ 11
+    Memory at fd100000 (32-bit, non-prefetchable) [disabled]
+    Memory at fd200000 (32-bit, non-prefetchable) [disabled]
      Capabilities: [48] Vendor Specific Information: Len=08 <?>
      Capabilities: [50] Power Management version 3
      Capabilities: [64] Express Endpoint, MSI 00
@@ -502,7 +502,7 @@

  2a:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Device 1455
      Subsystem: Advanced Micro Devices, Inc. [AMD] Device 1455
-    Flags: bus master, fast devsel, latency 0, IRQ 255
+    Flags: fast devsel, IRQ 255
      Capabilities: [48] Vendor Specific Information: Len=08 <?>
      Capabilities: [50] Power Management version 3
      Capabilities: [64] Express Endpoint, MSI 00

Frank

On 01/23/19 07:56, SAITOH Masanobu wrote:
Module Name:    src
Committed By:    msaitoh
Date:        Wed Jan 23 06:56:19 UTC 2019

Modified Files:
    src/sys/dev/pci: if_fxp_pci.c nvme_pci.c xhci_pci.c
    src/sys/dev/pci/ixgbe: ixgbe.c ixv.c

Log Message:
  Nowadays some UEFI BIOSes don't enable some PCI devices' address decoding.
To resolve this problem, pci_map.c rev. 1.34-1.36 changed the
pci_mapreg_(sub)map()'s to set the decode bit if it's not set. It's good for
almost all drivers, but some other drivers don't use pci_mapreg_map().
In drivers which don't use pci_mapreg_map(), some of them expilicitly enable
decoding but others don't. Add code to enable decoding to them.

  See also the following discussion:
    http://mail-index.netbsd.org/tech-kern/2017/03/22/msg021678.html


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/pci/if_fxp_pci.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/nvme_pci.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/xhci_pci.c
cvs rdiff -u -r1.170 -r1.171 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


Could you test with ppb.c rev. 1.66?

 Module Name:	src
 Committed By:	msaitoh
 Date:		Mon Jan 28 04:09:51 UTC 2019
Modified Files:
 	src/sys/dev/pci: ppb.c
Log Message:
  Explicitly enable bus masterling in case BIOS, UEFI or firmware don't enable
 it. Might fix PR kern/53811.
To generate a diff of this commit:
 cvs rdiff -u -r1.65 -r1.66 src/sys/dev/pci/ppb.

--
-----------------------------------------------
                SAITOH Masanobu (msaitoh%execsw.org@localhost
                                 msaitoh%netbsd.org@localhost)


Home | Main Index | Thread Index | Old Index