Bug 1217791 - Kernel 6.6.3 - Oops in sym53c8xx - at kernel/dma/mapping.c:545 dma_free_attrs+0x40/0x60
Summary: Kernel 6.6.3 - Oops in sym53c8xx - at kernel/dma/mapping.c:545 dma_free_attrs...
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Kernel:Drivers (show other bugs)
Version: Current
Hardware: x86-64 Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Kernel Bugs
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-04 18:45 UTC by Klaus Kämpf
Modified: 2023-12-05 14:34 UTC (History)
2 users (show)

See Also:
Found By: Community User
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Kämpf 2023-12-04 18:45:11 UTC
(same happened with kernel 6.6.2 but the oops is from 6.6.3)

[    2.062132] ------------[ cut here ]------------
[    2.062133] WARNING: CPU: 0 PID: 361 at kernel/dma/mapping.c:545 dma_free_attrs+0x40/0x60
[    2.062142] Modules linked in: sym53c8xx(+) scsi_transport_spi sd_mod drm_ttm_helper ttm scsi_dh_emc firewire_ohci(+) scsi_dh_rdac ohci_pci(+) video scsi_dh_alua ohci_hcd ehci_pci t10_pi ehci_hcd firewire_core crc_itu_t i2c_algo_bit sg drm_suballoc_helper scsi_mod serio_raw drm_display_helper usbcore sp5100_tco cec rc_core scsi_common wmi msr
[    2.062169] CPU: 0 PID: 361 Comm: kworker/0:3 Not tainted 6.6.3-1-default #1 openSUSE Tumbleweed 9031f8c42431aba86b6ec9224e28096b5a78e86b
[    2.062174] Hardware name: System manufacturer System Product Name/M4A785TD-V EVO, BIOS 0602    01/07/2010
[    2.062176] Workqueue: events work_for_cpu_fn
[    2.062181] RIP: 0010:dma_free_attrs+0x40/0x60
[    2.062184] Code: 48 0f 44 3d da 67 80 02 9c 58 0f 1f 40 00 f6 c4 02 74 17 48 85 d2 74 0d 48 85 ff 75 11 4c 89 cf e9 f5 18 00 00 c3 cc cc cc cc <0f> 0b eb e5 48 8b 47 10 48 85 c0 74 09 4c 89 cf e9 7b 3c b2 00 cc
[    2.062186] RSP: 0018:ffff998700487b70 EFLAGS: 00010046
[    2.062188] RAX: 0000000000000046 RBX: ffff8add49465280 RCX: 000000000109e000
[    2.062190] RDX: ffff8adc4109e000 RSI: 0000000000001000 RDI: ffffffffb0427360
[    2.062191] RBP: ffff8add49465000 R08: 0000000000000000 R09: ffff8add40b450c0
[    2.062193] R10: ffff8add49465160 R11: ffff8add49465128 R12: 0000000000000286
[    2.062194] R13: ffff8adc4109e000 R14: 00000000000004e4 R15: ffffffffc07c3a29
[    2.062196] FS:  0000000000000000(0000) GS:ffff8add5be00000(0000) knlGS:0000000000000000
[    2.062197] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    2.062199] CR2: 00007f402e89e003 CR3: 0000000108670000 CR4: 00000000000006f0
[    2.062201] Call Trace:
[    2.062203]  <TASK>
[    2.062205]  ? dma_free_attrs+0x40/0x60
[    2.062207]  ? __warn+0x81/0x130
[    2.062212]  ? dma_free_attrs+0x40/0x60
[    2.062214]  ? report_bug+0x171/0x1a0
[    2.062217]  ? handle_bug+0x3c/0x80
[    2.062221]  ? exc_invalid_op+0x17/0x70
[    2.062224]  ? asm_exc_invalid_op+0x1a/0x20
[    2.062231]  ? dma_free_attrs+0x40/0x60
[    2.062233]  ___free_dma_mem_cluster+0x5d/0x90 [sym53c8xx 565c81ee11de07352e8d24b783f5b6b7946802c5]
[    2.062254]  __sym_mfree_dma+0x5e/0xe0 [sym53c8xx 565c81ee11de07352e8d24b783f5b6b7946802c5]
[    2.062268]  sym_hcb_free+0x5c/0x1d0 [sym53c8xx 565c81ee11de07352e8d24b783f5b6b7946802c5]
[    2.062283]  sym_free_resources+0x41/0x80 [sym53c8xx 565c81ee11de07352e8d24b783f5b6b7946802c5]
[    2.062298]  sym2_probe+0x8e7/0xa70 [sym53c8xx 565c81ee11de07352e8d24b783f5b6b7946802c5]
[    2.062317]  local_pci_probe+0x45/0xa0
[    2.062321]  work_for_cpu_fn+0x1a/0x30
[    2.062324]  process_one_work+0x168/0x330
[    2.062328]  worker_thread+0x2f5/0x410
[    2.062332]  ? __pfx_worker_thread+0x10/0x10
[    2.062335]  kthread+0xe8/0x120
[    2.062338]  ? __pfx_kthread+0x10/0x10
[    2.062341]  ret_from_fork+0x34/0x50
[    2.062345]  ? __pfx_kthread+0x10/0x10
[    2.062348]  ret_from_fork_asm+0x1b/0x30
[    2.062354]  </TASK>
[    2.062355] ---[ end trace 0000000000000000 ]---
[    2.062363] ------------[ cut here ]------------
Comment 1 Takashi Iwai 2023-12-05 13:50:30 UTC
(In reply to Klaus Kämpf from comment #0)
> (same happened with kernel 6.6.2 but the oops is from 6.6.3)

So it's no regression, but the bug has appeared already for long time, right?
I can't see any changes in the relevant code, so just to make sure.

The problem is likely the sym53c8xx_2 driver code, __sym_mfree_dma() calls the memory release (that is dma_free_coherent() in the call chain) inside the spinlock sym53c8xx_lock.
Comment 2 Klaus Kämpf 2023-12-05 14:05:55 UTC
(In reply to Takashi Iwai from comment #1)
> 
> So it's no regression, but the bug has appeared already for long time, right?

Well, I can't tell about the oops, but the sym53c8xx driver worked nicely for me in the past. It stopped working with 6.6.3.
Comment 3 Takashi Iwai 2023-12-05 14:09:38 UTC
OK, then the shown kernel WARNING is probably a red herring, and it doesn't mean any breakage, per se.

What do you mean "stopped working"?
Comment 4 Klaus Kämpf 2023-12-05 14:10:53 UTC
(In reply to Takashi Iwai from comment #3)
> 
> What do you mean "stopped working"?

It doesn't recognize any attached SCSI devices.
Comment 5 Takashi Iwai 2023-12-05 14:34:17 UTC
OK, and 6.6.2 still works?  If yes, please give the full dmesg outputs from both working and non-working cases.