DVB Card with SAA7146 chipset not working

Bug #1742316 reported by TauSo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Kai-Heng Feng
Artful
Fix Released
Undecided
Unassigned

Bug Description

=== SRU Justification ===
[Impact]
Callers vmalloc_32() expect the page is not located in highmem.
All users of vmalloc_32() have this issue, module saa7146 is one of
them.

[Test]
saa7146 crashes at probing. The issue is fixed with the patch.

[Fix]
Add GFP_DMA32 to GFP_VMALLOC32 flag for 32bits systems.
The patch is in stable trees, so only Artful needs this patch.

[Regression Potential]
Low. It's a crucial fix for 32bits systems.

=== Original Bug Report ===
After upgrading to 17.10 (from 16.04 with 4.4 kernel) my PCI DVB card Terratec Cinergy DVB-1200 with SAA7146 chipset is not working anymore. There is a kernel bug message while booting and no /dev/dvb device is created. Tried also with newest mainline 4.14 kernel - same error.

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: linux-image-4.13.0-25-generic 4.13.0-25.29
ProcVersionSignature: Ubuntu 4.13.0-25.29-generic 4.13.13
Uname: Linux 4.13.0-25-generic i686
AlsaVersion: Advanced Linux Sound Architecture Driver Version k4.13.0-25-generic.
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
ApportVersion: 2.20.7-0ubuntu3.7
Architecture: i386
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 'arecord'
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', '/dev/snd/hwC0D1', '/dev/snd/hwC0D0', '/dev/snd/pcmC0D3p', '/dev/snd/pcmC0D2c', '/dev/snd/pcmC0D1p', '/dev/snd/pcmC0D0c', '/dev/snd/pcmC0D0p', '/dev/snd/controlC0', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
Card0.Amixer.info: Error: [Errno 2] No such file or directory: 'amixer': 'amixer'
Card0.Amixer.values: Error: [Errno 2] No such file or directory: 'amixer': 'amixer'
Date: Wed Jan 10 00:42:24 2018
HibernationDevice: RESUME=UUID=342e30a6-d71f-47c0-b65a-5ba657a80456
InstallationDate: Installed on 2016-02-13 (696 days ago)
InstallationMedia: Ubuntu-Server 15.10 "Wily Werewolf" - Release i386 (20151021)
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig': 'iwconfig'
MachineType: To Be Filled By O.E.M. To Be Filled By O.E.M.
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
ProcFB: 0 psbdrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.13.0-25-generic root=UUID=97ea5186-d18d-4c06-a8b2-2dd1417477be ro splash quiet acpi=force video=LVDS-1:d vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-4.13.0-25-generic N/A
 linux-backports-modules-4.13.0-25-generic N/A
 linux-firmware 1.169.1
RfKill: Error: [Errno 2] No such file or directory: 'rfkill': 'rfkill'
SourcePackage: linux
UpgradeStatus: Upgraded to artful on 2016-07-07 (551 days ago)
dmi.bios.date: 04/19/2013
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: P1.60
dmi.board.name: AD2700-ITX
dmi.board.vendor: ASRock
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP1.60:bd04/19/2013:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnASRock:rnAD2700-ITX:rvr:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.family: To Be Filled By O.E.M.
dmi.product.name: To Be Filled By O.E.M.
dmi.product.version: To Be Filled By O.E.M.
dmi.sys.vendor: To Be Filled By O.E.M.

Revision history for this message
TauSo (tauso) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v4.15 kernel[0].

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15-rc7

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Revision history for this message
TauSo (tauso) wrote :
Download full text (3.5 KiB)

Unfortunatly the same problem:

[ 6.201796] ------------[ cut here ]------------
[ 6.201799] kernel BUG at /home/kernel/COD/linux/drivers/media/common/saa7146/saa7146_core.c:163!
[ 6.201812] invalid opcode: 0000 [#1] SMP
[ 6.201814] Modules linked in: snd_hda_codec_generic snd_hda_intel budget_av(+) snd_hda_codec saa7146_vv snd_hda_core budget_core ttpci_eeprom snd_hwdep saa7146 snd_pcm intel_powerclamp videobuf_dma_sg videobuf_core dvb_core v4l2_common snd_timer videodev snd input_leds joydev lpc_ich media soundcore shpchp mac_hid nct6775 hwmon_vid coretemp ip_tables x_tables autofs4 uas usb_storage hid_generic usbhid hid gma500_gfx i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt r8169 fb_sys_fops ahci drm libahci mii video
[ 6.201882] CPU: 3 PID: 293 Comm: systemd-udevd Not tainted 4.15.0-041500rc7-generic #201801072330
[ 6.201884] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./AD2700-ITX, BIOS P1.60 04/19/2013
[ 6.201895] EIP: saa7146_vmalloc_build_pgtable+0x140/0x1020 [saa7146]
[ 6.201897] EFLAGS: 00010246 CPU: 3
[ 6.201900] EAX: f24b8908 EBX: f478b800 ECX: 00000002 EDX: fff1c000
[ 6.201903] ESI: 00000000 EDI: f864a000 EBP: f4b65c44 ESP: f4b65c24
[ 6.201906] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[ 6.201910] CR0: 80050033 CR2: 00587024 CR3: 310b72a0 CR4: 000006f0
[ 6.201912] Call Trace:
[ 6.201925] ttpci_budget_init+0x26c/0x530 [budget_core]
[ 6.201935] ? budget_av_attach+0x3e/0x4e8 [budget_av]
[ 6.201944] budget_av_attach+0x75/0x4e8 [budget_av]
[ 6.201954] ? vprintk_func+0x29/0x70
[ 6.201959] ? printk+0x13/0x15
[ 6.201965] ? saa7146_init_one+0x69f/0x770 [saa7146]
[ 6.201971] saa7146_init_one+0x70b/0x770 [saa7146]
[ 6.201979] ? __pm_runtime_resume+0x51/0x80
[ 6.201985] pci_device_probe+0xc2/0x160
[ 6.201991] driver_probe_device+0x2d9/0x450
[ 6.201996] __driver_attach+0x99/0xe0
[ 6.202000] ? driver_probe_device+0x450/0x450
[ 6.202005] bus_for_each_dev+0x57/0x90
[ 6.202010] driver_attach+0x19/0x20
[ 6.202014] ? driver_probe_device+0x450/0x450
[ 6.202018] bus_add_driver+0x187/0x230
[ 6.202022] ? 0xf8334000
[ 6.202026] driver_register+0x56/0xd0
[ 6.202030] ? 0xf8334000
[ 6.202035] __pci_register_driver+0x3a/0x40
[ 6.202041] saa7146_register_extension+0x50/0x80 [saa7146]
[ 6.202050] budget_av_init+0x12/0x1000 [budget_av]
[ 6.202055] do_one_initcall+0x46/0x170
[ 6.202061] ? vunmap_page_range+0x13e/0x280
[ 6.202067] ? _cond_resched+0x17/0x40
[ 6.202073] ? kmem_cache_alloc_trace+0x165/0x1d0
[ 6.202078] ? do_init_module+0x21/0x1ec
[ 6.202082] ? do_init_module+0x21/0x1ec
[ 6.202087] do_init_module+0x50/0x1ec
[ 6.202092] load_module+0x1565/0x1a80
[ 6.202102] SyS_finit_module+0x8a/0xe0
[ 6.202110] do_fast_syscall_32+0x71/0x1d0
[ 6.202116] entry_SYSENTER_32+0x4e/0x7c
[ 6.202119] EIP: 0xb7eeccf9
[ 6.202121] EFLAGS: 00000292 CPU: 3
[ 6.202124] EAX: ffffffda EBX: 00000018 ECX: b7cdda71 EDX: 00000000
[ 6.202127] ESI: 01547e30 EDI: 0154a2f0 EBP: 00000000 ESP: bfb3355c
[ 6.202129] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b
[ 6.202133]...

Read more...

tags: added: kernel-bug-exists-upstream
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Please follow [1] to find the first bad -rc kernel.

Then we can use `git bisect` to find the first bad commit.

[1] https://wiki.ubuntu.com/Kernel/KernelBisection

Revision history for this message
TauSo (tauso) wrote :

I've tried some of the mainline kernels and finally got to this situation:
last working kernel: v4.11.12 mainline build [1]
first non working kernel: v4.12-rc1 mainline build [2]

Hope that will help to find the bug.

[1] http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11.12/
[2] http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.12-rc1/

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Revision history for this message
TauSo (tauso) wrote :

Thanks for your work, but could you build the kernel for i386 platform, as my system (Atom D2700) does not support amd64 due to bios restrictions?

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Revision history for this message
TauSo (tauso) wrote :
Download full text (3.7 KiB)

Thanks for trying, but unfortunately your kernel does not resolve the problem:

4.13.0-32-generic #35~lp1742316 SMP Fri Jan 26 21:40:59 CST 2018 i686 i686 i686 GNU/Linux

[ 6.429543] ------------[ cut here ]------------
[ 6.429548] kernel BUG at /home/khfeng/Sources/linux-lp1742316-saa7146/drivers/media/common/saa7146/saa7146_core.c:163!
[ 6.429561] invalid opcode: 0000 [#1] SMP
[ 6.429708] Modules linked in: snd_hda_codec_hdmi(+) snd_hda_codec_realtek budget_av(+) saa7146_vv snd_hda_codec_generic budget_core ttpci_eeprom snd_hda_intel saa7146 ppdev videobuf_dma_sg videobuf_core dvb_core v4l2_common snd_hda_codec videodev snd_hda_core snd_hwdep intel_powerclamp media joydev input_leds snd_pcm lpc_ich snd_timer snd soundcore shpchp parport_pc parport nuvoton_cir mac_hid rc_core nct6775 hwmon_vid coretemp ip_tables x_tables autofs4 hid_generic usbhid hid gma500_gfx i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt ahci fb_sys_fops libahci drm r8169 mii video
[ 6.431394] CPU: 3 PID: 306 Comm: systemd-udevd Not tainted 4.13.0-32-generic #35~lp1742316
[ 6.431654] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./AD2700-ITX, BIOS P1.60 04/19/2013
[ 6.431949] task: f5202700 task.stack: f4886000
[ 6.432108] EIP: saa7146_vmalloc_build_pgtable+0x180/0x1020 [saa7146]
[ 6.432301] EFLAGS: 00010246 CPU: 3
[ 6.432406] EAX: f21e2568 EBX: f8365000 ECX: 00000002 EDX: fff1c000
[ 6.432592] ESI: 00000000 EDI: f871f000 EBP: f4887c44 ESP: f4887c20
[ 6.432784] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[ 6.432954] CR0: 80050033 CR2: 00b6e924 CR3: 35048940 CR4: 000006f0
[ 6.433142] Call Trace:
[ 6.433229] ttpci_budget_init+0x26c/0x530 [budget_core]
[ 6.433398] budget_av_attach+0x75/0x4e8 [budget_av]
[ 6.433556] ? vprintk_func+0x29/0x70
[ 6.433666] ? printk+0x13/0x15
[ 6.433767] ? saa7146_init_one+0x69f/0x770 [saa7146]
[ 6.433925] saa7146_init_one+0x70b/0x770 [saa7146]
[ 6.434080] ? __pm_runtime_resume+0x51/0x80
[ 6.434213] pci_device_probe+0xc2/0x160
[ 6.434328] driver_probe_device+0x2b9/0x410
[ 6.434457] __driver_attach+0x99/0xe0
[ 6.434575] ? driver_probe_device+0x410/0x410
[ 6.434708] bus_for_each_dev+0x57/0x90
[ 6.434832] driver_attach+0x19/0x20
[ 6.434937] ? driver_probe_device+0x410/0x410
[ 6.440934] bus_add_driver+0x187/0x230
[ 6.440938] ? 0xf8522000
[ 6.440943] driver_register+0x56/0xd0
[ 6.440946] ? 0xf8522000
[ 6.440950] __pci_register_driver+0x33/0x40
[ 6.440957] saa7146_register_extension+0x50/0x80 [saa7146]
[ 6.440966] budget_av_init+0xd/0x1000 [budget_av]
[ 6.440971] do_one_initcall+0x46/0x180
[ 6.440977] ? kfree+0x134/0x140
[ 6.440980] ? kfree+0x134/0x140
[ 6.440983] ? kfree+0x134/0x140
[ 6.440987] ? kmem_cache_alloc_trace+0x13d/0x1a0
[ 6.440992] ? do_init_module+0x21/0x1cc
[ 6.440995] ? do_init_module+0x21/0x1cc
[ 6.441000] do_init_module+0x50/0x1cc
[ 6.441004] load_module+0x1533/0x1aa0
[ 6.441011] ? kernel_read_file+0x26e/0x2a0
[ 6.441018] SyS_finit_module+0x8a/0xe0
[ 6.441025] do_fast_syscall_32+0x71/0x150
[ 6.441032] entry_SYSENTER_32+0x4e/0x7c
[ ...

Read more...

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
$ cd linux
$ git bisect start
$ git bisect good v4.11
$ git bisect bad v4.12-rc1
$ make localmodconfig
$ make -j`nproc` deb-pkg
Install the newly built kernel.
If the issue still happens,
$ git bisect bad
Otherwise,
$ git bisect good
Repeat to "make -j`nproc` deb-pkg" until you find the commit that causes the regression.

Revision history for this message
TauSo (tauso) wrote :

It took 14 steps, but finally here is the possible culprit:

19809c2da28aee5860ad9a2eff760730a0710df0 is the first bad commit
commit 19809c2da28aee5860ad9a2eff760730a0710df0
Author: Michal Hocko <email address hidden>
Date: Mon May 8 15:57:44 2017 -0700

    mm, vmalloc: use __GFP_HIGHMEM implicitly

    __vmalloc* allows users to provide gfp flags for the underlying
    allocation. This API is quite popular

      $ git grep "=[[:space:]]__vmalloc\|return[[:space:]]*__vmalloc" | wc -l
      77

    The only problem is that many people are not aware that they really want
    to give __GFP_HIGHMEM along with other flags because there is really no
    reason to consume precious lowmemory on CONFIG_HIGHMEM systems for pages
    which are mapped to the kernel vmalloc space. About half of users don't
    use this flag, though. This signals that we make the API unnecessarily
    too complex.

    This patch simply uses __GFP_HIGHMEM implicitly when allocating pages to
    be mapped to the vmalloc space. Current users which add __GFP_HIGHMEM
    are simplified and drop the flag.

    Link: http://<email address hidden>
    Signed-off-by: Michal Hocko <email address hidden>
    Reviewed-by: Matthew Wilcox <email address hidden>
    Cc: Al Viro <email address hidden>
    Cc: Vlastimil Babka <email address hidden>
    Cc: David Rientjes <email address hidden>
    Cc: Cristopher Lameter <email address hidden>
    Signed-off-by: Andrew Morton <email address hidden>
    Signed-off-by: Linus Torvalds <email address hidden>

:040000 040000 5cdc1c298cd62f74b76602846ce13ef386b06f22 d35baa52e7f078b35eb659fe2926c20c0867ed9e M arch
:040000 040000 045c832d50bf5255b42bdb0f28b09d36087a10eb 72610cae50071293567c229360546df0b99baae4 M drivers
:040000 040000 11f420f52bd9613ce1a1b0b01e3cbbd287a7b729 d3b957b5a886ba12041462588c323521961f368e M fs
:040000 040000 035a87f5c946730440625485bab4283ba03cbf3a 311929864121b80809596cc34d36b83bd6b8b9a6 M include
:040000 040000 46bcc13bebdc7f704db764542b6fae0a6362f64d c5674e6547e15e4a879576971fab242e1513e7e2 M kernel
:040000 040000 e11579b380817b207dd328539bbfa23723d7af95 ffc174b7261fcffcd52bfac24994469ccf5c7d12 M mm
:040000 040000 8357adc979b4be710b3d295425ac8c7ecd31b34d 31058e41d6828bcd7a9c9daf7a45cfa46dcd3ec4 M net

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Hmm I think my previous kernel won't work because your system is 32bit.
I'll build a new one soon.

Revision history for this message
TauSo (tauso) wrote :
Download full text (3.7 KiB)

Unfortunately it's not working, but the bug is at another codeline, so maybe another problem? Or the same problem is in the code multiple times?

 ------------[ cut here ]------------
[ 5.990508] kernel BUG at /home/khfeng/Sources/linux-lp1742316-saa7146/drivers/media/common/saa7146/saa7146_core.c:166!
[ 5.990519] invalid opcode: 0000 [#1] SMP
[ 5.990521] Modules linked in: ppdev snd_hda_codec_realtek(+) snd_hda_codec_generic budget_av(+) saa7146_vv snd_hda_intel budget_core ttpci_eeprom snd_hda_codec saa7146 snd_hda_core videobuf_dma_sg videobuf_core snd_hwdep dvb_core snd_pcm v4l2_common snd_timer videodev snd intel_powerclamp joydev media lpc_ich input_leds soundcore shpchp parport_pc nuvoton_cir parport rc_core mac_hid nct6775 hwmon_vid coretemp ip_tables x_tables autofs4 hid_generic usbhid hid gma500_gfx i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt r8169 ahci fb_sys_fops drm libahci mii video
[ 5.990587] CPU: 1 PID: 301 Comm: systemd-udevd Not tainted 4.13.0-33-generic #36
[ 5.990589] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./AD2700-ITX, BIOS P1.60 04/19/2013
[ 5.990591] task: f49bf500 task.stack: f4986000
[ 5.990601] EIP: saa7146_vmalloc_build_pgtable+0x188/0x1020 [saa7146]
[ 5.990603] EFLAGS: 00010246 CPU: 1
[ 5.990605] EAX: f1ce7d88 EBX: f8236000 ECX: 00000002 EDX: fff1c000
[ 5.990608] ESI: 00000000 EDI: f84f2000 EBP: f4987c44 ESP: f4987c20
[ 5.990610] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[ 5.990613] CR0: 80050033 CR2: b7b6715c CR3: 34935d60 CR4: 000006f0
[ 5.990615] Call Trace:
[ 5.990627] ttpci_budget_init+0x26c/0x530 [budget_core]
[ 5.990637] budget_av_attach+0x75/0x4e8 [budget_av]
[ 5.990646] ? vprintk_func+0x29/0x70
[ 5.990650] ? printk+0x13/0x15
[ 5.990655] ? saa7146_init_one+0x69f/0x770 [saa7146]
[ 5.990661] saa7146_init_one+0x70b/0x770 [saa7146]
[ 5.990667] ? __pm_runtime_resume+0x51/0x80
[ 5.990673] pci_device_probe+0xc2/0x160
[ 5.990679] driver_probe_device+0x2b9/0x410
[ 5.990683] __driver_attach+0x99/0xe0
[ 5.990687] ? driver_probe_device+0x410/0x410
[ 5.990691] bus_for_each_dev+0x57/0x90
[ 5.990695] driver_attach+0x19/0x20
[ 5.990698] ? driver_probe_device+0x410/0x410
[ 5.990702] bus_add_driver+0x187/0x230
[ 5.990705] ? 0xf826e000
[ 5.990709] driver_register+0x56/0xd0
[ 5.990712] ? 0xf826e000
[ 5.990715] __pci_register_driver+0x33/0x40
[ 5.990721] saa7146_register_extension+0x50/0x80 [saa7146]
[ 5.990730] budget_av_init+0xd/0x1000 [budget_av]
[ 5.990735] do_one_initcall+0x46/0x180
[ 5.990741] ? vunmap_page_range+0x13e/0x280
[ 5.990746] ? kvfree+0x45/0x50
[ 5.990750] ? kmem_cache_alloc_trace+0x13d/0x1a0
[ 5.990754] ? do_init_module+0x21/0x1cc
[ 5.990758] ? do_init_module+0x21/0x1cc
[ 5.990762] do_init_module+0x50/0x1cc
[ 5.990765] load_module+0x1533/0x1aa0
[ 5.990772] ? kernel_read_file+0x26e/0x2a0
[ 5.990778] SyS_finit_module+0x8a/0xe0
[ 5.990785] do_fast_syscall_32+0x71/0x150
[ 5.990791] entry_SYSENTER_32+0x4e/0x7c
[ 5.990794] EIP: 0xb7f5acf9
[ 5.990795] EFLAGS: 00000296 CPU: 1
[ 5.990798] EAX: ffffff...

Read more...

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

We need to use GFP_DMA32 for vmalloc, please try this kernel,

people.canonical.com/~khfeng/lp1742316-dma32/

Revision history for this message
TauSo (tauso) wrote :
Download full text (3.6 KiB)

Thanks for your work, but the bug is still triggered - new codeline at least ;-)

[ 5.405637] ------------[ cut here ]------------
[ 5.405643] kernel BUG at /home/khfeng/Sources/linux-lp1742316-saa7146/drivers/media/common/saa7146/saa7146_core.c:164!
[ 5.405671] invalid opcode: 0000 [#1] SMP
[ 5.405677] Modules linked in: snd_hda_codec_hdmi snd_hda_codec_realtek budget_av(+) snd_hda_codec_generic saa7146_vv snd_hda_intel budget_core ttpci_eeprom snd_hda_codec snd_hda_core saa7146 videobuf_dma_sg videobuf_core dvb_core snd_hwdep v4l2_common intel_powerclamp snd_pcm videodev snd_timer media joydev snd input_leds lpc_ich soundcore shpchp mac_hid nct6775 hwmon_vid coretemp ip_tables x_tables autofs4 hid_generic gma500_gfx usbhid hid i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt ahci r8169 fb_sys_fops libahci drm mii video
[ 5.405763] CPU: 0 PID: 288 Comm: systemd-udevd Not tainted 4.14.0-17-generic #20
[ 5.405769] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./AD2700-ITX, BIOS P1.60 04/19/2013
[ 5.405776] task: f11b30c0 task.stack: f48c8000
[ 5.405789] EIP: saa7146_vmalloc_build_pgtable+0x190/0x1020 [saa7146]
[ 5.405794] EFLAGS: 00010246 CPU: 0
[ 5.405800] EAX: f22dd620 EBX: f8272000 ECX: 00000002 EDX: fff1c000
[ 5.405806] ESI: 00000000 EDI: f84a4000 EBP: f48c9c44 ESP: f48c9c20
[ 5.405811] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[ 5.405817] CR0: 80050033 CR2: 017c7cf4 CR3: 313aa640 CR4: 000006f0
[ 5.405822] Call Trace:
[ 5.405838] ttpci_budget_init+0x26c/0x530 [budget_core]
[ 5.405851] ? budget_av_attach+0x3e/0x4e8 [budget_av]
[ 5.405864] budget_av_attach+0x75/0x4e8 [budget_av]
[ 5.405878] ? vprintk_func+0x29/0x70
[ 5.405886] ? printk+0x13/0x15
[ 5.405895] ? saa7146_init_one+0x69f/0x770 [saa7146]
[ 5.405906] saa7146_init_one+0x70b/0x770 [saa7146]
[ 5.405919] ? __pm_runtime_resume+0x51/0x80
[ 5.405929] pci_device_probe+0xc2/0x160
[ 5.405940] driver_probe_device+0x2b9/0x410
[ 5.405949] __driver_attach+0x99/0xe0
[ 5.405958] ? driver_probe_device+0x410/0x410
[ 5.405966] bus_for_each_dev+0x57/0x90
[ 5.405975] driver_attach+0x19/0x20
[ 5.405982] ? driver_probe_device+0x410/0x410
[ 5.405990] bus_add_driver+0x187/0x230
[ 5.405997] ? 0xf8727000
[ 5.406004] driver_register+0x56/0xd0
[ 5.406011] ? 0xf8727000
[ 5.406018] __pci_register_driver+0x3a/0x40
[ 5.406029] saa7146_register_extension+0x50/0x80 [saa7146]
[ 5.406043] budget_av_init+0xd/0x1000 [budget_av]
[ 5.406053] do_one_initcall+0x46/0x180
[ 5.406063] ? kfree+0x155/0x170
[ 5.406071] ? kfree+0x155/0x170
[ 5.406078] ? kmem_cache_alloc_trace+0x165/0x1d0
[ 5.406086] ? do_init_module+0x21/0x1cc
[ 5.406093] ? do_init_module+0x21/0x1cc
[ 5.406102] do_init_module+0x50/0x1cc
[ 5.406110] load_module+0x1565/0x1a80
[ 5.406124] SyS_finit_module+0x8a/0xe0
[ 5.406135] do_fast_syscall_32+0x71/0x1d0
[ 5.406145] entry_SYSENTER_32+0x4e/0x7c
[ 5.406151] EIP: 0xb7f3ecf9
[ 5.406156] EFLAGS: 00000296 CPU: 0
[ 5.406162] EAX: ffffffda EBX: 00000018 ECX: b7d2fa71 EDX: 00000000
[ 5.406167] ESI: 017bc9d0 EDI: ...

Read more...

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Hmmpf, please try this one,
people.canonical.com/~khfeng/lp1742316-dma/

Revision history for this message
TauSo (tauso) wrote :
Download full text (3.6 KiB)

Sorry, this won't do it.
Can I help with some other logfiles?

[ 5.493739] ------------[ cut here ]------------
[ 5.493742] kernel BUG at /home/khfeng/Sources/linux-lp1742316-saa7146/drivers/media/common/saa7146/saa7146_core.c:164!
[ 5.493760] invalid opcode: 0000 [#1] SMP
[ 5.493764] Modules linked in: budget_av(+) saa7146_vv snd_hda_codec_hdmi budget_core snd_hda_codec_realtek ttpci_eeprom snd_hda_codec_generic saa7146 snd_hda_intel snd_hda_codec videobuf_dma_sg videobuf_core snd_hda_core dvb_core snd_hwdep v4l2_common snd_pcm intel_powerclamp snd_timer videodev joydev snd media input_leds soundcore lpc_ich shpchp mac_hid nct6775 hwmon_vid coretemp ip_tables x_tables autofs4 hid_generic usbhid hid gma500_gfx i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ahci drm r8169 libahci mii video
[ 5.493848] CPU: 2 PID: 290 Comm: systemd-udevd Not tainted 4.14.0-17-generic #20
[ 5.493853] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./AD2700-ITX, BIOS P1.60 04/19/2013
[ 5.493860] task: f10e8000 task.stack: f4a00000
[ 5.493872] EIP: saa7146_vmalloc_build_pgtable+0x190/0x1020 [saa7146]
[ 5.493876] EFLAGS: 00010246 CPU: 2
[ 5.493881] EAX: f22dd8f0 EBX: f8271000 ECX: 00000002 EDX: fff1c000
[ 5.493886] ESI: 00000000 EDI: f868d000 EBP: f4a01c44 ESP: f4a01c20
[ 5.493892] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[ 5.493897] CR0: 80050033 CR2: 004f0860 CR3: 35389b00 CR4: 000006f0
[ 5.493901] Call Trace:
[ 5.493915] ttpci_budget_init+0x26c/0x530 [budget_core]
[ 5.493927] ? budget_av_attach+0x3e/0x4e8 [budget_av]
[ 5.493938] budget_av_attach+0x75/0x4e8 [budget_av]
[ 5.493950] ? vprintk_func+0x29/0x70
[ 5.493956] ? printk+0x13/0x15
[ 5.493964] ? saa7146_init_one+0x69f/0x770 [saa7146]
[ 5.493973] saa7146_init_one+0x70b/0x770 [saa7146]
[ 5.493982] ? __pm_runtime_resume+0x51/0x80
[ 5.493991] pci_device_probe+0xc2/0x160
[ 5.493998] driver_probe_device+0x2b9/0x410
[ 5.494006] __driver_attach+0x99/0xe0
[ 5.494012] ? driver_probe_device+0x410/0x410
[ 5.494018] bus_for_each_dev+0x57/0x90
[ 5.494025] driver_attach+0x19/0x20
[ 5.494031] ? driver_probe_device+0x410/0x410
[ 5.494037] bus_add_driver+0x187/0x230
[ 5.494043] ? 0xf8512000
[ 5.494049] driver_register+0x56/0xd0
[ 5.494055] ? 0xf8512000
[ 5.494061] __pci_register_driver+0x3a/0x40
[ 5.494069] saa7146_register_extension+0x50/0x80 [saa7146]
[ 5.494080] budget_av_init+0xd/0x1000 [budget_av]
[ 5.494087] do_one_initcall+0x46/0x180
[ 5.494094] ? __schedule+0x298/0x8c0
[ 5.494101] ? vunmap_page_range+0x13e/0x280
[ 5.494109] ? kmem_cache_alloc_trace+0x165/0x1d0
[ 5.494116] ? do_init_module+0x21/0x1cc
[ 5.494122] ? do_init_module+0x21/0x1cc
[ 5.494129] do_init_module+0x50/0x1cc
[ 5.494136] load_module+0x1565/0x1a80
[ 5.494148] SyS_finit_module+0x8a/0xe0
[ 5.494157] do_fast_syscall_32+0x71/0x1d0
[ 5.494164] entry_SYSENTER_32+0x4e/0x7c
[ 5.494169] EIP: 0xb7f30cf9
[ 5.494173] EFLAGS: 00000296 CPU: 2
[ 5.494178] EAX: ffffffda EBX: 00000018 ECX: b7d21a71 EDX: 00000000
[ 5.494183] ESI: 02293da0 EDI: 02...

Read more...

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

The problem is that the commit you bisected implicitly use GFP_HIGHMEM mask. A later commit, tries to alleviate the issue by not setting GFP_HIGHMEM when GFP_DMA or GFP_DMA32 is set,

commit 704b862f9efd6d4c87a8d0a344dda19bda9c6b69
Author: Laura Abbott <email address hidden>
Date: Fri Aug 18 15:16:27 2017 -0700

    mm/vmalloc.c: don't unconditonally use __GFP_HIGHMEM

So add GFP_DMA32 or GFP_DMA should solve the issue, but it doesn't,
diff --git a/drivers/media/common/saa7146/saa7146_core.c b/drivers/media/common/saa7146/saa7146_core.c
index 9f7c5b0a6b45..69f127067aa1 100644
--- a/drivers/media/common/saa7146/saa7146_core.c
+++ b/drivers/media/common/saa7146/saa7146_core.c
@@ -152,7 +152,8 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
        struct page *pg;
        int i;

- sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL);
+ sglist = __vmalloc(nr_pages * sizeof(struct scatterlist),
+ GFP_KERNEL | GFP_DMA | __GFP_ZERO, PAGE_KERNEL);
        if (NULL == sglist)
                return NULL;
        sg_init_table(sglist, nr_pages);
@@ -166,7 +167,7 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
        return sglist;

  err:
- kfree(sglist);
+ vfree(sglist);
        return NULL;
 }

@@ -203,7 +204,7 @@ void *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa
 err_free_pgtable:
        saa7146_pgtable_free(pci, pt);
 err_free_slist:
- kfree(pt->slist);
+ vfree(pt->slist);
        pt->slist = NULL;
 err_free_mem:
        vfree(mem);
@@ -215,7 +216,7 @@ void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, void *mem, struct saa714
 {
        pci_unmap_sg(pci, pt->slist, pt->nents, PCI_DMA_FROMDEVICE);
        saa7146_pgtable_free(pci, pt);
- kfree(pt->slist);
+ vfree(pt->slist);
        pt->slist = NULL;
        vfree(mem);
 }

I'll send a mail to ask the patch author, stay tuned.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Revision history for this message
TauSo (tauso) wrote :

Thanks, finally it's working. Do you need some additional infos/logs?

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

No not really.

I'll backport the patch once it's in Linus' tree.

Changed in linux (Ubuntu):
assignee: nobody → Kai-Heng Feng (kaihengfeng)
description: updated
Changed in linux (Ubuntu Artful):
status: New → Fix Committed
Changed in linux (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Stefan Bader (smb) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-artful' to 'verification-done-artful'. If the problem still exists, change the tag 'verification-needed-artful' to 'verification-failed-artful'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-artful
Revision history for this message
TauSo (tauso) wrote :

Kernel 4.13.0-38-generic #43-Ubuntu SMP Wed Mar 14 15:23:42 UTC 2018 i686 i686 i686 GNU/Linux

from artful-proposed is working.

tags: added: verification-done-artful
removed: verification-needed-artful
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (18.9 KiB)

This bug was fixed in the package linux - 4.13.0-38.43

---------------
linux (4.13.0-38.43) artful; urgency=medium

  * linux: 4.13.0-38.43 -proposed tracker (LP: #1755762)

  * Servers going OOM after updating kernel from 4.10 to 4.13 (LP: #1748408)
    - i40e: Fix memory leak related filter programming status
    - i40e: Add programming descriptors to cleaned_count

  * [SRU] Lenovo E41 Mic mute hotkey is not responding (LP: #1753347)
    - platform/x86: ideapad-laptop: Increase timeout to wait for EC answer

  * fails to dump with latest kpti fixes (LP: #1750021)
    - kdump: write correct address of mem_section into vmcoreinfo

  * headset mic can't be detected on two Dell machines (LP: #1748807)
    - ALSA: hda/realtek - Support headset mode for ALC215/ALC285/ALC289
    - ALSA: hda - Fix headset mic detection problem for two Dell machines
    - ALSA: hda - Fix a wrong FIXUP for alc289 on Dell machines

  * CIFS SMB2/SMB3 does not work for domain based DFS (LP: #1747572)
    - CIFS: make IPC a regular tcon
    - CIFS: use tcon_ipc instead of use_ipc parameter of SMB2_ioctl
    - CIFS: dump IPC tcon in debug proc file

  * i2c-thunderx: erroneous error message "unhandled state: 0" (LP: #1754076)
    - i2c: octeon: Prevent error message on bus error

  * hisi_sas: Add disk LED support (LP: #1752695)
    - scsi: hisi_sas: directly attached disk LED feature for v2 hw

  * EDAC, sb_edac: Backport 1 patch to Ubuntu 17.10 (Fix missing DIMM sysfs
    entries with KNL SNC2/SNC4 mode) (LP: #1743856)
    - EDAC, sb_edac: Fix missing DIMM sysfs entries with KNL SNC2/SNC4 mode

  * [regression] Colour banding and artefacts appear system-wide on an Asus
    Zenbook UX303LA with Intel HD 4400 graphics (LP: #1749420)
    - drm/edid: Add 6 bpc quirk for CPT panel in Asus UX303LA

  * DVB Card with SAA7146 chipset not working (LP: #1742316)
    - vmalloc: fix __GFP_HIGHMEM usage for vmalloc_32 on 32b systems

  * [Asus UX360UA] battery status in unity-panel is not changing when battery is
    being charged (LP: #1661876) // AC adapter status not detected on Asus
    ZenBook UX410UAK (LP: #1745032)
    - ACPI / battery: Add quirk for Asus UX360UA and UX410UAK

  * ASUS UX305LA - Battery state not detected correctly (LP: #1482390)
    - ACPI / battery: Add quirk for Asus GL502VSK and UX305LA

  * support thunderx2 vendor pmu events (LP: #1747523)
    - perf pmu: Extract function to get JSON alias map
    - perf pmu: Pass pmu as a parameter to get_cpuid_str()
    - perf tools arm64: Add support for get_cpuid_str function.
    - perf pmu: Add helper function is_pmu_core to detect PMU CORE devices
    - perf vendor events arm64: Add ThunderX2 implementation defined pmu core
      events
    - perf pmu: Add check for valid cpuid in perf_pmu__find_map()

  * lpfc.ko module doesn't work (LP: #1746970)
    - scsi: lpfc: Fix loop mode target discovery

  * Ubuntu 17.10 crashes on vmalloc.c (LP: #1739498)
    - powerpc/mm/book3s64: Make KERN_IO_START a variable
    - powerpc/mm/slb: Move comment next to the code it's referring to
    - powerpc/mm/hash64: Make vmalloc 56T on hash

  * ethtool -p fails to light NIC LED on HiSilicon D05 systems (LP: #1748567)
    - net...

Changed in linux (Ubuntu Artful):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.