Adding movable PCIe BARs support in snd_hda_intel
Hi, I am working on adding AMD related drivers support for PCIe BARs move feature developed by Sergei (https://linuxplumbersconf.org/event/7/contributions/847/attachments/584/1035/lpc2020_sergmir.pdf).
His feature is still not upstream, all his code and mine on top can be seen here - https://cgit.freedesktop.org/~agrodzov/linux/log/?h=yadro/pcie_hotplug/movable_bars_v9.1
I did basic implementation fro amdgpu driver and now I am doing the same for snd_hda_intel to support our on GPU Azalia audio chips. This relevant commit is here - https://cgit.freedesktop.org/~agrodzov/linux/commit/?h=yadro/pcie_hotplug/movable_bars_v9.1&id=7ec0f60633e898cb941cebb3cd18aae1374fc365
Any driver that wants to support movable BARs needs to implement rescan_prepare, rescan_done and bar_fixed callbacks where rescan_prepare needs to stop HW/SW and unamp all MMIO mappings and rescan_done needs to ioremap the BAR from it's new MMIO location and restart HW/SW.
I am able currently to trigger BARs move by sysfs using "/sys/bus/pci/rescan" and the driver will go through the sequence I described above without hangs. Problem is that after this when i try to use mplayer I am getting following errors:
andrey@andrey-test:~$ sudo mplayer -ao alsa:device=hw=0.3 Downloads/file_example_MP3_5MG.mp3 MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.
Playing Downloads/file_example_MP3_5MG.mp3.
libavformat version 58.29.100 (external)
Audio only file format detected.
Load subtitles in Downloads/
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 0.1 (00.0) of 132.0 (02:12.0) ??,?%
Audio device got stuck!
and in dmesg I see
[ 365.355518] snd_hda_codec_hdmi hdaudioC0D0: Unable to sync register 0x2f0d00. -5
Also I see 296.619014] snd_hda_intel 0000:0a:00.1: CORB reset timeout#2, CORBRP = 65535 error during the rescan_done callback execution
I know it has to do with the move of BAR's MMIO address because when i
disallow BAR migration by returning true from bar_fixed callback I have no such errors and mplayer works fine.
I enabled MMIO trace and didn't see that post BAR move there is a wrong MMIO access - all of them are from the new MMIO base offset - 0xfcd80000 (trace attached including mmio trace and dmesg)
I would be happy for any idea on this and any comment on the correctness of my sequence in the code
Andrey
[ 296.497276 < 100.521673>] snd_hda_intel 0000:0a:00.1: azx_rescan_prepare - start
[ 296.497293 < 0.000017>] mmiotrace: Unmapping 00000000a5260eea.
UNMAP 296.516872 1 0x0 0
[ 296.501936 < 0.004643>] snd_hda_intel 0000:0a:00.1: azx_rescan_prepare - end [ 296.502559 < 0.000623>] pcieport 0000:02:07.0: resource 13 [io 0xe000-0xefff] released [ 296.502577 < 0.000018>] pcieport 0000:01:00.2: resource 13 [io 0xe000-0xefff] released [ 296.502593 < 0.000016>] pcieport 0000:00:01.3: resource 13 [io 0xe000-0xefff] released [ 296.502608 < 0.000015>] pcieport 0000:09:00.0: resource 13 [io 0xd000-0xdfff] released [ 296.502622 < 0.000014>] pcieport 0000:08:00.0: resource 13 [io 0xd000-0xdfff] released [ 296.502636 < 0.000014>] pcieport 0000:00:03.1: resource 13 [io 0xd000-0xdfff] released [ 296.502651 < 0.000015>] pcieport 0000:00:01.3: resource 14 [mem 0xfca00000-0xfccfffff] released [ 296.502666 < 0.000015>] pcieport 0000:00:03.1: resource 14 [mem 0xfcd00000-0xfcefffff] released [ 296.502681 < 0.000015>] pcieport 0000:00:07.1: resource 14 [mem 0xfc700000-0xfc9fffff] released [ 296.502695 < 0.000014>] pcieport 0000:00:08.1: resource 14 [mem 0xfcf00000-0xfcffffff] released [ 296.502710 < 0.000015>] pcieport 0000:00:03.1: resource 15 [mem 0xe0000000-0xf01fffff 64bit pref] released [ 296.502908 < 0.000198>] pcieport 0000:00:01.3: BAR 13: assigned [io 0xe000-0xefff] [ 296.502951 < 0.000043>] pcieport 0000:00:03.1: BAR 15: assigned [mem 0xe0000000-0xf01fffff 64bit pref] [ 296.502974 < 0.000023>] pcieport 0000:00:07.1: BAR 14: assigned [mem 0xfc500000-0xfc7fffff] [ 296.502998 < 0.000024>] pcieport 0000:00:01.3: BAR 14: assigned [mem 0xfca00000-0xfccfffff] [ 296.503023 < 0.000025>] pcieport 0000:00:03.1: BAR 14: assigned [mem 0xfcd00000-0xfcefffff] [ 296.503048 < 0.000025>] pcieport 0000:00:08.1: BAR 14: assigned [mem 0xfcf00000-0xfcffffff] [ 296.503134 < 0.000086>] pcieport 0000:00:03.1: BAR 13: assigned [io 0x1000-0x1fff] [ 296.503252 < 0.000118>] pcieport 0000:01:00.2: BAR 13: assigned [io 0xe000-0xefff] [ 296.503267 < 0.000015>] pcieport 0000:01:00.2: BAR 14: assigned [mem 0xfca00000-0xfcbfffff] [ 296.503281 < 0.000014>] ahci 0000:01:00.1: BAR 6: assigned fixed [mem 0xfcc00000-0xfcc7ffff pref] [ 296.503296 < 0.000015>] ahci 0000:01:00.1: BAR 5: assigned fixed [mem 0xfcc80000-0xfcc9ffff] [ 296.503309 < 0.000013>] xhci_hcd 0000:01:00.0: BAR 0: assigned fixed [mem 0xfcca0000-0xfcca7fff 64bit] [ 296.503439 < 0.000130>] pcieport 0000:02:07.0: BAR 13: assigned [io 0xe000-0xefff] [ 296.503454 < 0.000015>] pcieport 0000:02:07.0: BAR 14: assigned [mem 0xfca00000-0xfcafffff] [ 296.503470 < 0.000016>] pcieport 0000:02:04.0: BAR 14: assigned [mem 0xfcb00000-0xfcbfffff] [ 296.503541 < 0.000071>] xhci_hcd 0000:04:00.0: BAR 0: assigned fixed [mem 0xfcb00000-0xfcb07fff 64bit] [ 296.503627 < 0.000086>] igb 0000:06:00.0: BAR 2: assigned fixed [io 0xe000-0xe01f] [ 296.503640 < 0.000013>] igb 0000:06:00.0: BAR 0: assigned fixed [mem 0xfca00000-0xfca1ffff] [ 296.503653 < 0.000013>] igb 0000:06:00.0: BAR 3: assigned fixed [mem 0xfca20000-0xfca23fff] [ 296.503780 < 0.000127>] pcieport 0000:08:00.0: BAR 15: assigned [mem 0xe0000000-0xf01fffff 64bit pref] [ 296.503797 < 0.000017>] pcieport 0000:08:00.0: BAR 14: assigned [mem 0xfcd00000-0xfcdfffff] [ 296.503835 < 0.000038>] pcieport 0000:08:00.0: BAR 0: assigned [mem 0xfce00000-0xfce03fff] [ 296.503855 < 0.000020>] pcieport 0000:08:00.0: BAR 13: assigned [io 0x1000-0x1fff] [ 296.503952 < 0.000097>] pcieport 0000:09:00.0: BAR 15: assigned [mem 0xe0000000-0xf01fffff 64bit pref] [ 296.503969 < 0.000017>] pcieport 0000:09:00.0: BAR 14: assigned [mem 0xfcd00000-0xfcdfffff] [ 296.504007 < 0.000038>] pcieport 0000:09:00.0: BAR 13: assigned [io 0x1000-0x1fff] [ 296.508267 < 0.004260>] pci 0000:0a:00.0: BAR 0: assigned fixed [mem 0xe0000000-0xefffffff 64bit pref] [ 296.508276 < 0.000009>] pci 0000:0a:00.0: BAR 2: assigned fixed [mem 0xf0000000-0xf01fffff 64bit pref] [ 296.508282 < 0.000006>] pci 0000:0a:00.0: BAR 5: assigned fixed [mem 0xfcd00000-0xfcd7ffff] [ 296.508308 < 0.000026>] snd_hda_intel 0000:0a:00.1: BAR 0: assigned [mem 0xfcd80000-0xfcd83fff] [ 296.508317 < 0.000009>] snd_hda_intel 0000:0a:00.1: BAR 0 updated: 0xfcda0000 -> 0xfcd80000 [ 296.508323 < 0.000006>] pci 0000:0a:00.0: BAR 4: assigned [io 0x1000-0x10ff] [ 296.508330 < 0.000007>] pci 0000:0a:00.0: BAR 4 updated: 0xd000 -> 0x1000 [ 296.508368 < 0.000038>] xhci_hcd 0000:0b:00.3: BAR 0: assigned fixed [mem 0xfc700000-0xfc7fffff 64bit] [ 296.508379 < 0.000011>] pci 0000:0b:00.2: BAR 2: assigned [mem 0xfc500000-0xfc5fffff] [ 296.508386 < 0.000007>] pci 0000:0b:00.2: BAR 2 updated: 0xfc800000 -> 0xfc500000 [ 296.508393 < 0.000007>] pci 0000:0b:00.2: BAR 5: assigned [mem 0xfc600000-0xfc601fff] [ 296.508400 < 0.000007>] pci 0000:0b:00.2: BAR 5 updated: 0xfc900000 -> 0xfc600000 [ 296.508421 < 0.000021>] ahci 0000:0c:00.2: BAR 5: assigned fixed [mem 0xfcf00000-0xfcf00fff] [ 296.508432 < 0.000011>] pci_bus 0000:00: resource 4 [io 0x0000-0x03af window] [ 296.508437 < 0.000005>] pci_bus 0000:00: resource 5 [io 0x03e0-0x0cf7 window] [ 296.508442 < 0.000005>] pci_bus 0000:00: resource 6 [io 0x03b0-0x03df window] [ 296.508447 < 0.000005>] pci_bus 0000:00: resource 7 [io 0x0d00-0xefff window] [ 296.508452 < 0.000005>] pci_bus 0000:00: resource 8 [mem 0x000a0000-0x000bffff window] [ 296.508457 < 0.000005>] pci_bus 0000:00: resource 9 [mem 0x000c0000-0x000dffff window] [ 296.508462 < 0.000005>] pci_bus 0000:00: resource 10 [mem 0xe0000000-0xfec2ffff window] [ 296.508467 < 0.000005>] pci_bus 0000:00: resource 11 [mem 0xfee00000-0xffffffff window] [ 296.508473 < 0.000006>] pci_bus 0000:01: resource 0 [io 0xe000-0xefff] [ 296.508478 < 0.000005>] pci_bus 0000:01: resource 1 [mem 0xfca00000-0xfccfffff] [ 296.508483 < 0.000005>] pci_bus 0000:02: resource 0 [io 0xe000-0xefff] [ 296.508488 < 0.000005>] pci_bus 0000:02: resource 1 [mem 0xfca00000-0xfcbfffff] [ 296.508493 < 0.000005>] pci_bus 0000:04: resource 1 [mem 0xfcb00000-0xfcbfffff] [ 296.508498 < 0.000005>] pci_bus 0000:06: resource 0 [io 0xe000-0xefff] [ 296.508503 < 0.000005>] pci_bus 0000:06: resource 1 [mem 0xfca00000-0xfcafffff] [ 296.508509 < 0.000006>] pci_bus 0000:08: resource 0 [io 0x1000-0x1fff] [ 296.508513 < 0.000004>] pci_bus 0000:08: resource 1 [mem 0xfcd00000-0xfcefffff] [ 296.508518 < 0.000005>] pci_bus 0000:08: resource 2 [mem 0xe0000000-0xf01fffff 64bit pref] [ 296.508524 < 0.000006>] pci_bus 0000:09: resource 0 [io 0x1000-0x1fff] [ 296.508528 < 0.000004>] pci_bus 0000:09: resource 1 [mem 0xfcd00000-0xfcdfffff] [ 296.508533 < 0.000005>] pci_bus 0000:09: resource 2 [mem 0xe0000000-0xf01fffff 64bit pref] [ 296.508539 < 0.000006>] pci_bus 0000:0a: resource 0 [io 0x1000-0x1fff] [ 296.508544 < 0.000005>] pci_bus 0000:0a: resource 1 [mem 0xfcd00000-0xfcdfffff] [ 296.508548 < 0.000004>] pci_bus 0000:0a: resource 2 [mem 0xe0000000-0xf01fffff 64bit pref] [ 296.508554 < 0.000006>] pci_bus 0000:0b: resource 1 [mem 0xfc500000-0xfc7fffff] [ 296.508559 < 0.000005>] pci_bus 0000:0c: resource 1 [mem 0xfcf00000-0xfcffffff] [ 296.508568 < 0.000009>] pcieport 0000:02:00.0: PCI bridge to [bus 03] [ 296.508583 < 0.000015>] pcieport 0000:02:04.0: PCI bridge to [bus 04] [ 296.508590 < 0.000007>] pcieport 0000:02:04.0: bridge window [mem 0xfcb00000-0xfcbfffff] [ 296.508602 < 0.000012>] pcieport 0000:02:06.0: PCI bridge to [bus 05] [ 296.508616 < 0.000014>] pcieport 0000:02:07.0: PCI bridge to [bus 06] [ 296.508621 < 0.000005>] pcieport 0000:02:07.0: bridge window [io 0xe000-0xefff] [ 296.508629 < 0.000008>] pcieport 0000:02:07.0: bridge window [mem 0xfca00000-0xfcafffff] [ 296.508640 < 0.000011>] pcieport 0000:02:09.0: PCI bridge to [bus 07] [ 296.508654 < 0.000014>] pcieport 0000:01:00.2: PCI bridge to [bus 02-07] [ 296.508659 < 0.000005>] pcieport 0000:01:00.2: bridge window [io 0xe000-0xefff] [ 296.508666 < 0.000007>] pcieport 0000:01:00.2: bridge window [mem 0xfca00000-0xfcbfffff] [ 296.508677 < 0.000011>] pcieport 0000:00:01.3: PCI bridge to [bus 01-07] [ 296.508682 < 0.000005>] pcieport 0000:00:01.3: bridge window [io 0xe000-0xefff] [ 296.508689 < 0.000007>] pcieport 0000:00:01.3: bridge window [mem 0xfca00000-0xfccfffff] [ 296.508697 < 0.000008>] pcieport 0000:09:00.0: PCI bridge to [bus 0a] [ 296.508702 < 0.000005>] pcieport 0000:09:00.0: bridge window [io 0x1000-0x1fff] [ 296.508710 < 0.000008>] pcieport 0000:09:00.0: bridge window [mem 0xfcd00000-0xfcdfffff] [ 296.508716 < 0.000006>] pcieport 0000:09:00.0: bridge window [mem 0xe0000000-0xf01fffff 64bit pref] [ 296.508725 < 0.000009>] pcieport 0000:08:00.0: PCI bridge to [bus 09-0a] [ 296.508731 < 0.000006>] pcieport 0000:08:00.0: bridge window [io 0x1000-0x1fff] [ 296.508738 < 0.000007>] pcieport 0000:08:00.0: bridge window [mem 0xfcd00000-0xfcdfffff] [ 296.508745 < 0.000007>] pcieport 0000:08:00.0: bridge window [mem 0xe0000000-0xf01fffff 64bit pref] [ 296.508754 < 0.000009>] pcieport 0000:00:03.1: PCI bridge to [bus 08-0a] [ 296.508759 < 0.000005>] pcieport 0000:00:03.1: bridge window [io 0x1000-0x1fff] [ 296.508765 < 0.000006>] pcieport 0000:00:03.1: bridge window [mem 0xfcd00000-0xfcefffff] [ 296.508771 < 0.000006>] pcieport 0000:00:03.1: bridge window [mem 0xe0000000-0xf01fffff 64bit pref] [ 296.508779 < 0.000008>] pcieport 0000:00:07.1: PCI bridge to [bus 0b] [ 296.508785 < 0.000006>] pcieport 0000:00:07.1: bridge window [mem 0xfc500000-0xfc7fffff] [ 296.508793 < 0.000008>] pcieport 0000:00:08.1: PCI bridge to [bus 0c] [ 296.508799 < 0.000006>] pcieport 0000:00:08.1: bridge window [mem 0xfcf00000-0xfcffffff] [ 296.509157 < 0.000358>] snd_hda_intel 0000:0a:00.1: azx_rescan_done - start [ 296.514080 < 0.004923>] mmiotrace: ioremap_*(0xfcd80000, 0x4000) = 0000000032c006d1
MAP 296.533618 2 0xfcd80000 0xffffc9000125c000 0x4000 0x0 0 W 2 296.533680 2 0xfcd8000e 0xff 0x0 0
R 4 296.533684 2 0xfcd80008 0xffffffff 0x0 0
W 4 296.533687 2 0xfcd80008 0xfffffffe 0x0 0
R 1 296.533690 2 0xfcd80008 0xff 0x0 0
R 1 296.535471 2 0xfcd80008 0xff 0x0 0
R 1 296.536552 2 0xfcd80008 0xff 0x0 0
R 1 296.537587 2 0xfcd80008 0xff 0x0 0
R 1 296.538617 2 0xfcd80008 0xff 0x0 0
R 1 296.539653 2 0xfcd80008 0xff 0x0 0
R 1 296.540688 2 0xfcd80008 0xff 0x0 0
R 1 296.541725 2 0xfcd80008 0xff 0x0 0
R 1 296.542763 2 0xfcd80008 0xff 0x0 0
R 1 296.543656 2 0xfcd80008 0xff 0x0 0
R 1 296.544684 2 0xfcd80008 0xff 0x0 0
R 1 296.545718 2 0xfcd80008 0xff 0x0 0
R 1 296.546748 2 0xfcd80008 0xff 0x0 0
R 1 296.547710 2 0xfcd80008 0xff 0x0 0
R 1 296.548738 2 0xfcd80008 0xff 0x0 0
R 1 296.549779 2 0xfcd80008 0xff 0x0 0
R 1 296.550805 2 0xfcd80008 0xff 0x0 0
R 1 296.551744 2 0xfcd80008 0xff 0x0 0
R 1 296.552776 2 0xfcd80008 0xff 0x0 0
R 1 296.553804 2 0xfcd80008 0xff 0x0 0
R 1 296.554830 2 0xfcd80008 0xff 0x0 0
R 1 296.555723 2 0xfcd80008 0xff 0x0 0
R 1 296.556880 2 0xfcd80008 0xff 0x0 0
R 1 296.557918 2 0xfcd80008 0xff 0x0 0
R 1 296.558948 2 0xfcd80008 0xff 0x0 0
R 1 296.559727 2 0xfcd80008 0xff 0x0 0
R 1 296.560760 2 0xfcd80008 0xff 0x0 0
R 1 296.561787 2 0xfcd80008 0xff 0x0 0
R 1 296.562814 2 0xfcd80008 0xff 0x0 0
R 1 296.563711 2 0xfcd80008 0xff 0x0 0
R 1 296.564739 2 0xfcd80008 0xff 0x0 0
R 1 296.565769 2 0xfcd80008 0xff 0x0 0
R 1 296.566810 2 0xfcd80008 0xff 0x0 0
R 1 296.567741 2 0xfcd80008 0xff 0x0 0
R 1 296.568769 2 0xfcd80008 0xff 0x0 0
R 1 296.569798 2 0xfcd80008 0xff 0x0 0
R 1 296.570824 2 0xfcd80008 0xff 0x0 0
R 1 296.571715 2 0xfcd80008 0xff 0x0 0
R 1 296.572744 2 0xfcd80008 0xff 0x0 0
R 1 296.573770 2 0xfcd80008 0xff 0x0 0
R 1 296.574809 2 0xfcd80008 0xff 0x0 0
R 1 296.575694 2 0xfcd80008 0xff 0x0 0
R 1 296.576890 2 0xfcd80008 0xff 0x0 0
R 1 296.577920 2 0xfcd80008 0xff 0x0 0
R 1 296.578947 2 0xfcd80008 0xff 0x0 0
R 1 296.579711 2 0xfcd80008 0xff 0x0 0
R 1 296.580738 2 0xfcd80008 0xff 0x0 0
R 1 296.581764 2 0xfcd80008 0xff 0x0 0
R 1 296.582801 2 0xfcd80008 0xff 0x0 0
R 1 296.583752 2 0xfcd80008 0xff 0x0 0
R 1 296.584784 2 0xfcd80008 0xff 0x0 0
R 1 296.585817 2 0xfcd80008 0xff 0x0 0
R 1 296.586850 2 0xfcd80008 0xff 0x0 0
R 1 296.587729 2 0xfcd80008 0xff 0x0 0
R 1 296.588756 2 0xfcd80008 0xff 0x0 0
R 1 296.589788 2 0xfcd80008 0xff 0x0 0
R 1 296.590820 2 0xfcd80008 0xff 0x0 0
R 1 296.591738 2 0xfcd80008 0xff 0x0 0
R 1 296.592769 2 0xfcd80008 0xff 0x0 0
R 1 296.593797 2 0xfcd80008 0xff 0x0 0
R 1 296.594825 2 0xfcd80008 0xff 0x0 0
R 1 296.595723 2 0xfcd80008 0xff 0x0 0
R 1 296.597155 2 0xfcd80008 0xff 0x0 0
R 1 296.598187 2 0xfcd80008 0xff 0x0 0
R 1 296.599215 2 0xfcd80008 0xff 0x0 0
R 1 296.600255 2 0xfcd80008 0xff 0x0 0
R 1 296.601285 2 0xfcd80008 0xff 0x0 0
R 1 296.602313 2 0xfcd80008 0xff 0x0 0
R 1 296.603342 2 0xfcd80008 0xff 0x0 0
R 1 296.604380 2 0xfcd80008 0xff 0x0 0
R 1 296.605406 2 0xfcd80008 0xff 0x0 0
R 1 296.606433 2 0xfcd80008 0xff 0x0 0
R 1 296.607461 2 0xfcd80008 0xff 0x0 0
R 1 296.608497 2 0xfcd80008 0xff 0x0 0
R 1 296.609525 2 0xfcd80008 0xff 0x0 0
R 1 296.610558 2 0xfcd80008 0xff 0x0 0
R 1 296.611586 2 0xfcd80008 0xff 0x0 0
R 1 296.612620 2 0xfcd80008 0xff 0x0 0
R 1 296.613649 2 0xfcd80008 0xff 0x0 0
R 1 296.614679 2 0xfcd80008 0xff 0x0 0
R 1 296.615672 2 0xfcd80008 0xff 0x0 0
R 1 296.616809 2 0xfcd80008 0xff 0x0 0
R 1 296.617837 2 0xfcd80008 0xff 0x0 0
R 1 296.618869 2 0xfcd80008 0xff 0x0 0
R 1 296.619738 2 0xfcd80008 0xff 0x0 0
R 1 296.620765 2 0xfcd80008 0xff 0x0 0
R 1 296.621792 2 0xfcd80008 0xff 0x0 0
R 1 296.622819 2 0xfcd80008 0xff 0x0 0
R 1 296.623708 2 0xfcd80008 0xff 0x0 0
R 1 296.624734 2 0xfcd80008 0xff 0x0 0
R 1 296.625775 2 0xfcd80008 0xff 0x0 0
R 1 296.626809 2 0xfcd80008 0xff 0x0 0
R 1 296.627720 2 0xfcd80008 0xff 0x0 0
R 1 296.628751 2 0xfcd80008 0xff 0x0 0
R 1 296.629780 2 0xfcd80008 0xff 0x0 0
R 1 296.630806 2 0xfcd80008 0xff 0x0 0
R 1 296.631724 2 0xfcd80008 0xff 0x0 0
R 1 296.632751 2 0xfcd80008 0xff 0x0 0
W 1 296.632760 2 0xfcd80008 0xff 0x0 0
R 1 296.632763 2 0xfcd80008 0xff 0x0 0
[ 296.619014 < 0.104934>] snd_hda_intel 0000:0a:00.1: CORB reset timeout#2, CORBRP = 65535
R 1 296.633994 2 0xfcd80008 0xff 0x0 0
W 1 296.634003 2 0xfcd80083 0x1c 0x0 0
W 1 296.634006 2 0xfcd800a3 0x1c 0x0 0
W 1 296.634009 2 0xfcd800c3 0x1c 0x0 0
W 1 296.634012 2 0xfcd800e3 0x1c 0x0 0
W 1 296.634015 2 0xfcd80103 0x1c 0x0 0
W 1 296.634018 2 0xfcd80123 0x1c 0x0 0
W 2 296.634021 2 0xfcd8000e 0xff 0x0 0
W 1 296.634023 2 0xfcd8005d 0x5 0x0 0
W 4 296.634026 2 0xfcd80024 0x400000ff 0x0 0
W 4 296.634029 2 0xfcd80040 0xfedf8000 0x0 0
W 4 296.634032 2 0xfcd80044 0x0 0x0 0
W 1 296.634034 2 0xfcd8004e 0x2 0x0 0
W 2 296.634037 2 0xfcd80048 0x0 0x0 0
W 2 296.634040 2 0xfcd8004a 0x8000 0x0 0
R 2 296.634043 2 0xfcd8004a 0xffff 0x0 0
W 2 296.634046 2 0xfcd8004a 0x0 0x0 0
R 2 296.634049 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634054 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634059 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634064 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634068 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634073 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634078 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634083 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634087 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634092 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634096 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634101 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634106 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634110 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634115 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634120 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634124 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634129 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634134 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634138 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634143 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634148 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634152 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634157 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634161 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634166 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634171 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634175 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634180 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634185 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634189 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634194 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634199 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634203 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634208 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634212 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634217 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634222 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634226 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634231 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634236 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634240 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634245 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634249 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634254 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634259 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634263 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634268 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634273 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634277 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634282 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634286 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634291 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634296 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634301 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634306 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634311 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634315 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634320 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634324 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634329 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634334 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634339 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634343 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634348 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634353 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634357 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634362 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634367 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634372 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634376 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634381 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634386 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634390 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634395 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634400 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634404 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634409 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634414 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634418 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634423 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634428 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634433 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634437 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634442 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634446 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634451 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634456 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634460 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634465 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634470 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634474 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634479 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634483 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634488 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634493 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634497 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634502 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634507 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634511 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634516 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634521 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634525 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634530 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634534 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634539 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634544 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634548 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634553 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634558 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634562 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634567 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634571 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634576 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634581 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634586 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634590 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634595 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634599 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634604 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634609 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634614 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634618 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634623 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634628 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634632 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634637 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634641 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634646 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634651 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634655 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634660 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634665 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634670 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634674 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634679 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634684 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634688 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634693 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634698 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634702 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634707 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634712 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634716 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634721 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634725 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634731 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634735 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634740 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634744 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634749 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634754 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634758 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634763 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634768 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634773 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634777 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634782 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634787 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634791 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634796 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634801 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634806 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634810 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634815 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634819 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634824 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634829 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634834 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634839 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634843 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634848 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634853 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634858 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634862 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634867 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634871 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634876 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634881 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634885 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634890 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634895 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634899 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634904 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634908 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634913 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634918 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634922 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634927 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634932 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634936 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634941 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634946 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634950 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634955 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634959 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634965 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634969 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634974 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634979 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634983 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634988 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634993 2 0xfcd8004a 0xffff 0x0 0
R 2 296.634997 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635002 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635007 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635011 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635016 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635021 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635026 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635030 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635035 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635040 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635044 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635049 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635053 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635058 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635063 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635067 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635072 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635077 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635081 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635086 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635090 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635095 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635100 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635104 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635109 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635114 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635118 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635123 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635127 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635132 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635137 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635141 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635146 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635151 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635155 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635161 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635165 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635170 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635175 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635179 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635184 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635189 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635193 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635198 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635203 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635207 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635212 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635217 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635222 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635226 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635231 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635235 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635240 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635245 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635249 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635254 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635259 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635263 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635268 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635273 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635277 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635282 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635286 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635291 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635295 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635300 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635305 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635309 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635314 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635319 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635323 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635328 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635332 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635337 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635342 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635346 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635351 2 0xfcd8004a 0xffff 0x0 0
R 2 296.635356 2 0xfcd8004a 0xffff 0x0 0
[ 296.633838 < 0.014824>] snd_hda_intel 0000:0a:00.1: azx_rescan_done - end [ 296.634239 < 0.000401>] pcieport 0000:00:01.3: Max Payload Size set to 512/ 512 (was 512), Max Read Rq 512 [ 296.634252 < 0.000013>] xhci_hcd 0000:01:00.0: Max Payload Size set to 512/ 512 (was 512), Max Read Rq 512 [ 296.634264 < 0.000012>] ahci 0000:01:00.1: Max Payload Size set to 512/ 512 (was 512), Max Read Rq 512 [ 296.634275 < 0.000011>] pcieport 0000:01:00.2: Max Payload Size set to 512/ 512 (was 512), Max Read Rq 512 [ 296.634285 < 0.000010>] pcieport 0000:02:00.0: Max Payload Size set to 512/ 512 (was 512), Max Read Rq 512 [ 296.634296 < 0.000011>] pcieport 0000:02:04.0: Max Payload Size set to 512/ 512 (was 512), Max Read Rq 512 [ 296.634310 < 0.000014>] xhci_hcd 0000:04:00.0: Max Payload Size set to 512/ 512 (was 512), Max Read Rq 512 [ 296.634320 < 0.000010>] pcieport 0000:02:06.0: Max Payload Size set to 512/ 512 (was 512), Max Read Rq 512 [ 296.634331 < 0.000011>] pcieport 0000:02:07.0: Max Payload Size set to 512/ 512 (was 512), Max Read Rq 512 [ 296.634349 < 0.000018>] igb 0000:06:00.0: Max Payload Size set to 512/ 512 (was 512), Max Read Rq 512 [ 296.634359 < 0.000010>] pcieport 0000:02:09.0: Max Payload Size set to 512/ 512 (was 512), Max Read Rq 512 [ 296.634368 < 0.000009>] pcieport 0000:00:03.1: Max Payload Size set to 256/ 512 (was 256), Max Read Rq 512 [ 296.634378 < 0.000010>] pcieport 0000:08:00.0: Max Payload Size set to 256/ 512 (was 256), Max Read Rq 512 [ 296.634388 < 0.000010>] pcieport 0000:09:00.0: Max Payload Size set to 256/ 512 (was 256), Max Read Rq 512 [ 296.634398 < 0.000010>] pci 0000:0a:00.0: Max Payload Size set to 256/ 256 (was 256), Max Read Rq 512 [ 296.634408 < 0.000010>] snd_hda_intel 0000:0a:00.1: Max Payload Size set to 256/ 256 (was 256), Max Read Rq 512 [ 296.634417 < 0.000009>] pcieport 0000:00:07.1: Max Payload Size set to 256/ 512 (was 256), Max Read Rq 512 [ 296.634425 < 0.000008>] pci 0000:0b:00.0: Max Payload Size set to 256/ 256 (was 256), Max Read Rq 512 [ 296.634434 < 0.000009>] pci 0000:0b:00.2: Max Payload Size set to 256/ 256 (was 256), Max Read Rq 512 [ 296.634442 < 0.000008>] xhci_hcd 0000:0b:00.3: Max Payload Size set to 256/ 256 (was 256), Max Read Rq 512 [ 296.634451 < 0.000009>] pcieport 0000:00:08.1: Max Payload Size set to 256/ 512 (was 256), Max Read Rq 512 [ 296.634460 < 0.000009>] pci 0000:0c:00.0: Max Payload Size set to 256/ 256 (was 256), Max Read Rq 512 [ 296.634468 < 0.000008>] ahci 0000:0c:00.2: Max Payload Size set to 256/ 256 (was 256), Max Read Rq 512
R 2 296.635360 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635365 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635370 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635374 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635379 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635384 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635389 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635393 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635398 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635402 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635407 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635412 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635416 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635421 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635426 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635430 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635435 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635440 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635444 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635449 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635454 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635459 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635463 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635468 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635473 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635477 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635482 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635487 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635492 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635496 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635501 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635506 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635511 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635515 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635520 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635525 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635530 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635534 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635539 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635543 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635548 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635553 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635557 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635562 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635567 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635571 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635576 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635580 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635585 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635590 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635595 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635599 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635604 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635609 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635613 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635618 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635623 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635627 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635632 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635636 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635640 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635645 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635649 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635654 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635658 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635662 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635667 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635671 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635676 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635680 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635684 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635689 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635693 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635698 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635702 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635706 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635711 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635715 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635720 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635724 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635728 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635733 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635737 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635741 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635746 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635750 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635755 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635759 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635763 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635768 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635772 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635777 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635781 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635785 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635790 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635794 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635799 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635803 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635807 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635812 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635816 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635820 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635825 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635829 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635834 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635838 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635842 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635847 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635851 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635856 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635860 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635864 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635869 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635873 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635878 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635882 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635886 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635891 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635895 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635899 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635904 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635908 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635913 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635917 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635921 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635926 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635930 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635935 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635939 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635943 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635948 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635952 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635956 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635961 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635965 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635970 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635974 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635978 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635983 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635987 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635992 2 0xfcd8004a 0xffff 0x0 0 R 2 296.635997 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636001 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636006 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636010 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636014 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636019 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636023 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636027 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636032 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636036 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636041 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636045 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636049 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636054 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636058 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636062 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636067 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636071 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636076 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636080 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636084 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636089 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636093 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636098 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636102 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636106 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636111 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636115 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636119 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636124 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636128 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636133 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636137 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636141 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636146 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636150 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636155 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636159 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636163 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636168 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636172 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636176 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636181 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636185 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636190 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636194 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636198 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636203 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636207 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636212 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636216 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636220 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636225 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636229 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636233 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636238 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636242 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636247 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636251 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636255 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636260 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636264 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636269 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636273 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636277 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636282 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636286 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636290 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636295 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636299 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636304 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636308 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636312 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636317 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636321 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636325 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636330 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636334 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636339 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636343 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636347 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636352 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636356 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636360 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636365 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636369 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636374 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636378 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636382 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636387 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636391 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636396 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636400 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636405 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636409 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636413 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636418 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636422 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636427 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636431 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636435 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636440 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636444 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636449 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636453 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636457 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636462 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636466 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636470 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636475 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636479 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636484 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636488 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636492 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636497 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636501 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636506 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636510 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636514 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636519 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636523 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636527 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636532 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636536 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636541 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636545 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636549 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636554 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636558 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636562 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636567 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636571 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636576 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636580 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636584 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636589 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636593 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636598 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636602 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636606 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636611 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636615 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636619 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636624 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636628 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636633 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636637 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636641 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636646 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636650 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636654 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636659 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636663 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636668 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636672 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636676 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636681 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636685 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636689 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636694 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636698 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636703 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636707 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636711 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636716 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636720 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636725 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636729 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636733 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636738 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636742 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636746 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636751 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636755 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636760 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636764 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636768 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636773 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636777 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636781 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636786 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636790 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636795 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636799 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636804 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636808 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636813 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636817 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636821 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636826 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636830 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636835 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636839 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636843 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636848 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636852 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636856 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636861 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636865 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636870 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636874 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636878 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636883 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636887 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636891 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636896 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636900 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636905 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636909 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636913 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636918 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636922 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636927 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636931 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636935 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636940 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636944 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636948 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636953 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636957 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636962 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636966 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636970 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636975 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636979 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636983 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636988 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636992 2 0xfcd8004a 0xffff 0x0 0 R 2 296.636997 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637001 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637005 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637010 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637014 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637019 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637023 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637027 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637032 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637036 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637040 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637045 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637049 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637054 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637058 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637062 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637067 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637071 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637075 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637080 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637084 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637089 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637093 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637097 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637102 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637106 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637110 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637115 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637119 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637124 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637128 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637132 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637137 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637141 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637145 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637150 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637154 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637159 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637163 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637167 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637172 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637176 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637181 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637185 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637189 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637194 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637198 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637202 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637208 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637212 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637216 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637221 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637225 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637230 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637234 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637238 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637243 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637247 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637251 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637256 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637260 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637265 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637269 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637273 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637278 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637282 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637287 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637291 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637295 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637300 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637304 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637308 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637313 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637317 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637322 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637326 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637330 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637335 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637339 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637343 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637348 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637352 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637357 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637361 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637365 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637370 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637374 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637379 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637383 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637387 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637392 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637396 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637400 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637405 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637409 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637414 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637418 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637422 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637427 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637431 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637435 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637440 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637444 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637449 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637453 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637457 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637462 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637466 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637470 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637475 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637479 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637484 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637488 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637492 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637497 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637501 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637506 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637510 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637514 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637519 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637523 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637527 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637532 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637536 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637541 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637545 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637549 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637554 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637558 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637562 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637567 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637571 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637576 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637580 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637584 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637589 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637593 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637597 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637602 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637606 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637611 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637616 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637620 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637624 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637629 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637633 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637637 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637642 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637646 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637651 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637655 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637659 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637664 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637668 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637673 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637677 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637681 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637686 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637690 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637694 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637699 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637703 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637708 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637712 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637716 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637721 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637725 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637730 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637734 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637738 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637743 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637747 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637751 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637756 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637760 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637765 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637769 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637773 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637778 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637782 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637786 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637791 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637795 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637800 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637804 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637808 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637813 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637817 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637821 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637826 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637830 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637835 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637839 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637843 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637848 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637852 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637857 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637861 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637865 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637870 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637874 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637878 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637883 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637887 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637892 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637896 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637900 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637905 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637909 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637913 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637918 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637922 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637927 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637931 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637935 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637940 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637944 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637948 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637953 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637957 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637962 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637966 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637970 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637975 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637979 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637984 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637988 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637992 2 0xfcd8004a 0xffff 0x0 0 R 2 296.637997 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638001 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638005 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638010 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638015 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638019 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638023 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638028 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638032 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638037 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638041 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638045 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638050 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638054 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638058 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638063 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638067 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638072 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638076 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638080 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638085 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638089 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638094 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638098 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638102 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638107 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638111 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638115 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638120 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638124 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638129 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638133 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638137 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638142 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638146 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638151 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638155 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638159 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638164 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638168 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638172 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638177 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638181 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638186 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638190 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638194 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638199 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638203 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638207 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638212 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638216 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638221 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638225 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638229 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638234 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638238 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638242 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638247 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638251 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638256 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638260 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638264 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638269 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638273 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638278 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638282 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638286 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638291 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638295 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638299 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638304 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638308 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638313 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638317 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638321 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638326 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638330 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638335 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638339 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638343 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638348 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638352 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638356 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638361 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638365 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638370 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638374 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638378 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638383 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638387 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638392 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638396 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638400 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638405 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638409 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638413 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638418 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638423 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638427 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638432 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638436 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638440 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638445 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638449 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638454 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638458 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638462 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638467 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638471 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638475 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638480 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638484 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638489 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638493 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638497 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638502 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638506 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638510 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638515 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638519 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638524 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638528 2 0xfcd8004a 0xffff 0x0 0 R 2 296.638533 2 0xfcd8004a 0xffff 0x0 0 W 1 296.638617 2 0xfcd8004c 0x2 0x0 0 W 4 296.638620 2 0xfcd80050 0xfedf8800 0x0 0 W 4 296.638622 2 0xfcd80054 0x0 0x0 0 W 1 296.638625 2 0xfcd8005e 0x2 0x0 0 W 2 296.638628 2 0xfcd80058 0x8000 0x0 0 W 2 296.638631 2 0xfcd8005a 0x1 0x0 0 W 1 296.638633 2 0xfcd8005c 0x3 0x0 0 R 4 296.638637 2 0xfcd80008 0xffffffff 0x0 0 W 4 296.638639 2 0xfcd80008 0xffffffff 0x0 0 R 4 296.638743 2 0xfcd80020 0xffffffff 0x0 0 W 4 296.638746 2 0xfcd80020 0xffffffff 0x0 0
[ 316.009708 < 19.375240>] loop0: detected capacity change from 8 to 0
R 2 365.095146 2 0xfcd8000e 0xffff 0x0 0 R 2 365.095385 2 0xfcd8000c 0xffff 0x0 0 W 2 365.095393 2 0xfcd8000c 0xff00 0x0 0 R 2 365.095533 2 0xfcd80048 0xffff 0x0 0 R 2 365.095797 2 0xfcd80048 0xffff 0x0 0 R 2 365.122857 2 0xfcd80048 0xffff 0x0 0 R 2 365.123278 2 0xfcd80048 0xffff 0x0 0 R 2 365.151005 2 0xfcd80048 0xffff 0x0 0 R 2 365.151416 2 0xfcd80048 0xffff 0x0 0 R 2 365.178787 2 0xfcd80048 0xffff 0x0 0 R 2 365.179216 2 0xfcd80048 0xffff 0x0 0 R 2 365.206865 2 0xfcd80048 0xffff 0x0 0 R 2 365.207298 2 0xfcd80048 0xffff 0x0 0 R 2 365.234858 2 0xfcd80048 0xffff 0x0 0 R 2 365.235269 2 0xfcd80048 0xffff 0x0 0 R 2 365.262813 2 0xfcd80048 0xffff 0x0 0 R 2 365.263282 2 0xfcd80048 0xffff 0x0 0 R 2 365.290848 2 0xfcd80048 0xffff 0x0 0 R 2 365.291308 2 0xfcd80048 0xffff 0x0 0 R 2 365.318848 2 0xfcd80048 0xffff 0x0 0 R 2 365.319081 2 0xfcd80048 0xffff 0x0 0 R 2 365.346846 2 0xfcd80048 0xffff 0x0 0 R 2 365.347080 2 0xfcd80048 0xffff 0x0 0 R 2 365.374847 2 0xfcd80048 0xffff 0x0 0 R 2 365.374874 2 0xfcd80048 0xffff 0x0 0 R 2 365.374883 2 0xfcd80048 0xffff 0x0 0 R 2 365.374892 2 0xfcd80048 0xffff 0x0 0 R 2 365.374901 2 0xfcd80048 0xffff 0x0 0 R 2 365.374911 2 0xfcd80048 0xffff 0x0 0 R 2 365.374920 2 0xfcd80048 0xffff 0x0 0 R 2 365.374928 2 0xfcd80048 0xffff 0x0 0 R 2 365.374937 2 0xfcd80048 0xffff 0x0 0 R 2 365.374946 2 0xfcd80048 0xffff 0x0 0 R 2 365.374955 2 0xfcd80048 0xffff 0x0 0 R 2 365.374963 2 0xfcd80048 0xffff 0x0 0 R 2 365.374972 2 0xfcd80048 0xffff 0x0 0 R 2 365.374981 2 0xfcd80048 0xffff 0x0 0 R 2 365.374989 2 0xfcd80048 0xffff 0x0 0 R 2 365.374998 2 0xfcd80048 0xffff 0x0 0 R 2 365.375007 2 0xfcd80048 0xffff 0x0 0 R 2 365.375015 2 0xfcd80048 0xffff 0x0 0 R 2 365.375031 2 0xfcd80048 0xffff 0x0 0 R 2 365.375209 2 0xfcd80048 0xffff 0x0 0 R 2 365.375218 2 0xfcd80048 0xffff 0x0 0 R 2 365.375248 2 0xfcd80048 0xffff 0x0 0 R 2 365.375257 2 0xfcd80048 0xffff 0x0 0 R 2 365.375281 2 0xfcd80048 0xffff 0x0 0 R 2 365.375290 2 0xfcd80048 0xffff 0x0 0 R 2 365.375314 2 0xfcd80048 0xffff 0x0 0 R 2 365.375322 2 0xfcd80048 0xffff 0x0 0 R 2 365.375346 2 0xfcd80048 0xffff 0x0 0 R 2 365.375354 2 0xfcd80048 0xffff 0x0 0 R 2 365.375378 2 0xfcd80048 0xffff 0x0 0 R 2 365.375386 2 0xfcd80048 0xffff 0x0 0 R 2 365.375545 2 0xfcd80048 0xffff 0x0 0 R 2 365.375560 2 0xfcd80048 0xffff 0x0 0
[ 365.355518 < 49.345810>] snd_hda_codec_hdmi hdaudioC0D0: Unable to sync register 0x2f0d00. -5 [ 365.355701 < 0.000183>] snd_hda_codec_hdmi hdaudioC0D0: HDMI ATI/AMD: no speaker allocation for ELD [ 365.355740 < 0.000039>] snd_hda_codec_hdmi hdaudioC0D0: HDMI ATI/AMD: no speaker allocation for ELD [ 365.355773 < 0.000033>] snd_hda_codec_hdmi hdaudioC0D0: HDMI ATI/AMD: no speaker allocation for ELD [ 365.355805 < 0.000032>] snd_hda_codec_hdmi hdaudioC0D0: HDMI ATI/AMD: no speaker allocation for ELD [ 365.355837 < 0.000032>] snd_hda_codec_hdmi hdaudioC0D0: HDMI ATI/AMD: no speaker allocation for ELD [ 365.355869 < 0.000032>] snd_hda_codec_hdmi hdaudioC0D0: HDMI ATI/AMD: no speaker allocation for ELD
16,971 lines not shown · raw message
Part of this message is not shown here. View the raw message.
Just an update, i found the issue which was actually to wake up the HW before doing stop/restart (using pm_runtime_get_sync), also handled protecting from concurrent snd_pcm_ioctls accessing the registers while the BAR is unmapped. Can go through BAR move while aplay is running now.
Once again, would be happy for any comments on the code - https://cgit.freedesktop.org/~agrodzov/linux/log/?h=yadro/pcie_hotplug/movable_bars_v9.1
Andrey
Quoted 44 lines · Andrey Grodzovsky
Hi, I am working on adding AMD related drivers support for PCIe BARs move feature developed by Sergei (https://linuxplumbersconf.org/event/7/contributions/847/attachments/584/1035/lpc2020_sergmir.pdf).
His feature is still not upstream, all his code and mine on top can be seen here - https://cgit.freedesktop.org/~agrodzov/linux/log/?h=yadro/pcie_hotplug/movable_bars_v9.1
I did basic implementation fro amdgpu driver and now I am doing the same for
snd_hda_intelto support our on GPU Azalia audio chips. This relevant commit is here - https://cgit.freedesktop.org/~agrodzov/linux/commit/?h=yadro/pcie_hotplug/movable_bars_v9.1&id=7ec0f60633e898cb941cebb3cd18aae1374fc365Any driver that wants to support movable BARs needs to implement
rescan_prepare,rescan_doneandbar_fixedcallbacks whererescan_prepareneeds to stop HW/SW and unamp all MMIO mappings andrescan_doneneeds to ioremap the BAR from it's new MMIO location and restart HW/SW.I am able currently to trigger BARs move by sysfs using "
/sys/bus/pci/rescan" and the driver will go through the sequence I described above without hangs. Problem is that after this when i try to use mplayer I am getting following errors:andrey@andrey-test:~$ sudo mplayer -ao alsa:device=hw=0.3 Downloads/file_example_MP3_5MG.mp3 MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.Playing Downloads/file_example_MP3_5MG.mp3.
libavformat version 58.29.100 (external)
Audio only file format detected.
Load subtitles in Downloads/
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 0.1 (00.0) of 132.0 (02:12.0) ??,?%
Audio device got stuck!and in dmesg I see
[ 365.355518]snd_hda_codec_hdmihdaudioC0D0: Unable to sync register0x2f0d00. -5Also I see 296.619014]
snd_hda_intel0000:0a:00.1: CORB reset timeout#2, CORBRP = 65535 error during therescan_donecallback executionI know it has to do with the move of BAR's MMIO address because when i
disallow BAR migration by returning true frombar_fixedcallback I have no such errors and mplayer works fine.I enabled MMIO trace and didn't see that post BAR move there is a wrong MMIO access - all of them are from the new MMIO base offset -
0xfcd80000(trace attached including mmio trace and dmesg)I would be happy for any idea on this and any comment on the correctness of my sequence in the code
Andrey
Quoted 9 lines · Andrey Grodzovsky
Just an update, i found the issue which was actually to wake up the HW before doing stop/restart (using
pm_runtime_get_sync), also handled protecting from concurrentsnd_pcm_ioctlsaccessing the registers while the BAR is unmapped. Can go through BAR move while aplay is running now.Once again, would be happy for any comments on the code -
https://cgit.freedesktop.org/~agrodzov/linux/log/?h=yadro/pcie_hotplug/movable_bars_v9.1
Hrm, this kind of change is a bit scary; we have some mechanism to stop the HD-audio hardware operation (e.g. for loading the DSP for CA0132 codec), but it's pretty hackish and error-prone.
Do we really need the BAR remap while operating the sound streaming? That is, can't we simply refuse the remap if it's in operation? If it can be refused, we may avoid a big locking or such.
thanks,
Takashi
Quoted 74 lines
Andrey
Quoted 68 lines · Andrey Grodzovsky
Hi, I am working on adding AMD related drivers support for PCIe BARs move feature developed by Sergei
(https://linuxplumbersconf.org/event/7/contributions/847/attachments/584/1035/lpc2020_sergmir.pdf).His feature is still not upstream, all his code and mine on top can be seen here -
https://cgit.freedesktop.org/~agrodzov/linux/log/?h=yadro/pcie_hotplug/movable_bars_v9.1I did basic implementation fro amdgpu driver and now I am doing the same for
snd_hda_intelto support our on GPU Azalia audio chips. This relevant commit is here -
https://cgit.freedesktop.org/~agrodzov/linux/commit/?h=yadro/pcie_hotplug/movable_bars_v9.1&id=7ec0f60633e898cb941cebb3cd18aae1374fc365Any driver that wants to support movable BARs needs to implement
rescan_prepare,rescan_doneandbar_fixedcallbacks whererescan_prepareneeds to stop HW/SW and unamp all MMIO mappings andrescan_doneneeds to ioremap the BAR from it's new MMIO location and restart HW/SW.I am able currently to trigger BARs move by sysfs using "
/sys/bus/pci/rescan" and the driver will go through the sequence I described above without hangs. Problem is that after this when i try to use mplayer I am getting following errors:andrey@andrey-test:~$ sudo mplayer -ao alsa:device=hw=0.3 Downloads/file_example_MP3_5MG.mp3 MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.Playing Downloads/file_example_MP3_5MG.mp3.
libavformat version 58.29.100 (external)
Audio only file format detected.
Load subtitles in Downloads/
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 0.1 (00.0) of 132.0 (02:12.0) ??,?%
Audio device got stuck!and in dmesg I see
[ 365.355518]snd_hda_codec_hdmihdaudioC0D0: Unable to sync register0x2f0d00. -5Also I see 296.619014]
snd_hda_intel0000:0a:00.1: CORB reset timeout#2, CORBRP = 65535 error during therescan_donecallback executionI know it has to do with the move of BAR's MMIO address because when i disallow BAR migration by returning true from
bar_fixedcallback I have no such errors and mplayer works fine.I enabled MMIO trace and didn't see that post BAR move there is a wrong MMIO access - all of them are from the new MMIO base offset -
0xfcd80000(trace attached including mmio trace and dmesg)I would be happy for any idea on this and any comment on the correctness of my sequence in the code
Andrey
Quoted 9 lines · Takashi Iwai
Quoted 7 lines · Andrey Grodzovsky
Just an update, i found the issue which was actually to wake up the HW before doing stop/restart (using
pm_runtime_get_sync), also handled protecting from concurrentsnd_pcm_ioctlsaccessing the registers while the BAR is unmapped. Can go through BAR move while aplay is running now.
Quoted 6 lines
Quoted 2 lines
Once again, would be happy for any comments on the code -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C600bb8a982f54a2674d508d8edf045ff%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637520963652402231%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QKlK45vaajKVF%2FXhLIWMhN%2FhGxTIMG%2FG0Y8xNC37LPw%3D&reserved=0Hrm, this kind of change is a bit scary; we have some mechanism to stop the HD-audio hardware operation (e.g. for loading the DSP for CA0132 codec), but it's pretty hackish and error-prone.
At least I didn't have issue with HW stopping, the problem is with unampping hdac_bus->remap_addr - as long as it's not iorampped back no code besides the PCI BAR move should run at all as any register access from this address will cause fatal page fault. I took care of most of the IOCTls i think, the interrupts are disabled in azx_stop_chip but I am probably still missing some stuff like some background work items or other IOCTls code path.
Quoted 4 lines
Do we really need the BAR remap while operating the sound streaming? That is, can't we simply refuse the remap if it's in operation? If it can be refused, we may avoid a big locking or such.
Problem here is that this feature is for the sake of hot-plug of a device, this supposed to give enough MMIO space to place all the BARs of newly plugging in device. Refusing to move BARs because there is some
app using the sound card on the background might then lead to failure of
plugging in the new device and this doesn't sound as a reasonable
behavior to me. Also note that the lock's impact is minimal as it's
read side lock only in the IOCTLs an so as long as hot plug not
taking place it has no impact.
Andrey
Quoted 80 lines
thanks,
Takashi
Quoted 74 lines
Andrey
Quoted 68 lines · Andrey Grodzovsky
Hi, I am working on adding AMD related drivers support for PCIe BARs move feature developed by Sergei
(https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flinuxplumbersconf.org%2Fevent%2F7%2Fcontributions%2F847%2Fattachments%2F584%2F1035%2Flpc2020_sergmir.pdf&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C600bb8a982f54a2674d508d8edf045ff%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637520963652402231%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=fegwYaNiLmfZWWmuaYXU5gcJsJ%2BwcEwry4FoI1eyiK8%3D&reserved=0).His feature is still not upstream, all his code and mine on top can be seen here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C600bb8a982f54a2674d508d8edf045ff%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637520963652402231%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QKlK45vaajKVF%2FXhLIWMhN%2FhGxTIMG%2FG0Y8xNC37LPw%3D&reserved=0I did basic implementation fro amdgpu driver and now I am doing the same for
snd_hda_intelto support our on GPU Azalia audio chips. This relevant commit is here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Fcommit%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1%26id%3D7ec0f60633e898cb941cebb3cd18aae1374fc365&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C600bb8a982f54a2674d508d8edf045ff%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637520963652402231%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pk8qVsTWuGLpE5js1oVx8swM8zK2Jh3uJwuTWJ7ixlM%3D&reserved=0Any driver that wants to support movable BARs needs to implement
rescan_prepare,rescan_doneandbar_fixedcallbacks whererescan_prepareneeds to stop HW/SW and unamp all MMIO mappings andrescan_doneneeds to ioremap the BAR from it's new MMIO location and restart HW/SW.I am able currently to trigger BARs move by sysfs using "
/sys/bus/pci/rescan" and the driver will go through the sequence I described above without hangs. Problem is that after this when i try to use mplayer I am getting following errors:andrey@andrey-test:~$ sudo mplayer -ao alsa:device=hw=0.3 Downloads/file_example_MP3_5MG.mp3 MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.Playing Downloads/file_example_MP3_5MG.mp3.
libavformat version 58.29.100 (external)
Audio only file format detected.
Load subtitles in Downloads/
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 0.1 (00.0) of 132.0 (02:12.0) ??,?%
Audio device got stuck!and in dmesg I see
[ 365.355518]snd_hda_codec_hdmihdaudioC0D0: Unable to sync register0x2f0d00. -5Also I see 296.619014]
snd_hda_intel0000:0a:00.1: CORB reset timeout#2, CORBRP = 65535 error during therescan_donecallback executionI know it has to do with the move of BAR's MMIO address because when i disallow BAR migration by returning true from
bar_fixedcallback I have no such errors and mplayer works fine.I enabled MMIO trace and didn't see that post BAR move there is a wrong MMIO access - all of them are from the new MMIO base offset -
0xfcd80000(trace attached including mmio trace and dmesg)I would be happy for any idea on this and any comment on the correctness of my sequence in the code
Andrey
Quoted 20 lines · Andrey Grodzovsky
Quoted 9 lines · Takashi Iwai
Quoted 7 lines · Andrey Grodzovsky
Just an update, i found the issue which was actually to wake up the HW before doing stop/restart (using
pm_runtime_get_sync), also handled protecting from concurrentsnd_pcm_ioctlsaccessing the registers while the BAR is unmapped. Can go through BAR move while aplay is running now.Quoted 6 lines
Quoted 2 lines
Once again, would be happy for any comments on the code -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C600bb8a982f54a2674d508d8edf045ff%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637520963652402231%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QKlK45vaajKVF%2FXhLIWMhN%2FhGxTIMG%2FG0Y8xNC37LPw%3D&reserved=0Hrm, this kind of change is a bit scary; we have some mechanism to stop the HD-audio hardware operation (e.g. for loading the DSP for CA0132 codec), but it's pretty hackish and error-prone.
Quoted 7 lines
At least I didn't have issue with HW stopping, the problem is with unampping
hdac_bus->remap_addr- as long as it's not iorampped back no code besides the PCI BAR move should run at all as any register access from this address will cause fatal page fault. I took care of most of the IOCTls i think, the interrupts are disabled inazx_stop_chipbut I am probably still missing some stuff like some background work items or other IOCTls code path.
Are the all running processes stopped before entering rescan_prepare callback? Otherwise, e.g. a process accessing PCM stream via mmap can run without ioctl and this may trigger the PCM period elapsed eventually. Similarly, a control interface may issue the verb that is processed via CORB/RIRB, too. So what you need to cover is not only about PCM.
Quoted 4 lines
Quoted 3 lines
Do we really need the BAR remap while operating the sound streaming? That is, can't we simply refuse the remap if it's in operation? If it can be refused, we may avoid a big locking or such.
Quoted 8 lines
Problem here is that this feature is for the sake of hot-plug of a device, this supposed to give enough MMIO space to place all the BARs of newly plugging in device. Refusing to move BARs because there is some app using the sound card on the background might then lead to failure of plugging in the new device and this doesn't sound as a reasonable behavior to me. Also note that the lock's impact is minimal as it's read side lock only in the IOCTLs an so as long as hot plug not taking place it has no impact.
But a hot-plugged device can't have any running files, no? So at which timing is the BAR movement _must_ happen?
And, even if we need some synchronization, the current lock implementation looks fragile to me. We likely overlook something when trying to cover each branch code path.
Basically it needs to wait until all running processes via PCM or control API are released. We have a mechanism to block the new opens like snd_hda_lock_devices(). We'll need an additional stuff to wait until all opened devices are released there, and this requires some help in the core code, I suppose.
(Actually this hackish lock_devices/unlock_devices should have been in
the core stuff from the beginning...)
thanks,
Takashi
Quoted 84 lines
Andrey
Quoted 80 lines
thanks,
Takashi
Quoted 74 lines
Andrey
Quoted 68 lines · Andrey Grodzovsky
Hi, I am working on adding AMD related drivers support for PCIe BARs move feature developed by Sergei
(https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flinuxplumbersconf.org%2Fevent%2F7%2Fcontributions%2F847%2Fattachments%2F584%2F1035%2Flpc2020_sergmir.pdf&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C600bb8a982f54a2674d508d8edf045ff%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637520963652402231%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=fegwYaNiLmfZWWmuaYXU5gcJsJ%2BwcEwry4FoI1eyiK8%3D&reserved=0).His feature is still not upstream, all his code and mine on top can be seen here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C600bb8a982f54a2674d508d8edf045ff%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637520963652402231%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QKlK45vaajKVF%2FXhLIWMhN%2FhGxTIMG%2FG0Y8xNC37LPw%3D&reserved=0I did basic implementation fro amdgpu driver and now I am doing the same for
snd_hda_intelto support our on GPU Azalia audio chips. This relevant commit is here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Fcommit%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1%26id%3D7ec0f60633e898cb941cebb3cd18aae1374fc365&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C600bb8a982f54a2674d508d8edf045ff%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637520963652402231%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pk8qVsTWuGLpE5js1oVx8swM8zK2Jh3uJwuTWJ7ixlM%3D&reserved=0Any driver that wants to support movable BARs needs to implement
rescan_prepare,rescan_doneandbar_fixedcallbacks whererescan_prepareneeds to stop HW/SW and unamp all MMIO mappings andrescan_doneneeds to ioremap the BAR from it's new MMIO location and restart HW/SW.I am able currently to trigger BARs move by sysfs using "
/sys/bus/pci/rescan" and the driver will go through the sequence I described above without hangs. Problem is that after this when i try to use mplayer I am getting following errors:andrey@andrey-test:~$ sudo mplayer -ao alsa:device=hw=0.3 Downloads/file_example_MP3_5MG.mp3 MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.Playing Downloads/file_example_MP3_5MG.mp3.
libavformat version 58.29.100 (external)
Audio only file format detected.
Load subtitles in Downloads/
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 0.1 (00.0) of 132.0 (02:12.0) ??,?%
Audio device got stuck!and in dmesg I see
[ 365.355518]snd_hda_codec_hdmihdaudioC0D0: Unable to sync register0x2f0d00. -5Also I see 296.619014]
snd_hda_intel0000:0a:00.1: CORB reset timeout#2, CORBRP = 65535 error during therescan_donecallback executionI know it has to do with the move of BAR's MMIO address because when i disallow BAR migration by returning true from
bar_fixedcallback I have no such errors and mplayer works fine.I enabled MMIO trace and didn't see that post BAR move there is a wrong MMIO access - all of them are from the new MMIO base offset -
0xfcd80000(trace attached including mmio trace and dmesg)I would be happy for any idea on this and any comment on the correctness of my sequence in the code
Andrey
Quoted 30 lines · Takashi Iwai
Quoted 20 lines · Andrey Grodzovsky
Quoted 9 lines · Takashi Iwai
Quoted 7 lines · Andrey Grodzovsky
Just an update, i found the issue which was actually to wake up the HW before doing stop/restart (using
pm_runtime_get_sync), also handled protecting from concurrentsnd_pcm_ioctlsaccessing the registers while the BAR is unmapped. Can go through BAR move while aplay is running now.Quoted 6 lines
Quoted 2 lines
Once again, would be happy for any comments on the code -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C047e560ff3994f24656c08d8ee0b9497%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521081583290130%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Egfb346Qsxvdk33o1HhuBJihwbZRc8EZa9aJPzQ3Prk%3D&reserved=0Hrm, this kind of change is a bit scary; we have some mechanism to stop the HD-audio hardware operation (e.g. for loading the DSP for CA0132 codec), but it's pretty hackish and error-prone.
Quoted 7 lines
At least I didn't have issue with HW stopping, the problem is with unampping
hdac_bus->remap_addr- as long as it's not iorampped back no code besides the PCI BAR move should run at all as any register access from this address will cause fatal page fault. I took care of most of the IOCTls i think, the interrupts are disabled inazx_stop_chipbut I am probably still missing some stuff like some background work items or other IOCTls code path.
Quoted 4 lines
Are the all running processes stopped before entering
rescan_preparecallback? Otherwise, e.g. a process accessing PCM stream via mmap can run without ioctl and this may trigger the PCM period elapsed eventually.
Is any of them remaps the BAR into user process VMA ? The only two I see in the sound subsystem doing remapping are are had_pcm_mmap and snd_pcm_lib_default_mmap and both of them remap dma buffers which are in system memory and not
MMIO space and hence should not be impacted by the BAR move.
Or maybe I didn't get your concern correctly ? Why there would be a problem to access the stream otherwise during the BAR move ?
Similarly, a control interface may issue the verb that is
Quoted 2 lines
processed via CORB/RIRB, too. So what you need to cover is not only about PCM.
Can you point me to the code path for this - is this through another type of IOCTL or interrupt handlers ?
Quoted 14 lines
Quoted 5 lines
Quoted 4 lines
Do we really need the BAR remap while operating the sound streaming? That is, can't we simply refuse the remap if it's in operation? If it can be refused, we may avoid a big locking or such.
Quoted 8 lines
Problem here is that this feature is for the sake of hot-plug of a device, this supposed to give enough MMIO space to place all the BARs of newly plugging in device. Refusing to move BARs because there is some app using the sound card on the background might then lead to failure of plugging in the new device and this doesn't sound as a reasonable behavior to me. Also note that the lock's impact is minimal as it's read side lock only in the IOCTLs an so as long as hot plug not taking place it has no impact.
Quoted 2 lines
But a hot-plugged device can't have any running files, no? So at which timing is the BAR movement _must_ happen?
No, the devices this code is written for are those already in the
system before the new device is plugged in, the new device needs enough
free MMIO space for his own BARs and so this features enables existing
devices to allow the PCI core to move their BARs within the physical address space such that enough free space will be available inside the MMIO window allocated for the new device's upstream PCI bridge.
Quoted 7 lines
And, even if we need some synchronization, the current lock implementation looks fragile to me. We likely overlook something when trying to cover each branch code path.
Basically it needs to wait until all running processes via PCM or control API are released.
This approach brings a couple of hard questions -
How we make them stop at once - they might run for long time, you
suggest something like invalidate all their mmaps and on next page
fault return SIGBUS to terminate them ? Then I need also to know they actually are done - should I wait for their device file instance release? What if they don't access any mmapped are for a long time ? Sending SIGKILL explicitly ? But do I have the task id's of all of them ?
We had those scenarios discussed during my initial work on GPU hot unplug and came to a conclusssion that trying to wait for current processes to die is not a good approach - see the this respone I got at the time for example - https://lists.freedesktop.org/archives/dri-devel/2020-May/265467.html
Andrey
We have a mechanism to block the new opens
Quoted 95 lines
like
snd_hda_lock_devices(). We'll need an additional stuff to wait until all opened devices are released there, and this requires some help in the core code, I suppose.
(Actually this hackish lock_devices/unlock_devices should have been in
the core stuff from the beginning...)thanks,
Takashi
Quoted 84 lines
Andrey
Quoted 80 lines
thanks,
Takashi
Quoted 74 lines
Andrey
Quoted 68 lines · Andrey Grodzovsky
Hi, I am working on adding AMD related drivers support for PCIe BARs move feature developed by Sergei
(https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flinuxplumbersconf.org%2Fevent%2F7%2Fcontributions%2F847%2Fattachments%2F584%2F1035%2Flpc2020_sergmir.pdf&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C047e560ff3994f24656c08d8ee0b9497%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521081583290130%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7n2pk2fzcltX4UxdLnDlqZxIqtG2G6922XiDkJIVMeA%3D&reserved=0).His feature is still not upstream, all his code and mine on top can be seen here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C047e560ff3994f24656c08d8ee0b9497%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521081583290130%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Egfb346Qsxvdk33o1HhuBJihwbZRc8EZa9aJPzQ3Prk%3D&reserved=0I did basic implementation fro amdgpu driver and now I am doing the same for
snd_hda_intelto support our on GPU Azalia audio chips. This relevant commit is here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Fcommit%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1%26id%3D7ec0f60633e898cb941cebb3cd18aae1374fc365&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C047e560ff3994f24656c08d8ee0b9497%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521081583290130%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=o5Iv8aTSOyj3m32oA4Dp4k1y%2BZxFTStYMl%2F4ogS9OtA%3D&reserved=0Any driver that wants to support movable BARs needs to implement
rescan_prepare,rescan_doneandbar_fixedcallbacks whererescan_prepareneeds to stop HW/SW and unamp all MMIO mappings andrescan_doneneeds to ioremap the BAR from it's new MMIO location and restart HW/SW.I am able currently to trigger BARs move by sysfs using "
/sys/bus/pci/rescan" and the driver will go through the sequence I described above without hangs. Problem is that after this when i try to use mplayer I am getting following errors:andrey@andrey-test:~$ sudo mplayer -ao alsa:device=hw=0.3 Downloads/file_example_MP3_5MG.mp3 MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.Playing Downloads/file_example_MP3_5MG.mp3.
libavformat version 58.29.100 (external)
Audio only file format detected.
Load subtitles in Downloads/
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 0.1 (00.0) of 132.0 (02:12.0) ??,?%
Audio device got stuck!and in dmesg I see
[ 365.355518]snd_hda_codec_hdmihdaudioC0D0: Unable to sync register0x2f0d00. -5Also I see 296.619014]
snd_hda_intel0000:0a:00.1: CORB reset timeout#2, CORBRP = 65535 error during therescan_donecallback executionI know it has to do with the move of BAR's MMIO address because when i disallow BAR migration by returning true from
bar_fixedcallback I have no such errors and mplayer works fine.I enabled MMIO trace and didn't see that post BAR move there is a wrong MMIO access - all of them are from the new MMIO base offset -
0xfcd80000(trace attached including mmio trace and dmesg)I would be happy for any idea on this and any comment on the correctness of my sequence in the code
Andrey
Quoted 39 lines · Andrey Grodzovsky
Quoted 30 lines · Takashi Iwai
Quoted 20 lines · Andrey Grodzovsky
Quoted 9 lines · Takashi Iwai
Quoted 7 lines · Andrey Grodzovsky
Just an update, i found the issue which was actually to wake up the HW before doing stop/restart (using
pm_runtime_get_sync), also handled protecting from concurrentsnd_pcm_ioctlsaccessing the registers while the BAR is unmapped. Can go through BAR move while aplay is running now.Quoted 6 lines
Quoted 2 lines
Once again, would be happy for any comments on the code -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C047e560ff3994f24656c08d8ee0b9497%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521081583290130%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Egfb346Qsxvdk33o1HhuBJihwbZRc8EZa9aJPzQ3Prk%3D&reserved=0Hrm, this kind of change is a bit scary; we have some mechanism to stop the HD-audio hardware operation (e.g. for loading the DSP for CA0132 codec), but it's pretty hackish and error-prone.
Quoted 7 lines
At least I didn't have issue with HW stopping, the problem is with unampping
hdac_bus->remap_addr- as long as it's not iorampped back no code besides the PCI BAR move should run at all as any register access from this address will cause fatal page fault. I took care of most of the IOCTls i think, the interrupts are disabled inazx_stop_chipbut I am probably still missing some stuff like some background work items or other IOCTls code path.Quoted 4 lines
Are the all running processes stopped before entering
rescan_preparecallback? Otherwise, e.g. a process accessing PCM stream via mmap can run without ioctl and this may trigger the PCM period elapsed eventually.
Quoted 5 lines
Is any of them remaps the BAR into user process VMA ? The only two I see in the sound subsystem doing remapping are are
had_pcm_mmapandsnd_pcm_lib_default_mmap
and both of them remap dma buffers which are in system memory and not MMIO space and hence should not be impacted by the BAR move.
When a stream is running, it can cause an interrupt that may issue an unsolicited event that is deals with CORB/RIRB later in a work asynchronously.
Quoted 9 lines
Or maybe I didn't get your concern correctly ? Why there would be a problem to access the stream otherwise during the BAR move ?
Similarly, a control interface may issue the verb that is
Quoted 2 lines
processed via CORB/RIRB, too. So what you need to cover is not only about PCM.
Can you point me to the code path for this - is this through another type of IOCTL or interrupt handlers ?
Yes, it's handled in the ALSA core control ioctls. Many of the control *_get()/*_put() callbacks in HD-audio are involved with the amp or other HD-audio verbs (typically calling snd_hda_codec_amp*(), etc). Those are the mixer elements and handled via regmap with HD-audio backend that deals with CORB/RIRB eventually.
Quoted 16 lines
Quoted 13 lines
Quoted 4 lines
Quoted 3 lines
Do we really need the BAR remap while operating the sound streaming? That is, can't we simply refuse the remap if it's in operation? If it can be refused, we may avoid a big locking or such.
Quoted 8 lines
Problem here is that this feature is for the sake of hot-plug of a device, this supposed to give enough MMIO space to place all the BARs of newly plugging in device. Refusing to move BARs because there is some app using the sound card on the background might then lead to failure of plugging in the new device and this doesn't sound as a reasonable behavior to me. Also note that the lock's impact is minimal as it's read side lock only in the IOCTLs an so as long as hot plug not taking place it has no impact.
Quoted 2 lines
But a hot-plugged device can't have any running files, no? So at which timing is the BAR movement _must_ happen?
Quoted 6 lines
No, the devices this code is written for are those already in the system before the new device is plugged in, the new device needs enough free MMIO space for his own BARs and so this features enables existing devices to allow the PCI core to move their BARs within the physical address space such that enough free space will be available inside the MMIO window allocated for the new device's upstream PCI bridge.
Hmm, OK, so it's other way round as I thought of.
Quoted 7 lines
Quoted 6 lines
And, even if we need some synchronization, the current lock implementation looks fragile to me. We likely overlook something when trying to cover each branch code path.
Basically it needs to wait until all running processes via PCM or control API are released.
Quoted 8 lines
This approach brings a couple of hard questions -
How we make them stop at once - they might run for long time, you suggest something like invalidate all their mmaps and on next page fault return SIGBUS to terminate them ? Then I need also to know they actually are done - should I wait for their device file instance release? What if they don't access any mmapped are for a long time ? Sending SIGKILL explicitly ? But do I have the task id's of all of them ?
You shouldn't kill them but wait for them aborting gracefully, IMO. Essentially a kind of hot-unplug. Most of Linux drivers won't kill processes at the hot-unplug, AFAIK.
But if it has to be done so, we have a list of file descriptors that are attached to the PCM and the control devices, too...
Quoted 5 lines
We had those scenarios discussed during my initial work on GPU hot unplug and came to a conclusssion that trying to wait for current processes to die is not a good approach - see the this respone I got at the time for example -
https://lists.freedesktop.org/archives/dri-devel/2020-May/265467.html
But should this be seen rather as an analogy of hot-replug? That won't kill processes.
Takashi
Quoted 100 lines
Andrey
We have a mechanism to block the new opens
Quoted 95 lines
like
snd_hda_lock_devices(). We'll need an additional stuff to wait until all opened devices are released there, and this requires some help in the core code, I suppose.
(Actually this hackish lock_devices/unlock_devices should have been in
the core stuff from the beginning...)thanks,
Takashi
Quoted 84 lines
Andrey
Quoted 80 lines
thanks,
Takashi
Quoted 74 lines
Andrey
Quoted 68 lines · Andrey Grodzovsky
Hi, I am working on adding AMD related drivers support for PCIe BARs move feature developed by Sergei
(https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flinuxplumbersconf.org%2Fevent%2F7%2Fcontributions%2F847%2Fattachments%2F584%2F1035%2Flpc2020_sergmir.pdf&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C047e560ff3994f24656c08d8ee0b9497%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521081583290130%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7n2pk2fzcltX4UxdLnDlqZxIqtG2G6922XiDkJIVMeA%3D&reserved=0).His feature is still not upstream, all his code and mine on top can be seen here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C047e560ff3994f24656c08d8ee0b9497%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521081583290130%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Egfb346Qsxvdk33o1HhuBJihwbZRc8EZa9aJPzQ3Prk%3D&reserved=0I did basic implementation fro amdgpu driver and now I am doing the same for
snd_hda_intelto support our on GPU Azalia audio chips. This relevant commit is here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Fcommit%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1%26id%3D7ec0f60633e898cb941cebb3cd18aae1374fc365&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C047e560ff3994f24656c08d8ee0b9497%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521081583290130%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=o5Iv8aTSOyj3m32oA4Dp4k1y%2BZxFTStYMl%2F4ogS9OtA%3D&reserved=0Any driver that wants to support movable BARs needs to implement
rescan_prepare,rescan_doneandbar_fixedcallbacks whererescan_prepareneeds to stop HW/SW and unamp all MMIO mappings andrescan_doneneeds to ioremap the BAR from it's new MMIO location and restart HW/SW.I am able currently to trigger BARs move by sysfs using "
/sys/bus/pci/rescan" and the driver will go through the sequence I described above without hangs. Problem is that after this when i try to use mplayer I am getting following errors:andrey@andrey-test:~$ sudo mplayer -ao alsa:device=hw=0.3 Downloads/file_example_MP3_5MG.mp3 MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.Playing Downloads/file_example_MP3_5MG.mp3.
libavformat version 58.29.100 (external)
Audio only file format detected.
Load subtitles in Downloads/
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 0.1 (00.0) of 132.0 (02:12.0) ??,?%
Audio device got stuck!and in dmesg I see
[ 365.355518]snd_hda_codec_hdmihdaudioC0D0: Unable to sync register0x2f0d00. -5Also I see 296.619014]
snd_hda_intel0000:0a:00.1: CORB reset timeout#2, CORBRP = 65535 error during therescan_donecallback executionI know it has to do with the move of BAR's MMIO address because when i disallow BAR migration by returning true from
bar_fixedcallback I have no such errors and mplayer works fine.I enabled MMIO trace and didn't see that post BAR move there is a wrong MMIO access - all of them are from the new MMIO base offset -
0xfcd80000(trace attached including mmio trace and dmesg)I would be happy for any idea on this and any comment on the correctness of my sequence in the code
Andrey
Quoted 47 lines · Takashi Iwai
Quoted 39 lines · Andrey Grodzovsky
Quoted 30 lines · Takashi Iwai
Quoted 20 lines · Andrey Grodzovsky
Quoted 9 lines · Takashi Iwai
Quoted 7 lines · Andrey Grodzovsky
Just an update, i found the issue which was actually to wake up the HW before doing stop/restart (using
pm_runtime_get_sync), also handled protecting from concurrentsnd_pcm_ioctlsaccessing the registers while the BAR is unmapped. Can go through BAR move while aplay is running now.Quoted 6 lines
Quoted 2 lines
Once again, would be happy for any comments on the code -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C0bda8b151e46406f541308d8ee1bc360%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521150744943554%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pZEuJv8898ad52gYIskao38J01dLdH1PEwSC5h3tgdM%3D&reserved=0Hrm, this kind of change is a bit scary; we have some mechanism to stop the HD-audio hardware operation (e.g. for loading the DSP for CA0132 codec), but it's pretty hackish and error-prone.
Quoted 7 lines
At least I didn't have issue with HW stopping, the problem is with unampping
hdac_bus->remap_addr- as long as it's not iorampped back no code besides the PCI BAR move should run at all as any register access from this address will cause fatal page fault. I took care of most of the IOCTls i think, the interrupts are disabled inazx_stop_chipbut I am probably still missing some stuff like some background work items or other IOCTls code path.Quoted 4 lines
Are the all running processes stopped before entering
rescan_preparecallback? Otherwise, e.g. a process accessing PCM stream via mmap can run without ioctl and this may trigger the PCM period elapsed eventually.Quoted 5 lines
Is any of them remaps the BAR into user process VMA ? The only two I see in the sound subsystem doing remapping are are
had_pcm_mmapandsnd_pcm_lib_default_mmap
and both of them remap dma buffers which are in system memory and not MMIO space and hence should not be impacted by the BAR move.
Quoted 3 lines
When a stream is running, it can cause an interrupt that may issue an unsolicited event that is deals with CORB/RIRB later in a work asynchronously.
On rescan_prepare I am calling snd_hdac_bus_stop_chip which in turn seems to disable interrupts - is this enough to guarantee all those won't be happening past that code ? Should I also flush any work queue items scheduled from within those ISRs before proceeding ?
Quoted 58 lines
Quoted 10 lines
Or maybe I didn't get your concern correctly ? Why there would be a problem to access the stream otherwise during the BAR move ?
Similarly, a control interface may issue the verb that is
Quoted 2 lines
processed via CORB/RIRB, too. So what you need to cover is not only about PCM.
Can you point me to the code path for this - is this through another type of IOCTL or interrupt handlers ?
Yes, it's handled in the ALSA core control ioctls. Many of the control *_get()/*_put() callbacks in HD-audio are involved with the amp or other HD-audio verbs (typically calling snd_hda_codec_amp*(), etc). Those are the mixer elements and handled via regmap with HD-audio backend that deals with CORB/RIRB eventually.
Quoted 16 lines
Quoted 13 lines
Quoted 4 lines
Quoted 3 lines
Do we really need the BAR remap while operating the sound streaming? That is, can't we simply refuse the remap if it's in operation? If it can be refused, we may avoid a big locking or such.
Quoted 8 lines
Problem here is that this feature is for the sake of hot-plug of a device, this supposed to give enough MMIO space to place all the BARs of newly plugging in device. Refusing to move BARs because there is some app using the sound card on the background might then lead to failure of plugging in the new device and this doesn't sound as a reasonable behavior to me. Also note that the lock's impact is minimal as it's read side lock only in the IOCTLs an so as long as hot plug not taking place it has no impact.
Quoted 2 lines
But a hot-plugged device can't have any running files, no? So at which timing is the BAR movement _must_ happen?
Quoted 6 lines
No, the devices this code is written for are those already in the system before the new device is plugged in, the new device needs enough free MMIO space for his own BARs and so this features enables existing devices to allow the PCI core to move their BARs within the physical address space such that enough free space will be available inside the MMIO window allocated for the new device's upstream PCI bridge.
Hmm, OK, so it's other way round as I thought of.
Quoted 7 lines
Quoted 6 lines
And, even if we need some synchronization, the current lock implementation looks fragile to me. We likely overlook something when trying to cover each branch code path.
Basically it needs to wait until all running processes via PCM or control API are released.
Quoted 8 lines
This approach brings a couple of hard questions -
How we make them stop at once - they might run for long time, you suggest something like invalidate all their mmaps and on next page fault return SIGBUS to terminate them ? Then I need also to know they actually are done - should I wait for their device file instance release? What if they don't access any mmapped are for a long time ? Sending SIGKILL explicitly ? But do I have the task id's of all of them ?
Quoted 3 lines
You shouldn't kill them but wait for them aborting gracefully, IMO. Essentially a kind of hot-unplug. Most of Linux drivers won't kill processes at the hot-unplug, AFAIK.
But see, the difference is such that on hot-plug I may just let those process pointing at zombie device to hang around indefently because I am not waiting for any output from them. That indeed what I am doing for amdgou hot-unplug work. Here i need to blocking wait for them since I need to finish the procedure so the PCI core can finish shuffling the existing BARs around and by this freeing enough space for the new device to be accepted. I user can't plug in his thunderbolt GPU and observe that nothing is happening actually because we are stuck waiting for some process just sitting idle.
Quoted 3 lines
But if it has to be done so, we have a list of file descriptors that are attached to the PCM and the control devices, too...
So you suggest iterate all of them, sigkill them and confirm all of them exit instead of using the rw_sem ? This will cover IOCTLs and any mmapped accesses i guess. Interrupts we discussed above. What above any
possible background kernel work going on in dedicated threads or work items ? Any pointers there what should be blocked and waited for ?
Andrey
Quoted 113 lines
Quoted 6 lines
We had those scenarios discussed during my initial work on GPU hot unplug and came to a conclusssion that trying to wait for current processes to die is not a good approach - see the this respone I got at the time for example -
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Farchives%2Fdri-devel%2F2020-May%2F265467.html&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C0bda8b151e46406f541308d8ee1bc360%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521150744953550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=kOBHOS8tmokHM23Hx2HH12NWgzadKv7lhuKoNhF2nFU%3D&reserved=0But should this be seen rather as an analogy of hot-replug? That won't kill processes.
Takashi
Quoted 100 lines
Andrey
We have a mechanism to block the new opens
Quoted 95 lines
like
snd_hda_lock_devices(). We'll need an additional stuff to wait until all opened devices are released there, and this requires some help in the core code, I suppose.
(Actually this hackish lock_devices/unlock_devices should have been in
the core stuff from the beginning...)thanks,
Takashi
Quoted 84 lines
Andrey
Quoted 80 lines
thanks,
Takashi
Quoted 74 lines
Andrey
Quoted 68 lines · Andrey Grodzovsky
Hi, I am working on adding AMD related drivers support for PCIe BARs move feature developed by Sergei
(https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flinuxplumbersconf.org%2Fevent%2F7%2Fcontributions%2F847%2Fattachments%2F584%2F1035%2Flpc2020_sergmir.pdf&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C0bda8b151e46406f541308d8ee1bc360%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521150744953550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QbiCIxry93FNvFJLHNaqEAdPbFRe%2FctIf%2BlGAQg0XDI%3D&reserved=0).His feature is still not upstream, all his code and mine on top can be seen here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C0bda8b151e46406f541308d8ee1bc360%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521150744953550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=G514jwRAVet2bFXPC7a1s0%2B0cRYhX7f45gesxQpcYfk%3D&reserved=0I did basic implementation fro amdgpu driver and now I am doing the same for
snd_hda_intelto support our on GPU Azalia audio chips. This relevant commit is here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Fcommit%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1%26id%3D7ec0f60633e898cb941cebb3cd18aae1374fc365&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C0bda8b151e46406f541308d8ee1bc360%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521150744953550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=zKywjLs5mCdQwlt%2Fjb0qe1aOlVb%2FWWf6eDqQ4m9WGSs%3D&reserved=0Any driver that wants to support movable BARs needs to implement
rescan_prepare,rescan_doneandbar_fixedcallbacks whererescan_prepareneeds to stop HW/SW and unamp all MMIO mappings andrescan_doneneeds to ioremap the BAR from it's new MMIO location and restart HW/SW.I am able currently to trigger BARs move by sysfs using "
/sys/bus/pci/rescan" and the driver will go through the sequence I described above without hangs. Problem is that after this when i try to use mplayer I am getting following errors:andrey@andrey-test:~$ sudo mplayer -ao alsa:device=hw=0.3 Downloads/file_example_MP3_5MG.mp3 MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.Playing Downloads/file_example_MP3_5MG.mp3.
libavformat version 58.29.100 (external)
Audio only file format detected.
Load subtitles in Downloads/
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 0.1 (00.0) of 132.0 (02:12.0) ??,?%
Audio device got stuck!and in dmesg I see
[ 365.355518]snd_hda_codec_hdmihdaudioC0D0: Unable to sync register0x2f0d00. -5Also I see 296.619014]
snd_hda_intel0000:0a:00.1: CORB reset timeout#2, CORBRP = 65535 error during therescan_donecallback executionI know it has to do with the move of BAR's MMIO address because when i disallow BAR migration by returning true from
bar_fixedcallback I have no such errors and mplayer works fine.I enabled MMIO trace and didn't see that post BAR move there is a wrong MMIO access - all of them are from the new MMIO base offset -
0xfcd80000(trace attached including mmio trace and dmesg)I would be happy for any idea on this and any comment on the correctness of my sequence in the code
Andrey
Quoted 51 lines · Andrey Grodzovsky
Quoted 47 lines · Takashi Iwai
Quoted 44 lines · Andrey Grodzovsky
Quoted 30 lines · Takashi Iwai
Quoted 20 lines · Andrey Grodzovsky
Quoted 9 lines · Takashi Iwai
Quoted 7 lines · Andrey Grodzovsky
Just an update, i found the issue which was actually to wake up the HW before doing stop/restart (using
pm_runtime_get_sync), also handled protecting from concurrentsnd_pcm_ioctlsaccessing the registers while the BAR is unmapped. Can go through BAR move while aplay is running now.Quoted 6 lines
Quoted 2 lines
Once again, would be happy for any comments on the code -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C0bda8b151e46406f541308d8ee1bc360%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521150744943554%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pZEuJv8898ad52gYIskao38J01dLdH1PEwSC5h3tgdM%3D&reserved=0Hrm, this kind of change is a bit scary; we have some mechanism to stop the HD-audio hardware operation (e.g. for loading the DSP for CA0132 codec), but it's pretty hackish and error-prone.
Quoted 7 lines
At least I didn't have issue with HW stopping, the problem is with unampping
hdac_bus->remap_addr- as long as it's not iorampped back no code besides the PCI BAR move should run at all as any register access from this address will cause fatal page fault. I took care of most of the IOCTls i think, the interrupts are disabled inazx_stop_chipbut I am probably still missing some stuff like some background work items or other IOCTls code path.Quoted 4 lines
Are the all running processes stopped before entering
rescan_preparecallback? Otherwise, e.g. a process accessing PCM stream via mmap can run without ioctl and this may trigger the PCM period elapsed eventually.Is any of them remaps the BAR into user process VMA ? The only two I see in the sound subsystem doing remapping are are
had_pcm_mmapandsnd_pcm_lib_default_mmap
and both of them remap dma buffers which are in system memory and not MMIO space and hence should not be impacted by the BAR move.
Quoted 8 lines
Quoted 3 lines
When a stream is running, it can cause an interrupt that may issue an unsolicited event that is deals with CORB/RIRB later in a work asynchronously.
On
rescan_prepareI am callingsnd_hdac_bus_stop_chipwhich in turn seems to disable interrupts - is this enough to guarantee all those won't be happening past that code ? Should I also flush any work queue items scheduled from within those ISRs before proceeding ?
Well, calling snd_hdac_bus_stop_chip() during operation itself isn't safe at all. It's called safely in the power management because we know all things have been already stopped. But calling it out of sudden is a completely different matter.
Quoted 61 lines
Quoted 57 lines
Quoted 9 lines
Or maybe I didn't get your concern correctly ? Why there would be a problem to access the stream otherwise during the BAR move ?
Similarly, a control interface may issue the verb that is
Quoted 2 lines
processed via CORB/RIRB, too. So what you need to cover is not only about PCM.
Can you point me to the code path for this - is this through another type of IOCTL or interrupt handlers ?
Yes, it's handled in the ALSA core control ioctls. Many of the control *_get()/*_put() callbacks in HD-audio are involved with the amp or other HD-audio verbs (typically calling snd_hda_codec_amp*(), etc). Those are the mixer elements and handled via regmap with HD-audio backend that deals with CORB/RIRB eventually.
Quoted 16 lines
Quoted 13 lines
Quoted 4 lines
Quoted 3 lines
Do we really need the BAR remap while operating the sound streaming? That is, can't we simply refuse the remap if it's in operation? If it can be refused, we may avoid a big locking or such.
Quoted 8 lines
Problem here is that this feature is for the sake of hot-plug of a device, this supposed to give enough MMIO space to place all the BARs of newly plugging in device. Refusing to move BARs because there is some app using the sound card on the background might then lead to failure of plugging in the new device and this doesn't sound as a reasonable behavior to me. Also note that the lock's impact is minimal as it's read side lock only in the IOCTLs an so as long as hot plug not taking place it has no impact.
Quoted 2 lines
But a hot-plugged device can't have any running files, no? So at which timing is the BAR movement _must_ happen?
Quoted 6 lines
No, the devices this code is written for are those already in the system before the new device is plugged in, the new device needs enough free MMIO space for his own BARs and so this features enables existing devices to allow the PCI core to move their BARs within the physical address space such that enough free space will be available inside the MMIO window allocated for the new device's upstream PCI bridge.
Hmm, OK, so it's other way round as I thought of.
Quoted 7 lines
Quoted 6 lines
And, even if we need some synchronization, the current lock implementation looks fragile to me. We likely overlook something when trying to cover each branch code path.
Basically it needs to wait until all running processes via PCM or control API are released.
Quoted 8 lines
This approach brings a couple of hard questions -
How we make them stop at once - they might run for long time, you suggest something like invalidate all their mmaps and on next page fault return SIGBUS to terminate them ? Then I need also to know they actually are done - should I wait for their device file instance release? What if they don't access any mmapped are for a long time ? Sending SIGKILL explicitly ? But do I have the task id's of all of them ?
Quoted 3 lines
You shouldn't kill them but wait for them aborting gracefully, IMO. Essentially a kind of hot-unplug. Most of Linux drivers won't kill processes at the hot-unplug, AFAIK.
Quoted 9 lines
But see, the difference is such that on hot-plug I may just let those process pointing at zombie device to hang around indefently because I am not waiting for any output from them. That indeed what I am doing for amdgou hot-unplug work. Here i need to blocking wait for them since I need to finish the procedure so the PCI core can finish shuffling the existing BARs around and by this freeing enough space for the new device to be accepted. I user can't plug in his thunderbolt GPU and observe that nothing is happening actually because we are stuck waiting for some process just sitting idle.
Then we can see it from a different angle; read below.
Quoted 5 lines
Quoted 2 lines
But if it has to be done so, we have a list of file descriptors that are attached to the PCM and the control devices, too...
So you suggest iterate all of them, sigkill them and confirm all of them exit instead of using the
rw_sem?
Note that, for the sound applications, we don't kill at disconnection. But the ALSA core stuff shuts the all operations up but for closing (also some event notification for the disconnection was done), hence we just wait for applications releasing resources. In anyway...
Quoted 4 lines
This will cover IOCTLs and any
mmapped accesses i guess. Interrupts we discussed above. What above any possible background kernel work going on in dedicated threads or work items ? Any pointers there what should be blocked and waited for ?
An alternative idea would be the analogy of the system suspend / resume. That is, we forcibly suspend the devices at first somehow, and also restricts the further accesses by some way. Then do remap, and resume. Not sure whether this will fly high, but if it works, it should be more systematic and more robust than papering over each piece manually, I suppose.
Takashi
Quoted 117 lines
Andrey
Quoted 113 lines
Quoted 6 lines
We had those scenarios discussed during my initial work on GPU hot unplug and came to a conclusssion that trying to wait for current processes to die is not a good approach - see the this respone I got at the time for example -
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Farchives%2Fdri-devel%2F2020-May%2F265467.html&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C0bda8b151e46406f541308d8ee1bc360%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521150744953550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=kOBHOS8tmokHM23Hx2HH12NWgzadKv7lhuKoNhF2nFU%3D&reserved=0But should this be seen rather as an analogy of hot-replug? That won't kill processes.
Takashi
Quoted 100 lines
Andrey
We have a mechanism to block the new opens
Quoted 95 lines
like
snd_hda_lock_devices(). We'll need an additional stuff to wait until all opened devices are released there, and this requires some help in the core code, I suppose.
(Actually this hackish lock_devices/unlock_devices should have been in
the core stuff from the beginning...)thanks,
Takashi
Quoted 84 lines
Andrey
Quoted 80 lines
thanks,
Takashi
Quoted 74 lines
Andrey
Quoted 68 lines · Andrey Grodzovsky
Hi, I am working on adding AMD related drivers support for PCIe BARs move feature developed by Sergei
(https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flinuxplumbersconf.org%2Fevent%2F7%2Fcontributions%2F847%2Fattachments%2F584%2F1035%2Flpc2020_sergmir.pdf&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C0bda8b151e46406f541308d8ee1bc360%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521150744953550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QbiCIxry93FNvFJLHNaqEAdPbFRe%2FctIf%2BlGAQg0XDI%3D&reserved=0).His feature is still not upstream, all his code and mine on top can be seen here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C0bda8b151e46406f541308d8ee1bc360%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521150744953550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=G514jwRAVet2bFXPC7a1s0%2B0cRYhX7f45gesxQpcYfk%3D&reserved=0I did basic implementation fro amdgpu driver and now I am doing the same for
snd_hda_intelto support our on GPU Azalia audio chips. This relevant commit is here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Fcommit%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1%26id%3D7ec0f60633e898cb941cebb3cd18aae1374fc365&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C0bda8b151e46406f541308d8ee1bc360%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521150744953550%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=zKywjLs5mCdQwlt%2Fjb0qe1aOlVb%2FWWf6eDqQ4m9WGSs%3D&reserved=0Any driver that wants to support movable BARs needs to implement
rescan_prepare,rescan_doneandbar_fixedcallbacks whererescan_prepareneeds to stop HW/SW and unamp all MMIO mappings andrescan_doneneeds to ioremap the BAR from it's new MMIO location and restart HW/SW.I am able currently to trigger BARs move by sysfs using "
/sys/bus/pci/rescan" and the driver will go through the sequence I described above without hangs. Problem is that after this when i try to use mplayer I am getting following errors:andrey@andrey-test:~$ sudo mplayer -ao alsa:device=hw=0.3 Downloads/file_example_MP3_5MG.mp3 MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.Playing Downloads/file_example_MP3_5MG.mp3.
libavformat version 58.29.100 (external)
Audio only file format detected.
Load subtitles in Downloads/
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 0.1 (00.0) of 132.0 (02:12.0) ??,?%
Audio device got stuck!and in dmesg I see
[ 365.355518]snd_hda_codec_hdmihdaudioC0D0: Unable to sync register0x2f0d00. -5Also I see 296.619014]
snd_hda_intel0000:0a:00.1: CORB reset timeout#2, CORBRP = 65535 error during therescan_donecallback executionI know it has to do with the move of BAR's MMIO address because when i disallow BAR migration by returning true from
bar_fixedcallback I have no such errors and mplayer works fine.I enabled MMIO trace and didn't see that post BAR move there is a wrong MMIO access - all of them are from the new MMIO base offset -
0xfcd80000(trace attached including mmio trace and dmesg)I would be happy for any idea on this and any comment on the correctness of my sequence in the code
Andrey
Quoted 151 lines · Takashi Iwai
Quoted 51 lines · Andrey Grodzovsky
Quoted 47 lines · Takashi Iwai
Quoted 44 lines · Andrey Grodzovsky
Quoted 30 lines · Takashi Iwai
Quoted 20 lines · Andrey Grodzovsky
Quoted 9 lines · Takashi Iwai
Quoted 7 lines · Andrey Grodzovsky
Just an update, i found the issue which was actually to wake up the HW before doing stop/restart (using
pm_runtime_get_sync), also handled protecting from concurrentsnd_pcm_ioctlsaccessing the registers while the BAR is unmapped. Can go through BAR move while aplay is running now.Quoted 6 lines
Quoted 2 lines
Once again, would be happy for any comments on the code -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C647bdeec424e470b890008d8ee212e56%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521174012618001%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=kJfEvDk3EhabJA10thL9NR7NZfZxwkSEhB2U3Rw0%2Fp0%3D&reserved=0Hrm, this kind of change is a bit scary; we have some mechanism to stop the HD-audio hardware operation (e.g. for loading the DSP for CA0132 codec), but it's pretty hackish and error-prone.
Quoted 7 lines
At least I didn't have issue with HW stopping, the problem is with unampping
hdac_bus->remap_addr- as long as it's not iorampped back no code besides the PCI BAR move should run at all as any register access from this address will cause fatal page fault. I took care of most of the IOCTls i think, the interrupts are disabled inazx_stop_chipbut I am probably still missing some stuff like some background work items or other IOCTls code path.Quoted 4 lines
Are the all running processes stopped before entering
rescan_preparecallback? Otherwise, e.g. a process accessing PCM stream via mmap can run without ioctl and this may trigger the PCM period elapsed eventually.Is any of them remaps the BAR into user process VMA ? The only two I see in the sound subsystem doing remapping are are
had_pcm_mmapandsnd_pcm_lib_default_mmap
and both of them remap dma buffers which are in system memory and not MMIO space and hence should not be impacted by the BAR move.Quoted 8 lines
Quoted 3 lines
When a stream is running, it can cause an interrupt that may issue an unsolicited event that is deals with CORB/RIRB later in a work asynchronously.
On
rescan_prepareI am callingsnd_hdac_bus_stop_chipwhich in turn seems to disable interrupts - is this enough to guarantee all those won't be happening past that code ? Should I also flush any work queue items scheduled from within those ISRs before proceeding ?Well, calling
snd_hdac_bus_stop_chip()during operation itself isn't safe at all. It's called safely in the power management because we know all things have been already stopped. But calling it out of sudden is a completely different matter.Quoted 61 lines
Quoted 57 lines
Quoted 9 lines
Or maybe I didn't get your concern correctly ? Why there would be a problem to access the stream otherwise during the BAR move ?
Similarly, a control interface may issue the verb that is
Quoted 2 lines
processed via CORB/RIRB, too. So what you need to cover is not only about PCM.
Can you point me to the code path for this - is this through another type of IOCTL or interrupt handlers ?
Yes, it's handled in the ALSA core control ioctls. Many of the control *_get()/*_put() callbacks in HD-audio are involved with the amp or other HD-audio verbs (typically calling snd_hda_codec_amp*(), etc). Those are the mixer elements and handled via regmap with HD-audio backend that deals with CORB/RIRB eventually.
Quoted 16 lines
Quoted 13 lines
Quoted 4 lines
Quoted 3 lines
Do we really need the BAR remap while operating the sound streaming? That is, can't we simply refuse the remap if it's in operation? If it can be refused, we may avoid a big locking or such.
Quoted 8 lines
Problem here is that this feature is for the sake of hot-plug of a device, this supposed to give enough MMIO space to place all the BARs of newly plugging in device. Refusing to move BARs because there is some app using the sound card on the background might then lead to failure of plugging in the new device and this doesn't sound as a reasonable behavior to me. Also note that the lock's impact is minimal as it's read side lock only in the IOCTLs an so as long as hot plug not taking place it has no impact.
Quoted 2 lines
But a hot-plugged device can't have any running files, no? So at which timing is the BAR movement _must_ happen?
Quoted 6 lines
No, the devices this code is written for are those already in the system before the new device is plugged in, the new device needs enough free MMIO space for his own BARs and so this features enables existing devices to allow the PCI core to move their BARs within the physical address space such that enough free space will be available inside the MMIO window allocated for the new device's upstream PCI bridge.
Hmm, OK, so it's other way round as I thought of.
Quoted 7 lines
Quoted 6 lines
And, even if we need some synchronization, the current lock implementation looks fragile to me. We likely overlook something when trying to cover each branch code path.
Basically it needs to wait until all running processes via PCM or control API are released.
Quoted 8 lines
This approach brings a couple of hard questions -
How we make them stop at once - they might run for long time, you suggest something like invalidate all their mmaps and on next page fault return SIGBUS to terminate them ? Then I need also to know they actually are done - should I wait for their device file instance release? What if they don't access any mmapped are for a long time ? Sending SIGKILL explicitly ? But do I have the task id's of all of them ?
Quoted 3 lines
You shouldn't kill them but wait for them aborting gracefully, IMO. Essentially a kind of hot-unplug. Most of Linux drivers won't kill processes at the hot-unplug, AFAIK.
Quoted 9 lines
But see, the difference is such that on hot-plug I may just let those process pointing at zombie device to hang around indefently because I am not waiting for any output from them. That indeed what I am doing for amdgou hot-unplug work. Here i need to blocking wait for them since I need to finish the procedure so the PCI core can finish shuffling the existing BARs around and by this freeing enough space for the new device to be accepted. I user can't plug in his thunderbolt GPU and observe that nothing is happening actually because we are stuck waiting for some process just sitting idle.
Then we can see it from a different angle; read below.
Quoted 5 lines
Quoted 2 lines
But if it has to be done so, we have a list of file descriptors that are attached to the PCM and the control devices, too...
So you suggest iterate all of them, sigkill them and confirm all of them exit instead of using the
rw_sem?Note that, for the sound applications, we don't kill at disconnection. But the ALSA core stuff shuts the all operations up but for closing (also some event notification for the disconnection was done), hence we just wait for applications releasing resources. In anyway...
Quoted 8 lines
Quoted 4 lines
This will cover IOCTLs and any
mmapped accesses i guess. Interrupts we discussed above. What above any possible background kernel work going on in dedicated threads or work items ? Any pointers there what should be blocked and waited for ?An alternative idea would be the analogy of the system suspend / resume. That is, we forcibly suspend the devices at first somehow, and also restricts the further accesses by some way. Then do remap,
But that the point I guess, how you block further accesses without those big locks, during S3 i believe user mode gets suspended before the driver and so you don't need to worry about concurrent IOCTLs when going through suspend sequence
Andrey
Quoted 124 lines
and resume. Not sure whether this will fly high, but if it works, it should be more systematic and more robust than papering over each piece manually, I suppose.
Takashi
Quoted 117 lines
Andrey
Quoted 113 lines
Quoted 6 lines
We had those scenarios discussed during my initial work on GPU hot unplug and came to a conclusssion that trying to wait for current processes to die is not a good approach - see the this respone I got at the time for example -
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Farchives%2Fdri-devel%2F2020-May%2F265467.html&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C647bdeec424e470b890008d8ee212e56%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521174012627999%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=6IlaLx6EB9RuDyGajJxCeGUe2AprvyUGjfRWWtlGpDY%3D&reserved=0But should this be seen rather as an analogy of hot-replug? That won't kill processes.
Takashi
Quoted 100 lines
Andrey
We have a mechanism to block the new opens
Quoted 95 lines
like
snd_hda_lock_devices(). We'll need an additional stuff to wait until all opened devices are released there, and this requires some help in the core code, I suppose.
(Actually this hackish lock_devices/unlock_devices should have been in
the core stuff from the beginning...)thanks,
Takashi
Quoted 84 lines
Andrey
Quoted 80 lines
thanks,
Takashi
Quoted 74 lines
Andrey
Quoted 68 lines · Andrey Grodzovsky
Hi, I am working on adding AMD related drivers support for PCIe BARs move feature developed by Sergei
(https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flinuxplumbersconf.org%2Fevent%2F7%2Fcontributions%2F847%2Fattachments%2F584%2F1035%2Flpc2020_sergmir.pdf&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C647bdeec424e470b890008d8ee212e56%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521174012627999%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=YwRNUglLIO2X7kYQTmRU%2BWvC6fCe0GLAR4%2BkntpmPFQ%3D&reserved=0).His feature is still not upstream, all his code and mine on top can be seen here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Flog%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C647bdeec424e470b890008d8ee212e56%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521174012627999%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Vz9SqXNT%2BQ9emNKim76HpS%2B1X2SNLzANqidWB4rkh8Q%3D&reserved=0I did basic implementation fro amdgpu driver and now I am doing the same for
snd_hda_intelto support our on GPU Azalia audio chips. This relevant commit is here -
https://nam11.safelinks.protection.outlook.com/?url=https:%2F%2Fcgit.freedesktop.org%2F~agrodzov%2Flinux%2Fcommit%2F%3Fh%3Dyadro%2Fpcie_hotplug%2Fmovable_bars_v9.1%26id%3D7ec0f60633e898cb941cebb3cd18aae1374fc365&data=04%7C01%7Candrey.grodzovsky%40amd.com%7C647bdeec424e470b890008d8ee212e56%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637521174012627999%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=j%2B9Xz7D%2BsMinhUY%2FlnKWv6NfjhnlxDPF7GehovVzwyc%3D&reserved=0Any driver that wants to support movable BARs needs to implement
rescan_prepare,rescan_doneandbar_fixedcallbacks whererescan_prepareneeds to stop HW/SW and unamp all MMIO mappings andrescan_doneneeds to ioremap the BAR from it's new MMIO location and restart HW/SW.I am able currently to trigger BARs move by sysfs using "
/sys/bus/pci/rescan" and the driver will go through the sequence I described above without hangs. Problem is that after this when i try to use mplayer I am getting following errors:andrey@andrey-test:~$ sudo mplayer -ao alsa:device=hw=0.3 Downloads/file_example_MP3_5MG.mp3 MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control.Playing Downloads/file_example_MP3_5MG.mp3.
libavformat version 58.29.100 (external)
Audio only file format detected.
Load subtitles in Downloads/
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 0.1 (00.0) of 132.0 (02:12.0) ??,?%
Audio device got stuck!and in dmesg I see
[ 365.355518]snd_hda_codec_hdmihdaudioC0D0: Unable to sync register0x2f0d00. -5Also I see 296.619014]
snd_hda_intel0000:0a:00.1: CORB reset timeout#2, CORBRP = 65535 error during therescan_donecallback executionI know it has to do with the move of BAR's MMIO address because when i disallow BAR migration by returning true from
bar_fixedcallback I have no such errors and mplayer works fine.I enabled MMIO trace and didn't see that post BAR move there is a wrong MMIO access - all of them are from the new MMIO base offset -
0xfcd80000(trace attached including mmio trace and dmesg)I would be happy for any idea on this and any comment on the correctness of my sequence in the code
Andrey
Quoted 6 lines · Andrey Grodzovsky
Quoted 6 lines
Quoted 5 lines
This will cover IOCTLs and any
mmapped accesses i guess. Interrupts we discussed above. What above any possible background kernel work going on in dedicated threads or work items ? Any pointers there what should be blocked and waited for ?
Quoted 8 lines
Quoted 3 lines
An alternative idea would be the analogy of the system suspend / resume. That is, we forcibly suspend the devices at first somehow, and also restricts the further accesses by some way. Then do remap,
But that the point I guess, how you block further accesses without those big locks, during S3 i believe user mode gets suspended before the driver and so you don't need to worry about concurrent IOCTLs when going through suspend sequence
ALSA core still has some legacy card-level power management code, which was introduced many years ago at the time we still managed the power state via an extra ioctl (hence working individually from the base PM code), and a few pieces are still effective for this kind of purposes. Through a quick glance, a couple of places need band-aids, but the rest should work.
A bit more difficult problem is the floating control API calls. The get/put calls might be still in flight when we perform the PCI rescan. This has to be filtered out additionally.
Below are a patch series I cooked quickly. Totally untested, just checked the compilation. The first patch is a fix I'll merge in anyway, while the rest are RFC.
thanks,
Takashi
From 52e2fad720c04345499e165be92063897cf64914 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 08:53:56 +0100
Subject: [PATCH 1/7] ALSA: hda: Re-add dropped snd_poewr_change_state() calls
The card power state change via snd_power_change_state() at the system suspend/resume seems dropped mistakenly during the PM code rewrite. The card power state doesn't play much role nowadays but it's still referred in a few places such as the HDMI codec driver.
This patch restores them, but in a more appropriate place now in the prepare and complete callbacks.
--- sound/pci/hda/hda_intel.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/hda_intel.c +2 -0
@@ -1025,6 +1025,7 @@ static int azx_prepare(struct device *dev) chip = card->private_data; chip->pm_prepared =1 ; +snd_power_change_state (card, SNDRV_CTL_POWER_D3hot);flush_work (&azx_bus (chip)->unsol_work);
@@ -1040,6 +1041,7 @@ static void azx_complete(struct device *dev)struct azx *chip; chip = card->private_data; +snd_power_change_state (card,SNDRV_CTL_POWER_D0 ); chip->pm_prepared =0 ; }
Signature · 1 line
2.26.2
From 57afd6d49b994e10e24f421abe517bde590ee120 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:02:33 +0100
Subject: [PATCH 2/7] ALSA: control: Add power state check commonly for ioctl
handlers
The card power state check can be better put in the common ioctl handler, as basically we want to prevent ioctls during the power off state. Although this situation won't happen normally, it'll be helpful for catching in the future faked suspend that is needed for PCI rescan.
--- sound/core/control.c | 3 +++ 1 file changed, 3 insertions(+)
sound/core/control.c +3 -0
@@ -1709,6 +1709,9 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg card = ctl->card;if (snd_BUG_ON (!card))return -ENXIO ; + err =snd_power_wait (card,SNDRV_CTL_POWER_D0 ); +if (err <0 ) +return err;switch (cmd) {case SNDRV_CTL_IOCTL_PVERSION :return put_user (SNDRV_CTL_VERSION , ip) ? -EFAULT :0 ;
Signature · 1 line
2.26.2
From 5e3fa9ca4e28acd21e492a36127b99f99a9cbb5d Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:03:39 +0100
Subject: [PATCH 3/7] ALSA: control: Drop superfluous snd_power_wait() calls
Now the card power state is checked in the common ioctl handler, drop the same redundant checks in each ioctl.
--- sound/core/control.c | 11 ----------- 1 file changed, 11 deletions(-)
sound/core/control.c +0 -11
@@ -1015,9 +1015,6 @@ static int snd_ctl_elem_info_user(struct snd_ctl_file *ctl,if (copy_from_user (&info, _info,sizeof (info)))return -EFAULT ; - result =snd_power_wait (ctl->card,SNDRV_CTL_POWER_D0 ); -if (result <0 ) -return result; result =snd_ctl_elem_info (ctl, &info);if (result <0 )return result;
@@ -1085,10 +1082,6 @@ static int snd_ctl_elem_read_user(struct snd_card *card,if (IS_ERR (control))return PTR_ERR (control); - result =snd_power_wait (card,SNDRV_CTL_POWER_D0 ); -if (result <0 ) - goto error; -down_read (&card->controls_rwsem); result =snd_ctl_elem_read (card, control);up_read (&card->controls_rwsem);
@@ -1146,10 +1139,6 @@ static int snd_ctl_elem_write_user(struct snd_ctl_file *file,return PTR_ERR (control); card = file->card; - result =snd_power_wait (card,SNDRV_CTL_POWER_D0 ); -if (result <0 ) - goto error; -down_write (&card->controls_rwsem); result =snd_ctl_elem_write (card, file, control);up_write (&card->controls_rwsem);
Signature · 1 line
2.26.2
From ec3c3ca67004483a7dbc02dc1807aae9a179306f Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:04:05 +0100
Subject: [PATCH 4/7] ALSA: control: Minor optimization for
SNDRV_CTL_IOCTL_POWER_STATE
The SNDRV_CTL_IOCTL_POWER_STATE is an obsoleted ioctl and now practically it returns always D0. Do some minor optimization.
--- sound/core/control.c | 4 ---- 1 file changed, 4 deletions(-)
sound/core/control.c +0 -4
@@ -1744,11 +1744,7 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long argcase SNDRV_CTL_IOCTL_POWER :return -ENOPROTOOPT ;case SNDRV_CTL_IOCTL_POWER_STATE : -#ifdef CONFIG_PM -return put_user (card->power_state, ip) ? -EFAULT :0 ; -#else return put_user (SNDRV_CTL_POWER_D0 , ip) ? -EFAULT :0 ; -#endif }down_read (&snd_ioctl_rwsem);list_for_each_entry (p, &snd_control_ioctls, list) {
Signature · 1 line
2.26.2
From 9502e76fcd9bf4ea3307811d40f5ac2be8725044 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:05:25 +0100
Subject: [PATCH 5/7] ALSA: pcm: Block the release until the system resume
finishes
The normal PCM operations are already blocked during the card power off state in the PCM common ioctl handler, but the release isn't covered. As the PCM stream release may also access the hardware, let's block the release until the card power turns on.
--- sound/core/pcm_native.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/core/pcm_native.c +4 -0
@@ -2799,6 +2799,10 @@ static int snd_pcm_release(struct inode *inode, struct file *file)if (snd_BUG_ON (!substream))return -ENXIO ; pcm = substream->pcm; + +/* block until the device gets woken up as it may touch the hardware */ +snd_power_wait (pcm->card,SNDRV_CTL_POWER_D0 ); +mutex_lock (&pcm->open_mutex);snd_pcm_release_substream (substream);kfree (pcm_file);
Signature · 1 line
2.26.2
From f49966c9be8d1f7d58b14b2394264b412127e31e Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:13:29 +0100
Subject: [PATCH 6/7] ALSA: hda: Add frozen flag for prohibiting hardware
access
The PCI rescan feature we're going to implement requires the prohibit of the hardware access during rescan and remap. This patch introduce a flag, frozen, to hdac_bus for preventing the CORB/RIRB accesses, as well as the helper function to flip it up/down.
--- include/sound/hdaudio.h | 2 ++ sound/hda/hdac_bus.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-)
include/sound/hdaudio.h +2 -0
@@ -333,6 +333,7 @@ struct hdac_bus {/* operation state */ bool chip_init:1; /* h/w initialized */ + bool frozen:1; /* h/w access prohibited *//* behavior flags */ bool aligned_mmio:1; /* aligned MMIO access */
@@ -377,6 +378,7 @@ struct hdac_bus {int snd_hdac_bus_init (struct hdac_bus *bus,struct device *dev,const struct hdac_bus_ops *ops);void snd_hdac_bus_exit (struct hdac_bus *bus); +void snd_hdac_bus_freeze (struct hdac_bus *bus,bool freeze);int snd_hdac_bus_exec_verb_unlocked (struct hdac_bus *bus,unsigned int addr,unsigned int cmd,unsigned int *res);
sound/hda/hdac_bus.c +12 -1
@@ -75,6 +75,14 @@ void snd_hdac_bus_exit(struct hdac_bus *bus) }EXPORT_SYMBOL_GPL (snd_hdac_bus_exit); +void snd_hdac_bus_freeze (struct hdac_bus *bus,bool frozen) +{ +mutex_lock (&bus->cmd_mutex); + bus->frozen = frozen; +mutex_unlock (&bus->cmd_mutex); +} +EXPORT_SYMBOL_GPL (snd_hdac_bus_freeze); +/** * snd_hdac_bus_exec_verb - execute a HD-audio verb on the given bus * @bus: bus object
@@ -90,7 +98,10 @@ int snd_hdac_bus_exec_verb(struct hdac_bus *bus, unsigned int addr,int err;mutex_lock (&bus->cmd_mutex); - err =snd_hdac_bus_exec_verb_unlocked (bus, addr, cmd, res); +if (bus->frozen) + err = -EBADFD ; +else + err =snd_hdac_bus_exec_verb_unlocked (bus, addr, cmd, res);mutex_unlock (&bus->cmd_mutex);return err; }
Signature · 1 line
2.26.2
From 6f35db2b5744de28dbf9b75eb2e62cc9015b17fd Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Tue, 16 Mar 2021 23:01:02 -0400
Subject: [PATCH 7/7] ALSA: hda: Add support for BARs move on PCI rescan
--- sound/pci/hda/hda_controller.c | 9 +++ sound/pci/hda/hda_controller.h | 1 + sound/pci/hda/hda_intel.c | 111 ++++++++++++++++++++++++++++++--- 3 files changed, 112 insertions(+), 9 deletions(-)
sound/pci/hda/hda_controller.c +9 -0
@@ -1057,6 +1057,15 @@ void azx_stop_chip(struct azx *chip) }EXPORT_SYMBOL_GPL (azx_stop_chip); +void azx_suspend_streams (struct azx *chip) +{ +struct azx_pcm *apcm; + +list_for_each_entry (apcm, &chip->pcm_list, list) +snd_pcm_suspend_all (apcm->pcm); +} +EXPORT_SYMBOL_GPL (azx_suspend_streams); +/* * interrupt handler */
sound/pci/hda/hda_controller.h +1 -0
@@ -212,5 +212,6 @@ int azx_probe_codecs(struct azx *chip, unsigned int max_slots);int azx_codec_configure (struct azx *chip);int azx_init_streams (struct azx *chip);void azx_free_streams (struct azx *chip); +void azx_suspend_streams (struct azx *chip);#endif /* __SOUND_HDA_CONTROLLER_H */
sound/pci/hda/hda_intel.c +102 -9
137 lines not on this page · raw message
Signature · 1 line
2.26.2
Appreciate you investing the effort in helping on this.
I will start to merge it now as it doesn't apply cleanly on my branch.
If I understand correctly your main HW access prevention mechanism during
the PCI prepare-rescan period is by bailing out on IOCTLs with the check
of power state == SNDRV_CTL_POWER_D0 or waiting when a user process closes
it's device file descriptor in patches 2 and 5. For command submission
prevention you use the freeze flag from patch 6.
If I haven't missed anything I don't see how those all protect when
new device is plugged while any of those operations are already in flight. What prevents concurrent HW access from an IOCTL already running and HW suspend and MMIO unampping in rescan_preapre which starts after IOCTL began ?
Andrey
Quoted 37 lines · Takashi Iwai
Quoted 6 lines · Andrey Grodzovsky
Quoted 6 lines
Quoted 5 lines
This will cover IOCTLs and any
mmapped accesses i guess. Interrupts we discussed above. What above any possible background kernel work going on in dedicated threads or work items ? Any pointers there what should be blocked and waited for ?Quoted 8 lines
Quoted 3 lines
An alternative idea would be the analogy of the system suspend / resume. That is, we forcibly suspend the devices at first somehow, and also restricts the further accesses by some way. Then do remap,
But that the point I guess, how you block further accesses without those big locks, during S3 i believe user mode gets suspended before the driver and so you don't need to worry about concurrent IOCTLs when going through suspend sequence
ALSA core still has some legacy card-level power management code, which was introduced many years ago at the time we still managed the power state via an extra ioctl (hence working individually from the base PM code), and a few pieces are still effective for this kind of purposes. Through a quick glance, a couple of places need band-aids, but the rest should work.
A bit more difficult problem is the floating control API calls. The get/put calls might be still in flight when we perform the PCI rescan. This has to be filtered out additionally.
Below are a patch series I cooked quickly. Totally untested, just checked the compilation. The first patch is a fix I'll merge in anyway, while the rest are RFC.
thanks,
Takashi
Quoted 4 lines · Andrey Grodzovsky
Appreciate you investing the effort in helping on this.
I will start to merge it now as it doesn't apply cleanly on my branch.
Quoted 11 lines
If I understand correctly your main HW access prevention mechanism during the PCI prepare-rescan period is by bailing out on IOCTLs with the check of power state ==
SNDRV_CTL_POWER_D0or waiting when a user process closes it's device file descriptor in patches 2 and 5. For command submission prevention you use the freeze flag from patch 6.
If I haven't missed anything I don't see how those all protect when new device is plugged while any of those operations are already in flight. What prevents concurrent HW access from an IOCTL already running
and HW suspend and MMIO unampping inrescan_preaprewhich starts after IOCTL began ?
The call of snd_pcm_suspend_all() is the key. That puts all PCM streams in the stopped and suspended state. And the codec devices as well as the controller device will be put into the suspended state. So, for the PCM side, this should be fine with it, I guess.
However, after sending the patches, I noticed that they won't suffice for the pending control calls. For the control get/put callbacks that have been pending before setting the power_state=D3hot, they would still kick off the runtime PM and bad things may happen. Due to that, the bus.frozen flag won't work reliably, I'm afraid.
So, in that part, we need the code to sync the execution of the pending get/put calls in addition. Maybe refcounting the control ioctls that are involved with get/put calls (SNDRV_CTL_IOCTL_ELEM_READ, _WRITE, maybe with _TLV_READ, too) and wait for those ioctls finishing before actually starting the codec suspend procedure.
Takashi
I merged the patches, since it looks like my branch is older I didn't have chip->init_failed member and also seems there was a typo on ur side as there is no flush_work_sync, only flush_work which waits synchronously anyway.
Everything works fine when testing with maplyer running concurrently to PCI rescan cycle.
Can you be more specific what are those get/put calls, I am thinking about some waitqueue to wait on in rescan_prepare after setting snd_hdac_bus_freeze,
on wakeup it checks that a counter dropped back to zero. Not sure on which entity to hang this counter ?
Andrey
Quoted 39 lines · Takashi Iwai
Quoted 4 lines · Andrey Grodzovsky
Appreciate you investing the effort in helping on this.
I will start to merge it now as it doesn't apply cleanly on my branch.Quoted 11 lines
If I understand correctly your main HW access prevention mechanism during the PCI prepare-rescan period is by bailing out on IOCTLs with the check of power state ==
SNDRV_CTL_POWER_D0or waiting when a user process closes it's device file descriptor in patches 2 and 5. For command submission prevention you use the freeze flag from patch 6.
If I haven't missed anything I don't see how those all protect when new device is plugged while any of those operations are already in flight. What prevents concurrent HW access from an IOCTL already running
and HW suspend and MMIO unampping inrescan_preaprewhich starts after IOCTL began ?The call of
snd_pcm_suspend_all()is the key. That puts all PCM streams in the stopped and suspended state. And the codec devices as well as the controller device will be put into the suspended state. So, for the PCM side, this should be fine with it, I guess.However, after sending the patches, I noticed that they won't suffice for the pending control calls. For the control get/put callbacks that have been pending before setting the power_state=D3hot, they would still kick off the runtime PM and bad things may happen. Due to that, the bus.frozen flag won't work reliably, I'm afraid.
So, in that part, we need the code to sync the execution of the pending get/put calls in addition. Maybe refcounting the control ioctls that are involved with get/put calls (
SNDRV_CTL_IOCTL_ELEM_READ,_WRITE, maybe with_TLV_READ, too) and wait for those ioctls finishing before actually starting the codec suspend procedure.Takashi
Quoted 6 lines · Andrey Grodzovsky
I merged the patches, since it looks like my branch is older I didn't have
chip->init_failedmember and also seems there was a typo on ur side as there is noflush_work_sync, onlyflush_workwhich waits synchronously anyway.
Ah that must be some typos I forgot to refresh.
Quoted 8 lines
Everything works fine when testing with maplyer running concurrently to PCI rescan cycle.
Can you be more specific what are those get/put calls, I am thinking about some waitqueue to wait on in
rescan_prepareafter settingsnd_hdac_bus_freeze,
on wakeup it checks that a counter dropped back to zero. Not sure on which entity to hang this counter ?
It's something like the patch 6 in the v2 series below. At this time, I dropped snd_hdac_bus_freeze() as this is basically useless.
Maybe this is no optimal implementation and we might improve a bit, but I guess you get an idea from that.
Also I added ifdef CONFIG_PM in the last patch as it obviously depends on it. It could be put in Kconfig somehow, too, but a simple ifdef should suffice.
Takashi
From 52e2fad720c04345499e165be92063897cf64914 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 08:53:56 +0100
Subject: [PATCH v2 1/8] ALSA: hda: Re-add dropped snd_poewr_change_state()
calls
The card power state change via snd_power_change_state() at the system suspend/resume seems dropped mistakenly during the PM code rewrite. The card power state doesn't play much role nowadays but it's still referred in a few places such as the HDMI codec driver.
This patch restores them, but in a more appropriate place now in the prepare and complete callbacks.
--- sound/pci/hda/hda_intel.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/hda_intel.c +2 -0
@@ -1025,6 +1025,7 @@ static int azx_prepare(struct device *dev) chip = card->private_data; chip->pm_prepared =1 ; +snd_power_change_state (card, SNDRV_CTL_POWER_D3hot);flush_work (&azx_bus (chip)->unsol_work);
@@ -1040,6 +1041,7 @@ static void azx_complete(struct device *dev)struct azx *chip; chip = card->private_data; +snd_power_change_state (card,SNDRV_CTL_POWER_D0 ); chip->pm_prepared =0 ; }
Signature · 1 line
2.26.2
From 5b359bb19610fdbc15fe87ef33e5654f87d34616 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 18:01:39 +0100
Subject: [PATCH v2 2/8] ALSA: core: Use READ_ONCE() / WRITE_ONCE() for power
state change
We need proper barriers to handle the power state change of the card.
--- include/sound/core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/sound/core.h +2 -2
@@ -142,12 +142,12 @@ struct snd_card {#ifdef CONFIG_PM static inline unsigned int snd_power_get_state (struct snd_card *card) { -return card->power_state; +return READ_ONCE (card->power_state); }static inline void snd_power_change_state (struct snd_card *card,unsigned int state) { - card->power_state = state; +WRITE_ONCE (card->power_state, state);wake_up (&card->power_sleep); }
Signature · 1 line
2.26.2
From 72698f7fd65f5e415bbfcd866da26f8c813d06b0 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:02:33 +0100
Subject: [PATCH v2 3/8] ALSA: control: Add power state check commonly for
ioctl handlers
The card power state check can be better put in the common ioctl handler, as basically we want to prevent ioctls during the power off state. Although this situation won't happen normally, it'll be helpful for catching in the future faked suspend that is needed for PCI rescan.
--- sound/core/control.c | 3 +++ 1 file changed, 3 insertions(+)
sound/core/control.c +3 -0
@@ -1709,6 +1709,9 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg card = ctl->card;if (snd_BUG_ON (!card))return -ENXIO ; + err =snd_power_wait (card,SNDRV_CTL_POWER_D0 ); +if (err <0 ) +return err;switch (cmd) {case SNDRV_CTL_IOCTL_PVERSION :return put_user (SNDRV_CTL_VERSION , ip) ? -EFAULT :0 ;
Signature · 1 line
2.26.2
From f4174e148f00a979e94a91dc397aa5a5e87ebe48 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:03:39 +0100
Subject: [PATCH v2 4/8] ALSA: control: Drop superfluous snd_power_wait() calls
Now the card power state is checked in the common ioctl handler, drop the same redundant checks in each ioctl.
--- sound/core/control.c | 11 ----------- 1 file changed, 11 deletions(-)
sound/core/control.c +0 -11
@@ -1015,9 +1015,6 @@ static int snd_ctl_elem_info_user(struct snd_ctl_file *ctl,if (copy_from_user (&info, _info,sizeof (info)))return -EFAULT ; - result =snd_power_wait (ctl->card,SNDRV_CTL_POWER_D0 ); -if (result <0 ) -return result; result =snd_ctl_elem_info (ctl, &info);if (result <0 )return result;
@@ -1085,10 +1082,6 @@ static int snd_ctl_elem_read_user(struct snd_card *card,if (IS_ERR (control))return PTR_ERR (control); - result =snd_power_wait (card,SNDRV_CTL_POWER_D0 ); -if (result <0 ) - goto error; -down_read (&card->controls_rwsem); result =snd_ctl_elem_read (card, control);up_read (&card->controls_rwsem);
@@ -1146,10 +1139,6 @@ static int snd_ctl_elem_write_user(struct snd_ctl_file *file,return PTR_ERR (control); card = file->card; - result =snd_power_wait (card,SNDRV_CTL_POWER_D0 ); -if (result <0 ) - goto error; -down_write (&card->controls_rwsem); result =snd_ctl_elem_write (card, file, control);up_write (&card->controls_rwsem);
Signature · 1 line
2.26.2
From cef4c5872c0b0d78de159cc5838f8b544bd32547 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:04:05 +0100
Subject: [PATCH v2 5/8] ALSA: control: Minor optimization for
SNDRV_CTL_IOCTL_POWER_STATE
The SNDRV_CTL_IOCTL_POWER_STATE is an obsoleted ioctl and now practically it returns always D0. Do some minor optimization.
--- sound/core/control.c | 4 ---- 1 file changed, 4 deletions(-)
sound/core/control.c +0 -4
@@ -1744,11 +1744,7 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long argcase SNDRV_CTL_IOCTL_POWER :return -ENOPROTOOPT ;case SNDRV_CTL_IOCTL_POWER_STATE : -#ifdef CONFIG_PM -return put_user (card->power_state, ip) ? -EFAULT :0 ; -#else return put_user (SNDRV_CTL_POWER_D0 , ip) ? -EFAULT :0 ; -#endif }down_read (&snd_ioctl_rwsem);list_for_each_entry (p, &snd_control_ioctls, list) {
Signature · 1 line
2.26.2
From a34ac4da0cb94f9de9410777477388b17250d0ea Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:02:33 +0100
Subject: [PATCH v2 6/8] ALSA: control: Track the floating control
read/write/tlv accesses
Although we introduced the power state check at the entrance of the common handler, there can be still some pending tasks that went into the ioctl handler, and those may access the hardware; this must be avoided, and we have to sync such in-flight kctls finishing.
For that purpose, this patch introduces
a few new things:
- A refcount, power_ref, and a wait head, power_ref_sleep, to the card object
- A new helper, snd_power_wait_and_ref(), and snd_power_unref()
In a few code paths that call kctl read/write/tlv ops, we check the power state again but at this time with snd_power_want_and_ref() -- which also takes the card.power_ref refcount. The refcount is then released after the kctl ops finishes. So the driver can sync via wait_event() with power_ref=0 for assuring all in-flight tasks are finished.
Also, this patch changes snd_power_wait() to accept only SNDRV_CTL_POWER_D0, which is the only value that makes sense. In later patch, the snd_power_wait() calls will be simplified.
--- include/sound/core.h | 17 +++++++++++++++++ sound/core/control.c | 29 ++++++++++++++++++++++------ sound/core/init.c | 45 ++++++++++++++++++++++++++++++++++++-------- 3 files changed, 77 insertions(+), 14 deletions(-)
include/sound/core.h +17 -0
@@ -129,6 +129,8 @@ struct snd_card {#ifdef CONFIG_PM unsigned int power_state;/* power state */ wait_queue_head_t power_sleep; +refcount_t power_ref; +wait_queue_head_t power_ref_sleep;#endif #if IS_ENABLED (CONFIG_SND_MIXER_OSS )
@@ -151,14 +153,29 @@ static inline void snd_power_change_state(struct snd_card *card, unsigned int stwake_up (&card->power_sleep); } +static inline void snd_power_ref (struct snd_card *card) +{ +refcount_inc (&card->power_ref); +} + +static inline void snd_power_unref (struct snd_card *card) +{ +if (refcount_dec_and_test (&card->power_ref)) +wake_up (&card->power_ref_sleep); +} +/* init.c */ int snd_power_wait (struct snd_card *card,unsigned int power_state); +int snd_power_wait_and_ref (struct snd_card *card,bool ref);#else /* ! CONFIG_PM */ static inline int snd_power_wait (struct snd_card *card,unsigned int state) {return 0 ; }#define snd_power_get_state (card) ({ (void)(card); SNDRV_CTL_POWER_D0; })#define snd_power_change_state (card, state) do { (void)(card); } while (0) +#define snd_power_wait_and_ref (card, ref) do { (void)(card); } while (0) +#define snd_power_ref (card) do { (void)(card); } while (0) +#define snd_power_unref (card) do { (void)(card); } while (0)#endif /* CONFIG_PM */
sound/core/control.c +23 -6
@@ -1057,9 +1057,12 @@ static int snd_ctl_elem_read(struct snd_card *card,if (!snd_ctl_skip_validation (&info))fill_remaining_elem_value (control, &info, pattern); + ret =snd_power_wait_and_ref (card, true); +if (ret <0 ) + goto out; ret = kctl->get (kctl, control);if (ret <0 ) -return ret; + goto out;if (!snd_ctl_skip_validation (&info) &&sanity_check_elem_value (card, control, &info, pattern) <0 ) { dev_err(card->dev,
@@ -1067,8 +1070,12 @@ static int snd_ctl_elem_read(struct snd_card *card, control->id.iface, control->id.device, control->id.subdevice, control->id.name, control->id.index); -return -EINVAL ; + ret = -EINVAL ; + goto out; } + + out: +snd_power_unref (card);return ret; }
@@ -1115,16 +1122,22 @@ static int snd_ctl_elem_write(struct snd_card *card, struct snd_ctl_file *file, }snd_ctl_build_ioff (&control->id, kctl, index_offset); + + result =snd_power_wait_and_ref (card, true); +if (result <0 ) + goto out; result = kctl->put (kctl, control);if (result <0 ) -return result; + goto out;if (result >0 ) {struct snd_ctl_elem_id id = control->id;snd_ctl_notify (card,SNDRV_CTL_EVENT_MASK_VALUE , &id); } -return 0 ; + out: +snd_power_unref (card); +return result <0 ? result :0 ; } static int snd_ctl_elem_write_user(struct snd_ctl_file *file,
@@ -1595,7 +1608,7 @@ static int call_tlv_handler(struct snd_ctl_file *file, int op_flag, {SNDRV_CTL_TLV_OP_CMD, SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND}, };struct snd_kcontrol_volatile *vd = &kctl->vd[snd_ctl_get_ioff (kctl, id)]; -int i; +int i, ret;/* Check support of the request for this element. */ for (i =0 ; i <ARRAY_SIZE (pairs); ++i) {
@@ -1613,7 +1626,11 @@ static int call_tlv_handler(struct snd_ctl_file *file, int op_flag, vd->owner != NULL && vd->owner != file)return -EPERM ; -return kctl->tlv.c (kctl, op_flag, size, buf); + ret =snd_power_wait_and_ref (file->card, true); +if (!ret) + ret = kctl->tlv.c (kctl, op_flag, size, buf); +snd_power_unref (file->card); +return ret; } static int read_tlv_buf(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id,
sound/core/init.c +37 -8
77 lines not on this page · raw message
Signature · 1 line
2.26.2
From c580b8b9ff0ddc4f8445d4306d53f6bd3f1b7666 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:05:25 +0100
Subject: [PATCH v2 7/8] ALSA: pcm: Block the release until the system resume
finishes
The normal PCM operations are already blocked during the card power off state in the PCM common ioctl handler, but the release isn't covered. As the PCM stream release may also access the hardware, let's block the release until the card power turns on.
--- sound/core/pcm_native.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/core/pcm_native.c +4 -0
@@ -2799,6 +2799,10 @@ static int snd_pcm_release(struct inode *inode, struct file *file)if (snd_BUG_ON (!substream))return -ENXIO ; pcm = substream->pcm; + +/* block until the device gets woken up as it may touch the hardware */ +snd_power_wait (pcm->card,SNDRV_CTL_POWER_D0 ); +mutex_lock (&pcm->open_mutex);snd_pcm_release_substream (substream);kfree (pcm_file);
Signature · 1 line
2.26.2
From 9b96b5c5dc578dc5cf170a62da6b5c67954e4a45 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Tue, 16 Mar 2021 23:01:02 -0400
Subject: [PATCH v2 8/8] ALSA: hda: Add support for BARs move on PCI rescan
--- sound/pci/hda/hda_controller.c | 9 +++ sound/pci/hda/hda_controller.h | 1 + sound/pci/hda/hda_intel.c | 115 ++++++++++++++++++++++++++++++--- 3 files changed, 116 insertions(+), 9 deletions(-)
sound/pci/hda/hda_controller.c +9 -0
@@ -1057,6 +1057,15 @@ void azx_stop_chip(struct azx *chip) }EXPORT_SYMBOL_GPL (azx_stop_chip); +void azx_suspend_streams (struct azx *chip) +{ +struct azx_pcm *apcm; + +list_for_each_entry (apcm, &chip->pcm_list, list) +snd_pcm_suspend_all (apcm->pcm); +} +EXPORT_SYMBOL_GPL (azx_suspend_streams); +/* * interrupt handler */
sound/pci/hda/hda_controller.h +1 -0
@@ -212,5 +212,6 @@ int azx_probe_codecs(struct azx *chip, unsigned int max_slots);int azx_codec_configure (struct azx *chip);int azx_init_streams (struct azx *chip);void azx_free_streams (struct azx *chip); +void azx_suspend_streams (struct azx *chip);#endif /* __SOUND_HDA_CONTROLLER_H */
sound/pci/hda/hda_intel.c +106 -9
141 lines not on this page · raw message
Signature · 1 line
2.26.2
Few comments -
1) Why we don't use snd_power_wait_and_ref in patch 3 in the common handler ? Don't we want the PCI rescan sequence to 'wait for' any in flight taks that might be accessing registers and not only read/write/tlv accesses ?
2) Possible deadlock -
In azx_rescan_prepare - you put the card into SNDRV_CTL_POWER_D3hot first and then 'wait for' all in flight tasks with the refcount. The in flight tasks on the other hand, using snd_power_wait_and_ref, may have already bumped up the refcount and now 'wait for' the card to go into SNDRV_CTL_POWER_D0 which can't happen since PCI rescan waits for the refocunt to drop to 0 before proceeding.
Instead of snd_power_wait_and_ref can't we just call snd_power_ref in common IOCTL before checking for power_state != SNDRV_CTL_POWER_D0 ? Or is it because you don't want to fail IOCTLs ?
Andrey
Quoted 34 lines · Takashi Iwai
Quoted 6 lines · Andrey Grodzovsky
I merged the patches, since it looks like my branch is older I didn't have
chip->init_failedmember and also seems there was a typo on ur side as there is noflush_work_sync, onlyflush_workwhich waits synchronously anyway.Ah that must be some typos I forgot to refresh.
Quoted 8 lines
Everything works fine when testing with maplyer running concurrently to PCI rescan cycle.
Can you be more specific what are those get/put calls, I am thinking about some waitqueue to wait on in
rescan_prepareafter settingsnd_hdac_bus_freeze,
on wakeup it checks that a counter dropped back to zero. Not sure on which entity to hang this counter ?It's something like the patch 6 in the v2 series below. At this time, I dropped
snd_hdac_bus_freeze()as this is basically useless.Maybe this is no optimal implementation and we might improve a bit, but I guess you get an idea from that.
Also I added ifdef
CONFIG_PMin the last patch as it obviously depends on it. It could be put inKconfigsomehow, too, but a simple ifdef should suffice.Takashi
Quoted 8 lines · Andrey Grodzovsky
Few comments -
1) Why we don't use
snd_power_wait_and_refin patch 3 in the common handler ?
Don't we want the PCI rescan sequence to 'wait for' any in flight taks that might be accessing registers and not only read/write/tlv accesses ?
Right, we don't need to block all ioctls, but only the ones that may access the hardware. So basically the patches 3-5 can be dropped if we take the patch 6. The current patch was written on top of the previous series, that's why it has both.
Quoted 11 lines
2) Possible deadlock -
Inazx_rescan_prepare- you put the card intoSNDRV_CTL_POWER_D3hotfirst and then 'wait for' all in flight tasks with the refcount. The in flight tasks on the other hand, usingsnd_power_wait_and_ref, may have already bumped up the refcount and now 'wait for' the card to go intoSNDRV_CTL_POWER_D0which can't happen since PCI rescan waits for the refocunt to drop to 0 before proceeding.Instead of
snd_power_wait_and_refcan't we just callsnd_power_refin common IOCTL before checking forpower_state!=SNDRV_CTL_POWER_D0? Or is it because you don't want to fail IOCTLs ?
No, this is the intended behavior and should work as-is because snd_power_wait_and_ref() drops the refcount in the loop before sleeping. The inc before the state check is a must for covering the possible race, and ditto for changing the power_state to D3hot before syncing.
Takashi
Quoted 28 lines · Takashi Iwai
Quoted 8 lines · Andrey Grodzovsky
Few comments -
1) Why we don't use
snd_power_wait_and_refin patch 3 in the common handler ?
Don't we want the PCI rescan sequence to 'wait for' any in flight taks that might be accessing registers and not only read/write/tlv accesses ?Right, we don't need to block all ioctls, but only the ones that may access the hardware. So basically the patches 3-5 can be dropped if we take the patch 6. The current patch was written on top of the previous series, that's why it has both.
Quoted 11 lines
2) Possible deadlock -
Inazx_rescan_prepare- you put the card intoSNDRV_CTL_POWER_D3hotfirst and then 'wait for' all in flight tasks with the refcount. The in flight tasks on the other hand, usingsnd_power_wait_and_ref, may have already bumped up the refcount and now 'wait for' the card to go intoSNDRV_CTL_POWER_D0which can't happen since PCI rescan waits for the refocunt to drop to 0 before proceeding.Instead of
snd_power_wait_and_refcan't we just callsnd_power_refin common IOCTL before checking forpower_state!=SNDRV_CTL_POWER_D0? Or is it because you don't want to fail IOCTLs ?
Quoted 5 lines
No, this is the intended behavior and should work as-is because
snd_power_wait_and_ref()drops the refcount in the loop before sleeping. The inc before the state check is a must for covering the possible race, and ditto for changing thepower_stateto D3hot before syncing.
Ohh, missed the refcount dec in the wait loop... My bad.
On boot the latest patch-set was throwing refcount warnings since u are not supposed to inc from zerro count and so I fixed with the attached patch. That way seems to work fine.
Andrey
Quoted 4 lines
Takashi
From 96c05549bb01697b97204dfd51f8f917ab11a178 Mon Sep 17 00:00:00 2001
From: Andrey Grodzovsky <[email protected]>
Date: Thu, 25 Mar 2021 12:07:38 -0400
Subject: FIX refcount splat
Righ on boot bellow WARN observed
Fix by setting refcount to 1 and also
drop the optimization in snd_power_unref since I can't rely on atomic refcount_sub_and_test anymore.
[ 41.710577 < 0.000078>] ------------[ cut here ]------------ [ 41.710580 < 0.000003>] refcount_t: addition on 0; use-after-free. [ 41.710603 < 0.000023>] WARNING: CPU: 10 PID: 2781 at lib/refcount.c:25 refcount_warn_saturate+0x86/0x110 [ 41.710614 < 0.000011>] Modules linked in: snd_hda_codec_hdmi(OE) snd_hda_intel(OE) snd_intel_dspcfg(OE) snd_hda_codec(OE) snd_hda_core(OE) snd_pcm(OE) snd_seq_midi(OE) snd_seq_midi_event(OE) snd_rawmidi(OE) snd_seq(OE) snd_seq_device(OE) snd_timer(OE) snd(OE) input_leds led_class joydev kvm k10temp drm(OE) drm_panel_orientation_quirks(OE) igb i2c_algo_bit pinctrl_amd [ 41.710679 < 0.000065>] CPU: 10 PID: 2781 Comm: alsactl Tainted: G OE 5.11.0-rc3-pci-bars+ #7 [ 41.710685 < 0.000006>] Hardware name: System manufacturer System Product Name/PRIME X470-PRO, BIOS 4406 02/28/2019 [ 41.710689 < 0.000004>] RIP: 0010:refcount_warn_saturate+0x86/0x110 [ 41.710696 < 0.000007>] Code: dc dd 27 02 01 e8 22 92 9f 00 0f 0b eb d9 80 3d cb dd 27 02 00 75 d0 48 c7 c7 40 f0 d9 83 c6 05 bb dd 27 02 01 e8 02 92 9f 00 <0f> 0b eb b9 80 3d ad dd 27 02 00 75 b0 48 c7 c7 a0 ef d9 83 c6 05 [ 41.710701 < 0.000005>] RSP: 0018:ffff888259bcfb98 EFLAGS: 00010286 [ 41.710707 < 0.000006>] RAX: 0000000000000000 RBX: 0000000000000002 RCX: 0000000000000000 [ 41.710711 < 0.000004>] RDX: 0000000000000027 RSI: 0000000000000004 RDI: ffffed104b379f65 [ 41.710715 < 0.000004>] RBP: ffff88816a60ef40 R08: ffffffff822b270e R09: ffffed10df33e014 [ 41.710719 < 0.000004>] R10: ffff8886f99f009b R11: ffffed10df33e013 R12: 0000000000000001 [ 41.710723 < 0.000004>] R13: 1ffff1104b379f79 R14: ffff88816a60ef40 R15: 0000000000000000 [ 41.710728 < 0.000005>] FS: 00007f0e1817e440(0000) GS:ffff8886f9800000(0000) knlGS:0000000000000000 [ 41.710732 < 0.000004>] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 41.710736 < 0.000004>] CR2: 00007f0e185f7000 CR3: 00000001532fa000 CR4: 00000000003506e0 [ 41.710740 < 0.000004>] Call Trace: [ 41.710744 < 0.000004>] snd_power_wait_and_ref+0x315/0x320 [snd] [ 41.710768 < 0.000024>] ? snd_card_new+0x5e0/0x5e0 [snd] [ 41.710790 < 0.000022>] ? lock_acquire+0xee/0x570 [ 41.710797 < 0.000007>] ? lock_acquire+0xee/0x570 [ 41.710804 < 0.000007>] ? lock_acquired+0xb4/0x5a0 [ 41.710810 < 0.000006>] ? snd_ctl_ioctl+0x240/0xb60 [snd] [ 41.710832 < 0.000022>] ? snd_ctl_find_id+0x161/0x180 [snd] [ 41.710855 < 0.000023>] snd_ctl_elem_write+0x1c4/0x350 [snd] [ 41.710878 < 0.000023>] ? copy_ctl_value_from_user+0x2f0/0x2f0 [snd] [ 41.710901 < 0.000023>] ? down_write+0x16c/0x2e0 [ 41.710907 < 0.000006>] ? snd_ctl_ioctl+0x240/0xb60 [snd] [ 41.710929 < 0.000022>] ? rwsem_down_read_slowpath+0x5f0/0x5f0 [ 41.710935 < 0.000006>] ? _copy_from_user+0xa0/0xf0 [ 41.710942 < 0.000007>] snd_ctl_ioctl+0x24e/0xb60 [snd] [ 41.710965 < 0.000023>] ? snd_ctl_elem_add_user+0x150/0x150 [snd] [ 41.710988 < 0.000023>] ? selinux_capable+0x20/0x20 [ 41.710995 < 0.000007>] ? kmem_cache_free+0x145/0x390 [ 41.711001 < 0.000006>] ? lockdep_hardirqs_on_prepare+0xe/0x210 [ 41.711007 < 0.000006>] ? blkcg_maybe_throttle_current+0x7f/0x7f0 [ 41.711014 < 0.000007>] ? call_rcu+0x20b/0x3a0 [ 41.711024 < 0.000010>] __x64_sys_ioctl+0xe0/0x120 [ 41.711029 < 0.000005>] ? syscall_trace_enter.isra.0+0xc9/0x270 [ 41.711036 < 0.000007>] do_syscall_64+0x33/0x80 [ 41.711042 < 0.000006>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 41.711048 < 0.000006>] RIP: 0033:0x7f0e183eb50b
--- include/sound/core.h | 4 ++-- sound/core/init.c | 3 ++- sound/pci/hda/hda_intel.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-)
include/sound/core.h +2 -2
@@ -157,8 +157,8 @@ static inline void snd_power_ref(struct snd_card *card)static inline void snd_power_unref (struct snd_card *card) { -if (refcount_dec_and_test (&card->power_ref)) -wake_up (&card->power_ref_sleep); +refcount_dec (&card->power_ref); +wake_up (&card->power_ref_sleep); }/* init.c */
sound/core/init.c +2 -1
@@ -215,8 +215,8 @@ int snd_card_new(struct device *parent, int idx, const char *xid,mutex_init (&card->memory_mutex);#ifdef CONFIG_PM init_waitqueue_head (&card->power_sleep); -refcount_set (&card->power_ref,0 );init_waitqueue_head (&card->power_ref_sleep); +refcount_set (&card->power_ref,1 );#endif init_waitqueue_head (&card->remove_sleep); card->sync_irq =-1 ;
@@ -1007,6 +1007,7 @@ int snd_power_wait_and_ref(struct snd_card *card, bool ref)/* fastpath */ if (ref)snd_power_ref (card); +if (snd_power_get_state (card) ==SNDRV_CTL_POWER_D0 )return 0 ;init_waitqueue_entry (&wait, current);
sound/pci/hda/hda_intel.c +1 -1
@@ -2457,7 +2457,7 @@ static void azx_rescan_prepare(struct pci_dev *pdev)azx_prepare (&pdev->dev);azx_suspend_streams (chip);wait_event (card->power_ref_sleep, - !refcount_read (&card->power_ref)); +refcount_read (&card->power_ref) ==1 );list_for_each_codec (codec, &chip->bus) {pm_runtime_suspend (hda_codec_dev (codec));pm_runtime_disable (hda_codec_dev (codec));
Signature · 1 line
2.25.1
Quoted 38 lines · Andrey Grodzovsky
Quoted 28 lines · Takashi Iwai
Quoted 8 lines · Andrey Grodzovsky
Few comments -
1) Why we don't use
snd_power_wait_and_refin patch 3 in the common handler ?
Don't we want the PCI rescan sequence to 'wait for' any in flight taks that might be accessing registers and not only read/write/tlv accesses ?Right, we don't need to block all ioctls, but only the ones that may access the hardware. So basically the patches 3-5 can be dropped if we take the patch 6. The current patch was written on top of the previous series, that's why it has both.
Quoted 11 lines
2) Possible deadlock -
Inazx_rescan_prepare- you put the card intoSNDRV_CTL_POWER_D3hotfirst and then 'wait for' all in flight tasks with the refcount. The in flight tasks on the other hand, usingsnd_power_wait_and_ref, may have already bumped up the refcount and now 'wait for' the card to go intoSNDRV_CTL_POWER_D0which can't happen since PCI rescan waits for the refocunt to drop to 0 before proceeding.Instead of
snd_power_wait_and_refcan't we just callsnd_power_refin common IOCTL before checking forpower_state!=SNDRV_CTL_POWER_D0? Or is it because you don't want to fail IOCTLs ?Quoted 5 lines
No, this is the intended behavior and should work as-is because
snd_power_wait_and_ref()drops the refcount in the loop before sleeping. The inc before the state check is a must for covering the possible race, and ditto for changing thepower_stateto D3hot before syncing.
Quoted 5 lines
Ohh, missed the refcount dec in the wait loop... My bad.
On boot the latest patch-set was throwing refcount warnings since u are not supposed to inc from zerro count and so I fixed with the attached patch. That way seems to work fine.
Ah, I completely forgot about the oddness of refcount_t. Then I guess it's simpler to replace with atomic_*() instead.
thanks,
Takashi
Attached.
Andrey
Quoted 46 lines · Takashi Iwai
Quoted 38 lines · Andrey Grodzovsky
Quoted 28 lines · Takashi Iwai
Quoted 8 lines · Andrey Grodzovsky
Few comments -
1) Why we don't use
snd_power_wait_and_refin patch 3 in the common handler ?
Don't we want the PCI rescan sequence to 'wait for' any in flight taks that might be accessing registers and not only read/write/tlv accesses ?Right, we don't need to block all ioctls, but only the ones that may access the hardware. So basically the patches 3-5 can be dropped if we take the patch 6. The current patch was written on top of the previous series, that's why it has both.
Quoted 11 lines
2) Possible deadlock -
Inazx_rescan_prepare- you put the card intoSNDRV_CTL_POWER_D3hotfirst and then 'wait for' all in flight tasks with the refcount. The in flight tasks on the other hand, usingsnd_power_wait_and_ref, may have already bumped up the refcount and now 'wait for' the card to go intoSNDRV_CTL_POWER_D0which can't happen since PCI rescan waits for the refocunt to drop to 0 before proceeding.Instead of
snd_power_wait_and_refcan't we just callsnd_power_refin common IOCTL before checking forpower_state!=SNDRV_CTL_POWER_D0? Or is it because you don't want to fail IOCTLs ?Quoted 5 lines
No, this is the intended behavior and should work as-is because
snd_power_wait_and_ref()drops the refcount in the loop before sleeping. The inc before the state check is a must for covering the possible race, and ditto for changing thepower_stateto D3hot before syncing.Quoted 5 lines
Ohh, missed the refcount dec in the wait loop... My bad.
On boot the latest patch-set was throwing refcount warnings since u are not supposed to inc from zerro count and so I fixed with the attached patch. That way seems to work fine.
Quoted 8 lines
Ah, I completely forgot about the oddness of
refcount_t. Then I guess it's simpler to replace with atomic_*() instead.thanks,
Takashi
From 0347ad666d2f0a20d1074a64dc5a1f6d9cec44b2 Mon Sep 17 00:00:00 2001
From: Andrey Grodzovsky <[email protected]>
Date: Thu, 25 Mar 2021 12:07:38 -0400
Subject: ALSA: Fix refcount splat
Righ on boot bellow WARN observed
Fix by setting refcount to 1 and also
drop the optimization in snd_power_unref since I can't rely on atomic refcount_sub_and_test anymore.
v2: Switch to atomic type instead of refcount
[ 41.710577 < 0.000078>] ------------[ cut here ]------------ [ 41.710580 < 0.000003>] refcount_t: addition on 0; use-after-free. [ 41.710603 < 0.000023>] WARNING: CPU: 10 PID: 2781 at lib/refcount.c:25 refcount_warn_saturate+0x86/0x110 [ 41.710614 < 0.000011>] Modules linked in: snd_hda_codec_hdmi(OE) snd_hda_intel(OE) snd_intel_dspcfg(OE) snd_hda_codec(OE) snd_hda_core(OE) snd_pcm(OE) snd_seq_midi(OE) snd_seq_midi_event(OE) snd_rawmidi(OE) snd_seq(OE) snd_seq_device(OE) snd_timer(OE) snd(OE) input_leds led_class joydev kvm k10temp drm(OE) drm_panel_orientation_quirks(OE) igb i2c_algo_bit pinctrl_amd [ 41.710679 < 0.000065>] CPU: 10 PID: 2781 Comm: alsactl Tainted: G OE 5.11.0-rc3-pci-bars+ #7 [ 41.710685 < 0.000006>] Hardware name: System manufacturer System Product Name/PRIME X470-PRO, BIOS 4406 02/28/2019 [ 41.710689 < 0.000004>] RIP: 0010:refcount_warn_saturate+0x86/0x110 [ 41.710696 < 0.000007>] Code: dc dd 27 02 01 e8 22 92 9f 00 0f 0b eb d9 80 3d cb dd 27 02 00 75 d0 48 c7 c7 40 f0 d9 83 c6 05 bb dd 27 02 01 e8 02 92 9f 00 <0f> 0b eb b9 80 3d ad dd 27 02 00 75 b0 48 c7 c7 a0 ef d9 83 c6 05 [ 41.710701 < 0.000005>] RSP: 0018:ffff888259bcfb98 EFLAGS: 00010286 [ 41.710707 < 0.000006>] RAX: 0000000000000000 RBX: 0000000000000002 RCX: 0000000000000000 [ 41.710711 < 0.000004>] RDX: 0000000000000027 RSI: 0000000000000004 RDI: ffffed104b379f65 [ 41.710715 < 0.000004>] RBP: ffff88816a60ef40 R08: ffffffff822b270e R09: ffffed10df33e014 [ 41.710719 < 0.000004>] R10: ffff8886f99f009b R11: ffffed10df33e013 R12: 0000000000000001 [ 41.710723 < 0.000004>] R13: 1ffff1104b379f79 R14: ffff88816a60ef40 R15: 0000000000000000 [ 41.710728 < 0.000005>] FS: 00007f0e1817e440(0000) GS:ffff8886f9800000(0000) knlGS:0000000000000000 [ 41.710732 < 0.000004>] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 41.710736 < 0.000004>] CR2: 00007f0e185f7000 CR3: 00000001532fa000 CR4: 00000000003506e0 [ 41.710740 < 0.000004>] Call Trace: [ 41.710744 < 0.000004>] snd_power_wait_and_ref+0x315/0x320 [snd] [ 41.710768 < 0.000024>] ? snd_card_new+0x5e0/0x5e0 [snd] [ 41.710790 < 0.000022>] ? lock_acquire+0xee/0x570 [ 41.710797 < 0.000007>] ? lock_acquire+0xee/0x570 [ 41.710804 < 0.000007>] ? lock_acquired+0xb4/0x5a0 [ 41.710810 < 0.000006>] ? snd_ctl_ioctl+0x240/0xb60 [snd] [ 41.710832 < 0.000022>] ? snd_ctl_find_id+0x161/0x180 [snd] [ 41.710855 < 0.000023>] snd_ctl_elem_write+0x1c4/0x350 [snd] [ 41.710878 < 0.000023>] ? copy_ctl_value_from_user+0x2f0/0x2f0 [snd] [ 41.710901 < 0.000023>] ? down_write+0x16c/0x2e0 [ 41.710907 < 0.000006>] ? snd_ctl_ioctl+0x240/0xb60 [snd] [ 41.710929 < 0.000022>] ? rwsem_down_read_slowpath+0x5f0/0x5f0 [ 41.710935 < 0.000006>] ? _copy_from_user+0xa0/0xf0 [ 41.710942 < 0.000007>] snd_ctl_ioctl+0x24e/0xb60 [snd] [ 41.710965 < 0.000023>] ? snd_ctl_elem_add_user+0x150/0x150 [snd] [ 41.710988 < 0.000023>] ? selinux_capable+0x20/0x20 [ 41.710995 < 0.000007>] ? kmem_cache_free+0x145/0x390 [ 41.711001 < 0.000006>] ? lockdep_hardirqs_on_prepare+0xe/0x210 [ 41.711007 < 0.000006>] ? blkcg_maybe_throttle_current+0x7f/0x7f0 [ 41.711014 < 0.000007>] ? call_rcu+0x20b/0x3a0 [ 41.711024 < 0.000010>] __x64_sys_ioctl+0xe0/0x120 [ 41.711029 < 0.000005>] ? syscall_trace_enter.isra.0+0xc9/0x270 [ 41.711036 < 0.000007>] do_syscall_64+0x33/0x80 [ 41.711042 < 0.000006>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 41.711048 < 0.000006>] RIP: 0033:0x7f0e183eb50b
--- include/sound/core.h | 6 +++--- sound/core/init.c | 3 ++- sound/pci/hda/hda_intel.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)
include/sound/core.h +3 -3
@@ -126,7 +126,7 @@ struct snd_card {#ifdef CONFIG_PM unsigned int power_state;/* power state */ wait_queue_head_t power_sleep; -refcount_t power_ref; +atomic_t power_ref;wait_queue_head_t power_ref_sleep;#endif
@@ -152,12 +152,12 @@ static inline void snd_power_change_state(struct snd_card *card, unsigned int ststatic inline void snd_power_ref (struct snd_card *card) { -refcount_inc (&card->power_ref); +atomic_inc (&card->power_ref); }static inline void snd_power_unref (struct snd_card *card) { -if (refcount_dec_and_test (&card->power_ref)) +if (atomic_dec_and_test (&card->power_ref))wake_up (&card->power_ref_sleep); }
sound/core/init.c +2 -1
@@ -215,8 +215,8 @@ int snd_card_new(struct device *parent, int idx, const char *xid,mutex_init (&card->memory_mutex);#ifdef CONFIG_PM init_waitqueue_head (&card->power_sleep); -refcount_set (&card->power_ref,0 );init_waitqueue_head (&card->power_ref_sleep); +atomic_set (&card->power_ref,0 );#endif init_waitqueue_head (&card->remove_sleep); card->sync_irq =-1 ;
@@ -1007,6 +1007,7 @@ int snd_power_wait_and_ref(struct snd_card *card, bool ref)/* fastpath */ if (ref)snd_power_ref (card); +if (snd_power_get_state (card) ==SNDRV_CTL_POWER_D0 )return 0 ;init_waitqueue_entry (&wait, current);
sound/pci/hda/hda_intel.c +1 -1
@@ -2457,7 +2457,7 @@ static void azx_rescan_prepare(struct pci_dev *pdev)azx_prepare (&pdev->dev);azx_suspend_streams (chip);wait_event (card->power_ref_sleep, - !refcount_read (&card->power_ref)); + !atomic_read (&card->power_ref));list_for_each_codec (codec, &chip->bus) {pm_runtime_suspend (hda_codec_dev (codec));pm_runtime_disable (hda_codec_dev (codec));
Signature · 1 line
2.25.1
Quoted 2 lines · Andrey Grodzovsky
Attached.
Thanks. I found that there are a few other places that may enter the hardware access and might need the power_state blocking similarly.
The patch set below is a refreshed one including those.
Takashi
From c061f5bedc8ae356132ea536c524a5460c2b2dd8 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 08:53:56 +0100
Subject: [PATCH v3 1/6] ALSA: hda: Re-add dropped snd_poewr_change_state()
calls
The card power state change via snd_power_change_state() at the system suspend/resume seems dropped mistakenly during the PM code rewrite. The card power state doesn't play much role nowadays but it's still referred in a few places such as the HDMI codec driver.
This patch restores them, but in a more appropriate place now in the prepare and complete callbacks.
--- sound/pci/hda/hda_intel.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/hda_intel.c +2 -0
@@ -1025,6 +1025,7 @@ static int azx_prepare(struct device *dev) chip = card->private_data; chip->pm_prepared =1 ; +snd_power_change_state (card, SNDRV_CTL_POWER_D3hot);flush_work (&azx_bus (chip)->unsol_work);
@@ -1040,6 +1041,7 @@ static void azx_complete(struct device *dev)struct azx *chip; chip = card->private_data; +snd_power_change_state (card,SNDRV_CTL_POWER_D0 ); chip->pm_prepared =0 ; }
Signature · 1 line
2.26.2
From ac37cc965a5a6ac28a3bd2ace7299ea0425e8465 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 18:01:39 +0100
Subject: [PATCH v3 2/6] ALSA: core: Use READ_ONCE() / WRITE_ONCE() for power
state change
We need proper barriers to handle the power state change of the card. In the normal situation in suspend/resume callbacks, the lack of the barrier is no big problem, but if it's actually referred outside the suspend state, it can be racy. Fix it with READ_ONCE() and WRITE_ONCE() macros.
--- include/sound/core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/sound/core.h +2 -2
@@ -142,12 +142,12 @@ struct snd_card {#ifdef CONFIG_PM static inline unsigned int snd_power_get_state (struct snd_card *card) { -return card->power_state; +return READ_ONCE (card->power_state); }static inline void snd_power_change_state (struct snd_card *card,unsigned int state) { - card->power_state = state; +WRITE_ONCE (card->power_state, state);wake_up (&card->power_sleep); }
Signature · 1 line
2.26.2
From 6cc9b0be57276b209069da459e167114c04a4e00 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Thu, 25 Mar 2021 08:31:23 +0100
Subject: [PATCH v3 3/6] ALSA: core: Use inline for dummy snd_power_*() helpers
Using the do-while(0) isn't really suitable for a macro with an argument, as checkpatch recently complained. Replace with static inline functions for safety.
--- include/sound/core.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
include/sound/core.h +13 -3
@@ -156,9 +156,19 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state);#else /* ! CONFIG_PM */ -static inline int snd_power_wait (struct snd_card *card,unsigned int state) {return 0 ; } -#define snd_power_get_state (card) ({ (void)(card); SNDRV_CTL_POWER_D0; }) -#define snd_power_change_state (card, state) do { (void)(card); } while (0) +static inline int snd_power_wait (struct snd_card *card,unsigned int state) +{ +return 0 ; +} + +static inline unsigned int snd_power_get_state (struct snd_card *card) +{ +return SNDRV_CTL_POWER_D0 ; +} + +static inline void snd_power_change_state (struct snd_card *card,unsigned int state) +{ +}#endif /* CONFIG_PM */
Signature · 1 line
2.26.2
From bc6b7a31914af194586d890c761eced196c25ae3 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:02:33 +0100
Subject: [PATCH v3 4/6] ALSA: control: Track the floating control
read/write/tlv accesses
Some control API ioctls may access the hardware and we need to block such operations during the card power state off. Although there have been already a few snd_power_wait() checks in some ioctl handlers, not only that the snd_power_wait() checks are missing around the actually needed places for kctl ops accesses, but also that the snd_power_wait() call itself is basically helpless; if a driver sets the power state to D3, a pending task that has already entered in the ioctl may access the hardware afterwards.
For covering those races, this patch introduces a few new things:
- A refcount, power_ref, and a wait head, power_ref_sleep, to the card object
- A new helper, snd_power_wait_and_ref(), and snd_power_unref()
In a few code paths that call kctl read/write/tlv ops, we check the power state again with the new snd_power_want_and_ref() helper, which also takes the card.power_ref refcount in return. The refcount is then released after the kctl ops finishes. So the driver can sync via wait_event() with power_ref=0 for assuring all in-flight tasks are finished. (Note that the snd_power_wait_and_ref() is written carefully not to deadlock the power_ref=0 loop by decrementing the refcount before sleeping.)
Also, this patch changes snd_power_wait() to accept only SNDRV_CTL_POWER_D0, which is the only value that makes sense. In later patch, the snd_power_wait() calls will be simplified.
Reader may wonder why a similar stuff isn't needed for PCM; it's because PCM is stateful unlike the control API and each operation stage has a proper state check.
Yet another note: the code uses atomic_t because refcount_t doesn't allow the increment on zero, and it gives no helper for dec-and-test other than comparison with zero, either.
--- include/sound/core.h | 27 +++++++++++++++++++++++++++ sound/core/control.c | 29 +++++++++++++++++++++++------ sound/core/init.c | 44 ++++++++++++++++++++++++++++++++++++-------- 3 files changed, 86 insertions(+), 14 deletions(-)
include/sound/core.h +27 -0
@@ -129,6 +129,8 @@ struct snd_card {#ifdef CONFIG_PM unsigned int power_state;/* power state */ wait_queue_head_t power_sleep; +atomic_t power_ref; +wait_queue_head_t power_ref_sleep;#endif #if IS_ENABLED (CONFIG_SND_MIXER_OSS )
@@ -151,8 +153,20 @@ static inline void snd_power_change_state(struct snd_card *card, unsigned int st wake_up(&card->power_sleep); } +static inline void snd_power_ref (struct snd_card *card) +{ +atomic_inc (&card->power_ref); +} + +static inline void snd_power_unref (struct snd_card *card) +{ +if (atomic_dec_and_test (&card->power_ref)) +wake_up (&card->power_ref_sleep); +} +/* init.c */ int snd_power_wait (struct snd_card *card,unsigned int power_state); +int snd_power_wait_and_ref (struct snd_card *card,bool ref);#else /* ! CONFIG_PM */
@@ -170,6 +184,19 @@ static inline void snd_power_change_state(struct snd_card *card, unsigned int st { } +static inline int snd_power_wait_and_ref (struct snd_card *card,bool ref) +{ +return 0 ; +} + +static inline void snd_power_ref (struct snd_card *card) +{ +} + +static inline void snd_power_unref (struct snd_card *card) +{ +} +#endif /* CONFIG_PM */ struct snd_minor {
sound/core/control.c +23 -6
@@ -1060,9 +1060,12 @@ static int snd_ctl_elem_read(struct snd_card *card,if (!snd_ctl_skip_validation (&info))fill_remaining_elem_value (control, &info, pattern); + ret =snd_power_wait_and_ref (card, true); +if (ret <0 ) + goto out; ret = kctl->get (kctl, control);if (ret <0 ) -return ret; + goto out;if (!snd_ctl_skip_validation (&info) &&sanity_check_elem_value (card, control, &info, pattern) <0 ) { dev_err(card->dev,
@@ -1070,8 +1073,12 @@ static int snd_ctl_elem_read(struct snd_card *card, control->id.iface, control->id.device, control->id.subdevice, control->id.name, control->id.index); -return -EINVAL ; + ret = -EINVAL ; + goto out; } + + out: +snd_power_unref (card);return ret; }
@@ -1122,16 +1129,22 @@ static int snd_ctl_elem_write(struct snd_card *card, struct snd_ctl_file *file, }snd_ctl_build_ioff (&control->id, kctl, index_offset); + + result =snd_power_wait_and_ref (card, true); +if (result <0 ) + goto out; result = kctl->put (kctl, control);if (result <0 ) -return result; + goto out;if (result >0 ) {struct snd_ctl_elem_id id = control->id;snd_ctl_notify (card,SNDRV_CTL_EVENT_MASK_VALUE , &id); } -return 0 ; + out: +snd_power_unref (card); +return result <0 ? result :0 ; } static int snd_ctl_elem_write_user(struct snd_ctl_file *file,
@@ -1606,7 +1619,7 @@ static int call_tlv_handler(struct snd_ctl_file *file, int op_flag, {SNDRV_CTL_TLV_OP_CMD, SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND}, };struct snd_kcontrol_volatile *vd = &kctl->vd[snd_ctl_get_ioff (kctl, id)]; -int i; +int i, ret;/* Check support of the request for this element. */ for (i =0 ; i <ARRAY_SIZE (pairs); ++i) {
@@ -1624,7 +1637,11 @@ static int call_tlv_handler(struct snd_ctl_file *file, int op_flag, vd->owner != NULL && vd->owner != file)return -EPERM ; -return kctl->tlv.c (kctl, op_flag, size, buf); + ret =snd_power_wait_and_ref (file->card, true); +if (!ret) + ret = kctl->tlv.c (kctl, op_flag, size, buf); +snd_power_unref (file->card); +return ret; } static int read_tlv_buf(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id,
sound/core/init.c +36 -8
76 lines not on this page · raw message
Signature · 1 line
2.26.2
From 3d711314c8a506121b82be480e896ea042d69a76 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Wed, 24 Mar 2021 09:05:25 +0100
Subject: [PATCH v3 5/6] ALSA: pcm: Block the release until the system resume
finishes
The normal PCM operations are already blocked during the card power off state in the PCM common ioctl handler, but the release isn't covered. As the PCM stream release may also access the hardware, let's block the release until the card power turns on.
--- sound/core/pcm_native.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/core/pcm_native.c +4 -0
@@ -2799,6 +2799,10 @@ static int snd_pcm_release(struct inode *inode, struct file *file)if (snd_BUG_ON (!substream))return -ENXIO ; pcm = substream->pcm; + +/* block until the device gets woken up as it may touch the hardware */ +snd_power_wait (pcm->card,SNDRV_CTL_POWER_D0 ); +mutex_lock (&pcm->open_mutex);snd_pcm_release_substream (substream);kfree (pcm_file);
Signature · 1 line
2.26.2
From 380cbaebf3bfdf6eaf0b46772411a64ca8bdbaeb Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Tue, 16 Mar 2021 23:01:02 -0400
Subject: [PATCH v3 6/6] ALSA: hda: Add support for BARs move on PCI rescan
--- sound/pci/hda/hda_beep.c | 2 + sound/pci/hda/hda_controller.c | 9 +++ sound/pci/hda/hda_controller.h | 1 + sound/pci/hda/hda_hwdep.c | 7 +- sound/pci/hda/hda_intel.c | 115 ++++++++++++++++++++++++++++++--- sound/pci/hda/hda_proc.c | 3 + sound/pci/hda/hda_sysfs.c | 5 ++ 7 files changed, 131 insertions(+), 11 deletions(-)
sound/pci/hda/hda_beep.c +2 -0
@@ -25,6 +25,7 @@ static void generate_tone(struct hda_beep *beep, int tone) {struct hda_codec *codec = beep->codec; +snd_power_wait_and_ref (codec->card, true);if (tone && !beep->playing) {snd_hda_power_up (codec);if (beep->power_hook)
@@ -39,6 +40,7 @@ static void generate_tone(struct hda_beep *beep, int tone) beep->power_hook (beep, false);snd_hda_power_down (codec); } +snd_power_unref (codec->card); }static void snd_hda_generate_beep (struct work_struct *work)
sound/pci/hda/hda_controller.c +9 -0
@@ -1057,6 +1057,15 @@ void azx_stop_chip(struct azx *chip) }EXPORT_SYMBOL_GPL (azx_stop_chip); +void azx_suspend_streams (struct azx *chip) +{ +struct azx_pcm *apcm; + +list_for_each_entry (apcm, &chip->pcm_list, list) +snd_pcm_suspend_all (apcm->pcm); +} +EXPORT_SYMBOL_GPL (azx_suspend_streams); +/* * interrupt handler */
sound/pci/hda/hda_controller.h +1 -0
@@ -212,5 +212,6 @@ int azx_probe_codecs(struct azx *chip, unsigned int max_slots);int azx_codec_configure (struct azx *chip);int azx_init_streams (struct azx *chip);void azx_free_streams (struct azx *chip); +void azx_suspend_streams (struct azx *chip);#endif /* __SOUND_HDA_CONTROLLER_H */
sound/pci/hda/hda_hwdep.c +5 -2
@@ -22,14 +22,17 @@ static int verb_write_ioctl(struct hda_codec *codec, struct hda_verb_ioctl __user *arg) {u32 verb, res; +int err;if (get_user (verb, &arg->verb))return -EFAULT ; + err =snd_power_wait_and_ref (codec->card, true); res =snd_hda_codec_read (codec, verb >>24 ,0 , (verb >>8 ) &0xffff , verb &0xff );if (put_user (res, &arg->res)) -return -EFAULT ; -return 0 ; + err = -EFAULT ; +snd_power_unref (codec->card); +return err; } static int get_wcap_ioctl(struct hda_codec *codec,
sound/pci/hda/hda_intel.c +106 -9
141 lines not on this page · raw message
sound/pci/hda/hda_proc.c +3 -0
@@ -782,6 +782,7 @@ static void print_codec_info(struct snd_info_entry *entry, fg = codec->core.afg;if (!fg)return ; +snd_power_wait_and_ref (codec->card, true);snd_hda_power_up (codec);snd_iprintf (buffer,"Default PCM:\n" );print_pcm_caps (buffer, codec, fg);
@@ -796,6 +797,7 @@ static void print_codec_info(struct snd_info_entry *entry,if (! nid || nodes <0 ) {snd_iprintf (buffer,"Invalid AFG subtree\n" );snd_hda_power_down (codec); +snd_power_unref (codec->card);return ; }
@@ -933,6 +935,7 @@ static void print_codec_info(struct snd_info_entry *entry,kfree (conn); }snd_hda_power_down (codec); +snd_power_unref (codec->card); }/*
sound/pci/hda/hda_sysfs.c +5 -0
@@ -118,12 +118,15 @@ static int clear_codec(struct hda_codec *codec) {int err; +snd_power_wait_and_ref (codec->card, true); err =snd_hda_codec_reset (codec);if (err <0 ) {codec_err (codec,"The codec is being used, can't free.\n" ); +snd_power_unref (codec->card);return err; }snd_hda_sysfs_clear (codec); +snd_power_unref (codec->card);return 0 ; }
@@ -131,6 +134,7 @@ static int reconfig_codec(struct hda_codec *codec) {int err; +snd_power_wait_and_ref (codec->card, true);snd_hda_power_up (codec);codec_info (codec,"hda-codec: reconfiguring\n" ); err =snd_hda_codec_reset (codec);
@@ -145,6 +149,7 @@ static int reconfig_codec(struct hda_codec *codec) err =snd_card_register (codec->card); error:snd_hda_power_down (codec); +snd_power_unref (codec->card);return err; }
Signature · 1 line
2.26.2
Tested and Looks good.
Thanks a lot for ur help! I will be moving now to work on USB driver as this is another on CARD controller we need to take care of.
Andrey
Quoted 13 lines · Takashi Iwai
Quoted 2 lines · Andrey Grodzovsky
Attached.
Thanks. I found that there are a few other places that may enter the hardware access and might need the
power_stateblocking similarly.The patch set below is a refreshed one including those.
Takashi
Quoted 6 lines · Andrey Grodzovsky
Tested and Looks good.
Thanks a lot for ur help! I will be moving now to work on USB driver as this is another on CARD controller we need to take care of.
OK, let me know if you need the final version some time later. The last (main) patch has no description, and I corrected a few minor things from the previous patch set.
Or, if you can give some branch I can put those patches on the top, I can keep it in my tree, too.
thanks,
Takashi
Quoted 18 lines
Andrey
Quoted 13 lines · Takashi Iwai
Quoted 2 lines · Andrey Grodzovsky
Attached.
Thanks. I found that there are a few other places that may enter the hardware access and might need the
power_stateblocking similarly.The patch set below is a refreshed one including those.
Takashi
Yea, better give me final version now as I might forget later.
I keep my work here - https://cgit.freedesktop.org/~agrodzov/linux/log/?h=yadro/pcie_hotplug/movable_bars_v9.1
It's a clone of Segei's original branch here https://github.com/YADRO-KNS/linux/commits/yadro/pcie_hotplug/movable_bars_v9.1
+ My amdgpu work and your ALSA work on top, once I finish the USB part
and resolve a few issues I still observe with AMDGPU
i will ask Sergei to merge everything to his branch and
form there I guess he will move on to submit another RFC.
Andrey
Quoted 39 lines · Takashi Iwai
Quoted 6 lines · Andrey Grodzovsky
Tested and Looks good.
Thanks a lot for ur help! I will be moving now to work on USB driver as this is another on CARD controller we need to take care of.
OK, let me know if you need the final version some time later. The last (main) patch has no description, and I corrected a few minor things from the previous patch set.
Or, if you can give some branch I can put those patches on the top, I can keep it in my tree, too.
thanks,
Takashi
Quoted 18 lines
Andrey
Quoted 13 lines · Takashi Iwai
Quoted 2 lines · Andrey Grodzovsky
Attached.
Thanks. I found that there are a few other places that may enter the hardware access and might need the
power_stateblocking similarly.The patch set below is a refreshed one including those.
Takashi
kernel test robot
build botRe: [PATCH v2 1/8] ALSA: hda: Re-add dropped snd_poewr_change_state()
In reply to Takashi IwaiI love your patch! Perhaps something to improve:
Hi Takashi,
I love your patch! Perhaps something to improve:
[auto build test WARNING on v5.12-rc4]
[also build test WARNING on next-20210324]
[cannot apply to sound/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Takashi-Iwai/ALSA-hda-Re-add-dropped-snd_poewr_change_state/20210325-043958 base: 0d02ec6b3136c73c09e7859f0d0e4e2c4c07b49b config: arc-allyesconfig (attached as .config) compiler: arceb-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/9d72f7bfcc53f9e360ceba244596818bb00f1f7d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Takashi-Iwai/ALSA-hda-Re-add-dropped-snd_poewr_change_state/20210325-043958 git checkout 9d72f7bfcc53f9e360ceba244596818bb00f1f7d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
sound/pci/hda/hda_intel.c: In function 'azx_rescan_prepare':
sound/pci/hda/hda_intel.c:2419:3: error: implicit declaration of function 'azx_prepare'; did you mean 'azx_create'? [-Werror=implicit-function-declaration]
2419 | azx_prepare(&pdev->dev);
| ^~~~~~~~~~~
| azx_create
sound/pci/hda/hda_intel.c:2427:3: error: implicit declaration of function 'azx_suspend' [-Werror=implicit-function-declaration]
2427 | azx_suspend(&pdev->dev);
| ^~~~~~~~~~~
sound/pci/hda/hda_intel.c: In function 'azx_rescan_done':
sound/pci/hda/hda_intel.c:2466:3: error: implicit declaration of function 'azx_resume'; did you mean 'azx_remove'? [-Werror=implicit-function-declaration]
2466 | azx_resume(&pdev->dev);
| ^~~~~~~~~~
| azx_remove
sound/pci/hda/hda_intel.c:2471:3: error: implicit declaration of function 'azx_complete'; did you mean 'complete'? [-Werror=implicit-function-declaration]
2471 | azx_complete(&pdev->dev);
| ^~~~~~~~~~~~
| complete
sound/pci/hda/hda_intel.c: At top level:
sound/pci/hda/hda_intel.c:2845:3: error: 'struct pci_driver' has no member named 'rescan_prepare'
2845 | .rescan_prepare = azx_rescan_prepare,
| ^~~~~~~~~~~~~~
>> sound/pci/hda/hda_intel.c:2845:20: warning: initialization of 'unsigned int' from 'void (*)(struct pci_dev *)' makes integer from pointer without a cast [-Wint-conversion]
2845 | .rescan_prepare = azx_rescan_prepare,
| ^~~~~~~~~~~~~~~~~~
sound/pci/hda/hda_intel.c:2845:20: note: (near initialization for 'azx_driver.dynids.lock.<anonymous>.rlock.raw_lock.slock')
sound/pci/hda/hda_intel.c:2846:3: error: 'struct pci_driver' has no member named 'rescan_done'
2846 | .rescan_done = azx_rescan_done,
| ^~~~~~~~~~~
>> sound/pci/hda/hda_intel.c:2846:17: warning: excess elements in struct initializer
2846 | .rescan_done = azx_rescan_done,
| ^~~~~~~~~~~~~~~
sound/pci/hda/hda_intel.c:2846:17: note: (near initialization for 'azx_driver')
sound/pci/hda/hda_intel.c:2847:3: error: 'struct pci_driver' has no member named 'bar_fixed'
2847 | .bar_fixed = azx_bar_fixed,
| ^~~~~~~~~
sound/pci/hda/hda_intel.c:2847:15: warning: excess elements in struct initializer
2847 | .bar_fixed = azx_bar_fixed,
| ^~~~~~~~~~~~~
sound/pci/hda/hda_intel.c:2847:15: note: (near initialization for 'azx_driver')
>> sound/pci/hda/hda_intel.c:2835:39: warning: missing braces around initializer [-Wmissing-braces]
2835 | static struct pci_driver azx_driver = {
| ^
......
2845 | .rescan_prepare = azx_rescan_prepare,
| {{{{{ }}}}}
In file included from include/linux/perf_event.h:25,
from include/linux/trace_events.h:10,
from include/trace/trace_events.h:21,
from include/trace/define_trace.h:102,
from sound/pci/hda/hda_intel_trace.h:54,
from sound/pci/hda/hda_intel.c:59:
arch/arc/include/asm/perf_event.h:126:23: warning: 'arc_pmu_cache_map' defined but not used [-Wunused-const-variable=]
126 | static const unsigned arc_pmu_cache_map[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
| ^~~~~~~~~~~~~~~~~
arch/arc/include/asm/perf_event.h:91:27: warning: 'arc_pmu_ev_hw_map' defined but not used [-Wunused-const-variable=]
91 | static const char * const arc_pmu_ev_hw_map[] = {
| ^~~~~~~~~~~~~~~~~cc1: some warnings being treated as errors
vim +2845 sound/pci/hda/hda_intel.c
2833
2834 /* pci_driver definition */
> 2835 static struct pci_driver azx_driver = {
2836 .name = KBUILD_MODNAME,
2837 .id_table = azx_ids,
2838 .probe = azx_probe,
2839 .remove = azx_remove,
2840 .shutdown = azx_shutdown,
2841 .driver = {
2842 .pm = AZX_PM_OPS,
2843 },
2844 #ifdef CONFIG_PM
> 2845 .rescan_prepare = azx_rescan_prepare,
> 2846 .rescan_done = azx_rescan_done, 2847 .bar_fixed = azx_bar_fixed,
2848 #endif
2849 };
2850
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [PATCH v2 1/8] ALSA: hda: Re-add dropped snd_poewr_change_state()
In reply to Takashi IwaiI love your patch! Yet something to improve:
Hi Takashi,
I love your patch! Yet something to improve:
[auto build test ERROR on v5.12-rc4]
[also build test ERROR on next-20210324]
[cannot apply to sound/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Takashi-Iwai/ALSA-hda-Re-add-dropped-snd_poewr_change_state/20210325-043958 base: 0d02ec6b3136c73c09e7859f0d0e4e2c4c07b49b config: m68k-allmodconfig (attached as .config) compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/9d72f7bfcc53f9e360ceba244596818bb00f1f7d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Takashi-Iwai/ALSA-hda-Re-add-dropped-snd_poewr_change_state/20210325-043958 git checkout 9d72f7bfcc53f9e360ceba244596818bb00f1f7d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
In file included from sound/core/control.c:16:
sound/core/control.c: In function 'snd_ctl_elem_read':
>> include/sound/core.h:176:43: error: expected expression before 'do'
176 | #define snd_power_wait_and_ref(card, ref) do { (void)(card); } while (0)
| ^~
sound/core/control.c:1060:8: note: in expansion of macro 'snd_power_wait_and_ref'
1060 | ret = snd_power_wait_and_ref(card, true);
| ^~~~~~~~~~~~~~~~~~~~~~
sound/core/control.c: In function 'snd_ctl_elem_write':
>> include/sound/core.h:176:43: error: expected expression before 'do'
176 | #define snd_power_wait_and_ref(card, ref) do { (void)(card); } while (0)
| ^~
sound/core/control.c:1126:11: note: in expansion of macro 'snd_power_wait_and_ref'
1126 | result = snd_power_wait_and_ref(card, true);
| ^~~~~~~~~~~~~~~~~~~~~~
sound/core/control.c: In function 'call_tlv_handler':
>> include/sound/core.h:176:43: error: expected expression before 'do'
176 | #define snd_power_wait_and_ref(card, ref) do { (void)(card); } while (0)
| ^~
sound/core/control.c:1629:8: note: in expansion of macro 'snd_power_wait_and_ref'
1629 | ret = snd_power_wait_and_ref(file->card, true);
| ^~~~~~~~~~~~~~~~~~~~~~vim +/do +176 include/sound/core.h
172
173 static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; }
174 #define snd_power_get_state(card) ({ (void)(card); SNDRV_CTL_POWER_D0; })
175 #define snd_power_change_state(card, state) do { (void)(card); } while (0)
> 176 #define snd_power_wait_and_ref(card, ref) do { (void)(card); } while (0) 177 #define snd_power_ref(card) do { (void)(card); } while (0)
178 #define snd_power_unref(card) do { (void)(card); } while (0)
179
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org