From eead52bc1658bffae12a7906c79dce3fd6d3e749 Mon Sep 17 00:00:00 2001 From: Huaisheng Ye Date: Thu, 16 Oct 2025 10:38:05 +0800 Subject: [PATCH] anolis: tools/testing/cxl: Init delayed_work of cxl_poison_state to avoid warning ANBZ: #26473 Hygon-SIG: commit none hygon tools/testing/cxl: Init delayed_work of cxl_poison_state to avoid warning Commit 2de325f80f2e ("anolis: driver/cxl: Full support for CXL 2.0 mailbox commands") supported the scan media operation polling, but warnings will appear when unloading the module cxl_test. That would cause some CXL test cases of Ndctl failing to pass. How to reproduce. 1. modprobe cxl_test 2. modprobe -r cxl_test [ 272.941799] ------------[ cut here ]------------ [ 272.941804] WARNING: CPU: 122 PID: 6931 at kernel/workqueue.c:3432 __flush_work+0x6f/0x80 [ 272.941811] Modules linked in: device_dax(ON) kmem dax_cxl cxl_mock_mem(ON) cxl_test(ON-) cxl_mem(ON) cxl_pmem(ON) cxl_acpi(ON) cxl_port(ON) cxl_mock(ON) libnvdimm(ON) nfit_test_iomap(ON) cxl_core(ON) einj rfkill nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink qrtr snd_hda_codec_generic ledtrig_audio snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd joydev virtio_balloon soundcore pcspkr i2c_piix4 dm_mod xfs libcrc32c sr_mod cdrom sg crct10dif_pclmul qxl ata_generic crc32_pclmul drm_ttm_helper ttm crc32c_intel drm_kms_helper ata_piix ghash_clmulni_intel virtio_net drm virtio_console libata net_failover virtio_blk failover serio_raw fuse [ 272.942243] CPU: 122 PID: 6931 Comm: modprobe Kdump: loaded Tainted: G W O N 6.6.102-test-03+ #4 [ 272.942246] Hardware name: Red Hat KVM, BIOS 1.11.1-4.nfs 04/01/2014 [ 272.942247] RIP: 0010:__flush_work+0x6f/0x80 [ 272.942251] Code: 14 25 28 00 00 00 75 28 48 83 c4 78 c3 cc cc cc cc 48 8d 7c 24 48 88 44 24 07 e8 dc a2 c7 00 0f b6 44 24 07 eb d2 0f 0b eb ce <0f> 0b 31 c0 eb c8 e8 16 28 c7 00 66 0f 1f 44 00 00 90 90 90 90 90 [ 272.942253] RSP: 0018:ffffcc6b1ba778c0 EFLAGS: 00010246 [ 272.942255] RAX: 0000000000000001 RBX: 0000000000000000 RCX: ffff8b4cb2715980 [ 272.942257] RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff8b4c88ffeae8 [ 272.942258] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000010 [ 272.942259] R10: ffff8b6bbffd5000 R11: 000000000003d180 R12: ffff8b4c88ffeae8 [ 272.942260] R13: ffff8b4cc046d640 R14: ffff8b4c84d6d320 R15: ffff8b4c84d6d31c [ 272.942272] FS: 00007f406577a740(0000) GS:ffff8b6b3fb00000(0000) knlGS:0000000000000000 [ 272.942333] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 272.942335] CR2: 00007f9f2f42aa20 CR3: 000000010a3ac000 CR4: 0000000000350ee0 [ 272.942337] Call Trace: [ 272.942338] [ 272.942340] ? __slab_free+0xea/0x340 [ 272.942345] ? try_to_grab_pending+0xcf/0x170 [ 272.942348] __cancel_work_timer+0x108/0x190 [ 272.960842] ? _raw_spin_unlock+0xa/0x30 [ 272.960887] ? free_unref_page+0xf1/0x140 [ 272.960941] release_nodes+0x40/0xb0 [ 272.960950] devres_release_all+0x8b/0xc0 [ 272.960957] device_unbind_cleanup+0xe/0x80 [ 272.960962] device_release_driver_internal+0x1b9/0x210 [ 272.960966] bus_remove_device+0xd5/0x140 [ 272.960969] device_del+0x160/0x3e0 [ 272.960975] platform_device_del.part.0+0x13/0x70 [ 272.960978] platform_device_unregister+0x1c/0x40 [ 272.960982] cxl_test_exit+0x27/0xdd0 [cxl_test] [ 272.960991] __do_sys_delete_module.constprop.0+0x17a/0x2f0 Initialize this delayed work by a function with no actual content in tools/testing/cxl for sovling the warning. Fixes: 2de325f80f2e ("anolis: driver/cxl: Full support for CXL 2.0 mailbox commands") Signed-off-by: Huaisheng Ye CC: hygon-arch@list.openanolis.cn --- tools/testing/cxl/test/mem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c index 8b04d4fbb7ab..44fcfb4eb0b1 100644 --- a/tools/testing/cxl/test/mem.c +++ b/tools/testing/cxl/test/mem.c @@ -1405,6 +1405,8 @@ static ssize_t event_trigger_store(struct device *dev, } static DEVICE_ATTR_WO(event_trigger); +static void cxl_mock_mbox_scan_media_work(struct work_struct *work) {} + static int cxl_mock_mem_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1452,6 +1454,7 @@ static int cxl_mock_mem_probe(struct platform_device *pdev) if (rc) return rc; + INIT_DELAYED_WORK(&mds->poison.poll_dwork, cxl_mock_mbox_scan_media_work); rc = cxl_poison_state_init(mds); if (rc) return rc; -- Gitee