Bug 214985 - snd_ctxfi module crashes in kernel 5.15.1, kernel 5.13.x not affected
Summary: snd_ctxfi module crashes in kernel 5.15.1, kernel 5.13.x not affected
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-10 19:26 UTC by Javier Fernandez
Modified: 2022-01-03 16:17 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.15.1, 5.13.x not affected
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg output wth kernel 5.15.1 (78.48 KB, text/plain)
2021-11-10 19:26 UTC, Javier Fernandez
Details
Test fix patch (4.58 KB, patch)
2021-11-11 10:11 UTC, Takashi Iwai
Details | Diff
reject after applying 1st patch (2.26 KB, patch)
2021-11-11 11:23 UTC, Javier Fernandez
Details | Diff

Description Javier Fernandez 2021-11-10 19:26:16 UTC
Created attachment 299511 [details]
dmesg output wth kernel 5.15.1

Usint Ubuntu 21.10 with shipped kernel (5.13.x), everything works fine.
But, at upgrading kernel to mainline 5.15.1, i see my sound card (emu20k2, Creative Labs Sound Blaster X-Fi Titanium) does not work anymore. By downgrading to 5.13 kernel problem is solved 

As seen in the dmesg output attached, snd_ctxfi module is crashing.
Comment 1 Javier Fernandez 2021-11-10 19:27:38 UTC
crash is at:

[   22.223684] RIP: 0010:srcimp_next_conj+0x31/0x40 [snd_ctxfi]

may this line be interesting too?

[   21.838167] snd_ctxfi 0000:04:00.0: chip 20K2 model Unknown (1102:0044) is found
Comment 2 Takashi Iwai 2021-11-11 09:40:51 UTC
Hm, there has been no code change on ctxfi driver at all since 5.13.  So it must be coincidence that it happens now or effected by some other change; in anyway the bug has to be present in the past, too, but just not surfaced.
Comment 3 Javier Fernandez 2021-11-11 09:52:54 UTC
To be honest, the working 5.13 kernel i use is not an upstream one, but the Ubuntu one, named 

elhoir@elhoir-desktop:~$ uname -r
5.13.0-20-generic
elhoir@elhoir-desktop:~$ 


I can use latest upstream 5.13 kernel if you wish
Comment 4 Javier Fernandez 2021-11-11 10:03:32 UTC
(In reply to Javier Fernandez from comment #1)
> crash is at:
> 
> [   22.223684] RIP: 0010:srcimp_next_conj+0x31/0x40 [snd_ctxfi]
> 
> may this line be interesting too?
> 
> [   21.838167] snd_ctxfi 0000:04:00.0: chip 20K2 model Unknown (1102:0044)
> is found


nope, i just found this "Unknown" thing into 5.13 dmesg too.
Comment 5 Takashi Iwai 2021-11-11 10:11:15 UTC
Could you try the following patch?
Comment 6 Takashi Iwai 2021-11-11 10:11:37 UTC
Created attachment 299527 [details]
Test fix patch
Comment 7 Javier Fernandez 2021-11-11 10:15:07 UTC
i'll try
Comment 8 Javier Fernandez 2021-11-11 11:20:35 UTC
(In reply to Takashi Iwai from comment #5)
> Could you try the following patch?

while applying the patch, output was:

can't find file to patch at input line 135
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c
|index bd4697b44233..4a94b4708a77 100644
|--- a/sound/pci/ctxfi/ctsrc.c
|+++ b/sound/pci/ctxfi/ctsrc.c
--------------------------
File to patch: sound/pci/ctxfi/ctsrc.c
patching file sound/pci/ctxfi/ctsrc.c
Hunk #1 FAILED at 590.
1 out of 1 hunk FAILED -- saving rejects to file sound/pci/ctxfi/ctsrc.c.rej
elhoir@elhoir-desktop:~/linux-5.15.1$ 


any idea?
Comment 9 Javier Fernandez 2021-11-11 11:23:10 UTC
Created attachment 299529 [details]
reject after applying 1st patch

reject after applying 1st patch
Comment 10 Takashi Iwai 2021-11-11 11:35:10 UTC
It applies cleanly on 5.15.1, so if any, you must have some local modifications that conflict.
Comment 11 Javier Fernandez 2021-11-11 11:36:00 UTC
(In reply to Takashi Iwai from comment #10)
> It applies cleanly on 5.15.1, so if any, you must have some local
> modifications that conflict.

Nope, i just downloaded 5.15.1 tarball.
Comment 12 Javier Fernandez 2021-11-11 11:36:36 UTC
let me try again
Comment 13 Javier Fernandez 2021-11-11 11:43:03 UTC
failed again. same error :-/
just downloaded and extracted tarball, no modifications :S
Comment 14 Takashi Iwai 2021-11-11 12:13:43 UTC
Weird.  It works fine here.  Using linux-stable git tree,

% git checkout v5.15.1

% md5sum ctxfi-fix.diff
e2844826d07a13f534a1be58b858de6b  ctxfi-fix.diff

% patch -p1 < ctxfi-fix.diff
patching file sound/pci/ctxfi/ctamixer.c
patching file sound/pci/ctxfi/ctdaio.c
patching file sound/pci/ctxfi/ctresource.c
patching file sound/pci/ctxfi/ctresource.h
patching file sound/pci/ctxfi/ctsrc.c

Also works fine with linux-5.15.1.tar.gz.

% md5sum linux-5.15.1.tar.gz
6d8af914422a3660c4b8dcbb1cb6b905  linux-5.15.1.tar.gz

% tar xf linux-5.15.1.tar.gz

% cd linux-5.15.1

% patch -p1 < ~/ctxfi-fix.diff
patching file sound/pci/ctxfi/ctamixer.c
patching file sound/pci/ctxfi/ctdaio.c
patching file sound/pci/ctxfi/ctresource.c
patching file sound/pci/ctxfi/ctresource.h
patching file sound/pci/ctxfi/ctsrc.c
Comment 15 Javier Fernandez 2021-11-11 12:25:32 UTC
hmm... maybe i missed the "-p1" parameter... letś try again...
Comment 16 Javier Fernandez 2021-11-11 12:26:59 UTC
also, the tarball i downloaded in under .tar.xz format, not .tar.gz...
Comment 17 Javier Fernandez 2021-11-11 12:37:10 UTC
ok, now it worked. Yes, i missed the "-p1" parameter.
Comment 18 Javier Fernandez 2021-11-11 13:52:21 UTC
(currently fighting with dpkg-deb to make .deb packages for the kernel and install and uninstall it easy and safely)
Comment 19 Javier Fernandez 2021-11-15 13:51:02 UTC
iḿ very sorry for the long delay, but iḿ unable to compile and install kernel in a way that is easy to uninstall it (i mean, via .deb packages).
Sorry.
I have sources downloaded and yout patch applied. But i dont know how to install it.
Comment 20 Takashi Iwai 2021-11-15 13:52:39 UTC
At best ask your distro.
Comment 21 Javier Fernandez 2021-11-22 10:48:19 UTC
Now running latest upstream 5.14 kernel (5.14.21)
snd_ctxfi module works fine.
So crash happens between 5.15-rc1 and 5.15.1
Comment 22 Javier Fernandez 2021-12-22 18:34:49 UTC
doesnt crash in 5.15.10
so crash seems fixed as of that version.
Comment 23 Takashi Iwai 2022-01-03 16:17:19 UTC
Good to hear.  Let's close now.

Note You need to log in before you can comment on or make changes to this bug.