Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TBS6984: no signal issue #3

Closed
jendik opened this issue Aug 14, 2013 · 50 comments
Closed

TBS6984: no signal issue #3

jendik opened this issue Aug 14, 2013 · 50 comments
Labels

Comments

@jendik
Copy link

jendik commented Aug 14, 2013

Hi,

first of all, thanks a lot for your work...

I have a signal issue with your drivers and TBS6984 card.
I've got UBUNTU based system with atom CPU TBS card and tvheadend(latest git version) server as backend. As I had several issues with freezing, interupted streaming or crashing tvheadend completely when using original TBS drivers, I compiled your drivers and extracted firmware following your wiki howtos...
Everything went well, seemed to be OK, modules loaded, adapters appeared, dmesg show firmware loaded, but I've got no signal and cannot tune any channel. As soon as I revert back to original drivers (v130318, v130506, v130318) signal is back, can tune, but "freezing" is back as well.

I have copied transponder settings from original adapters.
I tried autodetect muxes, monitor signal settings, etc - switching on and of,.. no success...
Dmesg doesn’t show any error, tvheadend neither.

Have you got an idea where could be an issue please?
Is there a way how to check, that everything is compiled and loaded/done correctly?
Which firmware should I use - windows/linux one? (tried both of them)
Would you need more information – which?

Anyway do you plan to implement support for TBS6985 as well?

Thanks a lot
Take care
jendik

Ubuntu 12.04 LTS
Linux jendaserver 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

@ljalves
Copy link
Owner

ljalves commented Aug 26, 2013

Hi,
No support for the 6985 is planned (I only own a 6981 and it's complicated to support hardware I don't have to test).

Please paste a dmesg output when using my driver.

@jendik
Copy link
Author

jendik commented Aug 26, 2013

Hi,

thank you very much for your time and support...

Here are lsmod and dmesg outputs, that could help you.

Thanks a lot
jendik

$ ls -lrtah /dev/dvb/
$
total 0
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter0
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter1
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter2
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter3
drwxr-xr-x 16 root root 4.1K Aug 26 13:01 ..
drwxr-xr-x 14 root root 280 Aug 26 13:01 .
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter5
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter24
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter4
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter23
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter7
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter22
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter6
drwxr-xr-x 2 root root 120 Aug 26 13:01 adapter21

$ lsmod
$
Module Size Used by
rc_it913x_v1 12511 0
it913x_fe 39134 4
dvb_usb_it913x 18451 0
dvb_usb_v2 23940 1 dvb_usb_it913x
rc_core 26587 4 rc_it913x_v1,dvb_usb_it913x,dvb_usb_v2
vesafb 13844 1
isl6423 13023 4
cx24117 17850 4
joydev 17693 0
pl2303 17993 0
usbserial 47077 1 pl2303
usbhid 47199 0
hid 99559 1 usbhid
ppdev 17113 0
snd_hda_codec_realtek 224066 1
snd_hda_codec_hdmi 32474 1
snd_hda_intel 33773 0
snd_hda_codec 127706 3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel
snd_hwdep 13668 1 snd_hda_codec
snd_pcm 97188 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_seq_midi 13324 0
psmouse 87692 0
snd_rawmidi 30748 1 snd_seq_midi
serio_raw 13211 0
snd_seq_midi_event 14899 1 snd_seq_midi
snd_seq 61896 2 snd_seq_midi,snd_seq_midi_event
snd_timer 29990 2 snd_pcm,snd_seq
snd_seq_device 14540 3 snd_seq_midi,snd_rawmidi,snd_seq
nfsd 277809 2
saa716x_budget 18634 0
saa716x_core 74961 1 saa716x_budget
binfmt_misc 17540 1
nfs 356410 1
mb86a16 27647 1 saa716x_budget
lockd 86161 2 nfsd,nfs
fscache 61529 1 nfs
auth_rpcgss 53380 2 nfsd,nfs
nfs_acl 12883 2 nfsd,nfs
sunrpc 245464 16 nfsd,nfs,lockd,auth_rpcgss,nfs_acl
dvb_core 105841 3 dvb_usb_v2,saa716x_budget,saa716x_core
snd 78855 10 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
stv090x 62330 1 saa716x_budget
soundcore 15091 1 snd
snd_page_alloc 18529 2 snd_hda_intel,snd_pcm
parport_pc 32866 1
video 19596 0
mac_hid 13253 0
w83627ehf 38805 0
hwmon_vid 12827 1 w83627ehf
coretemp 13525 0
lp 17799 0
parport 46562 3 ppdev,parport_pc,lp
e1000e 156693 0

$ dmesg
$
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.2.0-29-generic (buildd@allspice) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 (Ubuntu 3.2.0-29.46-generic 3.2.24)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-29-generic root=UUID=04903fec-da62-4876-8b88-3ff3100af7d0 ro
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls
[ 0.000000] Disabled fast string operations
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000008f000 (usable)
[ 0.000000] BIOS-e820: 000000000008f000 - 0000000000090000 (reserved)
[ 0.000000] BIOS-e820: 0000000000090000 - 000000000009e800 (usable)
[ 0.000000] BIOS-e820: 000000000009e800 - 00000000000a0000 (reserved)
[ 0.000000] BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
[ 0.000000] BIOS-e820: 0000000000100000 - 00000000cee95000 (usable)
[ 0.000000] BIOS-e820: 00000000cee95000 - 00000000ceebf000 (reserved)
[ 0.000000] BIOS-e820: 00000000ceebf000 - 00000000ceefc000 (usable)
[ 0.000000] BIOS-e820: 00000000ceefc000 - 00000000cefbf000 (ACPI NVS)
[ 0.000000] BIOS-e820: 00000000cefbf000 - 00000000cefef000 (usable)
[ 0.000000] BIOS-e820: 00000000cefef000 - 00000000cefff000 (ACPI data)
[ 0.000000] BIOS-e820: 00000000cefff000 - 00000000cf000000 (usable)
[ 0.000000] BIOS-e820: 00000000cf000000 - 00000000d0000000 (reserved)
[ 0.000000] BIOS-e820: 00000000e0000000 - 00000000e4000000 (reserved)
[ 0.000000] BIOS-e820: 00000000ffe00000 - 0000000100000000 (reserved)
[ 0.000000] BIOS-e820: 0000000100000000 - 0000000130000000 (usable)
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] DMI 2.7 present.
[ 0.000000] DMI: /DN2800MT, BIOS MTCDT10N.86A.0152.2012.0220.1510 02/20/2012
[ 0.000000] e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved)
[ 0.000000] e820 remove range: 00000000000a0000 - 0000000000100000 (usable)
[ 0.000000] No AGP bridge found
[ 0.000000] last_pfn = 0x130000 max_arch_pfn = 0x400000000
[ 0.000000] MTRR default type: uncachable
[ 0.000000] MTRR fixed ranges enabled:
[ 0.000000] 00000-9FFFF write-back
[ 0.000000] A0000-BFFFF uncachable
[ 0.000000] C0000-DFFFF write-protect
[ 0.000000] E0000-FFFFF uncachable
[ 0.000000] MTRR variable ranges enabled:
[ 0.000000] 0 base 000000000 mask F80000000 write-back
[ 0.000000] 1 base 080000000 mask FC0000000 write-back
[ 0.000000] 2 base 0C0000000 mask FF0000000 write-back
[ 0.000000] 3 base 0CF000000 mask FFF000000 uncachable
[ 0.000000] 4 base 100000000 mask FC0000000 write-back
[ 0.000000] 5 base 0FFE00000 mask FFFE00000 write-protect
[ 0.000000] 6 disabled
[ 0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
[ 0.000000] last_pfn = 0xcf000 max_arch_pfn = 0x400000000
[ 0.000000] found SMP MP-table at [ffff8800000fbe30] fbe30
[ 0.000000] initial memory mapped : 0 - 20000000
[ 0.000000] Base memory trampoline at [ffff880000099000] 99000 size 20480
[ 0.000000] init_memory_mapping: 0000000000000000-00000000cf000000
[ 0.000000] 0000000000 - 00cf000000 page 2M
[ 0.000000] kernel direct mapping tables up to cf000000 @ 1fffb000-20000000
[ 0.000000] init_memory_mapping: 0000000100000000-0000000130000000
[ 0.000000] 0100000000 - 0130000000 page 2M
[ 0.000000] kernel direct mapping tables up to 130000000 @ cefe9000-cefef000
[ 0.000000] RAMDISK: 364d4000 - 37262000
[ 0.000000] ACPI: RSDP 00000000000f2240 00024 (v02 INTEL )
[ 0.000000] ACPI: XSDT 00000000ceffe120 00064 (v01 INTEL DN2800MT 00000098 01000013)
[ 0.000000] ACPI: FACP 00000000ceff6000 000F4 (v03 INTEL DN2800MT 00000098 MSFT 0100000D)
[ 0.000000] ACPI: DSDT 00000000ceff8000 05C91 (v02 INTEL DN2800MT 00000098 MSFT 0100000D)
[ 0.000000] ACPI: FACS 00000000cef85000 00040
[ 0.000000] ACPI: SSDT 00000000ceff7000 0043E (v01 INTEL DN2800MT 00000098 MSFT 0100000D)
[ 0.000000] ACPI: APIC 00000000ceff5000 00084 (v02 INTEL DN2800MT 00000098 MSFT 0100000D)
[ 0.000000] ACPI: MCFG 00000000ceff4000 0003C (v01 INTEL DN2800MT 00000098 MSFT 0100000D)
[ 0.000000] ACPI: HPET 00000000ceff3000 00038 (v01 INTEL DN2800MT 00000098 MSFT 0100000D)
[ 0.000000] ACPI: SSDT 00000000ceff1000 00655 (v01 PmRef CpuPm 00003000 INTL 20061109)
[ 0.000000] ACPI: SSDT 00000000ceff0000 00259 (v01 PmRef Cpu0Tst 00003000 INTL 20061109)
[ 0.000000] ACPI: SSDT 00000000cefef000 0020F (v01 PmRef ApTst 00003000 INTL 20061109)
[ 0.000000] ACPI: Local APIC address 0xfee00000
[ 0.000000] No NUMA configuration found
[ 0.000000] Faking a node at 0000000000000000-0000000130000000
[ 0.000000] Initmem setup node 0 0000000000000000-0000000130000000
[ 0.000000] NODE_DATA [000000012fffb000 - 000000012fffffff]
[ 0.000000] [ffffea0000000000-ffffea0004bfffff] PMD -> [ffff88012b600000-ffff88012f5fffff] on node 0
[ 0.000000] Zone PFN ranges:
[ 0.000000] DMA 0x00000010 -> 0x00001000
[ 0.000000] DMA32 0x00001000 -> 0x00100000
[ 0.000000] Normal 0x00100000 -> 0x00130000
[ 0.000000] Movable zone start PFN for each node
[ 0.000000] early_node_map[7] active PFN ranges
[ 0.000000] 0: 0x00000010 -> 0x0000008f
[ 0.000000] 0: 0x00000090 -> 0x0000009e
[ 0.000000] 0: 0x00000100 -> 0x000cee95
[ 0.000000] 0: 0x000ceebf -> 0x000ceefc
[ 0.000000] 0: 0x000cefbf -> 0x000cefef
[ 0.000000] 0: 0x000cefff -> 0x000cf000
[ 0.000000] 0: 0x00100000 -> 0x00130000
[ 0.000000] On node 0 totalpages: 1044112
[ 0.000000] DMA zone: 64 pages used for memmap
[ 0.000000] DMA zone: 5 pages reserved
[ 0.000000] DMA zone: 3912 pages, LIFO batch:0
[ 0.000000] DMA32 zone: 16320 pages used for memmap
[ 0.000000] DMA32 zone: 827203 pages, LIFO batch:31
[ 0.000000] Normal zone: 3072 pages used for memmap
[ 0.000000] Normal zone: 193536 pages, LIFO batch:31
[ 0.000000] ACPI: PM-Timer IO Port: 0x408
[ 0.000000] ACPI: Local APIC address 0xfee00000
[ 0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
[ 0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
[ 0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
[ 0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
[ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x01] high level lint[0x1])
[ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x02] high level lint[0x1])
[ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x03] high level lint[0x1])
[ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x04] high level lint[0x1])
[ 0.000000] ACPI: IOAPIC (id[0x08] address[0xfec00000] gsi_base[0])
[ 0.000000] IOAPIC[0]: apic_id 8, version 32, address 0xfec00000, GSI 0-23
[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[ 0.000000] ACPI: IRQ0 used by override.
[ 0.000000] ACPI: IRQ2 used by override.
[ 0.000000] ACPI: IRQ9 used by override.
[ 0.000000] Using ACPI (MADT) for SMP configuration information
[ 0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[ 0.000000] SMP: Allowing 4 CPUs, 0 hotplug CPUs
[ 0.000000] nr_irqs_gsi: 40
[ 0.000000] PM: Registered nosave memory: 000000000008f000 - 0000000000090000
[ 0.000000] PM: Registered nosave memory: 000000000009e000 - 000000000009f000
[ 0.000000] PM: Registered nosave memory: 000000000009f000 - 00000000000a0000
[ 0.000000] PM: Registered nosave memory: 00000000000a0000 - 00000000000e0000
[ 0.000000] PM: Registered nosave memory: 00000000000e0000 - 0000000000100000
[ 0.000000] PM: Registered nosave memory: 00000000cee95000 - 00000000ceebf000
[ 0.000000] PM: Registered nosave memory: 00000000ceefc000 - 00000000cefbf000
[ 0.000000] PM: Registered nosave memory: 00000000cefef000 - 00000000cefff000
[ 0.000000] PM: Registered nosave memory: 00000000cf000000 - 00000000d0000000
[ 0.000000] PM: Registered nosave memory: 00000000d0000000 - 00000000e0000000
[ 0.000000] PM: Registered nosave memory: 00000000e0000000 - 00000000e4000000
[ 0.000000] PM: Registered nosave memory: 00000000e4000000 - 00000000ffe00000
[ 0.000000] PM: Registered nosave memory: 00000000ffe00000 - 0000000100000000
[ 0.000000] Allocating PCI resources starting at e4000000 (gap: e4000000:1be00000)
[ 0.000000] Booting paravirtualized kernel on bare hardware
[ 0.000000] setup_percpu: NR_CPUS:256 nr_cpumask_bits:256 nr_cpu_ids:4 nr_node_ids:1
[ 0.000000] PERCPU: Embedded 28 pages/cpu @ffff88012fc00000 s83072 r8192 d23424 u524288
[ 0.000000] pcpu-alloc: s83072 r8192 d23424 u524288 alloc=1*2097152
[ 0.000000] pcpu-alloc: [0] 0 1 2 3
[ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pages: 1024651
[ 0.000000] Policy zone: Normal
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-29-generic root=UUID=04903fec-da62-4876-8b88-3ff3100af7d0 ro
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.000000] Checking aperture...
[ 0.000000] No AGP bridge found
[ 0.000000] Calgary: detecting Calgary via BIOS EBDA area
[ 0.000000] Calgary: Unable to locate Rio Grande table in EBDA - bailing!
[ 0.000000] Memory: 4014696k/4980736k available (6555k kernel code, 804288k absent, 161752k reserved, 6645k data, 920k init)
[ 0.000000] SLUB: Genslabs=15, HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU dyntick-idle grace-period acceleration is enabled.
[ 0.000000] NR_IRQS:16640 nr_irqs:712 16
[ 0.000000] Extended CMOS year: 2000
[ 0.000000] Console: colour dummy device 80x25
[ 0.000000] console [tty0] enabled
[ 0.000000] allocated 33554432 bytes of page_cgroup
[ 0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[ 0.000000] hpet clockevent registered
[ 0.000000] Fast TSC calibration using PIT
[ 0.004000] Detected 1866.856 MHz processor.
[ 0.000006] Calibrating delay loop (skipped), value calculated using timer frequency.. 3733.71 BogoMIPS (lpj=7467424)
[ 0.000027] pid_max: default: 32768 minimum: 301
[ 0.000090] Security Framework initialized
[ 0.000130] AppArmor: AppArmor initialized
[ 0.000139] Yama: becoming mindful.
[ 0.001014] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)
[ 0.004378] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
[ 0.005868] Mount-cache hash table entries: 256
[ 0.006234] Initializing cgroup subsys cpuacct
[ 0.006256] Initializing cgroup subsys memory
[ 0.006279] Initializing cgroup subsys devices
[ 0.006289] Initializing cgroup subsys freezer
[ 0.006298] Initializing cgroup subsys blkio
[ 0.006321] Initializing cgroup subsys perf_event
[ 0.006387] Disabled fast string operations
[ 0.006402] CPU: Physical Processor ID: 0
[ 0.006410] CPU: Processor Core ID: 0
[ 0.006418] mce: CPU supports 5 MCE banks
[ 0.006435] CPU0: Thermal monitoring enabled (TM2)
[ 0.006447] using mwait in idle threads.
[ 0.009022] ACPI: Core revision 20110623
[ 0.020474] ftrace: allocating 26998 entries in 106 pages
[ 0.030638] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[ 0.070299] CPU0: Intel(R) Atom(TM) CPU N2800 @ 1.86GHz stepping 01
[ 0.177999] Performance Events: PEBS fmt0+, generic architected perfmon, Intel PMU driver.
[ 0.178022] ... version: 3
[ 0.178029] ... bit width: 40
[ 0.178036] ... generic registers: 2
[ 0.178042] ... value mask: 000000ffffffffff
[ 0.178050] ... max period: 000000007fffffff
[ 0.178057] ... fixed-purpose events: 3
[ 0.178064] ... event mask: 0000000700000003
[ 0.178474] NMI watchdog enabled, takes one hw-pmu counter.
[ 0.178821] Booting Node 0, Processors #1
[ 0.178832] smpboot cpu 1: start_ip = 99000
[ 0.673503] Disabled fast string operations
[ 0.693599] NMI watchdog enabled, takes one hw-pmu counter.
[ 0.693860] #2
[ 0.693868] smpboot cpu 2: start_ip = 99000
[ 0.781391] Disabled fast string operations
[ 0.801473] NMI watchdog enabled, takes one hw-pmu counter.
[ 0.801691] #3 Ok.
[ 0.801700] smpboot cpu 3: start_ip = 99000
[ 0.889280] Disabled fast string operations
[ 0.909348] NMI watchdog enabled, takes one hw-pmu counter.
[ 0.909413] Brought up 4 CPUs
[ 0.909422] Total of 4 processors activated (14934.16 BogoMIPS).
[ 0.910699] devtmpfs: initialized
[ 0.913618] EVM: security.selinux
[ 0.913627] EVM: security.SMACK64
[ 0.913634] EVM: security.capability
[ 0.913727] PM: Registering ACPI NVS region at ceefc000 (798720 bytes)
[ 0.916118] print_constraints: dummy:
[ 0.916172] RTC time: 11:01:44, date: 08/26/13
[ 0.916267] NET: Registered protocol family 16
[ 0.916623] Trying to unpack rootfs image as initramfs...
[ 0.916691] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
[ 0.916710] ACPI: bus type pci registered
[ 0.916935] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xe0000000-0xe3ffffff](base 0xe0000000)
[ 0.916957] PCI: MMCONFIG at [mem 0xe0000000-0xe3ffffff] reserved in E820
[ 0.944795] PCI: Using configuration type 1 for base access
[ 0.949338] bio: create slab at 0
[ 0.950092] ACPI: Added _OSI(Module Device)
[ 0.950111] ACPI: Added _OSI(Processor Device)
[ 0.950123] ACPI: Added _OSI(3.0 _SCP Extensions)
[ 0.950135] ACPI: Added _OSI(Processor Aggregator Device)
[ 0.954326] ACPI: EC: Look up EC in DSDT
[ 0.958730] ACPI: Executed 1 blocks of module-level executable AML code
[ 1.017327] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
[ 1.018846] ACPI: SSDT 00000000ceebec18 002A7 (v01 PmRef Cpu0Ist 00003000 INTL 20061109)
[ 1.019885] ACPI: Dynamic OEM Table Load:
[ 1.019903] ACPI: SSDT (null) 002A7 (v01 PmRef Cpu0Ist 00003000 INTL 20061109)
[ 1.050101] ACPI: SSDT 00000000ceebde18 001CF (v01 PmRef ApIst 00003000 INTL 20061109)
[ 1.051226] ACPI: Dynamic OEM Table Load:
[ 1.051246] ACPI: SSDT (null) 001CF (v01 PmRef ApIst 00003000 INTL 20061109)
[ 1.083223] ACPI: Interpreter enabled
[ 1.083246] ACPI: (supports S0 S3 S4 S5)
[ 1.083324] ACPI: Using IOAPIC for interrupt routing
[ 1.103360] ACPI: No dock devices found.
[ 1.103380] HEST: Table not found.
[ 1.103396] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[ 1.104131] SB.PCI0:_OSC invalid UUID
[ 1.104138] _OSC request data:1 8 1f
[ 1.104152] ACPI: PCI Root Bridge [PCI0](domain 0000 [bus 00-ff])
[ 1.105219] pci_root PNP0A08:00: host bridge window [io 0x0000-0x0cf7]
[ 1.105240] pci_root PNP0A08:00: host bridge window [io 0x0d00-0xffff]
[ 1.105256] pci_root PNP0A08:00: host bridge window [mem 0x000a0000-0x000bffff]
[ 1.105274] pci_root PNP0A08:00: host bridge window [mem 0x000c0000-0x000dffff]
[ 1.105291] pci_root PNP0A08:00: host bridge window [mem 0x000e0000-0x000effff]
[ 1.105308] pci_root PNP0A08:00: host bridge window [mem 0x000f0000-0x000fffff]
[ 1.105325] pci_root PNP0A08:00: host bridge window [mem 0xcf800000-0xcfffffff]
[ 1.105342] pci_root PNP0A08:00: host bridge window [mem 0xd0000000-0xfebfffff]
[ 1.105359] pci_root PNP0A08:00: host bridge window [mem 0xfed40000-0xfed44fff]
[ 1.105400] pci 0000:00:00.0: [8086:0bf2] type 0 class 0x000600
[ 1.105483] pci 0000:00:02.0: [8086:0be2] type 0 class 0x000300
[ 1.105508] pci 0000:00:02.0: reg 10: [mem 0xd0600000-0xd06fffff]
[ 1.105523] pci 0000:00:02.0: reg 14: [io 0x30d0-0x30d7]
[ 1.105662] pci 0000:00:1b.0: [8086:27d8] type 0 class 0x000403
[ 1.105692] pci 0000:00:1b.0: reg 10: [mem 0xd0800000-0xd0803fff 64bit]
[ 1.105806] pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold
[ 1.105817] pci 0000:00:1b.0: PME# disabled
[ 1.105856] pci 0000:00:1c.0: [8086:27d0] type 1 class 0x000604
[ 1.105972] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
[ 1.105982] pci 0000:00:1c.0: PME# disabled
[ 1.106023] pci 0000:00:1c.1: [8086:27d2] type 1 class 0x000604
[ 1.106139] pci 0000:00:1c.1: PME# supported from D0 D3hot D3cold
[ 1.106149] pci 0000:00:1c.1: PME# disabled
[ 1.106206] pci 0000:00:1d.0: [8086:27c8] type 0 class 0x000c03
[ 1.106281] pci 0000:00:1d.0: reg 20: [io 0x30a0-0x30bf]
[ 1.106345] pci 0000:00:1d.1: [8086:27c9] type 0 class 0x000c03
[ 1.106418] pci 0000:00:1d.1: reg 20: [io 0x3080-0x309f]
[ 1.106479] pci 0000:00:1d.2: [8086:27ca] type 0 class 0x000c03
[ 1.106550] pci 0000:00:1d.2: reg 20: [io 0x3060-0x307f]
[ 1.106611] pci 0000:00:1d.3: [8086:27cb] type 0 class 0x000c03
[ 1.106686] pci 0000:00:1d.3: reg 20: [io 0x3040-0x305f]
[ 1.106763] pci 0000:00:1d.7: [8086:27cc] type 0 class 0x000c03
[ 1.106797] pci 0000:00:1d.7: reg 10: [mem 0xd0704400-0xd07047ff]
[ 1.106921] pci 0000:00:1d.7: PME# supported from D0 D3hot D3cold
[ 1.106932] pci 0000:00:1d.7: PME# disabled
[ 1.106964] pci 0000:00:1e.0: [8086:2448] type 1 class 0x000604
[ 1.107078] pci 0000:00:1f.0: [8086:27bc] type 0 class 0x000601
[ 1.107189] pci 0000:00:1f.0: [Firmware Bug]: TigerPoint LPC.BM_STS cleared
[ 1.107272] pci 0000:00:1f.2: [8086:27c1] type 0 class 0x000106
[ 1.107301] pci 0000:00:1f.2: reg 10: [io 0x30c8-0x30cf]
[ 1.107318] pci 0000:00:1f.2: reg 14: [io 0x30dc-0x30df]
[ 1.107334] pci 0000:00:1f.2: reg 18: [io 0x30c0-0x30c7]
[ 1.107351] pci 0000:00:1f.2: reg 1c: [io 0x30d8-0x30db]
[ 1.107367] pci 0000:00:1f.2: reg 20: [io 0x3020-0x302f]
[ 1.107384] pci 0000:00:1f.2: reg 24: [mem 0xd0704000-0xd07043ff]
[ 1.107453] pci 0000:00:1f.2: PME# supported from D3hot
[ 1.107464] pci 0000:00:1f.2: PME# disabled
[ 1.107507] pci 0000:00:1f.3: [8086:27da] type 0 class 0x000c05
[ 1.107588] pci 0000:00:1f.3: reg 20: [io 0x3000-0x301f]
[ 1.107748] pci 0000:01:00.0: [8086:10d3] type 0 class 0x000200
[ 1.107786] pci 0000:01:00.0: reg 10: [mem 0xd0400000-0xd041ffff]
[ 1.107813] pci 0000:01:00.0: reg 14: [mem 0xd0000000-0xd03fffff]
[ 1.107839] pci 0000:01:00.0: reg 18: [io 0x2000-0x201f]
[ 1.107866] pci 0000:01:00.0: reg 1c: [mem 0xd0420000-0xd0423fff]
[ 1.108045] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[ 1.108057] pci 0000:01:00.0: PME# disabled
[ 1.113127] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
[ 1.113151] pci 0000:00:1c.0: bridge window [io 0x2000-0x2fff]
[ 1.113163] pci 0000:00:1c.0: bridge window [mem 0xd0000000-0xd04fffff]
[ 1.113273] pci 0000:02:00.0: [1131:7160] type 0 class 0x000480
[ 1.113316] pci 0000:02:00.0: reg 10: [mem 0xd0500000-0xd05fffff 64bit]
[ 1.113498] pci 0000:02:00.0: supports D1 D2
[ 1.113505] pci 0000:02:00.0: PME# supported from D0 D1 D2
[ 1.113517] pci 0000:02:00.0: PME# disabled
[ 1.121109] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
[ 1.121136] pci 0000:00:1c.1: bridge window [mem 0xd0500000-0xd05fffff]
[ 1.121257] pci 0000:00:1e.0: PCI bridge to [bus 03-03](subtractive decode)
[ 1.121290] pci 0000:00:1e.0: bridge window [io 0x0000-0x0cf7](subtractive decode)
[ 1.121300] pci 0000:00:1e.0: bridge window [io 0x0d00-0xffff](subtractive decode)
[ 1.121309] pci 0000:00:1e.0: bridge window [mem 0x000a0000-0x000bffff](subtractive decode)
[ 1.121318] pci 0000:00:1e.0: bridge window [mem 0x000c0000-0x000dffff](subtractive decode)
[ 1.121327] pci 0000:00:1e.0: bridge window [mem 0x000e0000-0x000effff](subtractive decode)
[ 1.121336] pci 0000:00:1e.0: bridge window [mem 0x000f0000-0x000fffff](subtractive decode)
[ 1.121345] pci 0000:00:1e.0: bridge window [mem 0xcf800000-0xcfffffff](subtractive decode)
[ 1.121354] pci 0000:00:1e.0: bridge window [mem 0xd0000000-0xfebfffff](subtractive decode)
[ 1.121363] pci 0000:00:1e.0: bridge window [mem 0xfed40000-0xfed44fff](subtractive decode)
[ 1.121405] ACPI: PCI Interrupt Routing Table [SB.PCI0._PRT]
[ 1.121645] ACPI: PCI Interrupt Routing Table [SB.PCI0.P0P1._PRT]
[ 1.121829] ACPI: PCI Interrupt Routing Table [SB.PCI0.RP01._PRT]
[ 1.121964] ACPI: PCI Interrupt Routing Table [SB.PCI0.RP02._PRT]
[ 1.122299] SB.PCI0:_OSC invalid UUID
[ 1.122305] _OSC request data:1 1f 1f
[ 1.122320] pci0000:00: Requesting ACPI _OSC control (0x1d)
[ 1.122464] SB.PCI0:_OSC invalid UUID
[ 1.122469] _OSC request data:1 0 1d
[ 1.122482] pci0000:00: ACPI _OSC request failed (AE_ERROR), returned control mask: 0x1d
[ 1.122499] ACPI _OSC control for PCIe not granted, disabling ASPM
[ 1.135541] ACPI: PCI Interrupt Link [LNKA](IRQs 1 3 4 5 6 7 10 12 14 15) *11
[ 1.135738] ACPI: PCI Interrupt Link [LNKB](IRQs 1 3 4 5 6 7 11 12 14 15) *10
[ 1.135936] ACPI: PCI Interrupt Link [LNKC](IRQs 1 3 4 5 6 7 *10 12 14 15)
[ 1.136122] ACPI: PCI Interrupt Link [LNKD](IRQs 1 3 4 5 6 7 11 12 14 15) *9
[ 1.136310] ACPI: PCI Interrupt Link [LNKE](IRQs 1 3 4 5 6 7 10 12 14 15) *0, disabled.
[ 1.136534] ACPI: PCI Interrupt Link [LNKF](IRQs 1 3 4 5 6 7 11 12 14 15) *0, disabled.
[ 1.136737] ACPI: PCI Interrupt Link [LNKG](IRQs 1 3 4 5 6 7 10 12 14 15) *9
[ 1.136925] ACPI: PCI Interrupt Link [LNKH](IRQs 1 3 4 5 6 7 *11 12 14 15)
[ 1.137373] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
[ 1.137413] vgaarb: loaded
[ 1.137422] vgaarb: bridge control possible 0000:00:02.0
[ 1.137787] i2c-core: driver [aat2870] using legacy suspend method
[ 1.137801] i2c-core: driver [aat2870] using legacy resume method
[ 1.138016] SCSI subsystem initialized
[ 1.138185] libata version 3.00 loaded.
[ 1.138350] usbcore: registered new interface driver usbfs
[ 1.138396] usbcore: registered new interface driver hub
[ 1.138485] usbcore: registered new device driver usb
[ 1.138825] PCI: Using ACPI for IRQ routing
[ 1.141062] PCI: pci_cache_line_size set to 64 bytes
[ 1.141203] reserve RAM buffer: 000000000008f000 - 000000000008ffff
[ 1.141211] reserve RAM buffer: 000000000009e800 - 000000000009ffff
[ 1.141218] reserve RAM buffer: 00000000cee95000 - 00000000cfffffff
[ 1.141226] reserve RAM buffer: 00000000ceefc000 - 00000000cfffffff
[ 1.141234] reserve RAM buffer: 00000000cefef000 - 00000000cfffffff
[ 1.141241] reserve RAM buffer: 00000000cf000000 - 00000000cfffffff
[ 1.141557] NetLabel: Initializing
[ 1.141573] NetLabel: domain hash size = 128
[ 1.141584] NetLabel: protocols = UNLABELED CIPSOv4
[ 1.141623] NetLabel: unlabeled traffic allowed by default
[ 1.141805] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
[ 1.141829] hpet0: 3 comparators, 64-bit 14.318180 MHz counter
[ 1.143886] Switching to clocksource hpet
[ 1.166478] AppArmor: AppArmor Filesystem Enabled
[ 1.166573] pnp: PnP ACPI init
[ 1.166617] ACPI: bus type pnp registered
[ 1.168570] pnp 00:00: [bus 00-ff]
[ 1.168578] pnp 00:00: [io 0x0000-0x0cf7 window]
[ 1.168583] pnp 00:00: [io 0x0cf8-0x0cff]
[ 1.168588] pnp 00:00: [io 0x0d00-0xffff window]
[ 1.168594] pnp 00:00: [mem 0x000a0000-0x000bffff window]
[ 1.168599] pnp 00:00: [mem 0x000c0000-0x000dffff window]
[ 1.168605] pnp 00:00: [mem 0x000e0000-0x000effff window]
[ 1.168610] pnp 00:00: [mem 0x000f0000-0x000fffff window]
[ 1.168616] pnp 00:00: [mem 0xcf800000-0xcfffffff window]
[ 1.168621] pnp 00:00: [mem 0xd0000000-0xfebfffff window]
[ 1.168626] pnp 00:00: [mem 0xfed40000-0xfed44fff window]
[ 1.168776] pnp 00:00: Plug and Play ACPI device, IDs PNP0a08 PNP0a03 (active)
[ 1.168822] pnp 00:01: [io 0x0000-0x001f]
[ 1.168828] pnp 00:01: [io 0x0081-0x0091]
[ 1.168832] pnp 00:01: [io 0x0093-0x009f]
[ 1.168837] pnp 00:01: [io 0x00c0-0x00df]
[ 1.168842] pnp 00:01: [dma 4]
[ 1.168898] pnp 00:01: Plug and Play ACPI device, IDs PNP0200 (active)
[ 1.168922] pnp 00:02: [mem 0xff000000-0xffffffff]
[ 1.168981] pnp 00:02: Plug and Play ACPI device, IDs INT0800 (active)
[ 1.169159] pnp 00:03: [mem 0xfed00000-0xfed003ff]
[ 1.169260] system 00:03: [mem 0xfed00000-0xfed003ff] has been reserved
[ 1.169278] system 00:03: Plug and Play ACPI device, IDs PNP0103 PNP0c01 (active)
[ 1.169309] pnp 00:04: [io 0x00f0]
[ 1.169328] pnp 00:04: [irq 13]
[ 1.169384] pnp 00:04: Plug and Play ACPI device, IDs PNP0c04 (active)
[ 1.169414] pnp 00:05: [io 0x002e-0x002f]
[ 1.169419] pnp 00:05: [io 0x004e-0x004f]
[ 1.169424] pnp 00:05: [io 0x0061]
[ 1.169428] pnp 00:05: [io 0x0063]
[ 1.169432] pnp 00:05: [io 0x0065]
[ 1.169437] pnp 00:05: [io 0x0067]
[ 1.169441] pnp 00:05: [io 0x0070]
[ 1.169446] pnp 00:05: [io 0x0080]
[ 1.169450] pnp 00:05: [io 0x0092]
[ 1.169454] pnp 00:05: [io 0x00b2-0x00b3]
[ 1.169459] pnp 00:05: [io 0x0680-0x069f]
[ 1.169464] pnp 00:05: [io 0x1000-0x100f]
[ 1.169468] pnp 00:05: [io 0xffff]
[ 1.169473] pnp 00:05: [io 0xffff]
[ 1.169477] pnp 00:05: [io 0x0400-0x047f]
[ 1.169482] pnp 00:05: [io 0x0500-0x057f]
[ 1.169491] pnp 00:05: [io 0x0600-0x061f]
[ 1.169594] system 00:05: [io 0x0680-0x069f] has been reserved
[ 1.169607] system 00:05: [io 0x1000-0x100f] has been reserved
[ 1.169618] system 00:05: [io 0xffff] has been reserved
[ 1.169628] system 00:05: [io 0xffff] has been reserved
[ 1.169637] system 00:05: [io 0x0400-0x047f] has been reserved
[ 1.169648] system 00:05: [io 0x0500-0x057f] has been reserved
[ 1.169658] system 00:05: [io 0x0600-0x061f] has been reserved
[ 1.169670] system 00:05: Plug and Play ACPI device, IDs PNP0c02 (active)
[ 1.169736] pnp 00:06: [io 0x06a0-0x06af]
[ 1.169742] pnp 00:06: [io 0x06b0-0x06ff]
[ 1.169831] system 00:06: [io 0x06a0-0x06af] has been reserved
[ 1.169843] system 00:06: [io 0x06b0-0x06ff] has been reserved
[ 1.169855] system 00:06: Plug and Play ACPI device, IDs PNP0c02 (active)
[ 1.169880] pnp 00:07: [io 0x0070-0x0077]
[ 1.169893] pnp 00:07: [irq 8]
[ 1.169956] pnp 00:07: Plug and Play ACPI device, IDs PNP0b00 (active)
[ 1.170326] pnp 00:08: [io 0x0378-0x037f]
[ 1.170339] pnp 00:08: [irq 7]
[ 1.170474] pnp 00:08: Plug and Play ACPI device, IDs PNP0400 (active)
[ 1.170837] pnp 00:09: [io 0x02f8-0x02ff]
[ 1.170849] pnp 00:09: [irq 3]
[ 1.171003] pnp 00:09: Plug and Play ACPI device, IDs PNP0501 (active)
[ 1.171287] pnp 00:0a: [io 0x03f8-0x03ff]
[ 1.171299] pnp 00:0a: [irq 4]
[ 1.171452] pnp 00:0a: Plug and Play ACPI device, IDs PNP0501 (active)
[ 1.171803] pnp 00:0b: [mem 0xfed1c000-0xfed1ffff]
[ 1.171809] pnp 00:0b: [mem 0x00000000-0x00003fff]
[ 1.171815] pnp 00:0b: [mem 0x00000000-0x00000fff]
[ 1.171824] pnp 00:0b: [mem 0x00000000-0x00000fff]
[ 1.171829] pnp 00:0b: [mem 0x00000000-0xffffffffffffffff disabled]
[ 1.171835] pnp 00:0b: [mem 0xfed45000-0xfed8ffff]
[ 1.171967] system 00:0b: [mem 0xfed1c000-0xfed1ffff] has been reserved
[ 1.171981] system 00:0b: [mem 0x00000000-0x00003fff] could not be reserved
[ 1.171993] system 00:0b: [mem 0x00000000-0x00000fff] could not be reserved
[ 1.172004] system 00:0b: [mem 0x00000000-0x00000fff] could not be reserved
[ 1.172015] system 00:0b: [mem 0xfed45000-0xfed8ffff] has been reserved
[ 1.172028] system 00:0b: Plug and Play ACPI device, IDs PNP0c02 (active)
[ 1.172343] pnp: PnP ACPI: found 12 devices
[ 1.172353] ACPI: ACPI bus type pnp unregistered
[ 1.182907] PCI: max bus depth: 1 pci_try_num: 2
[ 1.182975] pci 0000:00:1c.1: BAR 15: assigned [mem 0xd0900000-0xd0afffff 64bit pref]
[ 1.182994] pci 0000:00:1c.1: BAR 13: assigned [io 0x4000-0x4fff]
[ 1.183008] pci 0000:00:1c.0: BAR 15: assigned [mem 0xd0b00000-0xd0cfffff 64bit pref]
[ 1.183022] pci 0000:00:1c.0: PCI bridge to [bus 01-01]
[ 1.183032] pci 0000:00:1c.0: bridge window [io 0x2000-0x2fff]
[ 1.183046] pci 0000:00:1c.0: bridge window [mem 0xd0000000-0xd04fffff]
[ 1.183059] pci 0000:00:1c.0: bridge window [mem 0xd0b00000-0xd0cfffff 64bit pref]
[ 1.183076] pci 0000:00:1c.1: PCI bridge to [bus 02-02]
[ 1.183086] pci 0000:00:1c.1: bridge window [io 0x4000-0x4fff]
[ 1.183100] pci 0000:00:1c.1: bridge window [mem 0xd0500000-0xd05fffff]
[ 1.183113] pci 0000:00:1c.1: bridge window [mem 0xd0900000-0xd0afffff 64bit pref]
[ 1.183130] pci 0000:00:1e.0: PCI bridge to [bus 03-03]
[ 1.183182] pci 0000:00:1c.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 1.183198] pci 0000:00:1c.0: setting latency timer to 64
[ 1.183231] pci 0000:00:1c.1: PCI INT B -> GSI 17 (level, low) -> IRQ 17
[ 1.183244] pci 0000:00:1c.1: setting latency timer to 64
[ 1.183259] pci 0000:00:1e.0: setting latency timer to 64
[ 1.183267] pci_bus 0000:00: resource 4 [io 0x0000-0x0cf7]
[ 1.183272] pci_bus 0000:00: resource 5 [io 0x0d00-0xffff]
[ 1.183278] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff]
[ 1.183283] pci_bus 0000:00: resource 7 [mem 0x000c0000-0x000dffff]
[ 1.183289] pci_bus 0000:00: resource 8 [mem 0x000e0000-0x000effff]
[ 1.183294] pci_bus 0000:00: resource 9 [mem 0x000f0000-0x000fffff]
[ 1.183300] pci_bus 0000:00: resource 10 [mem 0xcf800000-0xcfffffff]
[ 1.183305] pci_bus 0000:00: resource 11 [mem 0xd0000000-0xfebfffff]
[ 1.183311] pci_bus 0000:00: resource 12 [mem 0xfed40000-0xfed44fff]
[ 1.183316] pci_bus 0000:01: resource 0 [io 0x2000-0x2fff]
[ 1.183322] pci_bus 0000:01: resource 1 [mem 0xd0000000-0xd04fffff]
[ 1.183328] pci_bus 0000:01: resource 2 [mem 0xd0b00000-0xd0cfffff 64bit pref]
[ 1.183334] pci_bus 0000:02: resource 0 [io 0x4000-0x4fff]
[ 1.183339] pci_bus 0000:02: resource 1 [mem 0xd0500000-0xd05fffff]
[ 1.183345] pci_bus 0000:02: resource 2 [mem 0xd0900000-0xd0afffff 64bit pref]
[ 1.183351] pci_bus 0000:03: resource 4 [io 0x0000-0x0cf7]
[ 1.183356] pci_bus 0000:03: resource 5 [io 0x0d00-0xffff]
[ 1.183362] pci_bus 0000:03: resource 6 [mem 0x000a0000-0x000bffff]
[ 1.183367] pci_bus 0000:03: resource 7 [mem 0x000c0000-0x000dffff]
[ 1.183373] pci_bus 0000:03: resource 8 [mem 0x000e0000-0x000effff]
[ 1.183378] pci_bus 0000:03: resource 9 [mem 0x000f0000-0x000fffff]
[ 1.183384] pci_bus 0000:03: resource 10 [mem 0xcf800000-0xcfffffff]
[ 1.183389] pci_bus 0000:03: resource 11 [mem 0xd0000000-0xfebfffff]
[ 1.183395] pci_bus 0000:03: resource 12 [mem 0xfed40000-0xfed44fff]
[ 1.183479] NET: Registered protocol family 2
[ 1.183783] IP route cache hash table entries: 131072 (order: 8, 1048576 bytes)
[ 1.186709] TCP established hash table entries: 524288 (order: 11, 8388608 bytes)
[ 1.192991] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
[ 1.193731] TCP: Hash tables configured (established 524288 bind 65536)
[ 1.193744] TCP reno registered
[ 1.193785] UDP hash table entries: 2048 (order: 4, 65536 bytes)
[ 1.193857] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes)
[ 1.194129] NET: Registered protocol family 1
[ 1.194176] pci 0000:00:02.0: Boot video device
[ 1.194230] pci 0000:00:1d.0: PCI INT A -> GSI 23 (level, low) -> IRQ 23
[ 1.194261] pci 0000:00:1d.0: PCI INT A disabled
[ 1.194291] pci 0000:00:1d.1: PCI INT B -> GSI 19 (level, low) -> IRQ 19
[ 1.194320] pci 0000:00:1d.1: PCI INT B disabled
[ 1.194348] pci 0000:00:1d.2: PCI INT C -> GSI 18 (level, low) -> IRQ 18
[ 1.194377] pci 0000:00:1d.2: PCI INT C disabled
[ 1.194396] pci 0000:00:1d.3: PCI INT D -> GSI 16 (level, low) -> IRQ 16
[ 1.194425] pci 0000:00:1d.3: PCI INT D disabled
[ 1.194445] pci 0000:00:1d.7: PCI INT A -> GSI 23 (level, low) -> IRQ 23
[ 1.212374] pci 0000:00:1d.7: PCI INT A disabled
[ 1.212419] PCI: CLS 64 bytes, default 64
[ 1.212424] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[ 1.212435] Placing 64MB software IO TLB between ffff8800cae95000 - ffff8800cee95000
[ 1.212446] software IO TLB at phys 0xcae95000 - 0xcee95000
[ 1.213463] audit: initializing netlink socket (disabled)
[ 1.213490] type=2000 audit(1377514903.648:1): initialized
[ 1.267569] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[ 1.300762] VFS: Disk quotas dquot_6.5.2
[ 1.300899] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 1.302173] fuse init (API version 7.17)
[ 1.302413] msgmni has been set to 7841
[ 1.303393] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[ 1.303481] io scheduler noop registered
[ 1.303493] io scheduler deadline registered
[ 1.303579] io scheduler cfq registered (default)
[ 1.303802] pcieport 0000:00:1c.0: setting latency timer to 64
[ 1.303878] pcieport 0000:00:1c.0: irq 40 for MSI/MSI-X
[ 1.303997] pcieport 0000:00:1c.1: setting latency timer to 64
[ 1.304060] pcieport 0000:00:1c.1: irq 41 for MSI/MSI-X
[ 1.304217] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[ 1.304325] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[ 1.304455] intel_idle: MWAIT substates: 0x3020220
[ 1.304459] intel_idle: does not run on family 6 model 54
[ 1.304638] input: Power Button as /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input0
[ 1.304658] ACPI: Power Button [PWRB]
[ 1.304766] input: Sleep Button as /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input1
[ 1.304782] ACPI: Sleep Button [SLPB]
[ 1.304886] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input2
[ 1.304901] ACPI: Power Button [PWRF]
[ 1.323464] ERST: Table is not found!
[ 1.323475] GHES: HEST is not enabled!
[ 1.323700] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
[ 1.344254] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 1.424596] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[ 1.502044] Freeing initrd memory: 13880k freed
[ 1.589016] 00:09: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[ 1.648474] 00:0a: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 1.692447] Linux agpgart interface v0.103
[ 1.696114] brd: module loaded
[ 1.698090] loop: module loaded
[ 1.698408] ahci 0000:00:1f.2: version 3.0
[ 1.698430] ahci 0000:00:1f.2: PCI INT B -> GSI 19 (level, low) -> IRQ 19
[ 1.698542] ahci 0000:00:1f.2: irq 42 for MSI/MSI-X
[ 1.698596] ahci: SSS flag set, parallel bus scan disabled
[ 1.698641] ahci 0000:00:1f.2: AHCI 0001.0100 32 slots 4 ports 3 Gbps 0x3 impl SATA mode
[ 1.698655] ahci 0000:00:1f.2: flags: 64bit ncq stag pm led clo pio slum part
[ 1.698670] ahci 0000:00:1f.2: setting latency timer to 64
[ 1.699758] scsi0 : ahci
[ 1.700036] scsi1 : ahci
[ 1.700217] scsi2 : ahci
[ 1.700392] scsi3 : ahci
[ 1.700519] ata1: SATA max UDMA/133 abar m1024@0xd0704000 port 0xd0704100 irq 42
[ 1.700534] ata2: SATA max UDMA/133 abar m1024@0xd0704000 port 0xd0704180 irq 42
[ 1.700545] ata3: DUMMY
[ 1.700551] ata4: DUMMY
[ 1.701483] Fixed MDIO Bus: probed
[ 1.701538] tun: Universal TUN/TAP device driver, 1.6
[ 1.701547] tun: (C) 1999-2004 Max Krasnyansky maxk@qualcomm.com
[ 1.701699] PPP generic driver version 2.4.2
[ 1.701973] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.702021] ehci_hcd 0000:00:1d.7: PCI INT A -> GSI 23 (level, low) -> IRQ 23
[ 1.702072] ehci_hcd 0000:00:1d.7: setting latency timer to 64
[ 1.702079] ehci_hcd 0000:00:1d.7: EHCI Host Controller
[ 1.702213] ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 1
[ 1.702264] ehci_hcd 0000:00:1d.7: using broken periodic workaround
[ 1.702287] ehci_hcd 0000:00:1d.7: debug port 1
[ 1.706181] ehci_hcd 0000:00:1d.7: cache line size of 64 is not supported
[ 1.706218] ehci_hcd 0000:00:1d.7: irq 23, io mem 0xd0704400
[ 1.719836] ehci_hcd 0000:00:1d.7: USB 2.0 started, EHCI 1.00
[ 1.720170] hub 1-0:1.0: USB hub found
[ 1.720186] hub 1-0:1.0: 8 ports detected
[ 1.720354] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.720395] uhci_hcd: USB Universal Host Controller Interface driver
[ 1.720443] uhci_hcd 0000:00:1d.0: PCI INT A -> GSI 23 (level, low) -> IRQ 23
[ 1.720464] uhci_hcd 0000:00:1d.0: setting latency timer to 64
[ 1.720471] uhci_hcd 0000:00:1d.0: UHCI Host Controller
[ 1.720612] uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2
[ 1.720661] uhci_hcd 0000:00:1d.0: irq 23, io base 0x000030a0
[ 1.720974] hub 2-0:1.0: USB hub found
[ 1.720990] hub 2-0:1.0: 2 ports detected
[ 1.721136] uhci_hcd 0000:00:1d.1: PCI INT B -> GSI 19 (level, low) -> IRQ 19
[ 1.721157] uhci_hcd 0000:00:1d.1: setting latency timer to 64
[ 1.721163] uhci_hcd 0000:00:1d.1: UHCI Host Controller
[ 1.721280] uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 3
[ 1.721346] uhci_hcd 0000:00:1d.1: irq 19, io base 0x00003080
[ 1.721657] hub 3-0:1.0: USB hub found
[ 1.721673] hub 3-0:1.0: 2 ports detected
[ 1.721812] uhci_hcd 0000:00:1d.2: PCI INT C -> GSI 18 (level, low) -> IRQ 18
[ 1.721833] uhci_hcd 0000:00:1d.2: setting latency timer to 64
[ 1.721839] uhci_hcd 0000:00:1d.2: UHCI Host Controller
[ 1.721958] uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 4
[ 1.722027] uhci_hcd 0000:00:1d.2: irq 18, io base 0x00003060
[ 1.722340] hub 4-0:1.0: USB hub found
[ 1.722355] hub 4-0:1.0: 2 ports detected
[ 1.722495] uhci_hcd 0000:00:1d.3: PCI INT D -> GSI 16 (level, low) -> IRQ 16
[ 1.722516] uhci_hcd 0000:00:1d.3: setting latency timer to 64
[ 1.722522] uhci_hcd 0000:00:1d.3: UHCI Host Controller
[ 1.722638] uhci_hcd 0000:00:1d.3: new USB bus registered, assigned bus number 5
[ 1.722702] uhci_hcd 0000:00:1d.3: irq 16, io base 0x00003040
[ 1.723013] hub 5-0:1.0: USB hub found
[ 1.723029] hub 5-0:1.0: 2 ports detected
[ 1.723290] usbcore: registered new interface driver libusual
[ 1.723391] i8042: PNP: No PS/2 controller found. Probing ports directly.
[ 1.726305] serio: i8042 KBD port at 0x60,0x64 irq 1
[ 1.726333] serio: i8042 AUX port at 0x60,0x64 irq 12
[ 1.726740] mousedev: PS/2 mouse device common for all mice
[ 1.727134] rtc_cmos 00:07: RTC can wake from S4
[ 1.727351] rtc_cmos 00:07: rtc core: registered rtc_cmos as rtc0
[ 1.727400] rtc0: alarms up to one month, y3k, 242 bytes nvram, hpet irqs
[ 1.727581] device-mapper: uevent: version 1.0.3
[ 1.727753] device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: dm-devel@redhat.com
[ 1.727776] cpuidle: using governor ladder
[ 1.727784] cpuidle: using governor menu
[ 1.727791] EFI Variables Facility v0.08 2004-May-17
[ 1.728343] TCP cubic registered
[ 1.728581] NET: Registered protocol family 10
[ 1.729664] NET: Registered protocol family 17
[ 1.729681] Registering the dns_resolver key type
[ 1.730001] PM: Hibernation image not present or could not be loaded.
[ 1.730026] registered taskstats version 1
[ 1.756829] Magic number: 9:94:25
[ 1.756997] rtc_cmos 00:07: setting system clock to 2013-08-26 11:01:45 UTC (1377514905)
[ 1.759086] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
[ 1.759098] EDD information not available.
[ 2.019548] ata1: SATA link down (SStatus 0 SControl 300)
[ 2.031530] usb 1-3: new high-speed USB device number 2 using ehci_hcd
[ 2.211343] Refined TSC clocksource calibration: 1866.732 MHz.
[ 2.211361] Switching to clocksource tsc
[ 2.279277] usb 1-4: new high-speed USB device number 3 using ehci_hcd
[ 2.339227] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[ 2.351022] ata2.00: ATA-8: ADATA SP300, 5.0.2d, max UDMA/133
[ 2.351033] ata2.00: 62533296 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[ 2.360821] ata2.00: configured for UDMA/133
[ 2.361075] scsi 1:0:0:0: Direct-Access ATA ADATA SP300 5.0. PQ: 0 ANSI: 5
[ 2.361434] sd 1:0:0:0: [sda] 62533296 512-byte logical blocks: (32.0 GB/29.8 GiB)
[ 2.361444] sd 1:0:0:0: Attached scsi generic sg0 type 0
[ 2.361735] sd 1:0:0:0: [sda] Write Protect is off
[ 2.361749] sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 2.361830] sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 2.362847] sda: sda1 sda2 < sda5 >
[ 2.363766] sd 1:0:0:0: [sda] Attached SCSI disk
[ 2.367447] Freeing unused kernel memory: 920k freed
[ 2.367939] Write protecting the kernel read-only data: 12288k
[ 2.381227] Freeing unused kernel memory: 1616k freed
[ 2.392168] Freeing unused kernel memory: 1200k freed
[ 2.432841] udevd[101]: starting version 175
[ 2.527084] usb 1-5: new high-speed USB device number 4 using ehci_hcd
[ 2.572319] e1000e: Intel(R) PRO/1000 Network Driver - 1.5.1-k
[ 2.572341] e1000e: Copyright(c) 1999 - 2011 Intel Corporation.
[ 2.572444] e1000e 0000:01:00.0: Disabling ASPM L0s L1
[ 2.572496] e1000e 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 2.572542] e1000e 0000:01:00.0: setting latency timer to 64
[ 2.572896] e1000e 0000:01:00.0: irq 43 for MSI/MSI-X
[ 2.572916] e1000e 0000:01:00.0: irq 44 for MSI/MSI-X
[ 2.572933] e1000e 0000:01:00.0: irq 45 for MSI/MSI-X
[ 2.621485] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 2.659903] hub 1-5:1.0: USB hub found
[ 2.660091] hub 1-5:1.0: 4 ports detected
[ 2.678884] e1000e 0000:01:00.0: eth0: (PCI Express:2.5GT/s:Width x1) 00:22:4d:86:89:ae
[ 2.678902] e1000e 0000:01:00.0: eth0: Intel(R) PRO/1000 Network Connection
[ 2.678925] e1000e 0000:01:00.0: eth0: MAC: 3, PHY: 8, PBA No: FFFFFF-0FF
[ 2.770786] usb 1-6: new high-speed USB device number 5 using ehci_hcd
[ 3.018562] usb 1-8: new high-speed USB device number 6 using ehci_hcd
[ 3.152863] hub 1-8:1.0: USB hub found
[ 3.152993] hub 1-8:1.0: 4 ports detected
[ 3.173550] Adding 4173820k swap on /dev/sda5. Priority:-1 extents:1 across:4173820k SS
[ 3.209065] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 3.229261] udevd[326]: starting version 175
[ 3.242535] usb 1-5.1: new low-speed USB device number 7 using ehci_hcd
[ 3.275790] lp: driver loaded but no devices found
[ 3.294487] coretemp coretemp.0: Unable to read TjMax from CPU 0
[ 3.294532] coretemp coretemp.0: Unable to read TjMax from CPU 2
[ 3.302992] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
[ 3.304409] w83627ehf: Found W83627DHG-P chip at 0x290
[ 3.429292] parport_pc 00:08: reported by Plug and Play ACPI
[ 3.429365] parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE]
[ 3.454301] usb 1-5.2: new full-speed USB device number 8 using ehci_hcd
[ 3.522671] lp0: using parport0 (interrupt-driven).
[ 3.643404] RPC: Registered named UNIX socket transport module.
[ 3.643414] RPC: Registered udp transport module.
[ 3.643419] RPC: Registered tcp transport module.
[ 3.643424] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 3.649025] WARNING: You are using an experimental version of the media stack.
[ 3.649031] As the driver is backported to an older kernel, it doesn't offer
[ 3.649035] enough quality for its usage in production.
[ 3.649038] Use it with care.
[ 3.649040] Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
[ 3.649044] 3f826b9 Merge branch 'media_tree/master' into latest
[ 3.649048] dfb9f94 [media] stk1160: Build as a module if SND is m and audio support is selected
[ 3.649054] 00f2be6 Merge branch 'cx24117' into latest
[ 3.650016] FS-Cache: Loaded
[ 3.654261] usb 1-5.3: new high-speed USB device number 9 using ehci_hcd
[ 3.678516] FS-Cache: Netfs 'nfs' registered for caching
[ 3.690201] SAA716x Budget 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[ 3.690222] SAA716x Budget 0000:02:00.0: setting latency timer to 64
[ 3.701938] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[ 3.841930] usb 1-5.4: new high-speed USB device number 10 using ehci_hcd
[ 3.981969] type=1400 audit(1377514907.724:2): apparmor="STATUS" operation="profile_load" name="/sbin/dhclient" pid=513 comm="apparmor_parser"
[ 3.983674] type=1400 audit(1377514907.724:3): apparmor="STATUS" operation="profile_load" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=513 comm="apparmor_parser"
[ 3.984602] type=1400 audit(1377514907.724:4): apparmor="STATUS" operation="profile_load" name="/usr/lib/connman/scripts/dhclient-script" pid=513 comm="apparmor_parser"
[ 4.055032] init: portmap-wait (statd) main process (410) killed by TERM signal
[ 4.141344] snd_hda_intel 0000:00:1b.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
[ 4.145792] snd_hda_intel 0000:00:1b.0: irq 46 for MSI/MSI-X
[ 4.145865] snd_hda_intel 0000:00:1b.0: setting latency timer to 64
[ 4.166017] init: statd-mounting main process (396) killed by TERM signal
[ 4.258870] hda_codec: ALC888-VD: BIOS auto-probing.
[ 4.263317] HDMI status: Codec=1 Pin=3 Presence_Detect=0 ELD_Valid=0
[ 4.268175] input: HDA Intel Front Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input3
[ 4.268192] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 4.268460] input: HDA Intel Rear Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input4
[ 4.268732] input: HDA Intel Front Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input5
[ 4.268973] input: HDA Intel Line-Out as /devices/pci0000:00/0000:00:1b.0/sound/card0/input6
[ 4.270186] input: HDA Intel HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input7
[ 4.514508] ppdev: user-space parallel port driver
[ 4.544289] usbcore: registered new interface driver usbserial
[ 4.544335] USB Serial support registered for generic
[ 4.549764] input: ABBAHOME as /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5.1/1-5.1:1.0/input/input8
[ 4.553463] generic-usb 0003:05D5:6782.0001: input,hidraw0: USB HID v1.10 Keyboard [ABBAHOME] on usb-0000:00:1d.7-5.1/input0
[ 4.565944] input: ABBAHOME as /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5.1/1-5.1:1.1/input/input9
[ 4.569905] generic-usb 0003:05D5:6782.0002: input,hidraw1: USB HID v1.10 Mouse [ABBAHOME] on usb-0000:00:1d.7-5.1/input1
[ 4.570104] usbcore: registered new interface driver usbhid
[ 4.570112] usbhid: USB HID core driver
[ 4.570420] usbcore: registered new interface driver usbserial_generic
[ 4.570428] usbserial: USB Serial Driver core
[ 4.571508] USB Serial support registered for pl2303
[ 4.571599] pl2303 1-5.2:1.0: pl2303 converter detected
[ 4.576259] usb 1-5.2: pl2303 converter now attached to ttyUSB0
[ 4.576417] usbcore: registered new interface driver pl2303
[ 4.576425] pl2303: Prolific PL2303 USB to serial adaptor driver
[ 6.851659] e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
[ 6.853015] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 7.346179] DVB: registering new adapter (SAA716x dvb adapter)
[ 7.347004] CX24117 frontend 0 attaching.
[ 7.353532] i2c i2c-1: cx24117: Attaching frontend 0
[ 7.376796] SAA716x Budget 0000:02:00.0: DVB: registering adapter 0 frontend 0 (Conexant CX24117/CX24132)...
[ 7.377305] DVB: registering new adapter (SAA716x dvb adapter)
[ 7.378156] CX24117 frontend 1 attaching.
[ 7.378183] i2c i2c-1: cx24117: Attaching frontend 1
[ 7.397883] SAA716x Budget 0000:02:00.0: DVB: registering adapter 1 frontend 0 (Conexant CX24117/CX24132)...
[ 7.398446] DVB: registering new adapter (SAA716x dvb adapter)
[ 7.399281] CX24117 frontend 2 attaching.
[ 7.399413] i2c i2c-0: cx24117: Attaching frontend 0
[ 7.419112] SAA716x Budget 0000:02:00.0: DVB: registering adapter 2 frontend 0 (Conexant CX24117/CX24132)...
[ 7.419607] DVB: registering new adapter (SAA716x dvb adapter)
[ 7.420424] CX24117 frontend 3 attaching.
[ 7.420445] i2c i2c-0: cx24117: Attaching frontend 1
[ 7.440139] SAA716x Budget 0000:02:00.0: DVB: registering adapter 3 frontend 0 (Conexant CX24117/CX24132)...
[ 7.586658] vesafb: mode is 640x480x32, linelength=2560, pages=0
[ 7.586664] vesafb: scrolling: redraw
[ 7.586670] vesafb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[ 7.586684] mtrr: type mismatch for cf800000,200000 old: write-back new: write-combining
[ 7.586692] mtrr: type mismatch for cf800000,100000 old: write-back new: write-combining
[ 7.586699] mtrr: type mismatch for cf800000,80000 old: write-back new: write-combining
[ 7.586706] mtrr: type mismatch for cf800000,40000 old: write-back new: write-combining
[ 7.586713] mtrr: type mismatch for cf800000,20000 old: write-back new: write-combining
[ 7.586719] mtrr: type mismatch for cf800000,10000 old: write-back new: write-combining
[ 7.586726] mtrr: type mismatch for cf800000,8000 old: write-back new: write-combining
[ 7.586733] mtrr: type mismatch for cf800000,4000 old: write-back new: write-combining
[ 7.586740] mtrr: type mismatch for cf800000,2000 old: write-back new: write-combining
[ 7.586747] mtrr: type mismatch for cf800000,1000 old: write-back new: write-combining
[ 7.587319] vesafb: framebuffer at 0xcf800000, mapped to 0xffffc90005a80000, using 1216k, total 1216k
[ 7.588483] Console: switching to colour frame buffer device 80x30
[ 7.591933] fb0: VESA VGA frame buffer device
[ 14.095032] init: failsafe main process (612) killed by TERM signal
[ 14.181276] type=1400 audit(1377514917.932:5): apparmor="STATUS" operation="profile_load" name="/usr/sbin/tcpdump" pid=1611 comm="apparmor_parser"
[ 14.182110] type=1400 audit(1377514917.932:6): apparmor="STATUS" operation="profile_replace" name="/sbin/dhclient" pid=1609 comm="apparmor_parser"
[ 14.183927] type=1400 audit(1377514917.936:7): apparmor="STATUS" operation="profile_replace" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=1609 comm="apparmor_parser"
[ 14.184650] type=1400 audit(1377514917.936:8): apparmor="STATUS" operation="profile_replace" name="/usr/lib/connman/scripts/dhclient-script" pid=1609 comm="apparmor_parser"
[ 14.614102] WARNING: You are using an experimental version of the media stack.
[ 14.614107] As the driver is backported to an older kernel, it doesn't offer
[ 14.614110] enough quality for its usage in production.
[ 14.614113] Use it with care.
[ 14.614115] Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
[ 14.614119] 3f826b9 Merge branch 'media_tree/master' into latest
[ 14.614123] dfb9f94 [media] stk1160: Build as a module if SND is m and audio support is selected
[ 14.614128] 00f2be6 Merge branch 'cx24117' into latest
[ 14.640385] usbcore: registered new interface driver dvb_usb_it913x
[ 14.640579] it913x: Chip Version=02 Chip Type=9135
[ 14.640908] it913x: Chip Version=02 Chip Type=9135
[ 14.641037] it913x: Firmware Version 52887808
[ 14.641396] it913x: Firmware Version 52887808
[ 14.641680] it913x: Chip Version=01 Chip Type=9135
[ 14.642430] it913x: Chip Version=02 Chip Type=9135
[ 14.642533] it913x: Firmware Version 204869120
[ 14.643012] it913x: Dual mode=0 Tuner Type=38
[ 14.643024] usb 1-6: dvb_usb_v2: found a 'ITE 9135 Generic' in warm state
[ 14.643184] usb 1-6: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[ 14.643716] it913x: Dual mode=0 Tuner Type=38
[ 14.643725] it913x: Unknown tuner ID applying default 0x60
[ 14.643736] usb 1-3: dvb_usb_v2: found a 'Avermedia A835B(2835)' in warm state
[ 14.643921] usb 1-3: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[ 14.644447] DVB: registering new adapter (Avermedia A835B(2835))
[ 14.645021] DVB: registering new adapter (ITE 9135 Generic)
[ 14.645147] it913x: Dual mode=0 Tuner Type=38
[ 14.645154] it913x: Unknown tuner ID applying default 0x60
[ 14.645164] usb 1-4: dvb_usb_v2: found a 'Avermedia A835B(2835)' in warm state
[ 14.645300] usb 1-4: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[ 14.645792] DVB: registering new adapter (Avermedia A835B(2835))
[ 14.646463] it913x: Firmware Version 52887808
[ 14.649891] it913x: Dual mode=0 Tuner Type=38
[ 14.649900] it913x: Unknown tuner ID applying default 0x60
[ 14.649910] usb 1-5.3: dvb_usb_v2: found a 'Avermedia A835B(2835)' in warm state
[ 14.650012] usb 1-5.3: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[ 14.650565] DVB: registering new adapter (Avermedia A835B(2835))
[ 14.661066] it913x-fe: ADF table value :00
[ 14.662845] it913x-fe: ADF table value :00
[ 14.665378] it913x-fe: Crystal Frequency :12000000 Adc Frequency :20250000 ADC X2: 01
[ 14.667004] it913x-fe: Crystal Frequency :12000000 Adc Frequency :20250000 ADC X2: 01
[ 14.669186] it913x-fe: ADF table value :00
[ 14.673237] it913x-fe: Crystal Frequency :12000000 Adc Frequency :20250000 ADC X2: 01
[ 14.683150] it913x-fe: ADF table value :00
[ 14.687095] it913x-fe: Crystal Frequency :12000000 Adc Frequency :20250000 ADC X2: 01
[ 14.701452] it913x-fe: Tuner LNA type :60
[ 14.707821] it913x-fe: Tuner LNA type :38
[ 14.708816] it913x-fe: Tuner LNA type :60
[ 14.722932] it913x-fe: Tuner LNA type :60
[ 14.761263] usb 1-6: DVB: registering adapter 5 frontend 0 (ITE 9135 Generic_1)...
[ 14.786660] Registered IR keymap rc-it913x-v1
[ 14.786887] input: ITE 9135 Generic as /devices/pci0000:00/0000:00:1d.7/usb1/1-6/rc/rc0/input10
[ 14.787088] rc0: ITE 9135 Generic as /devices/pci0000:00/0000:00:1d.7/usb1/1-6/rc/rc0
[ 14.787101] usb 1-6: dvb_usb_v2: schedule remote query interval to 250 msecs
[ 14.787113] usb 1-6: dvb_usb_v2: 'ITE 9135 Generic' successfully initialized and connected
[ 14.833066] usb 1-3: DVB: registering adapter 4 frontend 0 (Avermedia A835B(2835)_1)...
[ 14.833230] usb 1-3: dvb_usb_v2: 'Avermedia A835B(2835)' successfully initialized and connected
[ 14.841816] usb 1-5.3: DVB: registering adapter 7 frontend 0 (Avermedia A835B(2835)_1)...
[ 14.841981] usb 1-5.3: dvb_usb_v2: 'Avermedia A835B(2835)' successfully initialized and connected
[ 14.857790] usb 1-4: DVB: registering adapter 6 frontend 0 (Avermedia A835B(2835)_1)...
[ 14.857951] usb 1-4: dvb_usb_v2: 'Avermedia A835B(2835)' successfully initialized and connected
[ 17.487929] eth0: no IPv6 routers present

@ljalves
Copy link
Owner

ljalves commented Aug 26, 2013

Everything related to dvb looks good in dmesg.

Did you try to tune using a command line tool (like dvbtune or similar ?) or just trying in tvheadend?
What are the adapters 21, 22, 23 and 24?

@jendik
Copy link
Author

jendik commented Aug 26, 2013

No, I haven't yet... just tvheadend with different settings of adapters - signal monitoring yes/no, skip initial scan yes/no, etc... when I try to tune any channel tvheadend says testing->bad and no signal appears in status page.
All other settings like muxes, channels etc is the same like working TBS adapters settings and when I swtich to original drivers, it works with "original" adapters... strange, isn't it?

Have you got a hint for szap or similar command to test the signal/tunning from commandline please?

thx
j.

@jendik
Copy link
Author

jendik commented Aug 26, 2013

Just an idea..could there be an issue with TBS modified version of szap and scan-s2 that I have compiled and installed with original TBS drivers?

thx a lot
j.

@ljalves
Copy link
Owner

ljalves commented Aug 27, 2013

No, it should be unrelated to szap and scan-s2.

Are you using a native linux install or a virtual machine running linux?

@jendik
Copy link
Author

jendik commented Aug 27, 2013

I use native linux install - common Ubuntu server 12.04 LTS 64bit installed directly to SSD in Intel atom based PC, there is not any virtualization in place.

Could there be an issue with bad firmware loaded into the card? Which one should I use? Windows/linux firmware - I tried both - extracted acording to your howto - with the same result.

thx!
j.

@CJTalbot87
Copy link

Luis, as per your email I'm not running this in a virtual machine.

It's on dedicated hardware which is also running Ubuntu server 12.04 LTS 64bit; kernel is 3.5.

As you know I'm experiencing exactly the same issue as jendik when using the open source driver however the stock TBS works but with its own set of problems.

I feel that I have not done something right with the cx24117 install but have followed the instructions as per your Wiki.

cjtalbot@felton:~$ md5sum /lib/firmware/dvb-fe-cx24117.fw
96ae79acb8e51d90c90fa9759a1ce9df /lib/firmware/dvb-fe-cx24117.fw

cjtalbot@felton:~$ tail -n 200 /var/log/syslog | grep cx
Aug 28 00:36:21 felton kernel: [ 6.925053] i2c i2c-1: cx24117: Attaching frontend 0
Aug 28 00:36:21 felton kernel: [ 6.945819] i2c i2c-1: cx24117: Attaching frontend 1
Aug 28 00:36:21 felton kernel: [ 6.966025] i2c i2c-0: cx24117: Attaching frontend 0
Aug 28 00:36:21 felton kernel: [ 6.986106] i2c i2c-0: cx24117: Attaching frontend 1
Aug 28 00:38:49 felton kernel: [ 154.886220] i2c i2c-1: cx24117_load_firmware: FW version 9.1.10.0
Aug 28 00:38:49 felton kernel: [ 154.886231] i2c i2c-1: cx24117_firmware_ondemand: Firmware upload complete

Any Ideas?

Thanks Colin.

@ljalves
Copy link
Owner

ljalves commented Aug 28, 2013

Hi,

I only own one TBS6981 and the guy that does the testing for me on the TBS6984 is out on vacations.
As soon as I can contact him I'll try to figure out why he got it working.

I'm not sure if he changed the interrupt scheme of the saa716x, both of you can try changing that and see if it solve the issue.

Please try changing the int_type to MSI (the default is INT-A):

Example (for Ubuntu):
Create this file:
/etc/modprobe.d/options-dvb.conf

Place inside the file:
options saa716x_budget int_type=1

(reboot and test)

@jendik
Copy link
Author

jendik commented Aug 28, 2013

Hi,

thanks again...

I use similar settings for original TBS drivers as it solves some issues with crashing TVH, IRQs etc... It's option "saa716x_tbs-dvb int_type=1".

I will try your suggestion and let you know.

Thx
Kind regards
Jan

@ljalves
Copy link
Owner

ljalves commented Aug 30, 2013

Also, if that fails please try using the firmware extracted from the linux driver package (I had a report that the FW from windows driver was failing).
Also check that the firmware is correctly being loaded (it happens once when tuning 1 channel for the first time):
_i2c i2c-2: cx24117_load_firmware: FW version 1.44.95.2
i2c i2c-2: cx24117_firmware_ondemand: Firmware upload complete
_

@jendik
Copy link
Author

jendik commented Sep 3, 2013

tvh_cx_bad_signal
Hi,

I'm afraid, still no success-(( I'm not sure if it worked for Colin, but not for me...

thx a lot
take care
J.


dmesg |grep -i dvb
[ 7.188236] DVB: registering new adapter (SAA716x dvb adapter)
[ 7.218418] SAA716x Budget 0000:02:00.0: DVB: registering adapter 0 frontend 0 (Conexant CX24117/CX24132)...
[ 7.218950] DVB: registering new adapter (SAA716x dvb adapter)
[ 7.239142] SAA716x Budget 0000:02:00.0: DVB: registering adapter 1 frontend 0 (Conexant CX24117/CX24132)...
[ 7.239657] DVB: registering new adapter (SAA716x dvb adapter)
[ 7.260086] SAA716x Budget 0000:02:00.0: DVB: registering adapter 2 frontend 0 (Conexant CX24117/CX24132)...
[ 7.260690] DVB: registering new adapter (SAA716x dvb adapter)
[ 7.280769] SAA716x Budget 0000:02:00.0: DVB: registering adapter 3 frontend 0 (Conexant CX24117/CX24132)...
[ 14.404870] usbcore: registered new interface driver dvb_usb_it913x
[ 14.407196] usb 1-6: dvb_usb_v2: found a 'ITE 9135 Generic' in warm state
[ 14.407323] usb 1-6: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[ 14.407776] DVB: registering new adapter (ITE 9135 Generic)
[ 14.408507] usb 1-3: dvb_usb_v2: found a 'Avermedia A835B(2835)' in warm state
[ 14.408621] usb 1-3: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[ 14.409163] DVB: registering new adapter (Avermedia A835B(2835))
[ 14.410867] usb 1-4: dvb_usb_v2: found a 'Avermedia A835B(2835)' in warm state
[ 14.410988] usb 1-4: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[ 14.411510] DVB: registering new adapter (Avermedia A835B(2835))
[ 14.415812] usb 1-5.3: dvb_usb_v2: found a 'Avermedia A835B(2835)' in warm state
[ 14.415963] usb 1-5.3: dvb_usb_v2: will pass the complete MPEG2 transport stream to the software demuxer
[ 14.416602] DVB: registering new adapter (Avermedia A835B(2835))
[ 14.542530] usb 1-6: DVB: registering adapter 4 frontend 0 (ITE 9135 Generic_1)...
[ 14.569259] usb 1-6: dvb_usb_v2: schedule remote query interval to 250 msecs
[ 14.569271] usb 1-6: dvb_usb_v2: 'ITE 9135 Generic' successfully initialized and connected
[ 14.600109] usb 1-3: DVB: registering adapter 5 frontend 0 (Avermedia A835B(2835)_1)...
[ 14.600282] usb 1-3: dvb_usb_v2: 'Avermedia A835B(2835)' successfully initialized and connected
[ 14.604131] usb 1-4: DVB: registering adapter 6 frontend 0 (Avermedia A835B(2835)_1)...
[ 14.604281] usb 1-4: dvb_usb_v2: 'Avermedia A835B(2835)' successfully initialized and connected
[ 14.608541] usb 1-5.3: DVB: registering adapter 7 frontend 0 (Avermedia A835B(2835)_1)...
[ 14.608714] usb 1-5.3: dvb_usb_v2: 'Avermedia A835B(2835)' successfully initialized and connected


dmesg |grep -i cx
[ 3.638003] 00f2be6 Merge branch 'cx24117' into latest
[ 7.189082] CX24117 frontend 0 attaching.
[ 7.195407] i2c i2c-1: cx24117: Attaching frontend 0
[ 7.218418] SAA716x Budget 0000:02:00.0: DVB: registering adapter 0 frontend 0 (Conexant CX24117/CX24132)...
[ 7.219876] CX24117 frontend 1 attaching.
[ 7.219899] i2c i2c-1: cx24117: Attaching frontend 1
[ 7.239142] SAA716x Budget 0000:02:00.0: DVB: registering adapter 1 frontend 0 (Conexant CX24117/CX24132)...
[ 7.240787] CX24117 frontend 2 attaching.
[ 7.240916] i2c i2c-0: cx24117: Attaching frontend 0
[ 7.260086] SAA716x Budget 0000:02:00.0: DVB: registering adapter 2 frontend 0 (Conexant CX24117/CX24132)...
[ 7.261574] CX24117 frontend 3 attaching.
[ 7.261598] i2c i2c-0: cx24117: Attaching frontend 1
[ 7.280769] SAA716x Budget 0000:02:00.0: DVB: registering adapter 3 frontend 0 (Conexant CX24117/CX24132)...
[ 14.399859] 00f2be6 Merge branch 'cx24117' into latest
[ 32.234330] i2c i2c-1: cx24117_load_firmware: FW version 1.44.95.2
[ 32.234356] i2c i2c-1: cx24117_firmware_ondemand: Firmware upload complete


cat /etc/modprobe.d/tbs.conf
#original drivers
options saa716x_tbs-dvb int_type=1

#alternative drivers
options saa716x_budget int_type=1


md5sum /lib/firmware/dvb-fe-cx24117.fw
00bb54e462c84c71c052b1812a1c7190 /lib/firmware/dvb-fe-cx24117.fw

@ljalves
Copy link
Owner

ljalves commented Sep 3, 2013

I'll try to find out what could be wrong in the TBS6984 and give any news in here.
Thanks for testing and reporting.

@jendik
Copy link
Author

jendik commented Sep 3, 2013

It’s a commonplace...I thank you!

j.

@CJTalbot87
Copy link

Hi, sorry for the delay in getting back to you all.

I’m still experiencing the same problems as before, also I don’t seem to be getting the cx24117_load_firmware and cx24117_firmware_ondemand after changing the firmware as recommended.

ljalves pushed a commit that referenced this issue Sep 24, 2013
The way the page allocator interacts with kswapd creates aging imbalances,
where the amount of time a userspace page gets in memory under reclaim
pressure is dependent on which zone, which node the allocator took the
page frame from.

#1 fixes missed kswapd wakeups on NUMA systems, which lead to some
   nodes falling behind for a full reclaim cycle relative to the other
   nodes in the system

#3 fixes an interaction where kswapd and a continuous stream of page
   allocations keep the preferred zone of a task between the high and
   low watermark (allocations succeed + kswapd does not go to sleep)
   indefinitely, completely underutilizing the lower zones and
   thrashing on the preferred zone

These patches are the aging fairness part of the thrash-detection based
file LRU balancing.  Andrea recommended to submit them separately as they
are bugfixes in their own right.

The following test ran a foreground workload (memcachetest) with
background IO of various sizes on a 4 node 8G system (similar results were
observed with single-node 4G systems):

parallelio
                                               BAS                    FAIRALLO
                                              BASE                   FAIRALLOC
Ops memcachetest-0M              5170.00 (  0.00%)           5283.00 (  2.19%)
Ops memcachetest-791M            4740.00 (  0.00%)           5293.00 ( 11.67%)
Ops memcachetest-2639M           2551.00 (  0.00%)           4950.00 ( 94.04%)
Ops memcachetest-4487M           2606.00 (  0.00%)           3922.00 ( 50.50%)
Ops io-duration-0M                  0.00 (  0.00%)              0.00 (  0.00%)
Ops io-duration-791M               55.00 (  0.00%)             18.00 ( 67.27%)
Ops io-duration-2639M             235.00 (  0.00%)            103.00 ( 56.17%)
Ops io-duration-4487M             278.00 (  0.00%)            173.00 ( 37.77%)
Ops swaptotal-0M                    0.00 (  0.00%)              0.00 (  0.00%)
Ops swaptotal-791M             245184.00 (  0.00%)              0.00 (  0.00%)
Ops swaptotal-2639M            468069.00 (  0.00%)         108778.00 ( 76.76%)
Ops swaptotal-4487M            452529.00 (  0.00%)          76623.00 ( 83.07%)
Ops swapin-0M                       0.00 (  0.00%)              0.00 (  0.00%)
Ops swapin-791M                108297.00 (  0.00%)              0.00 (  0.00%)
Ops swapin-2639M               169537.00 (  0.00%)          50031.00 ( 70.49%)
Ops swapin-4487M               167435.00 (  0.00%)          34178.00 ( 79.59%)
Ops minorfaults-0M            1518666.00 (  0.00%)        1503993.00 (  0.97%)
Ops minorfaults-791M          1676963.00 (  0.00%)        1520115.00 (  9.35%)
Ops minorfaults-2639M         1606035.00 (  0.00%)        1799717.00 (-12.06%)
Ops minorfaults-4487M         1612118.00 (  0.00%)        1583825.00 (  1.76%)
Ops majorfaults-0M                  6.00 (  0.00%)              0.00 (  0.00%)
Ops majorfaults-791M            13836.00 (  0.00%)             10.00 ( 99.93%)
Ops majorfaults-2639M           22307.00 (  0.00%)           6490.00 ( 70.91%)
Ops majorfaults-4487M           21631.00 (  0.00%)           4380.00 ( 79.75%)

                 BAS    FAIRALLO
                BASE   FAIRALLOC
User          287.78      460.97
System       2151.67     3142.51
Elapsed      9737.00     8879.34

                                   BAS    FAIRALLO
                                  BASE   FAIRALLOC
Minor Faults                  53721925    57188551
Major Faults                    392195       15157
Swap Ins                       2994854      112770
Swap Outs                      4907092      134982
Direct pages scanned                 0       41824
Kswapd pages scanned          32975063     8128269
Kswapd pages reclaimed         6323069     7093495
Direct pages reclaimed               0       41824
Kswapd efficiency                  19%         87%
Kswapd velocity               3386.573     915.414
Direct efficiency                 100%        100%
Direct velocity                  0.000       4.710
Percentage direct scans             0%          0%
Zone normal velocity          2011.338     550.661
Zone dma32 velocity           1365.623     369.221
Zone dma velocity                9.612       0.242
Page writes by reclaim    18732404.000  614807.000
Page writes file              13825312      479825
Page writes anon               4907092      134982
Page reclaim immediate           85490        5647
Sector Reads                  12080532      483244
Sector Writes                 88740508    65438876
Page rescued immediate               0           0
Slabs scanned                    82560       12160
Direct inode steals                  0           0
Kswapd inode steals              24401       40013
Kswapd skipped wait                  0           0
THP fault alloc                      6           8
THP collapse alloc                5481        5812
THP splits                          75          22
THP fault fallback                   0           0
THP collapse fail                    0           0
Compaction stalls                    0          54
Compaction success                   0          45
Compaction failures                  0           9
Page migrate success            881492       82278
Page migrate failure                 0           0
Compaction pages isolated            0       60334
Compaction migrate scanned           0       53505
Compaction free scanned              0     1537605
Compaction cost                    914          86
NUMA PTE updates              46738231    41988419
NUMA hint faults              31175564    24213387
NUMA hint local faults        10427393     6411593
NUMA pages migrated             881492       55344
AutoNUMA cost                   156221      121361

The overall runtime was reduced, throughput for both the foreground
workload as well as the background IO improved, major faults, swapping and
reclaim activity shrunk significantly, reclaim efficiency more than
quadrupled.

This patch:

When the page allocator fails to get a page from all zones in its given
zonelist, it wakes up the per-node kswapds for all zones that are at their
low watermark.

However, with a system under load the free pages in a zone can fluctuate
enough that the allocation fails but the kswapd wakeup is also skipped
while the zone is still really close to the low watermark.

When one node misses a wakeup like this, it won't be aged before all the
other node's zones are down to their low watermarks again.  And skipping a
full aging cycle is an obvious fairness problem.

Kswapd runs until the high watermarks are restored, so it should also be
woken when the high watermarks are not met.  This ages nodes more equally
and creates a safety margin for the page counter fluctuation.

By using zone_balanced(), it will now check, in addition to the watermark,
if compaction requires more order-0 pages to create a higher order page.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Paul Bolle <paul.bollee@gmail.com>
Tested-by: Zlatko Calusic <zcalusic@bitsync.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ljalves pushed a commit that referenced this issue Sep 24, 2013
Gerlando Falauto reported that when HRTICK is enabled, it is
possible to trigger system deadlocks. These were hard to
reproduce, as HRTICK has been broken in the past, but seemed
to be connected to the timekeeping_seq lock.

Since seqlock/seqcount's aren't supported w/ lockdep, I added
some extra spinlock based locking and triggered the following
lockdep output:

[   15.849182] ntpd/4062 is trying to acquire lock:
[   15.849765]  (&(&pool->lock)->rlock){..-...}, at: [<ffffffff810aa9b5>] __queue_work+0x145/0x480
[   15.850051]
[   15.850051] but task is already holding lock:
[   15.850051]  (timekeeper_lock){-.-.-.}, at: [<ffffffff810df6df>] do_adjtimex+0x7f/0x100

<snip>

[   15.850051] Chain exists of: &(&pool->lock)->rlock --> &p->pi_lock --> timekeeper_lock
[   15.850051]  Possible unsafe locking scenario:
[   15.850051]
[   15.850051]        CPU0                    CPU1
[   15.850051]        ----                    ----
[   15.850051]   lock(timekeeper_lock);
[   15.850051]                                lock(&p->pi_lock);
[   15.850051] lock(timekeeper_lock);
[   15.850051] lock(&(&pool->lock)->rlock);
[   15.850051]
[   15.850051]  *** DEADLOCK ***

The deadlock was introduced by 06c017f ("timekeeping:
Hold timekeepering locks in do_adjtimex and hardpps") in 3.10

This patch avoids this deadlock, by moving the call to
schedule_delayed_work() outside of the timekeeper lock
critical section.

Reported-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Tested-by: Lin Ming <minggr@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: stable <stable@vger.kernel.org> #3.11, 3.10
Link: http://lkml.kernel.org/r/1378943457-27314-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
ljalves pushed a commit that referenced this issue Sep 24, 2013
Commit 05b016e "ARC: Setup Vector Table Base in early boot" moved
the Interrupt vector Table setup out of arc_init_IRQ() which is called
for all CPUs, to entry point of boot cpu only, breaking booting of others.

Fix by adding the same to entry point of non-boot CPUs too.

read_arc_build_cfg_regs() printing IVT Base Register didn't help the
casue since it prints a synthetic value if zero which is totally bogus,
so fix that to print the exact Register.

[vgupta: Remove the now stale comment from header of arc_init_IRQ and
also added the commentary for halt-on-reset]

Cc: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: Cc: <stable@vger.kernel.org> #3.11
Signed-off-by: Noam Camus <noamc@ezchip.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ljalves pushed a commit that referenced this issue Sep 24, 2013
Not all I/O ASIC versions have the free-running counter implemented, an
early revision used in the 5000/1xx models aka 3MIN and 4MIN did not have
it.  Therefore we cannot unconditionally use it as a clock source.
Fortunately if not implemented its register slot has a fixed value so it
is enough if we check for the value at the end of the calibration period
being the same as at the beginning.

This also means we need to look for another high-precision clock source on
the systems affected.  The 5000/1xx can have an R4000SC processor
installed where the CP0 Count register can be used as a clock source.
Unfortunately all the R4k DECstations suffer from the missed timer
interrupt on CP0 Count reads erratum, so we cannot use the CP0 timer as a
clock source and a clock event both at a time.  However we never need an
R4k clock event device because all DECstations have a DS1287A RTC chip
whose periodic interrupt can be used as a clock source.

This gives us the following four configuration possibilities for I/O ASIC
DECstations:

1. No I/O ASIC counter and no CP0 timer, e.g. R3k 5000/1xx (3MIN).

2. No I/O ASIC counter but the CP0 timer, i.e. R4k 5000/150 (4MIN).

3. The I/O ASIC counter but no CP0 timer, e.g. R3k 5000/240 (3MAX+).

4. The I/O ASIC counter and the CP0 timer, e.g. R4k 5000/260 (4MAX+).

For #1 and #2 this change stops the I/O ASIC free-running counter from
being installed as a clock source of a 0Hz frequency.  For #2 it also
arranges for the CP0 timer to be used as a clock source rather than a
clock event device, because having an accurate wall clock is more
important than a high-precision interval timer.  For #3 there is no
change.  For #4 the change makes the I/O ASIC free-running counter
installed as a clock source so that the CP0 timer can be used as a clock
event device.

Unfortunately the use of the CP0 timer as a clock event device relies on a
succesful completion of c0_compare_interrupt.  That never happens, because
while waiting for a CP0 Compare interrupt to happen the function spins in
a loop reading the CP0 Count register.  This makes the CP0 Count erratum
trigger reliably causing the interrupt waited for to be lost in all cases.
As a result #4 resorts to using the CP0 timer as a clock source as well,
just as #2.  However we want to keep this separate arrangement in case
(hope) c0_compare_interrupt is eventually rewritten such that it avoids
the erratum.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5825/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
ljalves pushed a commit that referenced this issue Sep 24, 2013
This driver must validate the availability of the HID output report and
its size before it can write LED states via buzz_set_leds(). This stops
a heap overflow that is possible if a device provides a malicious HID
output report:

[  108.171280] usb 1-1: New USB device found, idVendor=054c, idProduct=0002
...
[  117.507877] BUG kmalloc-192 (Not tainted): Redzone overwritten

CVE-2013-2890

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org #3.11
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
@jendik
Copy link
Author

jendik commented Oct 2, 2013

Hi Luis,

thanks a lot for your work... Is there please any progress with 6984 card please? Can I help you somehow?

thx
Kind regards
J.

@ljalves
Copy link
Owner

ljalves commented Oct 17, 2013

A minor update and some hope.
It seems that there are different hardware revisions of the card.
The user that has his card working is using a TBS6984 V14 (check lower right corner of the card).
For those who doesn't have signal with this driver, please post in here the card version please.
Thanks.

@CJTalbot87
Copy link

Hi Luis,

I'm running a v20 card, hope that helps.

Regards,
Colin.

@jendik
Copy link
Author

jendik commented Oct 31, 2013

Hi Luis,

thanks again... I tried latest build and still no success...

I've got v20 TBS 6984 card as well...

Thanks a lot
Take care
J.

ljalves pushed a commit that referenced this issue Dec 4, 2013
When parsing lines from objdump a line containing source code starting
with a numeric label is mistaken for a line of disassembly starting with
a memory address.

Current validation fails to recognise that the "memory address" is out
of range and calculates an invalid offset which later causes this
segfault:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000457315 in disasm__calc_percent (notes=0xc98970, evidx=0, offset=143705, end=2127526177, path=0x7fffffffbf50)
    at util/annotate.c:631
631				hits += h->addr[offset++];
(gdb) bt
 #0  0x0000000000457315 in disasm__calc_percent (notes=0xc98970, evidx=0, offset=143705, end=2127526177, path=0x7fffffffbf50)
    at util/annotate.c:631
 #1  0x00000000004d65e3 in annotate_browser__calc_percent (browser=0x7fffffffd130, evsel=0xa01da0) at ui/browsers/annotate.c:364
 #2  0x00000000004d7433 in annotate_browser__run (browser=0x7fffffffd130, evsel=0xa01da0, hbt=0x0) at ui/browsers/annotate.c:672
 #3  0x00000000004d80c9 in symbol__tui_annotate (sym=0xc989a0, map=0xa02660, evsel=0xa01da0, hbt=0x0) at ui/browsers/annotate.c:962
 #4  0x00000000004d7aa0 in hist_entry__tui_annotate (he=0xdf73f0, evsel=0xa01da0, hbt=0x0) at ui/browsers/annotate.c:823
 #5  0x00000000004dd648 in perf_evsel__hists_browse (evsel=0xa01da0, nr_events=1, helpline=
    0x58b768 "For a higher level overview, try: perf report --sort comm,dso", ev_name=0xa02cd0 "cycles", left_exits=false, hbt=
    0x0, min_pcnt=0, env=0xa011e0) at ui/browsers/hists.c:1659
 #6  0x00000000004de372 in perf_evlist__tui_browse_hists (evlist=0xa01520, help=
    0x58b768 "For a higher level overview, try: perf report --sort comm,dso", hbt=0x0, min_pcnt=0, env=0xa011e0)
    at ui/browsers/hists.c:1950
 #7  0x000000000042cf6b in __cmd_report (rep=0x7fffffffd6c0) at builtin-report.c:581
 #8  0x000000000042e25d in cmd_report (argc=0, argv=0x7fffffffe4b0, prefix=0x0) at builtin-report.c:965
 #9  0x000000000041a0e1 in run_builtin (p=0x801548, argc=1, argv=0x7fffffffe4b0) at perf.c:319
 #10 0x000000000041a319 in handle_internal_command (argc=1, argv=0x7fffffffe4b0) at perf.c:376
 #11 0x000000000041a465 in run_argv (argcp=0x7fffffffe38c, argv=0x7fffffffe380) at perf.c:420
 #12 0x000000000041a707 in main (argc=1, argv=0x7fffffffe4b0) at perf.c:521

After the fix is applied the symbol can be annotated showing the
problematic line "1:      rep"

copy_user_generic_string  /usr/lib/debug/lib/modules/3.9.10-100.fc17.x86_64/vmlinux
             */
            ENTRY(copy_user_generic_string)
                    CFI_STARTPROC
                    ASM_STAC
                    andl %edx,%edx
              and    %edx,%edx
                    jz 4f
              je     37
                    cmpl $8,%edx
              cmp    $0x8,%edx
                    jb 2f           /* less than 8 bytes, go to byte copy loop */
              jb     33
                    ALIGN_DESTINATION
              mov    %edi,%ecx
              and    $0x7,%ecx
              je     28
              sub    $0x8,%ecx
              neg    %ecx
              sub    %ecx,%edx
        1a:   mov    (%rsi),%al
              mov    %al,(%rdi)
              inc    %rsi
              inc    %rdi
              dec    %ecx
              jne    1a
                    movl %edx,%ecx
        28:   mov    %edx,%ecx
                    shrl $3,%ecx
              shr    $0x3,%ecx
                    andl $7,%edx
              and    $0x7,%edx
            1:      rep
100.00        rep    movsq %ds:(%rsi),%es:(%rdi)
                    movsq
            2:      movl %edx,%ecx
        33:   mov    %edx,%ecx
            3:      rep
              rep    movsb %ds:(%rsi),%es:(%rdi)
                    movsb
            4:      xorl %eax,%eax
        37:   xor    %eax,%eax
              data32 xchg %ax,%ax
                    ASM_CLAC
                    ret
              retq

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1379009721-27667-1-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
ljalves pushed a commit that referenced this issue Dec 4, 2013
There are four I2C interfaces on r8a7790, each of them can be connected to
one of the two respective I2C controllers, e.g. interface #0 can be
configured to work with I2C0 or with IIC0. Additionally some of those
interfaces can also use one of several pin sets. Interface #3 is special,
because it can be used in automatic mode for DVFS. It only has one set
of pins available and those pins cannot be used for anything else, they
also lack the GPIO function.

This patch uses the sh-pfc ability to configure pins, not associated with
GPIOs and adds support for I2C3 to the r8a7790 PFC set up.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
ljalves pushed a commit that referenced this issue Dec 4, 2013
As the new x86 CPU bootup printout format code maintainer, I am
taking immediate action to improve and clean (and thus indulge
my OCD) the reporting of the cores when coming up online.

Fix padding to a right-hand alignment, cleanup code and bind
reporting width to the max number of supported CPUs on the
system, like this:

 [    0.074509] smpboot: Booting Node   0, Processors:      #1  #2  #3  #4  #5  #6  #7 OK
 [    0.644008] smpboot: Booting Node   1, Processors:  #8  #9 #10 #11 #12 #13 #14 #15 OK
 [    1.245006] smpboot: Booting Node   2, Processors: #16 #17 #18 #19 #20 #21 #22 #23 OK
 [    1.864005] smpboot: Booting Node   3, Processors: #24 #25 #26 #27 #28 #29 #30 #31 OK
 [    2.489005] smpboot: Booting Node   4, Processors: #32 #33 #34 #35 #36 #37 #38 #39 OK
 [    3.093005] smpboot: Booting Node   5, Processors: #40 #41 #42 #43 #44 #45 #46 #47 OK
 [    3.698005] smpboot: Booting Node   6, Processors: #48 #49 #50 #51 #52 #53 #54 #55 OK
 [    4.304005] smpboot: Booting Node   7, Processors: #56 #57 #58 #59 #60 #61 #62 #63 OK
 [    4.961413] Brought up 64 CPUs

and this:

 [    0.072367] smpboot: Booting Node   0, Processors:    #1 #2 #3 #4 #5 #6 #7 OK
 [    0.686329] Brought up 8 CPUs

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Libin <huawei.libin@huawei.com>
Cc: wangyijing@huawei.com
Cc: fenghua.yu@intel.com
Cc: guohanjun@huawei.com
Cc: paul.gortmaker@windriver.com
Link: http://lkml.kernel.org/r/20130927143554.GF4422@pd.tnic
Signed-off-by: Ingo Molnar <mingo@kernel.org>
ljalves pushed a commit that referenced this issue Dec 4, 2013
Michael Semon reported that xfs/299 generated this lockdep warning:

=============================================
[ INFO: possible recursive locking detected ]
3.12.0-rc2+ #2 Not tainted
---------------------------------------------
touch/21072 is trying to acquire lock:
 (&xfs_dquot_other_class){+.+...}, at: [<c12902fb>] xfs_trans_dqlockedjoin+0x57/0x64

but task is already holding lock:
 (&xfs_dquot_other_class){+.+...}, at: [<c12902fb>] xfs_trans_dqlockedjoin+0x57/0x64

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&xfs_dquot_other_class);
  lock(&xfs_dquot_other_class);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

7 locks held by touch/21072:
 #0:  (sb_writers#10){++++.+}, at: [<c11185b6>] mnt_want_write+0x1e/0x3e
 #1:  (&type->i_mutex_dir_key#4){+.+.+.}, at: [<c11078ee>] do_last+0x245/0xe40
 #2:  (sb_internal#2){++++.+}, at: [<c122c9e0>] xfs_trans_alloc+0x1f/0x35
 #3:  (&(&ip->i_lock)->mr_lock/1){+.+...}, at: [<c126cd1b>] xfs_ilock+0x100/0x1f1
 #4:  (&(&ip->i_lock)->mr_lock){++++-.}, at: [<c126cf52>] xfs_ilock_nowait+0x105/0x22f
 #5:  (&dqp->q_qlock){+.+...}, at: [<c12902fb>] xfs_trans_dqlockedjoin+0x57/0x64
 #6:  (&xfs_dquot_other_class){+.+...}, at: [<c12902fb>] xfs_trans_dqlockedjoin+0x57/0x64

The lockdep annotation for dquot lock nesting only understands
locking for user and "other" dquots, not user, group and quota
dquots. Fix the annotations to match the locking heirarchy we now
have.

Reported-by: Michael L. Semon <mlsemon35@gmail.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
ljalves pushed a commit that referenced this issue Dec 4, 2013
Turn it into (for example):

[    0.073380] x86: Booting SMP configuration:
[    0.074005] .... node   #0, CPUs:          #1   #2   #3   #4   #5   #6   #7
[    0.603005] .... node   #1, CPUs:     #8   #9  #10  #11  #12  #13  #14  #15
[    1.200005] .... node   #2, CPUs:    #16  #17  #18  #19  #20  #21  #22  #23
[    1.796005] .... node   #3, CPUs:    #24  #25  #26  #27  #28  #29  #30  #31
[    2.393005] .... node   #4, CPUs:    #32  #33  #34  #35  #36  #37  #38  #39
[    2.996005] .... node   #5, CPUs:    #40  #41  #42  #43  #44  #45  #46  #47
[    3.600005] .... node   #6, CPUs:    #48  #49  #50  #51  #52  #53  #54  #55
[    4.202005] .... node   #7, CPUs:    #56  #57  #58  #59  #60  #61  #62  #63
[    4.811005] .... node   #8, CPUs:    #64  #65  #66  #67  #68  #69  #70  #71
[    5.421006] .... node   #9, CPUs:    #72  #73  #74  #75  #76  #77  #78  #79
[    6.032005] .... node  #10, CPUs:    #80  #81  #82  #83  #84  #85  #86  #87
[    6.648006] .... node  #11, CPUs:    #88  #89  #90  #91  #92  #93  #94  #95
[    7.262005] .... node  #12, CPUs:    #96  #97  #98  #99 #100 #101 #102 #103
[    7.865005] .... node  #13, CPUs:   #104 #105 #106 #107 #108 #109 #110 #111
[    8.466005] .... node  #14, CPUs:   #112 #113 #114 #115 #116 #117 #118 #119
[    9.073006] .... node  #15, CPUs:   #120 #121 #122 #123 #124 #125 #126 #127
[    9.679901] x86: Booted up 16 nodes, 128 CPUs

and drop useless elements.

Change num_digits() to hpa's division-avoiding, cell-phone-typed
version which he went at great lengths and pains to submit on a
Saturday evening.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: huawei.libin@huawei.com
Cc: wangyijing@huawei.com
Cc: fenghua.yu@intel.com
Cc: guohanjun@huawei.com
Cc: paul.gortmaker@windriver.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20130930095624.GB16383@pd.tnic
Signed-off-by: Ingo Molnar <mingo@kernel.org>
ljalves pushed a commit that referenced this issue Dec 4, 2013
The commit facd8b8
("irq: Sanitize invoke_softirq") converted irq exit
calls of do_softirq() to __do_softirq() on all architectures,
assuming it was only used there for its irq disablement
properties.

But as a side effect, the softirqs processed in the end
of the hardirq are always called on the inline current
stack that is used by irq_exit() instead of the softirq
stack provided by the archs that override do_softirq().

The result is mostly safe if the architecture runs irq_exit()
on a separate irq stack because then softirqs are processed
on that same stack that is near empty at this stage (assuming
hardirq aren't nesting).

Otherwise irq_exit() runs in the task stack and so does the softirq
too. The interrupted call stack can be randomly deep already and
the softirq can dig through it even further. To add insult to the
injury, this softirq can be interrupted by a new hardirq, maximizing
the chances for a stack overrun as reported in powerpc for example:

	do_IRQ: stack overflow: 1920
	CPU: 0 PID: 1602 Comm: qemu-system-ppc Not tainted 3.10.4-300.1.fc19.ppc64p7 #1
	Call Trace:
	[c0000000050a8740] .show_stack+0x130/0x200 (unreliable)
	[c0000000050a8810] .dump_stack+0x28/0x3c
	[c0000000050a8880] .do_IRQ+0x2b8/0x2c0
	[c0000000050a8930] hardware_interrupt_common+0x154/0x180
	--- Exception: 501 at .cp_start_xmit+0x3a4/0x820 [8139cp]
		LR = .cp_start_xmit+0x390/0x820 [8139cp]
	[c0000000050a8d40] .dev_hard_start_xmit+0x394/0x640
	[c0000000050a8e00] .sch_direct_xmit+0x110/0x260
	[c0000000050a8ea0] .dev_queue_xmit+0x260/0x630
	[c0000000050a8f40] .br_dev_queue_push_xmit+0xc4/0x130 [bridge]
	[c0000000050a8fc0] .br_dev_xmit+0x198/0x270 [bridge]
	[c0000000050a9070] .dev_hard_start_xmit+0x394/0x640
	[c0000000050a9130] .dev_queue_xmit+0x428/0x630
	[c0000000050a91d0] .ip_finish_output+0x2a4/0x550
	[c0000000050a9290] .ip_local_out+0x50/0x70
	[c0000000050a9310] .ip_queue_xmit+0x148/0x420
	[c0000000050a93b0] .tcp_transmit_skb+0x4e4/0xaf0
	[c0000000050a94a0] .__tcp_ack_snd_check+0x7c/0xf0
	[c0000000050a9520] .tcp_rcv_established+0x1e8/0x930
	[c0000000050a95f0] .tcp_v4_do_rcv+0x21c/0x570
	[c0000000050a96c0] .tcp_v4_rcv+0x734/0x930
	[c0000000050a97a0] .ip_local_deliver_finish+0x184/0x360
	[c0000000050a9840] .ip_rcv_finish+0x148/0x400
	[c0000000050a98d0] .__netif_receive_skb_core+0x4f8/0xb00
	[c0000000050a99d0] .netif_receive_skb+0x44/0x110
	[c0000000050a9a70] .br_handle_frame_finish+0x2bc/0x3f0 [bridge]
	[c0000000050a9b20] .br_nf_pre_routing_finish+0x2ac/0x420 [bridge]
	[c0000000050a9bd0] .br_nf_pre_routing+0x4dc/0x7d0 [bridge]
	[c0000000050a9c70] .nf_iterate+0x114/0x130
	[c0000000050a9d30] .nf_hook_slow+0xb4/0x1e0
	[c0000000050a9e00] .br_handle_frame+0x290/0x330 [bridge]
	[c0000000050a9ea0] .__netif_receive_skb_core+0x34c/0xb00
	[c0000000050a9fa0] .netif_receive_skb+0x44/0x110
	[c0000000050aa040] .napi_gro_receive+0xe8/0x120
	[c0000000050aa0c0] .cp_rx_poll+0x31c/0x590 [8139cp]
	[c0000000050aa1d0] .net_rx_action+0x1dc/0x310
	[c0000000050aa2b0] .__do_softirq+0x158/0x330
	[c0000000050aa3b0] .irq_exit+0xc8/0x110
	[c0000000050aa430] .do_IRQ+0xdc/0x2c0
	[c0000000050aa4e0] hardware_interrupt_common+0x154/0x180
	 --- Exception: 501 at .bad_range+0x1c/0x110
		 LR = .get_page_from_freelist+0x908/0xbb0
	[c0000000050aa7d0] .list_del+0x18/0x50 (unreliable)
	[c0000000050aa850] .get_page_from_freelist+0x908/0xbb0
	[c0000000050aa9e0] .__alloc_pages_nodemask+0x21c/0xae0
	[c0000000050aaba0] .alloc_pages_vma+0xd0/0x210
	[c0000000050aac60] .handle_pte_fault+0x814/0xb70
	[c0000000050aad50] .__get_user_pages+0x1a4/0x640
	[c0000000050aae60] .get_user_pages_fast+0xec/0x160
	[c0000000050aaf10] .__gfn_to_pfn_memslot+0x3b0/0x430 [kvm]
	[c0000000050aafd0] .kvmppc_gfn_to_pfn+0x64/0x130 [kvm]
	[c0000000050ab070] .kvmppc_mmu_map_page+0x94/0x530 [kvm]
	[c0000000050ab190] .kvmppc_handle_pagefault+0x174/0x610 [kvm]
	[c0000000050ab270] .kvmppc_handle_exit_pr+0x464/0x9b0 [kvm]
	[c0000000050ab320]  kvm_start_lightweight+0x1ec/0x1fc [kvm]
	[c0000000050ab4f0] .kvmppc_vcpu_run_pr+0x168/0x3b0 [kvm]
	[c0000000050ab9c0] .kvmppc_vcpu_run+0xc8/0xf0 [kvm]
	[c0000000050aba50] .kvm_arch_vcpu_ioctl_run+0x5c/0x1a0 [kvm]
	[c0000000050abae0] .kvm_vcpu_ioctl+0x478/0x730 [kvm]
	[c0000000050abc90] .do_vfs_ioctl+0x4ec/0x7c0
	[c0000000050abd80] .SyS_ioctl+0xd4/0xf0
	[c0000000050abe30] syscall_exit+0x0/0x98

Since this is a regression, this patch proposes a minimalistic
and low-risk solution by blindly forcing the hardirq exit processing of
softirqs on the softirq stack. This way we should reduce significantly
the opportunities for task stack overflow dug by softirqs.

Longer term solutions may involve extending the hardirq stack coverage to
irq_exit(), etc...

Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: #3.9.. <stable@vger.kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@au1.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Mackerras <paulus@au1.ibm.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: James E.J. Bottomley <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Dec 10, 2021
There are cases that the TSC clocksource is wrongly judged as unstable by
the clocksource watchdog mechanism which tries to validate the TSC against
HPET, PM_TIMER or jiffies. While there is hardly a general reliable way to
check the validity of a watchdog, Thomas Gleixner proposed [1]:

"I'm inclined to lift that requirement when the CPU has:

    1) X86_FEATURE_CONSTANT_TSC
    2) X86_FEATURE_NONSTOP_TSC
    3) X86_FEATURE_NONSTOP_TSC_S3
    4) X86_FEATURE_TSC_ADJUST
    5) At max. 4 sockets

 After two decades of horrors we're finally at a point where TSC seems
 to be halfway reliable and less abused by BIOS tinkerers. TSC_ADJUST
 was really key as we can now detect even small modifications reliably
 and the important point is that we can cure them as well (not pretty
 but better than all other options)."

As feature ljalves#3 X86_FEATURE_NONSTOP_TSC_S3 only exists on several generations
of Atom processorz, and is always coupled with X86_FEATURE_CONSTANT_TSC
and X86_FEATURE_NONSTOP_TSC, skip checking it, and also be more defensive
to use maximal 2 sockets.

The check is done inside tsc_init() before registering 'tsc-early' and
'tsc' clocksources, as there were cases that both of them had been
wrongly judged as unreliable.

For more background of tsc/watchdog, there is a good summary in [2]

[tglx} Update vs. jiffies:

  On systems where the only remaining clocksource aside of TSC is jiffies
  there is no way to make this work because that creates a circular
  dependency. Jiffies accuracy depends on not missing a periodic timer
  interrupt, which is not guaranteed. That could be detected by TSC, but as
  TSC is not trusted this cannot be compensated. The consequence is a
  circulus vitiosus which results in shutting down TSC and falling back to
  the jiffies clocksource which is even more unreliable.

[1]. https://lore.kernel.org/lkml/87eekfk8bd.fsf@nanos.tec.linutronix.de/
[2]. https://lore.kernel.org/lkml/87a6pimt1f.ffs@nanos.tec.linutronix.de/

[ tglx: Refine comment and amend changelog ]

Fixes: 6e3cd95 ("x86/hpet: Use another crystalball to evaluate HPET usability")
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "Paul E. McKenney" <paulmck@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20211117023751.24190-2-feng.tang@intel.com
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Dec 10, 2021
When branch target identifiers are in use, code reachable via an
indirect branch requires a BTI landing pad at the branch target site.

When building FTRACE_WITH_REGS atop patchable-function-entry, we miss
BTIs at the start start of the `ftrace_caller` and `ftrace_regs_caller`
trampolines, and when these are called from a module via a PLT (which
will use a `BR X16`), we will encounter a BTI failure, e.g.

| # insmod lkdtm.ko
| lkdtm: No crash points registered, enable through debugfs
| # echo function_graph > /sys/kernel/debug/tracing/current_tracer
| # cat /sys/kernel/debug/provoke-crash/DIRECT
| Unhandled 64-bit el1h sync exception on CPU0, ESR 0x34000001 -- BTI
| CPU: 0 PID: 174 Comm: cat Not tainted 5.16.0-rc2-dirty ljalves#3
| Hardware name: linux,dummy-virt (DT)
| pstate: 60400405 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=jc)
| pc : ftrace_caller+0x0/0x3c
| lr : lkdtm_debugfs_open+0xc/0x20 [lkdtm]
| sp : ffff800012e43b00
| x29: ffff800012e43b00 x28: 0000000000000000 x27: ffff800012e43c88
| x26: 0000000000000000 x25: 0000000000000000 x24: ffff0000c171f200
| x23: ffff0000c27b1e00 x22: ffff0000c2265240 x21: ffff0000c23c8c30
| x20: ffff8000090ba380 x19: 0000000000000000 x18: 0000000000000000
| x17: 0000000000000000 x16: ffff80001002bb4c x15: 0000000000000000
| x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000900ff0
| x11: ffff0000c4166310 x10: ffff800012e43b00 x9 : ffff8000104f2384
| x8 : 0000000000000001 x7 : 0000000000000000 x6 : 000000000000003f
| x5 : 0000000000000040 x4 : ffff800012e43af0 x3 : 0000000000000001
| x2 : ffff8000090b0000 x1 : ffff0000c171f200 x0 : ffff0000c23c8c30
| Kernel panic - not syncing: Unhandled exception
| CPU: 0 PID: 174 Comm: cat Not tainted 5.16.0-rc2-dirty ljalves#3
| Hardware name: linux,dummy-virt (DT)
| Call trace:
|  dump_backtrace+0x0/0x1a4
|  show_stack+0x24/0x30
|  dump_stack_lvl+0x68/0x84
|  dump_stack+0x1c/0x38
|  panic+0x168/0x360
|  arm64_exit_nmi.isra.0+0x0/0x80
|  el1h_64_sync_handler+0x68/0xd4
|  el1h_64_sync+0x78/0x7c
|  ftrace_caller+0x0/0x3c
|  do_dentry_open+0x134/0x3b0
|  vfs_open+0x38/0x44
|  path_openat+0x89c/0xe40
|  do_filp_open+0x8c/0x13c
|  do_sys_openat2+0xbc/0x174
|  __arm64_sys_openat+0x6c/0xbc
|  invoke_syscall+0x50/0x120
|  el0_svc_common.constprop.0+0xdc/0x100
|  do_el0_svc+0x84/0xa0
|  el0_svc+0x28/0x80
|  el0t_64_sync_handler+0xa8/0x130
|  el0t_64_sync+0x1a0/0x1a4
| SMP: stopping secondary CPUs
| Kernel Offset: disabled
| CPU features: 0x0,00000f42,da660c5f
| Memory Limit: none
| ---[ end Kernel panic - not syncing: Unhandled exception ]---

Fix this by adding the required `BTI C`, as we only require these to be
reachable via BL for direct calls or BR X16/X17 for PLTs. For now, these
are open-coded in the function prologue, matching the style of the
`__hwasan_tag_mismatch` trampoline.

In future we may wish to consider adding a new SYM_CODE_START_*()
variant which has an implicit BTI.

When ftrace is built atop mcount, the trampolines are marked with
SYM_FUNC_START(), and so get an implicit BTI. We may need to change
these over to SYM_CODE_START() in future for RELIABLE_STACKTRACE, in
case we need to apply special care aroud the return address being
rewritten.

Fixes: 97fed77 ("arm64: bti: Provide Kconfig for kernel mode BTI")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211129135709.2274019-1-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Mar 16, 2022
Change the cifs filesystem to take account of the changes to fscache's
indexing rewrite and reenable caching in cifs.

The following changes have been made:

 (1) The fscache_netfs struct is no more, and there's no need to register
     the filesystem as a whole.

 (2) The session cookie is now an fscache_volume cookie, allocated with
     fscache_acquire_volume().  That takes three parameters: a string
     representing the "volume" in the index, a string naming the cache to
     use (or NULL) and a u64 that conveys coherency metadata for the
     volume.

     For cifs, I've made it render the volume name string as:

	"cifs,<ipaddress>,<sharename>"

     where the sharename has '/' characters replaced with ';'.

     This probably needs rethinking a bit as the total name could exceed
     the maximum filename component length.

     Further, the coherency data is currently just set to 0.  It needs
     something else doing with it - I wonder if it would suffice simply to
     sum the resource_id, vol_create_time and vol_serial_number or maybe
     hash them.

 (3) The fscache_cookie_def is no more and needed information is passed
     directly to fscache_acquire_cookie().  The cache no longer calls back
     into the filesystem, but rather metadata changes are indicated at
     other times.

     fscache_acquire_cookie() is passed the same keying and coherency
     information as before.

 (4) The functions to set/reset cookies are removed and
     fscache_use_cookie() and fscache_unuse_cookie() are used instead.

     fscache_use_cookie() is passed a flag to indicate if the cookie is
     opened for writing.  fscache_unuse_cookie() is passed updates for the
     metadata if we changed it (ie. if the file was opened for writing).

     These are called when the file is opened or closed.

 (5) cifs_setattr_*() are made to call fscache_resize() to change the size
     of the cache object.

 (6) The functions to read and write data are stubbed out pending a
     conversion to use netfslib.

Changes
=======
ver ljalves#8:
 - Abstract cache invalidation into a helper function.
 - Fix some checkpatch warnings[3].

ver ljalves#7:
 - Removed the accidentally added-back call to get the super cookie in
   cifs_root_iget().
 - Fixed the right call to cifs_fscache_get_super_cookie() to take account
   of the "-o fsc" mount flag.

ver ljalves#6:
 - Moved the change of gfpflags_allow_blocking() to current_is_kswapd() for
   cifs here.
 - Fixed one of the error paths in cifs_atomic_open() to jump around the
   call to use the cookie.
 - Fixed an additional successful return in the middle of cifs_open() to
   use the cookie on the way out.
 - Only get a volume cookie (and thus inode cookies) when "-o fsc" is
   supplied to mount.

ver ljalves#5:
 - Fixed a couple of bits of cookie handling[2]:
   - The cookie should be released in cifs_evict_inode(), not
     cifsFileInfo_put_final().  The cookie needs to persist beyond file
     closure so that writepages will be able to write to it.
   - fscache_use_cookie() needs to be called in cifs_atomic_open() as it is
     for cifs_open().

ver ljalves#4:
 - Fixed the use of sizeof with memset.
 - tcon->vol_create_time is __le64 so doesn't need cpu_to_le64().

ver ljalves#3:
 - Canonicalise the cifs coherency data to make the cache portable.
 - Set volume coherency data.

ver ljalves#2:
 - Use gfpflags_allow_blocking() rather than using flag directly.
 - Upgraded to -rc4 to allow for upstream changes[1].
 - fscache_acquire_volume() now returns errors.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Jeff Layton <jlayton@kernel.org>
cc: Steve French <smfrench@gmail.com>
cc: Shyam Prasad N <nspmangalore@gmail.com>
cc: linux-cifs@vger.kernel.org
cc: linux-cachefs@redhat.com
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=23b55d673d7527b093cd97b7c217c82e70cd1af0 [1]
Link: https://lore.kernel.org/r/3419813.1641592362@warthog.procyon.org.uk/ [2]
Link: https://lore.kernel.org/r/CAH2r5muTanw9pJqzAHd01d9A8keeChkzGsCEH6=0rHutVLAF-A@mail.gmail.com/ [3]
Link: https://lore.kernel.org/r/163819671009.215744.11230627184193298714.stgit@warthog.procyon.org.uk/ # v1
Link: https://lore.kernel.org/r/163906982979.143852.10672081929614953210.stgit@warthog.procyon.org.uk/ # v2
Link: https://lore.kernel.org/r/163967187187.1823006.247415138444991444.stgit@warthog.procyon.org.uk/ # v3
Link: https://lore.kernel.org/r/164021579335.640689.2681324337038770579.stgit@warthog.procyon.org.uk/ # v4
Link: https://lore.kernel.org/r/3462849.1641593783@warthog.procyon.org.uk/ # v5
Link: https://lore.kernel.org/r/1318953.1642024578@warthog.procyon.org.uk/ # v6
Signed-off-by: Steve French <stfrench@microsoft.com>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Apr 8, 2022
Only an EDID CEA extension has byte ljalves#3, while the CTA DisplayID Data
Block does not. Don't interpret bogus data for color formats.

For most displays it's probably an unlikely scenario you'd have a CTA
DisplayID Data Block without a CEA extension, but they do exist.

Fixes: e28ad54 ("drm/edid: parse CEA blocks embedded in DisplayID")
Cc: <stable@vger.kernel.org>
Cc: Shawn C Lee <shawn.c.lee@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220323100438.1757295-1-jani.nikula@intel.com
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Apr 8, 2022
Pull drm fixes from Dave Airlie:
 "Some fixes were queued up in and in light of the fbdev regressions,
  I've pulled those in as well.

  core:
   - Make audio and color plane support checking only happen when a CEA
     extension block is found.
   - Small selftest fix.

  fbdev:
   - two regressions fixes from speedup patches.

  ttm:
   - Fix a small regression from ttm_resource_fini()

  i915:
   - Reject unsupported TMDS rates on ICL+
   - Treat SAGV block time 0 as SAGV disabled
   - Fix PSF GV point mask when SAGV is not possible
   - Fix renamed INTEL_INFO->media.arch/ver field"

* tag 'drm-next-2022-03-25' of git://anongit.freedesktop.org/drm/drm:
  fbdev: Fix cfb_imageblit() for arbitrary image widths
  fbdev: Fix sys_imageblit() for arbitrary image widths
  drm/edid: fix CEA extension byte ljalves#3 parsing
  drm/edid: check basic audio support on CEA extension block
  drm/i915: Fix renamed struct field
  drm/i915: Fix PSF GV point mask when SAGV is not possible
  drm/i915: Treat SAGV block time 0 as SAGV disabled
  drm/i915: Reject unsupported TMDS rates on ICL+
  drm/selftest: plane_helper: Put test structures in static storage
  drm/ttm: Fix a kernel oops due to an invalid read
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Apr 8, 2022
The io-specific memcpy/memset functions use string mmio accesses to do
their work. Under SEV, the hypervisor can't emulate these instructions
because they read/write directly from/to encrypted memory.

KVM will inject a page fault exception into the guest when it is asked
to emulate string mmio instructions for an SEV guest:

  BUG: unable to handle page fault for address: ffffc90000065068
  #PF: supervisor read access in kernel mode
  #PF: error_code(0x0000) - not-present page
  PGD 8000100000067 P4D 8000100000067 PUD 80001000fb067 PMD 80001000fc067 PTE 80000000fed40173
  Oops: 0000 [ljalves#1] PREEMPT SMP NOPTI
  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.17.0-rc7 ljalves#3

As string mmio for an SEV guest can not be supported by the
hypervisor, unroll the instructions for CC_ATTR_GUEST_UNROLL_STRING_IO
enabled kernels.

This issue appears when kernels are launched in recent libvirt-managed
SEV virtual machines, because virt-install started to add a tpm-crb
device to the guest by default and proactively because, raisins:

  virt-manager/virt-manager@eb58c09

and as that commit says, the default adding of a TPM can be disabled
with "virt-install ... --tpm none".

The kernel driver for tpm-crb uses memcpy_to/from_io() functions to
access MMIO memory, resulting in a page-fault injected by KVM and
crashing the kernel at boot.

  [ bp: Massage and extend commit message. ]

Fixes: d8aa7ee ('x86/mm: Add Secure Encrypted Virtualization (SEV) support')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220321093351.23976-1-joro@8bytes.org
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Apr 8, 2022
We've got a mess on our hands.

1. xfs_trans_commit() cannot cancel transactions because the mount is
shut down - that causes dirty, aborted, unlogged log items to sit
unpinned in memory and potentially get written to disk before the
log is shut down. Hence xfs_trans_commit() can only abort
transactions when xlog_is_shutdown() is true.

2. xfs_force_shutdown() is used in places to cause the current
modification to be aborted via xfs_trans_commit() because it may be
impractical or impossible to cancel the transaction directly, and
hence xfs_trans_commit() must cancel transactions when
xfs_is_shutdown() is true in this situation. But we can't do that
because of ljalves#1.

3. Log IO errors cause log shutdowns by calling xfs_force_shutdown()
to shut down the mount and then the log from log IO completion.

4. xfs_force_shutdown() can result in a log force being issued,
which has to wait for log IO completion before it will mark the log
as shut down. If ljalves#3 races with some other shutdown trigger that runs
a log force, we rely on xfs_force_shutdown() silently ignoring ljalves#3
and avoiding shutting down the log until the failed log force
completes.

5. To ensure ljalves#2 always works, we have to ensure that
xfs_force_shutdown() does not return until the the log is shut down.
But in the case of ljalves#4, this will result in a deadlock because the
log Io completion will block waiting for a log force to complete
which is blocked waiting for log IO to complete....

So the very first thing we have to do here to untangle this mess is
dissociate log shutdown triggers from mount shutdowns. We already
have xlog_forced_shutdown, which will atomically transistion to the
log a shutdown state. Due to internal asserts it cannot be called
multiple times, but was done simply because the only place that
could call it was xfs_do_force_shutdown() (i.e. the mount shutdown!)
and that could only call it once and once only.  So the first thing
we do is remove the asserts.

We then convert all the internal log shutdown triggers to call
xlog_force_shutdown() directly instead of xfs_force_shutdown(). This
allows the log shutdown triggers to shut down the log without
needing to care about mount based shutdown constraints. This means
we shut down the log independently of the mount and the mount may
not notice this until it's next attempt to read or modify metadata.
At that point (e.g. xfs_trans_commit()) it will see that the log is
shutdown, error out and shutdown the mount.

To ensure that all the unmount behaviours and asserts track
correctly as a result of a log shutdown, propagate the shutdown up
to the mount if it is not already set. This keeps the mount and log
state in sync, and saves a huge amount of hassle where code fails
because of a log shutdown but only checks for mount shutdowns and
hence ends up doing the wrong thing. Cleaning up that mess is
an exercise for another day.

This enables us to address the other problems noted above in
followup patches.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Apr 8, 2022
As guest_irq is coming from KVM_IRQFD API call, it may trigger
crash in svm_update_pi_irte() due to out-of-bounds:

crash> bt
PID: 22218  TASK: ffff951a6ad74980  CPU: 73  COMMAND: "vcpu8"
 #0 [ffffb1ba6707fa40] machine_kexec at ffffffff8565b397
 ljalves#1 [ffffb1ba6707fa90] __crash_kexec at ffffffff85788a6d
 ljalves#2 [ffffb1ba6707fb58] crash_kexec at ffffffff8578995d
 ljalves#3 [ffffb1ba6707fb70] oops_end at ffffffff85623c0d
 ljalves#4 [ffffb1ba6707fb90] no_context at ffffffff856692c9
 ljalves#5 [ffffb1ba6707fbf8] exc_page_fault at ffffffff85f95b51
 ljalves#6 [ffffb1ba6707fc50] asm_exc_page_fault at ffffffff86000ace
    [exception RIP: svm_update_pi_irte+227]
    RIP: ffffffffc0761b53  RSP: ffffb1ba6707fd08  RFLAGS: 00010086
    RAX: ffffb1ba6707fd78  RBX: ffffb1ba66d91000  RCX: 0000000000000001
    RDX: 00003c803f63f1c0  RSI: 000000000000019a  RDI: ffffb1ba66db2ab8
    RBP: 000000000000019a   R8: 0000000000000040   R9: ffff94ca41b82200
    R10: ffffffffffffffcf  R11: 0000000000000001  R12: 0000000000000001
    R13: 0000000000000001  R14: ffffffffffffffcf  R15: 000000000000005f
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
 ljalves#7 [ffffb1ba6707fdb8] kvm_irq_routing_update at ffffffffc09f19a1 [kvm]
 ljalves#8 [ffffb1ba6707fde0] kvm_set_irq_routing at ffffffffc09f2133 [kvm]
 ljalves#9 [ffffb1ba6707fe18] kvm_vm_ioctl at ffffffffc09ef544 [kvm]
    RIP: 00007f143c36488b  RSP: 00007f143a4e04b8  RFLAGS: 00000246
    RAX: ffffffffffffffda  RBX: 00007f05780041d0  RCX: 00007f143c36488b
    RDX: 00007f05780041d0  RSI: 000000004008ae6a  RDI: 0000000000000020
    RBP: 00000000000004e8   R8: 0000000000000008   R9: 00007f05780041e0
    R10: 00007f0578004560  R11: 0000000000000246  R12: 00000000000004e0
    R13: 000000000000001a  R14: 00007f1424001c60  R15: 00007f0578003bc0
    ORIG_RAX: 0000000000000010  CS: 0033  SS: 002b

Vmx have been fix this in commit 3a8b067 (KVM: VMX: Do not BUG() on
out-of-bounds guest IRQ), so we can just copy source from that to fix
this.

Co-developed-by: Yi Liu <liu.yi24@zte.com.cn>
Signed-off-by: Yi Liu <liu.yi24@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Message-Id: <20220309113025.44469-1-wang.yi59@zte.com.cn>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue May 3, 2022
…e_zone

btrfs_can_activate_zone() can be called with the device_list_mutex already
held, which will lead to a deadlock:

insert_dev_extents() // Takes device_list_mutex
`-> insert_dev_extent()
 `-> btrfs_insert_empty_item()
  `-> btrfs_insert_empty_items()
   `-> btrfs_search_slot()
    `-> btrfs_cow_block()
     `-> __btrfs_cow_block()
      `-> btrfs_alloc_tree_block()
       `-> btrfs_reserve_extent()
        `-> find_free_extent()
         `-> find_free_extent_update_loop()
          `-> can_allocate_chunk()
           `-> btrfs_can_activate_zone() // Takes device_list_mutex again

Instead of using the RCU on fs_devices->device_list we
can use fs_devices->alloc_list, protected by the chunk_mutex to traverse
the list of active devices.

We are in the chunk allocation thread. The newer chunk allocation
happens from the devices in the fs_device->alloc_list protected by the
chunk_mutex.

  btrfs_create_chunk()
    lockdep_assert_held(&info->chunk_mutex);
    gather_device_info
      list_for_each_entry(device, &fs_devices->alloc_list, dev_alloc_list)

Also, a device that reappears after the mount won't join the alloc_list
yet and, it will be in the dev_list, which we don't want to consider in
the context of the chunk alloc.

  [15.166572] WARNING: possible recursive locking detected
  [15.167117] 5.17.0-rc6-dennis ljalves#79 Not tainted
  [15.167487] --------------------------------------------
  [15.167733] kworker/u8:3/146 is trying to acquire lock:
  [15.167733] ffff888102962ee0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: find_free_extent+0x15a/0x14f0 [btrfs]
  [15.167733]
  [15.167733] but task is already holding lock:
  [15.167733] ffff888102962ee0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: btrfs_create_pending_block_groups+0x20a/0x560 [btrfs]
  [15.167733]
  [15.167733] other info that might help us debug this:
  [15.167733]  Possible unsafe locking scenario:
  [15.167733]
  [15.171834]        CPU0
  [15.171834]        ----
  [15.171834]   lock(&fs_devs->device_list_mutex);
  [15.171834]   lock(&fs_devs->device_list_mutex);
  [15.171834]
  [15.171834]  *** DEADLOCK ***
  [15.171834]
  [15.171834]  May be due to missing lock nesting notation
  [15.171834]
  [15.171834] 5 locks held by kworker/u8:3/146:
  [15.171834]  #0: ffff888100050938 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x1c3/0x5a0
  [15.171834]  ljalves#1: ffffc9000067be80 ((work_completion)(&fs_info->async_data_reclaim_work)){+.+.}-{0:0}, at: process_one_work+0x1c3/0x5a0
  [15.176244]  ljalves#2: ffff88810521e620 (sb_internal){.+.+}-{0:0}, at: flush_space+0x335/0x600 [btrfs]
  [15.176244]  ljalves#3: ffff888102962ee0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: btrfs_create_pending_block_groups+0x20a/0x560 [btrfs]
  [15.176244]  ljalves#4: ffff8881152e4b78 (btrfs-dev-00){++++}-{3:3}, at: __btrfs_tree_lock+0x27/0x130 [btrfs]
  [15.179641]
  [15.179641] stack backtrace:
  [15.179641] CPU: 1 PID: 146 Comm: kworker/u8:3 Not tainted 5.17.0-rc6-dennis ljalves#79
  [15.179641] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1.fc35 04/01/2014
  [15.179641] Workqueue: events_unbound btrfs_async_reclaim_data_space [btrfs]
  [15.179641] Call Trace:
  [15.179641]  <TASK>
  [15.179641]  dump_stack_lvl+0x45/0x59
  [15.179641]  __lock_acquire.cold+0x217/0x2b2
  [15.179641]  lock_acquire+0xbf/0x2b0
  [15.183838]  ? find_free_extent+0x15a/0x14f0 [btrfs]
  [15.183838]  __mutex_lock+0x8e/0x970
  [15.183838]  ? find_free_extent+0x15a/0x14f0 [btrfs]
  [15.183838]  ? find_free_extent+0x15a/0x14f0 [btrfs]
  [15.183838]  ? lock_is_held_type+0xd7/0x130
  [15.183838]  ? find_free_extent+0x15a/0x14f0 [btrfs]
  [15.183838]  find_free_extent+0x15a/0x14f0 [btrfs]
  [15.183838]  ? _raw_spin_unlock+0x24/0x40
  [15.183838]  ? btrfs_get_alloc_profile+0x106/0x230 [btrfs]
  [15.187601]  btrfs_reserve_extent+0x131/0x260 [btrfs]
  [15.187601]  btrfs_alloc_tree_block+0xb5/0x3b0 [btrfs]
  [15.187601]  __btrfs_cow_block+0x138/0x600 [btrfs]
  [15.187601]  btrfs_cow_block+0x10f/0x230 [btrfs]
  [15.187601]  btrfs_search_slot+0x55f/0xbc0 [btrfs]
  [15.187601]  ? lock_is_held_type+0xd7/0x130
  [15.187601]  btrfs_insert_empty_items+0x2d/0x60 [btrfs]
  [15.187601]  btrfs_create_pending_block_groups+0x2b3/0x560 [btrfs]
  [15.187601]  __btrfs_end_transaction+0x36/0x2a0 [btrfs]
  [15.192037]  flush_space+0x374/0x600 [btrfs]
  [15.192037]  ? find_held_lock+0x2b/0x80
  [15.192037]  ? btrfs_async_reclaim_data_space+0x49/0x180 [btrfs]
  [15.192037]  ? lock_release+0x131/0x2b0
  [15.192037]  btrfs_async_reclaim_data_space+0x70/0x180 [btrfs]
  [15.192037]  process_one_work+0x24c/0x5a0
  [15.192037]  worker_thread+0x4a/0x3d0

Fixes: a85f05e ("btrfs: zoned: avoid chunk allocation if active block group has enough space")
CC: stable@vger.kernel.org # 5.16+
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue May 3, 2022
There is possible circular locking dependency detected on event_mutex
(see below logs). This is due to set fail safe mode is done at
dp_panel_read_sink_caps() within event_mutex scope. To break this
possible circular locking, this patch move setting fail safe mode
out of event_mutex scope.

[   23.958078] ======================================================
[   23.964430] WARNING: possible circular locking dependency detected
[   23.970777] 5.17.0-rc2-lockdep-00088-g05241de1f69e ljalves#148 Not tainted
[   23.977219] ------------------------------------------------------
[   23.983570] DrmThread/1574 is trying to acquire lock:
[   23.988763] ffffff808423aab0 (&dp->event_mutex){+.+.}-{3:3}, at: msm_dp_displ                                                                             ay_enable+0x58/0x164
[   23.997895]
[   23.997895] but task is already holding lock:
[   24.003895] ffffff808420b280 (&kms->commit_lock[i]/1){+.+.}-{3:3}, at: lock_c                                                                             rtcs+0x80/0x8c
[   24.012495]
[   24.012495] which lock already depends on the new lock.
[   24.012495]
[   24.020886]
[   24.020886] the existing dependency chain (in reverse order) is:
[   24.028570]
[   24.028570] -> ljalves#5 (&kms->commit_lock[i]/1){+.+.}-{3:3}:
[   24.035472]        __mutex_lock+0xc8/0x384
[   24.039695]        mutex_lock_nested+0x54/0x74
[   24.044272]        lock_crtcs+0x80/0x8c
[   24.048222]        msm_atomic_commit_tail+0x1e8/0x3d0
[   24.053413]        commit_tail+0x7c/0xfc
[   24.057452]        drm_atomic_helper_commit+0x158/0x15c
[   24.062826]        drm_atomic_commit+0x60/0x74
[   24.067403]        drm_mode_atomic_ioctl+0x6b0/0x908
[   24.072508]        drm_ioctl_kernel+0xe8/0x168
[   24.077086]        drm_ioctl+0x320/0x370
[   24.081123]        drm_compat_ioctl+0x40/0xdc
[   24.085602]        __arm64_compat_sys_ioctl+0xe0/0x150
[   24.090895]        invoke_syscall+0x80/0x114
[   24.095294]        el0_svc_common.constprop.3+0xc4/0xf8
[   24.100668]        do_el0_svc_compat+0x2c/0x54
[   24.105242]        el0_svc_compat+0x4c/0xe4
[   24.109548]        el0t_32_sync_handler+0xc4/0xf4
[   24.114381]        el0t_32_sync+0x178
[   24.118688]
[   24.118688] -> ljalves#4 (&kms->commit_lock[i]){+.+.}-{3:3}:
[   24.125408]        __mutex_lock+0xc8/0x384
[   24.129628]        mutex_lock_nested+0x54/0x74
[   24.134204]        lock_crtcs+0x80/0x8c
[   24.138155]        msm_atomic_commit_tail+0x1e8/0x3d0
[   24.143345]        commit_tail+0x7c/0xfc
[   24.147382]        drm_atomic_helper_commit+0x158/0x15c
[   24.152755]        drm_atomic_commit+0x60/0x74
[   24.157323]        drm_atomic_helper_set_config+0x68/0x90
[   24.162869]        drm_mode_setcrtc+0x394/0x648
[   24.167535]        drm_ioctl_kernel+0xe8/0x168
[   24.172102]        drm_ioctl+0x320/0x370
[   24.176135]        drm_compat_ioctl+0x40/0xdc
[   24.180621]        __arm64_compat_sys_ioctl+0xe0/0x150
[   24.185904]        invoke_syscall+0x80/0x114
[   24.190302]        el0_svc_common.constprop.3+0xc4/0xf8
[   24.195673]        do_el0_svc_compat+0x2c/0x54
[   24.200241]        el0_svc_compat+0x4c/0xe4
[   24.204544]        el0t_32_sync_handler+0xc4/0xf4
[   24.209378]        el0t_32_sync+0x174/0x178
[   24.213680] -> ljalves#3 (crtc_ww_class_mutex){+.+.}-{3:3}:
[   24.220308]        __ww_mutex_lock.constprop.20+0xe8/0x878
[   24.225951]        ww_mutex_lock+0x60/0xd0
[   24.230166]        modeset_lock+0x190/0x19c
[   24.234467]        drm_modeset_lock+0x34/0x54
[   24.238953]        drmm_mode_config_init+0x550/0x764
[   24.244065]        msm_drm_bind+0x170/0x59c
[   24.248374]        try_to_bring_up_master+0x244/0x294
[   24.253572]        __component_add+0xf4/0x14c
[   24.258057]        component_add+0x2c/0x38
[   24.262273]        dsi_dev_attach+0x2c/0x38
[   24.266575]        dsi_host_attach+0xc4/0x120
[   24.271060]        mipi_dsi_attach+0x34/0x48
[   24.275456]        devm_mipi_dsi_attach+0x28/0x68
[   24.280298]        ti_sn_bridge_probe+0x2b4/0x2dc
[   24.285137]        auxiliary_bus_probe+0x78/0x90
[   24.289893]        really_probe+0x1e4/0x3d8
[   24.294194]        __driver_probe_device+0x14c/0x164
[   24.299298]        driver_probe_device+0x54/0xf8
[   24.304043]        __device_attach_driver+0xb4/0x118
[   24.309145]        bus_for_each_drv+0xb0/0xd4
[   24.313628]        __device_attach+0xcc/0x158
[   24.318112]        device_initial_probe+0x24/0x30
[   24.322954]        bus_probe_device+0x38/0x9c
[   24.327439]        deferred_probe_work_func+0xd4/0xf0
[   24.332628]        process_one_work+0x2f0/0x498
[   24.337289]        process_scheduled_works+0x44/0x48
[   24.342391]        worker_thread+0x1e4/0x26c
[   24.346788]        kthread+0xe4/0xf4
[   24.350470]        ret_from_fork+0x10/0x20
[   24.354683]
[   24.354683]
[   24.354683] -> ljalves#2 (crtc_ww_class_acquire){+.+.}-{0:0}:
[   24.361489]        drm_modeset_acquire_init+0xe4/0x138
[   24.366777]        drm_helper_probe_detect_ctx+0x44/0x114
[   24.372327]        check_connector_changed+0xbc/0x198
[   24.377517]        drm_helper_hpd_irq_event+0xcc/0x11c
[   24.382804]        dsi_hpd_worker+0x24/0x30
[   24.387104]        process_one_work+0x2f0/0x498
[   24.391762]        worker_thread+0x1d0/0x26c
[   24.396158]        kthread+0xe4/0xf4
[   24.399840]        ret_from_fork+0x10/0x20
[   24.404053]
[   24.404053] -> ljalves#1 (&dev->mode_config.mutex){+.+.}-{3:3}:
[   24.411032]        __mutex_lock+0xc8/0x384
[   24.415247]        mutex_lock_nested+0x54/0x74
[   24.419819]        dp_panel_read_sink_caps+0x23c/0x26c
[   24.425108]        dp_display_process_hpd_high+0x34/0xd4
[   24.430570]        dp_display_usbpd_configure_cb+0x30/0x3c
[   24.436205]        hpd_event_thread+0x2ac/0x550
[   24.440864]        kthread+0xe4/0xf4
[   24.444544]        ret_from_fork+0x10/0x20
[   24.448757]
[   24.448757] -> #0 (&dp->event_mutex){+.+.}-{3:3}:
[   24.455116]        __lock_acquire+0xe2c/0x10d8
[   24.459690]        lock_acquire+0x1ac/0x2d0
[   24.463988]        __mutex_lock+0xc8/0x384
[   24.468201]        mutex_lock_nested+0x54/0x74
[   24.472773]        msm_dp_display_enable+0x58/0x164
[   24.477789]        dp_bridge_enable+0x24/0x30
[   24.482273]        drm_atomic_bridge_chain_enable+0x78/0x9c
[   24.488006]        drm_atomic_helper_commit_modeset_enables+0x1bc/0x244
[   24.494801]        msm_atomic_commit_tail+0x248/0x3d0
[   24.499992]        commit_tail+0x7c/0xfc
[   24.504031]        drm_atomic_helper_commit+0x158/0x15c
[   24.509404]        drm_atomic_commit+0x60/0x74
[   24.513976]        drm_mode_atomic_ioctl+0x6b0/0x908
[   24.519079]        drm_ioctl_kernel+0xe8/0x168
[   24.523650]        drm_ioctl+0x320/0x370
[   24.527689]        drm_compat_ioctl+0x40/0xdc
[   24.532175]        __arm64_compat_sys_ioctl+0xe0/0x150
[   24.537463]        invoke_syscall+0x80/0x114
[   24.541861]        el0_svc_common.constprop.3+0xc4/0xf8
[   24.547235]        do_el0_svc_compat+0x2c/0x54
[   24.551806]        el0_svc_compat+0x4c/0xe4
[   24.556106]        el0t_32_sync_handler+0xc4/0xf4
[   24.560948]        el0t_32_sync+0x174/0x178

Changes in v2:
-- add circular lockiing trace

Fixes: d4aca42 ("drm/msm/dp:  always add fail-safe mode into connector mode list")
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/481396/
Link: https://lore.kernel.org/r/1649451894-554-1-git-send-email-quic_khsieh@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 17, 2022
Current DP driver implementation has adding safe mode done at
dp_hpd_plug_handle() which is expected to be executed under event
thread context.

However there is possible circular locking happen (see blow stack trace)
after edp driver call dp_hpd_plug_handle() from dp_bridge_enable() which
is executed under drm_thread context.

After review all possibilities methods and as discussed on
https://patchwork.freedesktop.org/patch/483155/, supporting EDID
compliance tests in the driver is quite hacky. As seen with other
vendor drivers, supporting these will be much easier with IGT. Hence
removing all the related fail safe code for it so that no possibility
of circular lock will happen.
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

======================================================
 WARNING: possible circular locking dependency detected
 5.15.35-lockdep ljalves#6 Tainted: G        W
 ------------------------------------------------------
 frecon/429 is trying to acquire lock:
 ffffff808dc3c4e8 (&dev->mode_config.mutex){+.+.}-{3:3}, at:
dp_panel_add_fail_safe_mode+0x4c/0xa0

 but task is already holding lock:
 ffffff808dc441e0 (&kms->commit_lock[i]){+.+.}-{3:3}, at: lock_crtcs+0xb4/0x124

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -> ljalves#3 (&kms->commit_lock[i]){+.+.}-{3:3}:
        __mutex_lock_common+0x174/0x1a64
        mutex_lock_nested+0x98/0xac
        lock_crtcs+0xb4/0x124
        msm_atomic_commit_tail+0x330/0x748
        commit_tail+0x19c/0x278
        drm_atomic_helper_commit+0x1dc/0x1f0
        drm_atomic_commit+0xc0/0xd8
        drm_atomic_helper_set_config+0xb4/0x134
        drm_mode_setcrtc+0x688/0x1248
        drm_ioctl_kernel+0x1e4/0x338
        drm_ioctl+0x3a4/0x684
        __arm64_sys_ioctl+0x118/0x154
        invoke_syscall+0x78/0x224
        el0_svc_common+0x178/0x200
        do_el0_svc+0x94/0x13c
        el0_svc+0x5c/0xec
        el0t_64_sync_handler+0x78/0x108
        el0t_64_sync+0x1a4/0x1a8

 -> ljalves#2 (crtc_ww_class_mutex){+.+.}-{3:3}:
        __mutex_lock_common+0x174/0x1a64
        ww_mutex_lock+0xb8/0x278
        modeset_lock+0x304/0x4ac
        drm_modeset_lock+0x4c/0x7c
        drmm_mode_config_init+0x4a8/0xc50
        msm_drm_init+0x274/0xac0
        msm_drm_bind+0x20/0x2c
        try_to_bring_up_master+0x3dc/0x470
        __component_add+0x18c/0x3c0
        component_add+0x1c/0x28
        dp_display_probe+0x954/0xa98
        platform_probe+0x124/0x15c
        really_probe+0x1b0/0x5f8
        __driver_probe_device+0x174/0x20c
        driver_probe_device+0x70/0x134
        __device_attach_driver+0x130/0x1d0
        bus_for_each_drv+0xfc/0x14c
        __device_attach+0x1bc/0x2bc
        device_initial_probe+0x1c/0x28
        bus_probe_device+0x94/0x178
        deferred_probe_work_func+0x1a4/0x1f0
        process_one_work+0x5d4/0x9dc
        worker_thread+0x898/0xccc
        kthread+0x2d4/0x3d4
        ret_from_fork+0x10/0x20

 -> ljalves#1 (crtc_ww_class_acquire){+.+.}-{0:0}:
        ww_acquire_init+0x1c4/0x2c8
        drm_modeset_acquire_init+0x44/0xc8
        drm_helper_probe_single_connector_modes+0xb0/0x12dc
        drm_mode_getconnector+0x5dc/0xfe8
        drm_ioctl_kernel+0x1e4/0x338
        drm_ioctl+0x3a4/0x684
        __arm64_sys_ioctl+0x118/0x154
        invoke_syscall+0x78/0x224
        el0_svc_common+0x178/0x200
        do_el0_svc+0x94/0x13c
        el0_svc+0x5c/0xec
        el0t_64_sync_handler+0x78/0x108
        el0t_64_sync+0x1a4/0x1a8

 -> #0 (&dev->mode_config.mutex){+.+.}-{3:3}:
        __lock_acquire+0x2650/0x672c
        lock_acquire+0x1b4/0x4ac
        __mutex_lock_common+0x174/0x1a64
        mutex_lock_nested+0x98/0xac
        dp_panel_add_fail_safe_mode+0x4c/0xa0
        dp_hpd_plug_handle+0x1f0/0x280
        dp_bridge_enable+0x94/0x2b8
        drm_atomic_bridge_chain_enable+0x11c/0x168
        drm_atomic_helper_commit_modeset_enables+0x500/0x740
        msm_atomic_commit_tail+0x3e4/0x748
        commit_tail+0x19c/0x278
        drm_atomic_helper_commit+0x1dc/0x1f0
        drm_atomic_commit+0xc0/0xd8
        drm_atomic_helper_set_config+0xb4/0x134
        drm_mode_setcrtc+0x688/0x1248
        drm_ioctl_kernel+0x1e4/0x338
        drm_ioctl+0x3a4/0x684
        __arm64_sys_ioctl+0x118/0x154
        invoke_syscall+0x78/0x224
        el0_svc_common+0x178/0x200
        do_el0_svc+0x94/0x13c
        el0_svc+0x5c/0xec
        el0t_64_sync_handler+0x78/0x108
        el0t_64_sync+0x1a4/0x1a8

Changes in v2:
-- re text commit title
-- remove all fail safe mode

Changes in v3:
-- remove dp_panel_add_fail_safe_mode() from dp_panel.h
-- add Fixes

Changes in v5:
--  to=dianders@chromium.org

Changes in v6:
--  fix Fixes commit ID

Fixes: 8b2c181 ("drm/msm/dp: add fail safe mode outside of event_mutex context")
Reported-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Link: https://lore.kernel.org/r/1651007534-31842-1-git-send-email-quic_khsieh@quicinc.com
Signed-off-by: Rob Clark <robdclark@chromium.org>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 17, 2022
While handling PCI errors (AER flow) driver tries to
disable NAPI [napi_disable()] after NAPI is deleted
[__netif_napi_del()] which causes unexpected system
hang/crash.

System message log shows the following:
=======================================
[ 3222.537510] EEH: Detected PCI bus error on PHB#384-PE#800000 [ 3222.537511] EEH: This PCI device has failed 2 times in the last hour and will be permanently disabled after 5 failures.
[ 3222.537512] EEH: Notify device drivers to shutdown [ 3222.537513] EEH: Beginning: 'error_detected(IO frozen)'
[ 3222.537514] EEH: PE#800000 (PCI 0384:80:00.0): Invoking
bnx2x->error_detected(IO frozen)
[ 3222.537516] bnx2x: [bnx2x_io_error_detected:14236(eth14)]IO error detected [ 3222.537650] EEH: PE#800000 (PCI 0384:80:00.0): bnx2x driver reports:
'need reset'
[ 3222.537651] EEH: PE#800000 (PCI 0384:80:00.1): Invoking
bnx2x->error_detected(IO frozen)
[ 3222.537651] bnx2x: [bnx2x_io_error_detected:14236(eth13)]IO error detected [ 3222.537729] EEH: PE#800000 (PCI 0384:80:00.1): bnx2x driver reports:
'need reset'
[ 3222.537729] EEH: Finished:'error_detected(IO frozen)' with aggregate recovery state:'need reset'
[ 3222.537890] EEH: Collect temporary log [ 3222.583481] EEH: of node=0384:80:00.0 [ 3222.583519] EEH: PCI device/vendor: 168e14e4 [ 3222.583557] EEH: PCI cmd/status register: 00100140 [ 3222.583557] EEH: PCI-E capabilities and status follow:
[ 3222.583744] EEH: PCI-E 00: 00020010 012c8da2 00095d5e 00455c82 [ 3222.583892] EEH: PCI-E 10: 10820000 00000000 00000000 00000000 [ 3222.583893] EEH: PCI-E 20: 00000000 [ 3222.583893] EEH: PCI-E AER capability register set follows:
[ 3222.584079] EEH: PCI-E AER 00: 13c10001 00000000 00000000 00062030 [ 3222.584230] EEH: PCI-E AER 10: 00002000 000031c0 000001e0 00000000 [ 3222.584378] EEH: PCI-E AER 20: 00000000 00000000 00000000 00000000 [ 3222.584416] EEH: PCI-E AER 30: 00000000 00000000 [ 3222.584416] EEH: of node=0384:80:00.1 [ 3222.584454] EEH: PCI device/vendor: 168e14e4 [ 3222.584491] EEH: PCI cmd/status register: 00100140 [ 3222.584492] EEH: PCI-E capabilities and status follow:
[ 3222.584677] EEH: PCI-E 00: 00020010 012c8da2 00095d5e 00455c82 [ 3222.584825] EEH: PCI-E 10: 10820000 00000000 00000000 00000000 [ 3222.584826] EEH: PCI-E 20: 00000000 [ 3222.584826] EEH: PCI-E AER capability register set follows:
[ 3222.585011] EEH: PCI-E AER 00: 13c10001 00000000 00000000 00062030 [ 3222.585160] EEH: PCI-E AER 10: 00002000 000031c0 000001e0 00000000 [ 3222.585309] EEH: PCI-E AER 20: 00000000 00000000 00000000 00000000 [ 3222.585347] EEH: PCI-E AER 30: 00000000 00000000 [ 3222.586872] RTAS: event: 5, Type: Platform Error (224), Severity: 2 [ 3222.586873] EEH: Reset without hotplug activity [ 3224.762767] EEH: Beginning: 'slot_reset'
[ 3224.762770] EEH: PE#800000 (PCI 0384:80:00.0): Invoking
bnx2x->slot_reset()
[ 3224.762771] bnx2x: [bnx2x_io_slot_reset:14271(eth14)]IO slot reset initializing...
[ 3224.762887] bnx2x 0384:80:00.0: enabling device (0140 -> 0142) [ 3224.768157] bnx2x: [bnx2x_io_slot_reset:14287(eth14)]IO slot reset
--> driver unload

Uninterruptible tasks
=====================
crash> ps | grep UN
     213      2  11  c000000004c89e00  UN   0.0       0      0  [eehd]
     215      2   0  c000000004c80000  UN   0.0       0      0
[kworker/0:2]
    2196      1  28  c000000004504f00  UN   0.1   15936  11136  wickedd
    4287      1   9  c00000020d076800  UN   0.0    4032   3008  agetty
    4289      1  20  c00000020d056680  UN   0.0    7232   3840  agetty
   32423      2  26  c00000020038c580  UN   0.0       0      0
[kworker/26:3]
   32871   4241  27  c0000002609ddd00  UN   0.1   18624  11648  sshd
   32920  10130  16  c00000027284a100  UN   0.1   48512  12608  sendmail
   33092  32987   0  c000000205218b00  UN   0.1   48512  12608  sendmail
   33154   4567  16  c000000260e51780  UN   0.1   48832  12864  pickup
   33209   4241  36  c000000270cb6500  UN   0.1   18624  11712  sshd
   33473  33283   0  c000000205211480  UN   0.1   48512  12672  sendmail
   33531   4241  37  c00000023c902780  UN   0.1   18624  11648  sshd

EEH handler hung while bnx2x sleeping and holding RTNL lock
===========================================================
crash> bt 213
PID: 213    TASK: c000000004c89e00  CPU: 11  COMMAND: "eehd"
  #0 [c000000004d477e0] __schedule at c000000000c70808
  ljalves#1 [c000000004d478b0] schedule at c000000000c70ee0
  ljalves#2 [c000000004d478e0] schedule_timeout at c000000000c76dec
  ljalves#3 [c000000004d479c0] msleep at c0000000002120cc
  ljalves#4 [c000000004d479f0] napi_disable at c000000000a06448
                                        ^^^^^^^^^^^^^^^^
  ljalves#5 [c000000004d47a30] bnx2x_netif_stop at c0080000018dba94 [bnx2x]
  ljalves#6 [c000000004d47a60] bnx2x_io_slot_reset at c0080000018a551c [bnx2x]
  ljalves#7 [c000000004d47b20] eeh_report_reset at c00000000004c9bc
  ljalves#8 [c000000004d47b90] eeh_pe_report at c00000000004d1a8
  ljalves#9 [c000000004d47c40] eeh_handle_normal_event at c00000000004da64

And the sleeping source code
============================
crash> dis -ls c000000000a06448
FILE: ../net/core/dev.c
LINE: 6702

   6697  {
   6698          might_sleep();
   6699          set_bit(NAPI_STATE_DISABLE, &n->state);
   6700
   6701          while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
* 6702                  msleep(1);
   6703          while (test_and_set_bit(NAPI_STATE_NPSVC, &n->state))
   6704                  msleep(1);
   6705
   6706          hrtimer_cancel(&n->timer);
   6707
   6708          clear_bit(NAPI_STATE_DISABLE, &n->state);
   6709  }

EEH calls into bnx2x twice based on the system log above, first through
bnx2x_io_error_detected() and then bnx2x_io_slot_reset(), and executes
the following call chains:

bnx2x_io_error_detected()
  +-> bnx2x_eeh_nic_unload()
       +-> bnx2x_del_all_napi()
            +-> __netif_napi_del()

bnx2x_io_slot_reset()
  +-> bnx2x_netif_stop()
       +-> bnx2x_napi_disable()
            +->napi_disable()

Fix this by correcting the sequence of NAPI APIs usage,
that is delete the NAPI after disabling it.

Fixes: 7fa6f34 ("bnx2x: AER revised")
Reported-by: David Christensen <drc@linux.vnet.ibm.com>
Tested-by: David Christensen <drc@linux.vnet.ibm.com>
Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Link: https://lore.kernel.org/r/20220426153913.6966-1-manishc@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 17, 2022
The following VM_BUG_ON_FOLIO() is triggered when memory error event
happens on the (thp/folio) pages which are about to be freed:

  [ 1160.232771] page:00000000b36a8a0f refcount:1 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x16a000
  [ 1160.236916] page:00000000b36a8a0f refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x16a000
  [ 1160.240684] flags: 0x57ffffc0800000(hwpoison|node=1|zone=2|lastcpupid=0x1fffff)
  [ 1160.243458] raw: 0057ffffc0800000 dead000000000100 dead000000000122 0000000000000000
  [ 1160.246268] raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
  [ 1160.249197] page dumped because: VM_BUG_ON_FOLIO(!folio_test_large(folio))
  [ 1160.251815] ------------[ cut here ]------------
  [ 1160.253438] kernel BUG at include/linux/mm.h:788!
  [ 1160.256162] invalid opcode: 0000 [ljalves#1] PREEMPT SMP PTI
  [ 1160.258172] CPU: 2 PID: 115368 Comm: mceinj.sh Tainted: G            E     5.18.0-rc1-v5.18-rc1-220404-2353-005-g83111+ ljalves#3
  [ 1160.262049] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1.fc35 04/01/2014
  [ 1160.265103] RIP: 0010:dump_page.cold+0x27e/0x2bd
  [ 1160.266757] Code: fe ff ff 48 c7 c6 81 f1 5a 98 e9 4c fe ff ff 48 c7 c6 a1 95 59 98 e9 40 fe ff ff 48 c7 c6 50 bf 5a 98 48 89 ef e8 9d 04 6d ff <0f> 0b 41 f7 c4 ff 0f 00 00 0f 85 9f fd ff ff 49 8b 04 24 a9 00 00
  [ 1160.273180] RSP: 0018:ffffaa2c4d59fd18 EFLAGS: 00010292
  [ 1160.274969] RAX: 000000000000003e RBX: 0000000000000001 RCX: 0000000000000000
  [ 1160.277263] RDX: 0000000000000001 RSI: ffffffff985995a1 RDI: 00000000ffffffff
  [ 1160.279571] RBP: ffffdc9c45a80000 R08: 0000000000000000 R09: 00000000ffffdfff
  [ 1160.281794] R10: ffffaa2c4d59fb08 R11: ffffffff98940d08 R12: ffffdc9c45a80000
  [ 1160.283920] R13: ffffffff985b6f94 R14: 0000000000000000 R15: ffffdc9c45a80000
  [ 1160.286641] FS:  00007eff54ce1740(0000) GS:ffff99c67bd00000(0000) knlGS:0000000000000000
  [ 1160.289498] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  [ 1160.291106] CR2: 00005628381a5f68 CR3: 0000000104712003 CR4: 0000000000170ee0
  [ 1160.293031] Call Trace:
  [ 1160.293724]  <TASK>
  [ 1160.294334]  get_hwpoison_page+0x47d/0x570
  [ 1160.295474]  memory_failure+0x106/0xaa0
  [ 1160.296474]  ? security_capable+0x36/0x50
  [ 1160.297524]  hard_offline_page_store+0x43/0x80
  [ 1160.298684]  kernfs_fop_write_iter+0x11c/0x1b0
  [ 1160.299829]  new_sync_write+0xf9/0x160
  [ 1160.300810]  vfs_write+0x209/0x290
  [ 1160.301835]  ksys_write+0x4f/0xc0
  [ 1160.302718]  do_syscall_64+0x3b/0x90
  [ 1160.303664]  entry_SYSCALL_64_after_hwframe+0x44/0xae
  [ 1160.304981] RIP: 0033:0x7eff54b018b7

As shown in the RIP address, this VM_BUG_ON in folio_entire_mapcount() is
called from dump_page("hwpoison: unhandlable page") in get_any_page().
The below explains the mechanism of the race:

  CPU 0                                       CPU 1

    memory_failure
      get_hwpoison_page
        get_any_page
          dump_page
            compound = PageCompound
                                                free_pages_prepare
                                                  page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP
            folio_entire_mapcount
              VM_BUG_ON_FOLIO(!folio_test_large(folio))

So replace dump_page() with safer one, pr_err().

Link: https://lkml.kernel.org/r/20220427053220.719866-1-naoya.horiguchi@linux.dev
Fixes: 74e8ee4 ("mm: Turn head_compound_mapcount() into folio_entire_mapcount()")
Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: William Kucharski <william.kucharski@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 17, 2022
As reported by Alan, the CFI (Call Frame Information) in the VDSO time
routines is incorrect since commit ce7d805 ("powerpc/vdso: Prepare
for switching VDSO to generic C implementation.").

DWARF has a concept called the CFA (Canonical Frame Address), which on
powerpc is calculated as an offset from the stack pointer (r1). That
means when the stack pointer is changed there must be a corresponding
CFI directive to update the calculation of the CFA.

The current code is missing those directives for the changes to r1,
which prevents gdb from being able to generate a backtrace from inside
VDSO functions, eg:

  Breakpoint 1, 0x00007ffff7f804dc in __kernel_clock_gettime ()
  (gdb) bt
  #0  0x00007ffff7f804dc in __kernel_clock_gettime ()
  ljalves#1  0x00007ffff7d8872c in clock_gettime@@GLIBC_2.17 () from /lib64/libc.so.6
  ljalves#2  0x00007fffffffd960 in ?? ()
  ljalves#3  0x00007ffff7d8872c in clock_gettime@@GLIBC_2.17 () from /lib64/libc.so.6
  Backtrace stopped: frame did not save the PC

Alan helpfully describes some rules for correctly maintaining the CFI information:

  1) Every adjustment to the current frame address reg (ie. r1) must be
     described, and exactly at the instruction where r1 changes. Why?
     Because stack unwinding might want to access previous frames.

  2) If a function changes LR or any non-volatile register, the save
     location for those regs must be given. The CFI can be at any
     instruction after the saves up to the point that the reg is
     changed.
     (Exception: LR save should be described before a bl. not after)

  3) If asychronous unwind info is needed then restores of LR and
     non-volatile regs must also be described. The CFI can be at any
     instruction after the reg is restored up to the point where the
     save location is (potentially) trashed.

Fix the inability to backtrace by adding CFI directives describing the
changes to r1, ie. satisfying rule 1.

Also change the information for LR to point to the copy saved on the
stack, not the value in r0 that will be overwritten by the function
call.

Finally, add CFI directives describing the save/restore of r2.

With the fix gdb can correctly back trace and navigate up and down the stack:

  Breakpoint 1, 0x00007ffff7f804dc in __kernel_clock_gettime ()
  (gdb) bt
  #0  0x00007ffff7f804dc in __kernel_clock_gettime ()
  ljalves#1  0x00007ffff7d8872c in clock_gettime@@GLIBC_2.17 () from /lib64/libc.so.6
  ljalves#2  0x0000000100015b60 in gettime ()
  ljalves#3  0x000000010000c8bc in print_long_format ()
  ljalves#4  0x000000010000d180 in print_current_files ()
  ljalves#5  0x00000001000054ac in main ()
  (gdb) up
  ljalves#1  0x00007ffff7d8872c in clock_gettime@@GLIBC_2.17 () from /lib64/libc.so.6
  (gdb)
  ljalves#2  0x0000000100015b60 in gettime ()
  (gdb)
  ljalves#3  0x000000010000c8bc in print_long_format ()
  (gdb)
  ljalves#4  0x000000010000d180 in print_current_files ()
  (gdb)
  ljalves#5  0x00000001000054ac in main ()
  (gdb)
  Initial frame selected; you cannot go up.
  (gdb) down
  ljalves#4  0x000000010000d180 in print_current_files ()
  (gdb)
  ljalves#3  0x000000010000c8bc in print_long_format ()
  (gdb)
  ljalves#2  0x0000000100015b60 in gettime ()
  (gdb)
  ljalves#1  0x00007ffff7d8872c in clock_gettime@@GLIBC_2.17 () from /lib64/libc.so.6
  (gdb)
  #0  0x00007ffff7f804dc in __kernel_clock_gettime ()
  (gdb)

Fixes: ce7d805 ("powerpc/vdso: Prepare for switching VDSO to generic C implementation.")
Cc: stable@vger.kernel.org # v5.11+
Reported-by: Alan Modra <amodra@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Link: https://lore.kernel.org/r/20220502125010.1319370-1-mpe@ellerman.id.au
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 17, 2022
'rmmod pmt_telemetry' panics with:

 BUG: kernel NULL pointer dereference, address: 0000000000000040
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: 0000 [ljalves#1] PREEMPT SMP NOPTI
 CPU: 4 PID: 1697 Comm: rmmod Tainted: G S      W        --------  ---  5.18.0-rc4 ljalves#3
 Hardware name: Intel Corporation Alder Lake Client Platform/AlderLake-P DDR5 RVP, BIOS ADLPFWI1.R00.3056.B00.2201310233 01/31/2022
 RIP: 0010:device_del+0x1b/0x3d0
 Code: e8 1a d9 e9 ff e9 58 ff ff ff 48 8b 08 eb dc 0f 1f 44 00 00 41 56 41 55 41 54 55 48 8d af 80 00 00 00 53 48 89 fb 48 83 ec 18 <4c> 8b 67 40 48 89 ef 65 48 8b 04 25 28 00 00 00 48 89 44 24 10 31
 RSP: 0018:ffffb520415cfd60 EFLAGS: 00010286
 RAX: 0000000000000070 RBX: 0000000000000000 RCX: 0000000000000000
 RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000
 RBP: 0000000000000080 R08: ffffffffffffffff R09: ffffb520415cfd78
 R10: 0000000000000002 R11: ffffb520415cfd78 R12: 0000000000000000
 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 FS:  00007f7e198e5740(0000) GS:ffff905c9f700000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 0000000000000040 CR3: 000000010782a005 CR4: 0000000000770ee0
 PKRU: 55555554
 Call Trace:
  <TASK>
  ? __xa_erase+0x53/0xb0
  device_unregister+0x13/0x50
  intel_pmt_dev_destroy+0x34/0x60 [pmt_class]
  pmt_telem_remove+0x40/0x50 [pmt_telemetry]
  auxiliary_bus_remove+0x18/0x30
  device_release_driver_internal+0xc1/0x150
  driver_detach+0x44/0x90
  bus_remove_driver+0x74/0xd0
  auxiliary_driver_unregister+0x12/0x20
  pmt_telem_exit+0xc/0xe4a [pmt_telemetry]
  __x64_sys_delete_module+0x13a/0x250
  ? syscall_trace_enter.isra.19+0x11e/0x1a0
  do_syscall_64+0x58/0x80
  ? syscall_exit_to_user_mode+0x12/0x30
  ? do_syscall_64+0x67/0x80
  ? syscall_exit_to_user_mode+0x12/0x30
  ? do_syscall_64+0x67/0x80
  ? syscall_exit_to_user_mode+0x12/0x30
  ? do_syscall_64+0x67/0x80
  ? exc_page_fault+0x64/0x140
  entry_SYSCALL_64_after_hwframe+0x44/0xae
 RIP: 0033:0x7f7e1803a05b
 Code: 73 01 c3 48 8b 0d 2d 4e 38 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d fd 4d 38 00 f7 d8 64 89 01 48

The probe function, pmt_telem_probe(), adds an entry for devices even if
they have not been initialized.  This results in the array of initialized
devices containing both initialized and uninitialized entries.  This
causes a panic in the remove function, pmt_telem_remove() which expects
the array to only contain initialized entries.

Only use an entry when a device is initialized.

Cc: "David E. Box" <david.e.box@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Gross <markgross@kernel.org>
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: David Arcari <darcari@redhat.com>
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Reviewed-by: David E. Box <david.e.box@linux.intel.com>
Link: https://lore.kernel.org/r/20220429122322.2550003-1-prarit@redhat.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 17, 2022
…/kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 5.18, take ljalves#3

- Correctly expose GICv3 support even if no irqchip is created
  so that userspace doesn't observe it changing pointlessly
  (fixing a regression with QEMU)

- Don't issue a hypercall to set the id-mapped vectors when
  protected mode is enabled (fix for pKVM in combination with
  CPUs affected by Spectre-v3a)
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 17, 2022
Do not allow to write timestamps on RX rings if PF is being configured.
When PF is being configured RX rings can be freed or rebuilt. If at the
same time timestamps are updated, the kernel will crash by dereferencing
null RX ring pointer.

PID: 1449   TASK: ff187d28ed658040  CPU: 34  COMMAND: "ice-ptp-0000:51"
 #0 [ff1966a94a713bb0] machine_kexec at ffffffff9d05a0be
 ljalves#1 [ff1966a94a713c08] __crash_kexec at ffffffff9d192e9d
 ljalves#2 [ff1966a94a713cd0] crash_kexec at ffffffff9d1941bd
 ljalves#3 [ff1966a94a713ce8] oops_end at ffffffff9d01bd54
 ljalves#4 [ff1966a94a713d08] no_context at ffffffff9d06bda4
 ljalves#5 [ff1966a94a713d60] __bad_area_nosemaphore at ffffffff9d06c10c
 ljalves#6 [ff1966a94a713da8] do_page_fault at ffffffff9d06cae4
 ljalves#7 [ff1966a94a713de0] page_fault at ffffffff9da0107e
    [exception RIP: ice_ptp_update_cached_phctime+91]
    RIP: ffffffffc076db8b  RSP: ff1966a94a713e98  RFLAGS: 00010246
    RAX: 16e3db9c6b7ccae4  RBX: ff187d269dd3c180  RCX: ff187d269cd4d018
    RDX: 0000000000000000  RSI: 0000000000000000  RDI: 0000000000000000
    RBP: ff187d269cfcc644   R8: ff187d339b9641b0   R9: 0000000000000000
    R10: 0000000000000002  R11: 0000000000000000  R12: ff187d269cfcc648
    R13: ffffffff9f128784  R14: ffffffff9d101b70  R15: ff187d269cfcc640
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
 ljalves#8 [ff1966a94a713ea0] ice_ptp_periodic_work at ffffffffc076dbef [ice]
 ljalves#9 [ff1966a94a713ee0] kthread_worker_fn at ffffffff9d101c1b
 ljalves#10 [ff1966a94a713f10] kthread at ffffffff9d101b4d
 ljalves#11 [ff1966a94a713f50] ret_from_fork at ffffffff9da0023f

Fixes: 77a7811 ("ice: enable receive hardware timestamping")
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Reviewed-by: Michal Schmidt <mschmidt@redhat.com>
Tested-by: Dave Cain <dcain@redhat.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 17, 2022
The splat below can be seen when running kvm-unit-test:

     =============================
     WARNING: suspicious RCU usage
     5.18.0-rc7 ljalves#5 Tainted: G          IOE
     -----------------------------
     /home/kernel/linux/arch/x86/kvm/../../../virt/kvm/eventfd.c:80 RCU-list traversed in non-reader section!!

     other info that might help us debug this:

     rcu_scheduler_active = 2, debug_locks = 1
     4 locks held by qemu-system-x86/35124:
      #0: ffff9725391d80b8 (&vcpu->mutex){+.+.}-{4:4}, at: kvm_vcpu_ioctl+0x77/0x710 [kvm]
      ljalves#1: ffffbd25cfb2a0b8 (&kvm->srcu){....}-{0:0}, at: vcpu_enter_guest+0xdeb/0x1900 [kvm]
      ljalves#2: ffffbd25cfb2b920 (&kvm->irq_srcu){....}-{0:0}, at: kvm_hv_notify_acked_sint+0x79/0x1e0 [kvm]
      ljalves#3: ffffbd25cfb2b920 (&kvm->irq_srcu){....}-{0:0}, at: irqfd_resampler_ack+0x5/0x110 [kvm]

     stack backtrace:
     CPU: 2 PID: 35124 Comm: qemu-system-x86 Tainted: G          IOE     5.18.0-rc7 ljalves#5
     Call Trace:
      <TASK>
      dump_stack_lvl+0x6c/0x9b
      irqfd_resampler_ack+0xfd/0x110 [kvm]
      kvm_notify_acked_gsi+0x32/0x90 [kvm]
      kvm_hv_notify_acked_sint+0xc5/0x1e0 [kvm]
      kvm_hv_set_msr_common+0xec1/0x1160 [kvm]
      kvm_set_msr_common+0x7c3/0xf60 [kvm]
      vmx_set_msr+0x394/0x1240 [kvm_intel]
      kvm_set_msr_ignored_check+0x86/0x200 [kvm]
      kvm_emulate_wrmsr+0x4f/0x1f0 [kvm]
      vmx_handle_exit+0x6fb/0x7e0 [kvm_intel]
      vcpu_enter_guest+0xe5a/0x1900 [kvm]
      kvm_arch_vcpu_ioctl_run+0x16e/0xac0 [kvm]
      kvm_vcpu_ioctl+0x279/0x710 [kvm]
      __x64_sys_ioctl+0x83/0xb0
      do_syscall_64+0x3b/0x90
      entry_SYSCALL_64_after_hwframe+0x44/0xae

resampler-list is protected by irq_srcu (see kvm_irqfd_assign), so fix
the false positive by using list_for_each_entry_srcu().

Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Message-Id: <1652950153-12489-1-git-send-email-wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Mar 14, 2023
This fixes the following trace caused by attempting to lock
cmd_sync_work_lock while holding the rcu_read_lock:

kworker/u3:2/212 is trying to lock:
ffff888002600910 (&hdev->cmd_sync_work_lock){+.+.}-{3:3}, at:
hci_cmd_sync_queue+0xad/0x140
other info that might help us debug this:
context-{4:4}
4 locks held by kworker/u3:2/212:
 #0: ffff8880028c6530 ((wq_completion)hci0#2){+.+.}-{0:0}, at:
 process_one_work+0x4dc/0x9a0
 ljalves#1: ffff888001aafde0 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0},
 at: process_one_work+0x4dc/0x9a0
 ljalves#2: ffff888002600070 (&hdev->lock){+.+.}-{3:3}, at:
 hci_cc_le_set_cig_params+0x64/0x4f0
 ljalves#3: ffffffffa5994b00 (rcu_read_lock){....}-{1:2}, at:
 hci_cc_le_set_cig_params+0x2f9/0x4f0

Fixes: 26afbd8 ("Bluetooth: Add initial implementation of CIS connections")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Mar 14, 2023
…ress

Bug report and analysis from Ding Hui.

During iSCSI session logout, if another task accesses the shost ipaddress
attr, we can get a KASAN UAF report like this:

[  276.942144] BUG: KASAN: use-after-free in _raw_spin_lock_bh+0x78/0xe0
[  276.942535] Write of size 4 at addr ffff8881053b45b8 by task cat/4088
[  276.943511] CPU: 2 PID: 4088 Comm: cat Tainted: G            E      6.1.0-rc8+ ljalves#3
[  276.943997] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
[  276.944470] Call Trace:
[  276.944943]  <TASK>
[  276.945397]  dump_stack_lvl+0x34/0x48
[  276.945887]  print_address_description.constprop.0+0x86/0x1e7
[  276.946421]  print_report+0x36/0x4f
[  276.947358]  kasan_report+0xad/0x130
[  276.948234]  kasan_check_range+0x35/0x1c0
[  276.948674]  _raw_spin_lock_bh+0x78/0xe0
[  276.949989]  iscsi_sw_tcp_host_get_param+0xad/0x2e0 [iscsi_tcp]
[  276.951765]  show_host_param_ISCSI_HOST_PARAM_IPADDRESS+0xe9/0x130 [scsi_transport_iscsi]
[  276.952185]  dev_attr_show+0x3f/0x80
[  276.953005]  sysfs_kf_seq_show+0x1fb/0x3e0
[  276.953401]  seq_read_iter+0x402/0x1020
[  276.954260]  vfs_read+0x532/0x7b0
[  276.955113]  ksys_read+0xed/0x1c0
[  276.955952]  do_syscall_64+0x38/0x90
[  276.956347]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
[  276.956769] RIP: 0033:0x7f5d3a679222
[  276.957161] Code: c0 e9 b2 fe ff ff 50 48 8d 3d 32 c0 0b 00 e8 a5 fe 01 00 0f 1f 44 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff ff 77 56 c3 0f 1f 44 00 00 48 83 ec 28 48 89 54 24
[  276.958009] RSP: 002b:00007ffc864d16a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[  276.958431] RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007f5d3a679222
[  276.958857] RDX: 0000000000020000 RSI: 00007f5d3a4fe000 RDI: 0000000000000003
[  276.959281] RBP: 00007f5d3a4fe000 R08: 00000000ffffffff R09: 0000000000000000
[  276.959682] R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000020000
[  276.960126] R13: 0000000000000003 R14: 0000000000000000 R15: 0000557a26dada58
[  276.960536]  </TASK>
[  276.961357] Allocated by task 2209:
[  276.961756]  kasan_save_stack+0x1e/0x40
[  276.962170]  kasan_set_track+0x21/0x30
[  276.962557]  __kasan_kmalloc+0x7e/0x90
[  276.962923]  __kmalloc+0x5b/0x140
[  276.963308]  iscsi_alloc_session+0x28/0x840 [scsi_transport_iscsi]
[  276.963712]  iscsi_session_setup+0xda/0xba0 [libiscsi]
[  276.964078]  iscsi_sw_tcp_session_create+0x1fd/0x330 [iscsi_tcp]
[  276.964431]  iscsi_if_create_session.isra.0+0x50/0x260 [scsi_transport_iscsi]
[  276.964793]  iscsi_if_recv_msg+0xc5a/0x2660 [scsi_transport_iscsi]
[  276.965153]  iscsi_if_rx+0x198/0x4b0 [scsi_transport_iscsi]
[  276.965546]  netlink_unicast+0x4d5/0x7b0
[  276.965905]  netlink_sendmsg+0x78d/0xc30
[  276.966236]  sock_sendmsg+0xe5/0x120
[  276.966576]  ____sys_sendmsg+0x5fe/0x860
[  276.966923]  ___sys_sendmsg+0xe0/0x170
[  276.967300]  __sys_sendmsg+0xc8/0x170
[  276.967666]  do_syscall_64+0x38/0x90
[  276.968028]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
[  276.968773] Freed by task 2209:
[  276.969111]  kasan_save_stack+0x1e/0x40
[  276.969449]  kasan_set_track+0x21/0x30
[  276.969789]  kasan_save_free_info+0x2a/0x50
[  276.970146]  __kasan_slab_free+0x106/0x190
[  276.970470]  __kmem_cache_free+0x133/0x270
[  276.970816]  device_release+0x98/0x210
[  276.971145]  kobject_cleanup+0x101/0x360
[  276.971462]  iscsi_session_teardown+0x3fb/0x530 [libiscsi]
[  276.971775]  iscsi_sw_tcp_session_destroy+0xd8/0x130 [iscsi_tcp]
[  276.972143]  iscsi_if_recv_msg+0x1bf1/0x2660 [scsi_transport_iscsi]
[  276.972485]  iscsi_if_rx+0x198/0x4b0 [scsi_transport_iscsi]
[  276.972808]  netlink_unicast+0x4d5/0x7b0
[  276.973201]  netlink_sendmsg+0x78d/0xc30
[  276.973544]  sock_sendmsg+0xe5/0x120
[  276.973864]  ____sys_sendmsg+0x5fe/0x860
[  276.974248]  ___sys_sendmsg+0xe0/0x170
[  276.974583]  __sys_sendmsg+0xc8/0x170
[  276.974891]  do_syscall_64+0x38/0x90
[  276.975216]  entry_SYSCALL_64_after_hwframe+0x63/0xcd

We can easily reproduce by two tasks:
1. while :; do iscsiadm -m node --login; iscsiadm -m node --logout; done
2. while :; do cat \
/sys/devices/platform/host*/iscsi_host/host*/ipaddress; done

            iscsid              |        cat
--------------------------------+---------------------------------------
|- iscsi_sw_tcp_session_destroy |
  |- iscsi_session_teardown     |
    |- device_release           |
      |- iscsi_session_release  ||- dev_attr_show
        |- kfree                |  |- show_host_param_
                                |             ISCSI_HOST_PARAM_IPADDRESS
                                |    |- iscsi_sw_tcp_host_get_param
                                |      |- r/w tcp_sw_host->session (UAF)
  |- iscsi_host_remove          |
  |- iscsi_host_free            |

Fix the above bug by splitting the session removal into 2 parts:

 1. removal from iSCSI class which includes sysfs and removal from host
    tracking.

 2. freeing of session.

During iscsi_tcp host and session removal we can remove the session from
sysfs then remove the host from sysfs. At this point we know userspace is
not accessing the kernel via sysfs so we can free the session and host.

Link: https://lore.kernel.org/r/20230117193937.21244-2-michael.christie@oracle.com
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Acked-by: Ding Hui <dinghui@sangfor.com.cn>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Mar 14, 2023
The referenced commit changed the error code returned by the kernel
when preventing a non-established socket from attaching the ktls
ULP. Before to such a commit, the user-space got ENOTCONN instead
of EINVAL.

The existing self-tests depend on such error code, and the change
caused a failure:

  RUN           global.non_established ...
 tls.c:1673:non_established:Expected errno (22) == ENOTCONN (107)
 non_established: Test failed at step ljalves#3
          FAIL  global.non_established

In the unlikely event existing applications do the same, address
the issue by restoring the prior error code in the above scenario.

Note that the only other ULP performing similar checks at init
time - smc_ulp_ops - also fails with ENOTCONN when trying to attach
the ULP to a non-established socket.

Reported-by: Sabrina Dubroca <sd@queasysnail.net>
Fixes: 2c02d41 ("net/ulp: prevent ULP without clone op from entering the LISTEN status")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://lore.kernel.org/r/7bb199e7a93317fb6f8bf8b9b2dc71c18f337cde.1674042685.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Mar 14, 2023
Jakub Sitnicki says:

====================

This patch set addresses the syzbot report in [1].

Patch ljalves#1 has been suggested by Eric [2]. I extended it to cover the rest of
sock_map proto callbacks. Otherwise we would still overflow the stack.

Patch ljalves#2 contains the actual fix and bug analysis.
Patches ljalves#3 & ljalves#4 add coverage to selftests to trigger the bug.

[1] https://lore.kernel.org/all/00000000000073b14905ef2e7401@google.com/
[2] https://lore.kernel.org/all/CANn89iK2UN1FmdUcH12fv_xiZkv2G+Nskvmq7fG6aA_6VKRf6g@mail.gmail.com/
---
v1 -> v2:
v1: https://lore.kernel.org/r/20230113-sockmap-fix-v1-0-d3cad092ee10@cloudflare.com
[v1 didn't hit bpf@ ML by mistake]

 * pull in Eric's patch to protect against recursion loop bugs (Eric)
 * add a macro helper to check if pointer is inside a memory range (Eric)
====================

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Mar 14, 2023
During EEH error injection testing, a deadlock was encountered in the tg3
driver when tg3_io_error_detected() was attempting to cancel outstanding
reset tasks:

crash> foreach UN bt
...
PID: 159    TASK: c0000000067c6000  CPU: 8   COMMAND: "eehd"
...
 ljalves#5 [c00000000681f990] __cancel_work_timer at c00000000019fd18
 ljalves#6 [c00000000681fa30] tg3_io_error_detected at c00800000295f098 [tg3]
 ljalves#7 [c00000000681faf0] eeh_report_error at c00000000004e25c
...

PID: 290    TASK: c000000036e5f800  CPU: 6   COMMAND: "kworker/6:1"
...
 ljalves#4 [c00000003721fbc0] rtnl_lock at c000000000c940d8
 ljalves#5 [c00000003721fbe0] tg3_reset_task at c008000002969358 [tg3]
 ljalves#6 [c00000003721fc60] process_one_work at c00000000019e5c4
...

PID: 296    TASK: c000000037a65800  CPU: 21  COMMAND: "kworker/21:1"
...
 ljalves#4 [c000000037247bc0] rtnl_lock at c000000000c940d8
 ljalves#5 [c000000037247be0] tg3_reset_task at c008000002969358 [tg3]
 ljalves#6 [c000000037247c60] process_one_work at c00000000019e5c4
...

PID: 655    TASK: c000000036f49000  CPU: 16  COMMAND: "kworker/16:2"
...:1

 ljalves#4 [c0000000373ebbc0] rtnl_lock at c000000000c940d8
 ljalves#5 [c0000000373ebbe0] tg3_reset_task at c008000002969358 [tg3]
 ljalves#6 [c0000000373ebc60] process_one_work at c00000000019e5c4
...

Code inspection shows that both tg3_io_error_detected() and
tg3_reset_task() attempt to acquire the RTNL lock at the beginning of
their code blocks.  If tg3_reset_task() should happen to execute between
the times when tg3_io_error_deteced() acquires the RTNL lock and
tg3_reset_task_cancel() is called, a deadlock will occur.

Moving tg3_reset_task_cancel() call earlier within the code block, prior
to acquiring RTNL, prevents this from happening, but also exposes another
deadlock issue where tg3_reset_task() may execute AFTER
tg3_io_error_detected() has executed:

crash> foreach UN bt
PID: 159    TASK: c0000000067d2000  CPU: 9   COMMAND: "eehd"
...
 ljalves#4 [c000000006867a60] rtnl_lock at c000000000c940d8
 ljalves#5 [c000000006867a80] tg3_io_slot_reset at c0080000026c2ea8 [tg3]
 ljalves#6 [c000000006867b00] eeh_report_reset at c00000000004de88
...
PID: 363    TASK: c000000037564000  CPU: 6   COMMAND: "kworker/6:1"
...
 ljalves#3 [c000000036c1bb70] msleep at c000000000259e6c
 ljalves#4 [c000000036c1bba0] napi_disable at c000000000c6b848
 ljalves#5 [c000000036c1bbe0] tg3_reset_task at c0080000026d942c [tg3]
 ljalves#6 [c000000036c1bc60] process_one_work at c00000000019e5c4
...

This issue can be avoided by aborting tg3_reset_task() if EEH error
recovery is already in progress.

Fixes: db84bf4 ("tg3: tg3_reset_task() needs to use rtnl_lock to synchronize")
Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Link: https://lore.kernel.org/r/20230124185339.225806-1-drc@linux.vnet.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Mar 14, 2023
…kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 6.2, take ljalves#3

- Yet another fix for non-CPU accesses to the memory backing
  the VGICv3 subsystem

- A set of fixes for the setlftest checking for the S1PTW
  behaviour after the fix that went in ealier in the cycle
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Apr 28, 2023
code path:

ocfs2_ioctl_move_extents
 ocfs2_move_extents
  ocfs2_defrag_extent
   __ocfs2_move_extent
    + ocfs2_journal_access_di
    + ocfs2_split_extent  //sub-paths call jbd2_journal_restart
    + ocfs2_journal_dirty //crash by jbs2 ASSERT

crash stacks:

PID: 11297  TASK: ffff974a676dcd00  CPU: 67  COMMAND: "defragfs.ocfs2"
 #0 [ffffb25d8dad3900] machine_kexec at ffffffff8386fe01
 ljalves#1 [ffffb25d8dad3958] __crash_kexec at ffffffff8395959d
 ljalves#2 [ffffb25d8dad3a20] crash_kexec at ffffffff8395a45d
 ljalves#3 [ffffb25d8dad3a38] oops_end at ffffffff83836d3f
 ljalves#4 [ffffb25d8dad3a58] do_trap at ffffffff83833205
 ljalves#5 [ffffb25d8dad3aa0] do_invalid_op at ffffffff83833aa6
 ljalves#6 [ffffb25d8dad3ac0] invalid_op at ffffffff84200d18
    [exception RIP: jbd2_journal_dirty_metadata+0x2ba]
    RIP: ffffffffc09ca54a  RSP: ffffb25d8dad3b70  RFLAGS: 00010207
    RAX: 0000000000000000  RBX: ffff9706eedc5248  RCX: 0000000000000000
    RDX: 0000000000000001  RSI: ffff97337029ea28  RDI: ffff9706eedc5250
    RBP: ffff9703c3520200   R8: 000000000f46b0b2   R9: 0000000000000000
    R10: 0000000000000001  R11: 00000001000000fe  R12: ffff97337029ea28
    R13: 0000000000000000  R14: ffff9703de59bf60  R15: ffff9706eedc5250
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
 ljalves#7 [ffffb25d8dad3ba8] ocfs2_journal_dirty at ffffffffc137fb95 [ocfs2]
 ljalves#8 [ffffb25d8dad3be8] __ocfs2_move_extent at ffffffffc139a950 [ocfs2]
 ljalves#9 [ffffb25d8dad3c80] ocfs2_defrag_extent at ffffffffc139b2d2 [ocfs2]

Analysis

This bug has the same root cause of 'commit 7f27ec9 ("ocfs2: call
ocfs2_journal_access_di() before ocfs2_journal_dirty() in
ocfs2_write_end_nolock()")'.  For this bug, jbd2_journal_restart() is
called by ocfs2_split_extent() during defragmenting.

How to fix

For ocfs2_split_extent() can handle journal operations totally by itself. 
Caller doesn't need to call journal access/dirty pair, and caller only
needs to call journal start/stop pair.  The fix method is to remove
journal access/dirty from __ocfs2_move_extent().

The discussion for this patch:
https://oss.oracle.com/pipermail/ocfs2-devel/2023-February/000647.html

Link: https://lkml.kernel.org/r/20230217003717.32469-1-heming.zhao@suse.com
Signed-off-by: Heming Zhao <heming.zhao@suse.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue May 30, 2023
Sai Krishna says:

====================
octeontx2: Miscellaneous fixes

This patchset includes following fixes.

Patch ljalves#1 Fix for the race condition while updating APR table

Patch ljalves#2 Fix end bit position in NPC scan config

Patch ljalves#3 Fix depth of CAM, MEM table entries

Patch ljalves#4 Fix in increase the size of DMAC filter flows

Patch ljalves#5 Fix driver crash resulting from invalid interface type
information retrieved from firmware

Patch ljalves#6 Fix incorrect mask used while installing filters involving
fragmented packets

Patch ljalves#7 Fixes for NPC field hash extract w.r.t IPV6 hash reduction,
         IPV6 filed hash configuration.

Patch ljalves#8 Fix for NPC hardware parser configuration destination
         address hash, IPV6 endianness issues.

Patch ljalves#9 Fix for skipping mbox initialization for PFs disabled by firmware.

Patch ljalves#10 Fix disabling packet I/O in case of mailbox timeout.

Patch ljalves#11 Fix detaching LF resources in case of VF probe fail.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 1, 2023
In the function ieee80211_tx_dequeue() there is a particular locking
sequence:

begin:
	spin_lock(&local->queue_stop_reason_lock);
	q_stopped = local->queue_stop_reasons[q];
	spin_unlock(&local->queue_stop_reason_lock);

However small the chance (increased by ftracetest), an asynchronous
interrupt can occur in between of spin_lock() and spin_unlock(),
and the interrupt routine will attempt to lock the same
&local->queue_stop_reason_lock again.

This will cause a costly reset of the CPU and the wifi device or an
altogether hang in the single CPU and single core scenario.

The only remaining spin_lock(&local->queue_stop_reason_lock) that
did not disable interrupts was patched, which should prevent any
deadlocks on the same CPU/core and the same wifi device.

This is the probable trace of the deadlock:

kernel: ================================
kernel: WARNING: inconsistent lock state
kernel: 6.3.0-rc6-mt-20230401-00001-gf86822a1170f ljalves#4 Tainted: G        W
kernel: --------------------------------
kernel: inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
kernel: kworker/5:0/25656 [HC0[0]:SC0[0]:HE1:SE1] takes:
kernel: ffff9d6190779478 (&local->queue_stop_reason_lock){+.?.}-{2:2}, at: return_to_handler+0x0/0x40
kernel: {IN-SOFTIRQ-W} state was registered at:
kernel:   lock_acquire+0xc7/0x2d0
kernel:   _raw_spin_lock+0x36/0x50
kernel:   ieee80211_tx_dequeue+0xb4/0x1330 [mac80211]
kernel:   iwl_mvm_mac_itxq_xmit+0xae/0x210 [iwlmvm]
kernel:   iwl_mvm_mac_wake_tx_queue+0x2d/0xd0 [iwlmvm]
kernel:   ieee80211_queue_skb+0x450/0x730 [mac80211]
kernel:   __ieee80211_xmit_fast.constprop.66+0x834/0xa50 [mac80211]
kernel:   __ieee80211_subif_start_xmit+0x217/0x530 [mac80211]
kernel:   ieee80211_subif_start_xmit+0x60/0x580 [mac80211]
kernel:   dev_hard_start_xmit+0xb5/0x260
kernel:   __dev_queue_xmit+0xdbe/0x1200
kernel:   neigh_resolve_output+0x166/0x260
kernel:   ip_finish_output2+0x216/0xb80
kernel:   __ip_finish_output+0x2a4/0x4d0
kernel:   ip_finish_output+0x2d/0xd0
kernel:   ip_output+0x82/0x2b0
kernel:   ip_local_out+0xec/0x110
kernel:   igmpv3_sendpack+0x5c/0x90
kernel:   igmp_ifc_timer_expire+0x26e/0x4e0
kernel:   call_timer_fn+0xa5/0x230
kernel:   run_timer_softirq+0x27f/0x550
kernel:   __do_softirq+0xb4/0x3a4
kernel:   irq_exit_rcu+0x9b/0xc0
kernel:   sysvec_apic_timer_interrupt+0x80/0xa0
kernel:   asm_sysvec_apic_timer_interrupt+0x1f/0x30
kernel:   _raw_spin_unlock_irqrestore+0x3f/0x70
kernel:   free_to_partial_list+0x3d6/0x590
kernel:   __slab_free+0x1b7/0x310
kernel:   kmem_cache_free+0x52d/0x550
kernel:   putname+0x5d/0x70
kernel:   do_sys_openat2+0x1d7/0x310
kernel:   do_sys_open+0x51/0x80
kernel:   __x64_sys_openat+0x24/0x30
kernel:   do_syscall_64+0x5c/0x90
kernel:   entry_SYSCALL_64_after_hwframe+0x72/0xdc
kernel: irq event stamp: 5120729
kernel: hardirqs last  enabled at (5120729): [<ffffffff9d149936>] trace_graph_return+0xd6/0x120
kernel: hardirqs last disabled at (5120728): [<ffffffff9d149950>] trace_graph_return+0xf0/0x120
kernel: softirqs last  enabled at (5069900): [<ffffffff9cf65b60>] return_to_handler+0x0/0x40
kernel: softirqs last disabled at (5067555): [<ffffffff9cf65b60>] return_to_handler+0x0/0x40
kernel:
        other info that might help us debug this:
kernel:  Possible unsafe locking scenario:
kernel:        CPU0
kernel:        ----
kernel:   lock(&local->queue_stop_reason_lock);
kernel:   <Interrupt>
kernel:     lock(&local->queue_stop_reason_lock);
kernel:
         *** DEADLOCK ***
kernel: 8 locks held by kworker/5:0/25656:
kernel:  #0: ffff9d618009d138 ((wq_completion)events_freezable){+.+.}-{0:0}, at: process_one_work+0x1ca/0x530
kernel:  ljalves#1: ffffb1ef4637fe68 ((work_completion)(&local->restart_work)){+.+.}-{0:0}, at: process_one_work+0x1ce/0x530
kernel:  ljalves#2: ffffffff9f166548 (rtnl_mutex){+.+.}-{3:3}, at: return_to_handler+0x0/0x40
kernel:  ljalves#3: ffff9d6190778728 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: return_to_handler+0x0/0x40
kernel:  ljalves#4: ffff9d619077b480 (&mvm->mutex){+.+.}-{3:3}, at: return_to_handler+0x0/0x40
kernel:  ljalves#5: ffff9d61907bacd8 (&trans_pcie->mutex){+.+.}-{3:3}, at: return_to_handler+0x0/0x40
kernel:  ljalves#6: ffffffff9ef9cda0 (rcu_read_lock){....}-{1:2}, at: iwl_mvm_queue_state_change+0x59/0x3a0 [iwlmvm]
kernel:  ljalves#7: ffffffff9ef9cda0 (rcu_read_lock){....}-{1:2}, at: iwl_mvm_mac_itxq_xmit+0x42/0x210 [iwlmvm]
kernel:
        stack backtrace:
kernel: CPU: 5 PID: 25656 Comm: kworker/5:0 Tainted: G        W          6.3.0-rc6-mt-20230401-00001-gf86822a1170f ljalves#4
kernel: Hardware name: LENOVO 82H8/LNVNB161216, BIOS GGCN51WW 11/16/2022
kernel: Workqueue: events_freezable ieee80211_restart_work [mac80211]
kernel: Call Trace:
kernel:  <TASK>
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  dump_stack_lvl+0x5f/0xa0
kernel:  dump_stack+0x14/0x20
kernel:  print_usage_bug.part.46+0x208/0x2a0
kernel:  mark_lock.part.47+0x605/0x630
kernel:  ? sched_clock+0xd/0x20
kernel:  ? trace_clock_local+0x14/0x30
kernel:  ? __rb_reserve_next+0x5f/0x490
kernel:  ? _raw_spin_lock+0x1b/0x50
kernel:  __lock_acquire+0x464/0x1990
kernel:  ? mark_held_locks+0x4e/0x80
kernel:  lock_acquire+0xc7/0x2d0
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  ? ftrace_return_to_handler+0x8b/0x100
kernel:  ? preempt_count_add+0x4/0x70
kernel:  _raw_spin_lock+0x36/0x50
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  ieee80211_tx_dequeue+0xb4/0x1330 [mac80211]
kernel:  ? prepare_ftrace_return+0xc5/0x190
kernel:  ? ftrace_graph_func+0x16/0x20
kernel:  ? 0xffffffffc02ab0b1
kernel:  ? lock_acquire+0xc7/0x2d0
kernel:  ? iwl_mvm_mac_itxq_xmit+0x42/0x210 [iwlmvm]
kernel:  ? ieee80211_tx_dequeue+0x9/0x1330 [mac80211]
kernel:  ? __rcu_read_lock+0x4/0x40
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  iwl_mvm_mac_itxq_xmit+0xae/0x210 [iwlmvm]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  iwl_mvm_queue_state_change+0x311/0x3a0 [iwlmvm]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  iwl_mvm_wake_sw_queue+0x17/0x20 [iwlmvm]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  iwl_txq_gen2_unmap+0x1c9/0x1f0 [iwlwifi]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  iwl_txq_gen2_free+0x55/0x130 [iwlwifi]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  iwl_txq_gen2_tx_free+0x63/0x80 [iwlwifi]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  _iwl_trans_pcie_gen2_stop_device+0x3f3/0x5b0 [iwlwifi]
kernel:  ? _iwl_trans_pcie_gen2_stop_device+0x9/0x5b0 [iwlwifi]
kernel:  ? mutex_lock_nested+0x4/0x30
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  iwl_trans_pcie_gen2_stop_device+0x5f/0x90 [iwlwifi]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  iwl_mvm_stop_device+0x78/0xd0 [iwlmvm]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  __iwl_mvm_mac_start+0x114/0x210 [iwlmvm]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  iwl_mvm_mac_start+0x76/0x150 [iwlmvm]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  drv_start+0x79/0x180 [mac80211]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  ieee80211_reconfig+0x1523/0x1ce0 [mac80211]
kernel:  ? synchronize_net+0x4/0x50
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  ieee80211_restart_work+0x108/0x170 [mac80211]
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  process_one_work+0x250/0x530
kernel:  ? ftrace_regs_caller_end+0x66/0x66
kernel:  worker_thread+0x48/0x3a0
kernel:  ? __pfx_worker_thread+0x10/0x10
kernel:  kthread+0x10f/0x140
kernel:  ? __pfx_kthread+0x10/0x10
kernel:  ret_from_fork+0x29/0x50
kernel:  </TASK>

Fixes: 4444bc2 ("wifi: mac80211: Proper mark iTXQs for resumption")
Link: https://lore.kernel.org/all/1f58a0d1-d2b9-d851-73c3-93fcc607501c@alu.unizg.hr/
Reported-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Cc: Gregory Greenman <gregory.greenman@intel.com>
Cc: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/all/cdc80531-f25f-6f9d-b15f-25e16130b53a@alu.unizg.hr/
Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Alexander Wetzel <alexander@wetzel-home.de>
Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: tag, or it goes automatically?
Link: https://lore.kernel.org/r/20230425164005.25272-1-mirsad.todorovac@alu.unizg.hr
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 1, 2023
The cited commit adds a compeletion to remove dependency on rtnl
lock. But it causes a deadlock for multiple encapsulations:

 crash> bt ffff8aece8a64000
 PID: 1514557  TASK: ffff8aece8a64000  CPU: 3    COMMAND: "tc"
  #0 [ffffa6d14183f368] __schedule at ffffffffb8ba7f45
  ljalves#1 [ffffa6d14183f3f8] schedule at ffffffffb8ba8418
  ljalves#2 [ffffa6d14183f418] schedule_preempt_disabled at ffffffffb8ba8898
  ljalves#3 [ffffa6d14183f428] __mutex_lock at ffffffffb8baa7f8
  ljalves#4 [ffffa6d14183f4d0] mutex_lock_nested at ffffffffb8baabeb
  ljalves#5 [ffffa6d14183f4e0] mlx5e_attach_encap at ffffffffc0f48c17 [mlx5_core]
  ljalves#6 [ffffa6d14183f628] mlx5e_tc_add_fdb_flow at ffffffffc0f39680 [mlx5_core]
  ljalves#7 [ffffa6d14183f688] __mlx5e_add_fdb_flow at ffffffffc0f3b636 [mlx5_core]
  ljalves#8 [ffffa6d14183f6f0] mlx5e_tc_add_flow at ffffffffc0f3bcdf [mlx5_core]
  ljalves#9 [ffffa6d14183f728] mlx5e_configure_flower at ffffffffc0f3c1d1 [mlx5_core]
 ljalves#10 [ffffa6d14183f790] mlx5e_rep_setup_tc_cls_flower at ffffffffc0f3d529 [mlx5_core]
 ljalves#11 [ffffa6d14183f7a0] mlx5e_rep_setup_tc_cb at ffffffffc0f3d714 [mlx5_core]
 ljalves#12 [ffffa6d14183f7b0] tc_setup_cb_add at ffffffffb8931bb8
 ljalves#13 [ffffa6d14183f810] fl_hw_replace_filter at ffffffffc0dae901 [cls_flower]
 ljalves#14 [ffffa6d14183f8d8] fl_change at ffffffffc0db5c57 [cls_flower]
 ljalves#15 [ffffa6d14183f970] tc_new_tfilter at ffffffffb8936047
 ljalves#16 [ffffa6d14183fac8] rtnetlink_rcv_msg at ffffffffb88c7c31
 ljalves#17 [ffffa6d14183fb50] netlink_rcv_skb at ffffffffb8942853
 ljalves#18 [ffffa6d14183fbc0] rtnetlink_rcv at ffffffffb88c1835
 ljalves#19 [ffffa6d14183fbd0] netlink_unicast at ffffffffb8941f27
 ljalves#20 [ffffa6d14183fc18] netlink_sendmsg at ffffffffb8942245
 ljalves#21 [ffffa6d14183fc98] sock_sendmsg at ffffffffb887d482
 ljalves#22 [ffffa6d14183fcb8] ____sys_sendmsg at ffffffffb887d81a
 ljalves#23 [ffffa6d14183fd38] ___sys_sendmsg at ffffffffb88806e2
 ljalves#24 [ffffa6d14183fe90] __sys_sendmsg at ffffffffb88807a2
 ljalves#25 [ffffa6d14183ff28] __x64_sys_sendmsg at ffffffffb888080f
 ljalves#26 [ffffa6d14183ff38] do_syscall_64 at ffffffffb8b9b6a8
 ljalves#27 [ffffa6d14183ff50] entry_SYSCALL_64_after_hwframe at ffffffffb8c0007c
 crash> bt 0xffff8aeb07544000
 PID: 1110766  TASK: ffff8aeb07544000  CPU: 0    COMMAND: "kworker/u20:9"
  #0 [ffffa6d14e6b7bd8] __schedule at ffffffffb8ba7f45
  ljalves#1 [ffffa6d14e6b7c68] schedule at ffffffffb8ba8418
  ljalves#2 [ffffa6d14e6b7c88] schedule_timeout at ffffffffb8baef88
  ljalves#3 [ffffa6d14e6b7d10] wait_for_completion at ffffffffb8ba968b
  ljalves#4 [ffffa6d14e6b7d60] mlx5e_take_all_encap_flows at ffffffffc0f47ec4 [mlx5_core]
  ljalves#5 [ffffa6d14e6b7da0] mlx5e_rep_update_flows at ffffffffc0f3e734 [mlx5_core]
  ljalves#6 [ffffa6d14e6b7df8] mlx5e_rep_neigh_update at ffffffffc0f400bb [mlx5_core]
  ljalves#7 [ffffa6d14e6b7e50] process_one_work at ffffffffb80acc9c
  ljalves#8 [ffffa6d14e6b7ed0] worker_thread at ffffffffb80ad012
  ljalves#9 [ffffa6d14e6b7f10] kthread at ffffffffb80b615d
 ljalves#10 [ffffa6d14e6b7f50] ret_from_fork at ffffffffb8001b2f

After the first encap is attached, flow will be added to encap
entry's flows list. If neigh update is running at this time, the
following encaps of the flow can't hold the encap_tbl_lock and
sleep. If neigh update thread is waiting for that flow's init_done,
deadlock happens.

Fix it by holding lock outside of the for loop. If neigh update is
running, prevent encap flows from offloading. Since the lock is held
outside of the for loop, concurrent creation of encap entries is not
allowed. So remove unnecessary wait_for_completion call for res_ready.

Fixes: 95435ad ("net/mlx5e: Only access fully initialized flows in neigh update")
Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 1, 2023
…kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 6.4, take ljalves#3

- Fix the reported address of a watchpoint forwarded to userspace

- Fix the freeing of the root of stage-2 page tables

- Stop creating spurious PMU events to perform detection of the
  default PMU and use the existing PMU list instead.
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 27, 2023
…linux/kernel/git/tip/tip

Pull SMP updates from Thomas Gleixner:
 "A large update for SMP management:

   - Parallel CPU bringup

     The reason why people are interested in parallel bringup is to
     shorten the (kexec) reboot time of cloud servers to reduce the
     downtime of the VM tenants.

     The current fully serialized bringup does the following per AP:

       1) Prepare callbacks (allocate, intialize, create threads)
       2) Kick the AP alive (e.g. INIT/SIPI on x86)
       3) Wait for the AP to report alive state
       4) Let the AP continue through the atomic bringup
       5) Let the AP run the threaded bringup to full online state

     There are two significant delays:

       ljalves#3 The time for an AP to report alive state in start_secondary()
          on x86 has been measured in the range between 350us and 3.5ms
          depending on vendor and CPU type, BIOS microcode size etc.

       ljalves#4 The atomic bringup does the microcode update. This has been
          measured to take up to ~8ms on the primary threads depending
          on the microcode patch size to apply.

     On a two socket SKL server with 56 cores (112 threads) the boot CPU
     spends on current mainline about 800ms busy waiting for the APs to
     come up and apply microcode. That's more than 80% of the actual
     onlining procedure.

     This can be reduced significantly by splitting the bringup
     mechanism into two parts:

       1) Run the prepare callbacks and kick the AP alive for each AP
          which needs to be brought up.

          The APs wake up, do their firmware initialization and run the
          low level kernel startup code including microcode loading in
          parallel up to the first synchronization point. (ljalves#1 and ljalves#2
          above)

       2) Run the rest of the bringup code strictly serialized per CPU
          (ljalves#3 - ljalves#5 above) as it's done today.

          Parallelizing that stage of the CPU bringup might be possible
          in theory, but it's questionable whether required surgery
          would be justified for a pretty small gain.

     If the system is large enough the first AP is already waiting at
     the first synchronization point when the boot CPU finished the
     wake-up of the last AP. That reduces the AP bringup time on that
     SKL from ~800ms to ~80ms, i.e. by a factor ~10x.

     The actual gain varies wildly depending on the system, CPU,
     microcode patch size and other factors. There are some
     opportunities to reduce the overhead further, but that needs some
     deep surgery in the x86 CPU bringup code.

     For now this is only enabled on x86, but the core functionality
     obviously works for all SMP capable architectures.

   - Enhancements for SMP function call tracing so it is possible to
     locate the scheduling and the actual execution points. That allows
     to measure IPI delivery time precisely"

* tag 'smp-core-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip: (45 commits)
  trace,smp: Add tracepoints for scheduling remotelly called functions
  trace,smp: Add tracepoints around remotelly called functions
  MAINTAINERS: Add CPU HOTPLUG entry
  x86/smpboot: Fix the parallel bringup decision
  x86/realmode: Make stack lock work in trampoline_compat()
  x86/smp: Initialize cpu_primary_thread_mask late
  cpu/hotplug: Fix off by one in cpuhp_bringup_mask()
  x86/apic: Fix use of X{,2}APIC_ENABLE in asm with older binutils
  x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it
  x86/smpboot: Support parallel startup of secondary CPUs
  x86/smpboot: Implement a bit spinlock to protect the realmode stack
  x86/apic: Save the APIC virtual base address
  cpu/hotplug: Allow "parallel" bringup up to CPUHP_BP_KICK_AP_STATE
  x86/apic: Provide cpu_primary_thread mask
  x86/smpboot: Enable split CPU startup
  cpu/hotplug: Provide a split up CPUHP_BRINGUP mechanism
  cpu/hotplug: Reset task stack state in _cpu_up()
  cpu/hotplug: Remove unused state functions
  riscv: Switch to hotplug core state synchronization
  parisc: Switch to hotplug core state synchronization
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants