-
Notifications
You must be signed in to change notification settings - Fork 54.8k
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
fix a bug refer to max_discard is 0 #505
Conversation
typically TRIM cost shorter time than ERASE, so we expect max_trim as max_discard. But when ERASE timeout is too long, it did happened actually rather than theoretically. A type of Toshiba eMMC's ERASE_TIMEOUT_MULT is too long and controller's max_busy_timeout is relatively small, then max_discard could be 0, even max_trim is available, but max_trim < max_disable can't be true, so we get a result of 0 instead of max_trim.
Hi @catShit! Thanks for your contribution to the Linux kernel! Linux kernel development happens on mailing lists, rather than on GitHub - this GitHub repository is a read-only mirror that isn't used for accepting contributions. So that your change can become part of Linux, please email it to us as a patch. Sending patches isn't quite as simple as sending a pull request, but fortunately it is a well documented process. Here's what to do:
How do I format my contribution?The Linux kernel community is notoriously picky about how contributions are formatted and sent. Fortunately, they have documented their expectations. Firstly, all contributions need to be formatted as patches. A patch is a plain text document showing the change you want to make to the code, and documenting why it is a good idea. You can create patches with Secondly, patches need 'commit messages', which is the human-friendly documentation explaining what the change is and why it's necessary. Thirdly, changes have some technical requirements. There is a Linux kernel coding style, and there are licensing requirements you need to comply with. Both of these are documented in the Submitting Patches documentation that is part of the kernel. Note that you will almost certainly have to modify your existing git commits to satisfy these requirements. Don't worry: there are many guides on the internet for doing this. Who do I send my contribution to?The Linux kernel is composed of a number of subsystems. These subsystems are maintained by different people, and have different mailing lists where they discuss proposed changes. If you don't already know what subsystem your change belongs to, the
Make sure that your list of recipients includes a mailing list. If you can't find a more specific mailing list, then LKML - the Linux Kernel Mailing List - is the place to send your patches. It's not usually necessary to subscribe to the mailing list before you send the patches, but if you're interested in kernel development, subscribing to a subsystem mailing list is a good idea. (At this point, you probably don't need to subscribe to LKML - it is a very high traffic list with about a thousand messages per day, which is often not useful for beginners.) How do I send my contribution?Use For more information about using How do I get help if I'm stuck?Firstly, don't get discouraged! There are an enormous number of resources on the internet, and many kernel developers who would like to see you succeed. Many issues - especially about how to use certain tools - can be resolved by using your favourite internet search engine. If you can't find an answer, there are a few places you can turn:
If you get really, really stuck, you could try the owners of this bot, @daxtens and @ajdlinux. Please be aware that we do have full-time jobs, so we are almost certainly the slowest way to get answers! I sent my patch - now what?You wait. You can check that your email has been received by checking the mailing list archives for the mailing list you sent your patch to. Messages may not be received instantly, so be patient. Kernel developers are generally very busy people, so it may take a few weeks before your patch is looked at. Then, you keep waiting. Three things may happen:
Further information
Happy hacking! This message was posted by a bot - if you have any questions or suggestions, please talk to my owners, @ajdlinux and @daxtens, or raise an issue at https://github.com/ajdlinux/KernelPRBot. |
Not an expert in this driver, but if you need help with getting this upstream and the instructions above aren't enough let me know |
unsubscribe
…On Tue, Feb 6, 2018 at 9:10 AM, Andrew Donnellan ***@***.***> wrote:
Not an expert in this driver, but if you need help with getting this
upstream and the instructions above aren't enough let me know
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#505 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKYHFKxrch2ZLLAtZOBUmDC9xg2Q_g8Jks5tR6Z6gaJpZM4RVPzh>
.
|
wwan_register_ops() ends up calls ipc_wwan_newlink() before it returns. ipc_wwan_newlink() uses pc_wwan->if_mutex, so we must initialize it before calling wwan_register_ops(). This fixes the following WARN() when lock-debugging is enabled: [ 610.708713] ------------[ cut here ]------------ [ 610.708721] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 610.708727] WARNING: CPU: 11 PID: 506 at kernel/locking/mutex.c:582 __mutex_lock+0x3e4/0x7e0 [ 610.708736] Modules linked in: iosm snd_seq_dummy snd_hrtimer rfcomm qrtr bnep binfmt_misc snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_soc_dmic iTCO_wdt intel_pmc_bxt mei_hdcp mei_pxp iTCO_vendor_support pmt_telemetry intel_rapl_msr pmt_class intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass rapl intel_cstate intel_uncore pcspkr think_lmi firmware_attributes_class wmi_bmof snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core iwlmvm snd_hwdep snd_seq btusb snd_seq_device btrtl btbcm snd_pcm [ 610.708767] btintel mei_me mac80211 i2c_i801 btmtk libarc4 i2c_smbus snd_timer mei bluetooth hid_sensor_gyro_3d iwlwifi hid_sensor_accel_3d idma64 hid_sensor_trigger hid_sensor_iio_common ecdh_generic industrialio_triggered_buffer kfifo_buf cfg80211 joydev industrialio int3403_thermal soc_button_array ov2740 v4l2_fwnode v4l2_async videodev mc intel_skl_int3472_tps68470 tps68470_regulator clk_tps68470 intel_skl_int3472_discrete intel_hid sparse_keymap int3400_thermal acpi_thermal_rel acpi_tad acpi_pad vfat fat processor_thermal_device_pci processor_thermal_device processor_thermal_rfim processor_thermal_mbox processor_thermal_rapl thunderbolt intel_rapl_common intel_vsec int340x_thermal_zone igen6_edac zram dm_crypt hid_sensor_hub intel_ishtp_hid i915 thinkpad_acpi drm_buddy drm_display_helper snd soundcore ledtrig_audio crct10dif_pclmul wacom platform_profile crc32_pclmul cec nvme intel_ish_ipc rfkill crc32c_intel ucsi_acpi hid_multitouch serio_raw typec_ucsi ghash_clmulni_intel [ 610.708798] nvme_core video intel_ishtp ttm typec i2c_hid_acpi i2c_hid wmi pinctrl_tigerlake ip6_tables ip_tables i2c_dev fuse [ 610.708806] CPU: 11 PID: 506 Comm: kworker/11:2 Tainted: G W 6.0.0+ torvalds#505 [ 610.708809] Hardware name: LENOVO 21CEZ9Q3US/21CEZ9Q3US, BIOS N3AET66W (1.31 ) 09/09/2022 [ 610.708811] Workqueue: events ipc_imem_run_state_worker [iosm] [ 610.708831] RIP: 0010:__mutex_lock+0x3e4/0x7e0 [ 610.708836] Code: ff 85 c0 0f 84 9b fc ff ff 8b 15 6f 54 11 01 85 d2 0f 85 8d fc ff ff 48 c7 c6 f0 f0 84 94 48 c7 c7 83 07 83 94 e8 91 33 f8 ff <0f> 0b e9 73 fc ff ff f6 83 d1 0c 00 00 01 0f 85 4b ff ff ff 4c 89 [ 610.708837] RSP: 0018:ffffaf0b80767a50 EFLAGS: 00010282 [ 610.708840] RAX: 0000000000000028 RBX: 0000000000000000 RCX: 0000000000000000 [ 610.708841] RDX: 0000000000000001 RSI: ffffffff948b357c RDI: 00000000ffffffff [ 610.708842] RBP: ffffaf0b80767ae0 R08: 0000000000000000 R09: ffffaf0b80767900 [ 610.708843] R10: 0000000000000003 R11: ffff9c191b7fffe8 R12: 0000000000000002 [ 610.708845] R13: 0000000000000000 R14: ffff9c16a3044450 R15: ffff9c15e342ce40 [ 610.708846] FS: 0000000000000000(0000) GS:ffff9c18fd6c0000(0000) knlGS:0000000000000000 [ 610.708848] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 610.708849] CR2: 00001d40ba7bd008 CR3: 00000001d6c26002 CR4: 0000000000770ee0 [ 610.708850] PKRU: 55555554 [ 610.708851] Call Trace: [ 610.708852] <TASK> [ 610.708856] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708862] ? wwan_port_fops_read+0x1b0/0x1b0 [ 610.708867] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708872] ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708877] wwan_rtnl_newlink+0x7e/0xd0 [ 610.708880] wwan_create_default_link+0x24c/0x2e0 [ 610.708890] wwan_register_ops+0x71/0x90 [ 610.708893] ipc_wwan_init+0x48/0x90 [iosm] [ 610.708897] ipc_imem_wwan_channel_init+0x81/0xa0 [iosm] [ 610.708902] ipc_imem_run_state_worker+0xab/0x1b0 [iosm] [ 610.708907] process_one_work+0x254/0x570 [ 610.708914] worker_thread+0x4f/0x3a0 [ 610.708917] ? process_one_work+0x570/0x570 [ 610.708919] kthread+0xf2/0x120 [ 610.708922] ? kthread_complete_and_exit+0x20/0x20 [ 610.708924] ret_from_fork+0x1f/0x30 [ 610.708931] </TASK> [ 610.708931] irq event stamp: 89949 [ 610.708933] hardirqs last enabled at (89949): [<ffffffff93ebc630>] _raw_spin_unlock_irqrestore+0x30/0x60 [ 610.708936] hardirqs last disabled at (89948): [<ffffffff93ebc3bf>] _raw_spin_lock_irqsave+0x5f/0x70 [ 610.708938] softirqs last enabled at (89876): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708942] softirqs last disabled at (89874): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708944] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede <hdegoede@redhat.com>
wwan_register_ops() ends up calls ipc_wwan_newlink() before it returns. ipc_wwan_newlink() uses pc_wwan->if_mutex, so we must initialize it before calling wwan_register_ops(). This fixes the following WARN() when lock-debugging is enabled: [ 610.708713] ------------[ cut here ]------------ [ 610.708721] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 610.708727] WARNING: CPU: 11 PID: 506 at kernel/locking/mutex.c:582 __mutex_lock+0x3e4/0x7e0 [ 610.708736] Modules linked in: iosm snd_seq_dummy snd_hrtimer rfcomm qrtr bnep binfmt_misc snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_soc_dmic iTCO_wdt intel_pmc_bxt mei_hdcp mei_pxp iTCO_vendor_support pmt_telemetry intel_rapl_msr pmt_class intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass rapl intel_cstate intel_uncore pcspkr think_lmi firmware_attributes_class wmi_bmof snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core iwlmvm snd_hwdep snd_seq btusb snd_seq_device btrtl btbcm snd_pcm [ 610.708767] btintel mei_me mac80211 i2c_i801 btmtk libarc4 i2c_smbus snd_timer mei bluetooth hid_sensor_gyro_3d iwlwifi hid_sensor_accel_3d idma64 hid_sensor_trigger hid_sensor_iio_common ecdh_generic industrialio_triggered_buffer kfifo_buf cfg80211 joydev industrialio int3403_thermal soc_button_array ov2740 v4l2_fwnode v4l2_async videodev mc intel_skl_int3472_tps68470 tps68470_regulator clk_tps68470 intel_skl_int3472_discrete intel_hid sparse_keymap int3400_thermal acpi_thermal_rel acpi_tad acpi_pad vfat fat processor_thermal_device_pci processor_thermal_device processor_thermal_rfim processor_thermal_mbox processor_thermal_rapl thunderbolt intel_rapl_common intel_vsec int340x_thermal_zone igen6_edac zram dm_crypt hid_sensor_hub intel_ishtp_hid i915 thinkpad_acpi drm_buddy drm_display_helper snd soundcore ledtrig_audio crct10dif_pclmul wacom platform_profile crc32_pclmul cec nvme intel_ish_ipc rfkill crc32c_intel ucsi_acpi hid_multitouch serio_raw typec_ucsi ghash_clmulni_intel [ 610.708798] nvme_core video intel_ishtp ttm typec i2c_hid_acpi i2c_hid wmi pinctrl_tigerlake ip6_tables ip_tables i2c_dev fuse [ 610.708806] CPU: 11 PID: 506 Comm: kworker/11:2 Tainted: G W 6.0.0+ torvalds#505 [ 610.708809] Hardware name: LENOVO 21CEZ9Q3US/21CEZ9Q3US, BIOS N3AET66W (1.31 ) 09/09/2022 [ 610.708811] Workqueue: events ipc_imem_run_state_worker [iosm] [ 610.708831] RIP: 0010:__mutex_lock+0x3e4/0x7e0 [ 610.708836] Code: ff 85 c0 0f 84 9b fc ff ff 8b 15 6f 54 11 01 85 d2 0f 85 8d fc ff ff 48 c7 c6 f0 f0 84 94 48 c7 c7 83 07 83 94 e8 91 33 f8 ff <0f> 0b e9 73 fc ff ff f6 83 d1 0c 00 00 01 0f 85 4b ff ff ff 4c 89 [ 610.708837] RSP: 0018:ffffaf0b80767a50 EFLAGS: 00010282 [ 610.708840] RAX: 0000000000000028 RBX: 0000000000000000 RCX: 0000000000000000 [ 610.708841] RDX: 0000000000000001 RSI: ffffffff948b357c RDI: 00000000ffffffff [ 610.708842] RBP: ffffaf0b80767ae0 R08: 0000000000000000 R09: ffffaf0b80767900 [ 610.708843] R10: 0000000000000003 R11: ffff9c191b7fffe8 R12: 0000000000000002 [ 610.708845] R13: 0000000000000000 R14: ffff9c16a3044450 R15: ffff9c15e342ce40 [ 610.708846] FS: 0000000000000000(0000) GS:ffff9c18fd6c0000(0000) knlGS:0000000000000000 [ 610.708848] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 610.708849] CR2: 00001d40ba7bd008 CR3: 00000001d6c26002 CR4: 0000000000770ee0 [ 610.708850] PKRU: 55555554 [ 610.708851] Call Trace: [ 610.708852] <TASK> [ 610.708856] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708862] ? wwan_port_fops_read+0x1b0/0x1b0 [ 610.708867] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708872] ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708877] wwan_rtnl_newlink+0x7e/0xd0 [ 610.708880] wwan_create_default_link+0x24c/0x2e0 [ 610.708890] wwan_register_ops+0x71/0x90 [ 610.708893] ipc_wwan_init+0x48/0x90 [iosm] [ 610.708897] ipc_imem_wwan_channel_init+0x81/0xa0 [iosm] [ 610.708902] ipc_imem_run_state_worker+0xab/0x1b0 [iosm] [ 610.708907] process_one_work+0x254/0x570 [ 610.708914] worker_thread+0x4f/0x3a0 [ 610.708917] ? process_one_work+0x570/0x570 [ 610.708919] kthread+0xf2/0x120 [ 610.708922] ? kthread_complete_and_exit+0x20/0x20 [ 610.708924] ret_from_fork+0x1f/0x30 [ 610.708931] </TASK> [ 610.708931] irq event stamp: 89949 [ 610.708933] hardirqs last enabled at (89949): [<ffffffff93ebc630>] _raw_spin_unlock_irqrestore+0x30/0x60 [ 610.708936] hardirqs last disabled at (89948): [<ffffffff93ebc3bf>] _raw_spin_lock_irqsave+0x5f/0x70 [ 610.708938] softirqs last enabled at (89876): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708942] softirqs last disabled at (89874): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708944] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede <hdegoede@redhat.com>
wwan_register_ops() ends up calls ipc_wwan_newlink() before it returns. ipc_wwan_newlink() uses pc_wwan->if_mutex, so we must initialize it before calling wwan_register_ops(). This fixes the following WARN() when lock-debugging is enabled: [ 610.708713] ------------[ cut here ]------------ [ 610.708721] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 610.708727] WARNING: CPU: 11 PID: 506 at kernel/locking/mutex.c:582 __mutex_lock+0x3e4/0x7e0 [ 610.708736] Modules linked in: iosm snd_seq_dummy snd_hrtimer rfcomm qrtr bnep binfmt_misc snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_soc_dmic iTCO_wdt intel_pmc_bxt mei_hdcp mei_pxp iTCO_vendor_support pmt_telemetry intel_rapl_msr pmt_class intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass rapl intel_cstate intel_uncore pcspkr think_lmi firmware_attributes_class wmi_bmof snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core iwlmvm snd_hwdep snd_seq btusb snd_seq_device btrtl btbcm snd_pcm [ 610.708767] btintel mei_me mac80211 i2c_i801 btmtk libarc4 i2c_smbus snd_timer mei bluetooth hid_sensor_gyro_3d iwlwifi hid_sensor_accel_3d idma64 hid_sensor_trigger hid_sensor_iio_common ecdh_generic industrialio_triggered_buffer kfifo_buf cfg80211 joydev industrialio int3403_thermal soc_button_array ov2740 v4l2_fwnode v4l2_async videodev mc intel_skl_int3472_tps68470 tps68470_regulator clk_tps68470 intel_skl_int3472_discrete intel_hid sparse_keymap int3400_thermal acpi_thermal_rel acpi_tad acpi_pad vfat fat processor_thermal_device_pci processor_thermal_device processor_thermal_rfim processor_thermal_mbox processor_thermal_rapl thunderbolt intel_rapl_common intel_vsec int340x_thermal_zone igen6_edac zram dm_crypt hid_sensor_hub intel_ishtp_hid i915 thinkpad_acpi drm_buddy drm_display_helper snd soundcore ledtrig_audio crct10dif_pclmul wacom platform_profile crc32_pclmul cec nvme intel_ish_ipc rfkill crc32c_intel ucsi_acpi hid_multitouch serio_raw typec_ucsi ghash_clmulni_intel [ 610.708798] nvme_core video intel_ishtp ttm typec i2c_hid_acpi i2c_hid wmi pinctrl_tigerlake ip6_tables ip_tables i2c_dev fuse [ 610.708806] CPU: 11 PID: 506 Comm: kworker/11:2 Tainted: G W 6.0.0+ torvalds#505 [ 610.708809] Hardware name: LENOVO 21CEZ9Q3US/21CEZ9Q3US, BIOS N3AET66W (1.31 ) 09/09/2022 [ 610.708811] Workqueue: events ipc_imem_run_state_worker [iosm] [ 610.708831] RIP: 0010:__mutex_lock+0x3e4/0x7e0 [ 610.708836] Code: ff 85 c0 0f 84 9b fc ff ff 8b 15 6f 54 11 01 85 d2 0f 85 8d fc ff ff 48 c7 c6 f0 f0 84 94 48 c7 c7 83 07 83 94 e8 91 33 f8 ff <0f> 0b e9 73 fc ff ff f6 83 d1 0c 00 00 01 0f 85 4b ff ff ff 4c 89 [ 610.708837] RSP: 0018:ffffaf0b80767a50 EFLAGS: 00010282 [ 610.708840] RAX: 0000000000000028 RBX: 0000000000000000 RCX: 0000000000000000 [ 610.708841] RDX: 0000000000000001 RSI: ffffffff948b357c RDI: 00000000ffffffff [ 610.708842] RBP: ffffaf0b80767ae0 R08: 0000000000000000 R09: ffffaf0b80767900 [ 610.708843] R10: 0000000000000003 R11: ffff9c191b7fffe8 R12: 0000000000000002 [ 610.708845] R13: 0000000000000000 R14: ffff9c16a3044450 R15: ffff9c15e342ce40 [ 610.708846] FS: 0000000000000000(0000) GS:ffff9c18fd6c0000(0000) knlGS:0000000000000000 [ 610.708848] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 610.708849] CR2: 00001d40ba7bd008 CR3: 00000001d6c26002 CR4: 0000000000770ee0 [ 610.708850] PKRU: 55555554 [ 610.708851] Call Trace: [ 610.708852] <TASK> [ 610.708856] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708862] ? wwan_port_fops_read+0x1b0/0x1b0 [ 610.708867] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708872] ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708877] wwan_rtnl_newlink+0x7e/0xd0 [ 610.708880] wwan_create_default_link+0x24c/0x2e0 [ 610.708890] wwan_register_ops+0x71/0x90 [ 610.708893] ipc_wwan_init+0x48/0x90 [iosm] [ 610.708897] ipc_imem_wwan_channel_init+0x81/0xa0 [iosm] [ 610.708902] ipc_imem_run_state_worker+0xab/0x1b0 [iosm] [ 610.708907] process_one_work+0x254/0x570 [ 610.708914] worker_thread+0x4f/0x3a0 [ 610.708917] ? process_one_work+0x570/0x570 [ 610.708919] kthread+0xf2/0x120 [ 610.708922] ? kthread_complete_and_exit+0x20/0x20 [ 610.708924] ret_from_fork+0x1f/0x30 [ 610.708931] </TASK> [ 610.708931] irq event stamp: 89949 [ 610.708933] hardirqs last enabled at (89949): [<ffffffff93ebc630>] _raw_spin_unlock_irqrestore+0x30/0x60 [ 610.708936] hardirqs last disabled at (89948): [<ffffffff93ebc3bf>] _raw_spin_lock_irqsave+0x5f/0x70 [ 610.708938] softirqs last enabled at (89876): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708942] softirqs last disabled at (89874): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708944] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede <hdegoede@redhat.com>
wwan_register_ops() ends up calls ipc_wwan_newlink() before it returns. ipc_wwan_newlink() uses pc_wwan->if_mutex, so we must initialize it before calling wwan_register_ops(). This fixes the following WARN() when lock-debugging is enabled: [ 610.708713] ------------[ cut here ]------------ [ 610.708721] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 610.708727] WARNING: CPU: 11 PID: 506 at kernel/locking/mutex.c:582 __mutex_lock+0x3e4/0x7e0 [ 610.708736] Modules linked in: iosm snd_seq_dummy snd_hrtimer rfcomm qrtr bnep binfmt_misc snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_soc_dmic iTCO_wdt intel_pmc_bxt mei_hdcp mei_pxp iTCO_vendor_support pmt_telemetry intel_rapl_msr pmt_class intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass rapl intel_cstate intel_uncore pcspkr think_lmi firmware_attributes_class wmi_bmof snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core iwlmvm snd_hwdep snd_seq btusb snd_seq_device btrtl btbcm snd_pcm [ 610.708767] btintel mei_me mac80211 i2c_i801 btmtk libarc4 i2c_smbus snd_timer mei bluetooth hid_sensor_gyro_3d iwlwifi hid_sensor_accel_3d idma64 hid_sensor_trigger hid_sensor_iio_common ecdh_generic industrialio_triggered_buffer kfifo_buf cfg80211 joydev industrialio int3403_thermal soc_button_array ov2740 v4l2_fwnode v4l2_async videodev mc intel_skl_int3472_tps68470 tps68470_regulator clk_tps68470 intel_skl_int3472_discrete intel_hid sparse_keymap int3400_thermal acpi_thermal_rel acpi_tad acpi_pad vfat fat processor_thermal_device_pci processor_thermal_device processor_thermal_rfim processor_thermal_mbox processor_thermal_rapl thunderbolt intel_rapl_common intel_vsec int340x_thermal_zone igen6_edac zram dm_crypt hid_sensor_hub intel_ishtp_hid i915 thinkpad_acpi drm_buddy drm_display_helper snd soundcore ledtrig_audio crct10dif_pclmul wacom platform_profile crc32_pclmul cec nvme intel_ish_ipc rfkill crc32c_intel ucsi_acpi hid_multitouch serio_raw typec_ucsi ghash_clmulni_intel [ 610.708798] nvme_core video intel_ishtp ttm typec i2c_hid_acpi i2c_hid wmi pinctrl_tigerlake ip6_tables ip_tables i2c_dev fuse [ 610.708806] CPU: 11 PID: 506 Comm: kworker/11:2 Tainted: G W 6.0.0+ torvalds#505 [ 610.708809] Hardware name: LENOVO 21CEZ9Q3US/21CEZ9Q3US, BIOS N3AET66W (1.31 ) 09/09/2022 [ 610.708811] Workqueue: events ipc_imem_run_state_worker [iosm] [ 610.708831] RIP: 0010:__mutex_lock+0x3e4/0x7e0 [ 610.708836] Code: ff 85 c0 0f 84 9b fc ff ff 8b 15 6f 54 11 01 85 d2 0f 85 8d fc ff ff 48 c7 c6 f0 f0 84 94 48 c7 c7 83 07 83 94 e8 91 33 f8 ff <0f> 0b e9 73 fc ff ff f6 83 d1 0c 00 00 01 0f 85 4b ff ff ff 4c 89 [ 610.708837] RSP: 0018:ffffaf0b80767a50 EFLAGS: 00010282 [ 610.708840] RAX: 0000000000000028 RBX: 0000000000000000 RCX: 0000000000000000 [ 610.708841] RDX: 0000000000000001 RSI: ffffffff948b357c RDI: 00000000ffffffff [ 610.708842] RBP: ffffaf0b80767ae0 R08: 0000000000000000 R09: ffffaf0b80767900 [ 610.708843] R10: 0000000000000003 R11: ffff9c191b7fffe8 R12: 0000000000000002 [ 610.708845] R13: 0000000000000000 R14: ffff9c16a3044450 R15: ffff9c15e342ce40 [ 610.708846] FS: 0000000000000000(0000) GS:ffff9c18fd6c0000(0000) knlGS:0000000000000000 [ 610.708848] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 610.708849] CR2: 00001d40ba7bd008 CR3: 00000001d6c26002 CR4: 0000000000770ee0 [ 610.708850] PKRU: 55555554 [ 610.708851] Call Trace: [ 610.708852] <TASK> [ 610.708856] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708862] ? wwan_port_fops_read+0x1b0/0x1b0 [ 610.708867] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708872] ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708877] wwan_rtnl_newlink+0x7e/0xd0 [ 610.708880] wwan_create_default_link+0x24c/0x2e0 [ 610.708890] wwan_register_ops+0x71/0x90 [ 610.708893] ipc_wwan_init+0x48/0x90 [iosm] [ 610.708897] ipc_imem_wwan_channel_init+0x81/0xa0 [iosm] [ 610.708902] ipc_imem_run_state_worker+0xab/0x1b0 [iosm] [ 610.708907] process_one_work+0x254/0x570 [ 610.708914] worker_thread+0x4f/0x3a0 [ 610.708917] ? process_one_work+0x570/0x570 [ 610.708919] kthread+0xf2/0x120 [ 610.708922] ? kthread_complete_and_exit+0x20/0x20 [ 610.708924] ret_from_fork+0x1f/0x30 [ 610.708931] </TASK> [ 610.708931] irq event stamp: 89949 [ 610.708933] hardirqs last enabled at (89949): [<ffffffff93ebc630>] _raw_spin_unlock_irqrestore+0x30/0x60 [ 610.708936] hardirqs last disabled at (89948): [<ffffffff93ebc3bf>] _raw_spin_lock_irqsave+0x5f/0x70 [ 610.708938] softirqs last enabled at (89876): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708942] softirqs last disabled at (89874): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708944] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede <hdegoede@redhat.com>
wwan_register_ops() ends up calls ipc_wwan_newlink() before it returns. ipc_wwan_newlink() uses pc_wwan->if_mutex, so we must initialize it before calling wwan_register_ops(). This fixes the following WARN() when lock-debugging is enabled: [ 610.708713] ------------[ cut here ]------------ [ 610.708721] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 610.708727] WARNING: CPU: 11 PID: 506 at kernel/locking/mutex.c:582 __mutex_lock+0x3e4/0x7e0 [ 610.708736] Modules linked in: iosm snd_seq_dummy snd_hrtimer rfcomm qrtr bnep binfmt_misc snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_soc_dmic iTCO_wdt intel_pmc_bxt mei_hdcp mei_pxp iTCO_vendor_support pmt_telemetry intel_rapl_msr pmt_class intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass rapl intel_cstate intel_uncore pcspkr think_lmi firmware_attributes_class wmi_bmof snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core iwlmvm snd_hwdep snd_seq btusb snd_seq_device btrtl btbcm snd_pcm [ 610.708767] btintel mei_me mac80211 i2c_i801 btmtk libarc4 i2c_smbus snd_timer mei bluetooth hid_sensor_gyro_3d iwlwifi hid_sensor_accel_3d idma64 hid_sensor_trigger hid_sensor_iio_common ecdh_generic industrialio_triggered_buffer kfifo_buf cfg80211 joydev industrialio int3403_thermal soc_button_array ov2740 v4l2_fwnode v4l2_async videodev mc intel_skl_int3472_tps68470 tps68470_regulator clk_tps68470 intel_skl_int3472_discrete intel_hid sparse_keymap int3400_thermal acpi_thermal_rel acpi_tad acpi_pad vfat fat processor_thermal_device_pci processor_thermal_device processor_thermal_rfim processor_thermal_mbox processor_thermal_rapl thunderbolt intel_rapl_common intel_vsec int340x_thermal_zone igen6_edac zram dm_crypt hid_sensor_hub intel_ishtp_hid i915 thinkpad_acpi drm_buddy drm_display_helper snd soundcore ledtrig_audio crct10dif_pclmul wacom platform_profile crc32_pclmul cec nvme intel_ish_ipc rfkill crc32c_intel ucsi_acpi hid_multitouch serio_raw typec_ucsi ghash_clmulni_intel [ 610.708798] nvme_core video intel_ishtp ttm typec i2c_hid_acpi i2c_hid wmi pinctrl_tigerlake ip6_tables ip_tables i2c_dev fuse [ 610.708806] CPU: 11 PID: 506 Comm: kworker/11:2 Tainted: G W 6.0.0+ torvalds#505 [ 610.708809] Hardware name: LENOVO 21CEZ9Q3US/21CEZ9Q3US, BIOS N3AET66W (1.31 ) 09/09/2022 [ 610.708811] Workqueue: events ipc_imem_run_state_worker [iosm] [ 610.708831] RIP: 0010:__mutex_lock+0x3e4/0x7e0 [ 610.708836] Code: ff 85 c0 0f 84 9b fc ff ff 8b 15 6f 54 11 01 85 d2 0f 85 8d fc ff ff 48 c7 c6 f0 f0 84 94 48 c7 c7 83 07 83 94 e8 91 33 f8 ff <0f> 0b e9 73 fc ff ff f6 83 d1 0c 00 00 01 0f 85 4b ff ff ff 4c 89 [ 610.708837] RSP: 0018:ffffaf0b80767a50 EFLAGS: 00010282 [ 610.708840] RAX: 0000000000000028 RBX: 0000000000000000 RCX: 0000000000000000 [ 610.708841] RDX: 0000000000000001 RSI: ffffffff948b357c RDI: 00000000ffffffff [ 610.708842] RBP: ffffaf0b80767ae0 R08: 0000000000000000 R09: ffffaf0b80767900 [ 610.708843] R10: 0000000000000003 R11: ffff9c191b7fffe8 R12: 0000000000000002 [ 610.708845] R13: 0000000000000000 R14: ffff9c16a3044450 R15: ffff9c15e342ce40 [ 610.708846] FS: 0000000000000000(0000) GS:ffff9c18fd6c0000(0000) knlGS:0000000000000000 [ 610.708848] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 610.708849] CR2: 00001d40ba7bd008 CR3: 00000001d6c26002 CR4: 0000000000770ee0 [ 610.708850] PKRU: 55555554 [ 610.708851] Call Trace: [ 610.708852] <TASK> [ 610.708856] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708862] ? wwan_port_fops_read+0x1b0/0x1b0 [ 610.708867] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708872] ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708877] wwan_rtnl_newlink+0x7e/0xd0 [ 610.708880] wwan_create_default_link+0x24c/0x2e0 [ 610.708890] wwan_register_ops+0x71/0x90 [ 610.708893] ipc_wwan_init+0x48/0x90 [iosm] [ 610.708897] ipc_imem_wwan_channel_init+0x81/0xa0 [iosm] [ 610.708902] ipc_imem_run_state_worker+0xab/0x1b0 [iosm] [ 610.708907] process_one_work+0x254/0x570 [ 610.708914] worker_thread+0x4f/0x3a0 [ 610.708917] ? process_one_work+0x570/0x570 [ 610.708919] kthread+0xf2/0x120 [ 610.708922] ? kthread_complete_and_exit+0x20/0x20 [ 610.708924] ret_from_fork+0x1f/0x30 [ 610.708931] </TASK> [ 610.708931] irq event stamp: 89949 [ 610.708933] hardirqs last enabled at (89949): [<ffffffff93ebc630>] _raw_spin_unlock_irqrestore+0x30/0x60 [ 610.708936] hardirqs last disabled at (89948): [<ffffffff93ebc3bf>] _raw_spin_lock_irqsave+0x5f/0x70 [ 610.708938] softirqs last enabled at (89876): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708942] softirqs last disabled at (89874): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708944] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede <hdegoede@redhat.com>
wwan_register_ops() ends up calls ipc_wwan_newlink() before it returns. ipc_wwan_newlink() uses pc_wwan->if_mutex, so we must initialize it before calling wwan_register_ops(). This fixes the following WARN() when lock-debugging is enabled: [ 610.708713] ------------[ cut here ]------------ [ 610.708721] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 610.708727] WARNING: CPU: 11 PID: 506 at kernel/locking/mutex.c:582 __mutex_lock+0x3e4/0x7e0 [ 610.708736] Modules linked in: iosm snd_seq_dummy snd_hrtimer rfcomm qrtr bnep binfmt_misc snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_soc_dmic iTCO_wdt intel_pmc_bxt mei_hdcp mei_pxp iTCO_vendor_support pmt_telemetry intel_rapl_msr pmt_class intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass rapl intel_cstate intel_uncore pcspkr think_lmi firmware_attributes_class wmi_bmof snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core iwlmvm snd_hwdep snd_seq btusb snd_seq_device btrtl btbcm snd_pcm [ 610.708767] btintel mei_me mac80211 i2c_i801 btmtk libarc4 i2c_smbus snd_timer mei bluetooth hid_sensor_gyro_3d iwlwifi hid_sensor_accel_3d idma64 hid_sensor_trigger hid_sensor_iio_common ecdh_generic industrialio_triggered_buffer kfifo_buf cfg80211 joydev industrialio int3403_thermal soc_button_array ov2740 v4l2_fwnode v4l2_async videodev mc intel_skl_int3472_tps68470 tps68470_regulator clk_tps68470 intel_skl_int3472_discrete intel_hid sparse_keymap int3400_thermal acpi_thermal_rel acpi_tad acpi_pad vfat fat processor_thermal_device_pci processor_thermal_device processor_thermal_rfim processor_thermal_mbox processor_thermal_rapl thunderbolt intel_rapl_common intel_vsec int340x_thermal_zone igen6_edac zram dm_crypt hid_sensor_hub intel_ishtp_hid i915 thinkpad_acpi drm_buddy drm_display_helper snd soundcore ledtrig_audio crct10dif_pclmul wacom platform_profile crc32_pclmul cec nvme intel_ish_ipc rfkill crc32c_intel ucsi_acpi hid_multitouch serio_raw typec_ucsi ghash_clmulni_intel [ 610.708798] nvme_core video intel_ishtp ttm typec i2c_hid_acpi i2c_hid wmi pinctrl_tigerlake ip6_tables ip_tables i2c_dev fuse [ 610.708806] CPU: 11 PID: 506 Comm: kworker/11:2 Tainted: G W 6.0.0+ torvalds#505 [ 610.708809] Hardware name: LENOVO 21CEZ9Q3US/21CEZ9Q3US, BIOS N3AET66W (1.31 ) 09/09/2022 [ 610.708811] Workqueue: events ipc_imem_run_state_worker [iosm] [ 610.708831] RIP: 0010:__mutex_lock+0x3e4/0x7e0 [ 610.708836] Code: ff 85 c0 0f 84 9b fc ff ff 8b 15 6f 54 11 01 85 d2 0f 85 8d fc ff ff 48 c7 c6 f0 f0 84 94 48 c7 c7 83 07 83 94 e8 91 33 f8 ff <0f> 0b e9 73 fc ff ff f6 83 d1 0c 00 00 01 0f 85 4b ff ff ff 4c 89 [ 610.708837] RSP: 0018:ffffaf0b80767a50 EFLAGS: 00010282 [ 610.708840] RAX: 0000000000000028 RBX: 0000000000000000 RCX: 0000000000000000 [ 610.708841] RDX: 0000000000000001 RSI: ffffffff948b357c RDI: 00000000ffffffff [ 610.708842] RBP: ffffaf0b80767ae0 R08: 0000000000000000 R09: ffffaf0b80767900 [ 610.708843] R10: 0000000000000003 R11: ffff9c191b7fffe8 R12: 0000000000000002 [ 610.708845] R13: 0000000000000000 R14: ffff9c16a3044450 R15: ffff9c15e342ce40 [ 610.708846] FS: 0000000000000000(0000) GS:ffff9c18fd6c0000(0000) knlGS:0000000000000000 [ 610.708848] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 610.708849] CR2: 00001d40ba7bd008 CR3: 00000001d6c26002 CR4: 0000000000770ee0 [ 610.708850] PKRU: 55555554 [ 610.708851] Call Trace: [ 610.708852] <TASK> [ 610.708856] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708862] ? wwan_port_fops_read+0x1b0/0x1b0 [ 610.708867] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708872] ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708877] wwan_rtnl_newlink+0x7e/0xd0 [ 610.708880] wwan_create_default_link+0x24c/0x2e0 [ 610.708890] wwan_register_ops+0x71/0x90 [ 610.708893] ipc_wwan_init+0x48/0x90 [iosm] [ 610.708897] ipc_imem_wwan_channel_init+0x81/0xa0 [iosm] [ 610.708902] ipc_imem_run_state_worker+0xab/0x1b0 [iosm] [ 610.708907] process_one_work+0x254/0x570 [ 610.708914] worker_thread+0x4f/0x3a0 [ 610.708917] ? process_one_work+0x570/0x570 [ 610.708919] kthread+0xf2/0x120 [ 610.708922] ? kthread_complete_and_exit+0x20/0x20 [ 610.708924] ret_from_fork+0x1f/0x30 [ 610.708931] </TASK> [ 610.708931] irq event stamp: 89949 [ 610.708933] hardirqs last enabled at (89949): [<ffffffff93ebc630>] _raw_spin_unlock_irqrestore+0x30/0x60 [ 610.708936] hardirqs last disabled at (89948): [<ffffffff93ebc3bf>] _raw_spin_lock_irqsave+0x5f/0x70 [ 610.708938] softirqs last enabled at (89876): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708942] softirqs last disabled at (89874): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708944] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede <hdegoede@redhat.com>
wwan_register_ops() ends up calls ipc_wwan_newlink() before it returns. ipc_wwan_newlink() uses pc_wwan->if_mutex, so we must initialize it before calling wwan_register_ops(). This fixes the following WARN() when lock-debugging is enabled: [ 610.708713] ------------[ cut here ]------------ [ 610.708721] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 610.708727] WARNING: CPU: 11 PID: 506 at kernel/locking/mutex.c:582 __mutex_lock+0x3e4/0x7e0 [ 610.708736] Modules linked in: iosm snd_seq_dummy snd_hrtimer rfcomm qrtr bnep binfmt_misc snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_soc_dmic iTCO_wdt intel_pmc_bxt mei_hdcp mei_pxp iTCO_vendor_support pmt_telemetry intel_rapl_msr pmt_class intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass rapl intel_cstate intel_uncore pcspkr think_lmi firmware_attributes_class wmi_bmof snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core iwlmvm snd_hwdep snd_seq btusb snd_seq_device btrtl btbcm snd_pcm [ 610.708767] btintel mei_me mac80211 i2c_i801 btmtk libarc4 i2c_smbus snd_timer mei bluetooth hid_sensor_gyro_3d iwlwifi hid_sensor_accel_3d idma64 hid_sensor_trigger hid_sensor_iio_common ecdh_generic industrialio_triggered_buffer kfifo_buf cfg80211 joydev industrialio int3403_thermal soc_button_array ov2740 v4l2_fwnode v4l2_async videodev mc intel_skl_int3472_tps68470 tps68470_regulator clk_tps68470 intel_skl_int3472_discrete intel_hid sparse_keymap int3400_thermal acpi_thermal_rel acpi_tad acpi_pad vfat fat processor_thermal_device_pci processor_thermal_device processor_thermal_rfim processor_thermal_mbox processor_thermal_rapl thunderbolt intel_rapl_common intel_vsec int340x_thermal_zone igen6_edac zram dm_crypt hid_sensor_hub intel_ishtp_hid i915 thinkpad_acpi drm_buddy drm_display_helper snd soundcore ledtrig_audio crct10dif_pclmul wacom platform_profile crc32_pclmul cec nvme intel_ish_ipc rfkill crc32c_intel ucsi_acpi hid_multitouch serio_raw typec_ucsi ghash_clmulni_intel [ 610.708798] nvme_core video intel_ishtp ttm typec i2c_hid_acpi i2c_hid wmi pinctrl_tigerlake ip6_tables ip_tables i2c_dev fuse [ 610.708806] CPU: 11 PID: 506 Comm: kworker/11:2 Tainted: G W 6.0.0+ torvalds#505 [ 610.708809] Hardware name: LENOVO 21CEZ9Q3US/21CEZ9Q3US, BIOS N3AET66W (1.31 ) 09/09/2022 [ 610.708811] Workqueue: events ipc_imem_run_state_worker [iosm] [ 610.708831] RIP: 0010:__mutex_lock+0x3e4/0x7e0 [ 610.708836] Code: ff 85 c0 0f 84 9b fc ff ff 8b 15 6f 54 11 01 85 d2 0f 85 8d fc ff ff 48 c7 c6 f0 f0 84 94 48 c7 c7 83 07 83 94 e8 91 33 f8 ff <0f> 0b e9 73 fc ff ff f6 83 d1 0c 00 00 01 0f 85 4b ff ff ff 4c 89 [ 610.708837] RSP: 0018:ffffaf0b80767a50 EFLAGS: 00010282 [ 610.708840] RAX: 0000000000000028 RBX: 0000000000000000 RCX: 0000000000000000 [ 610.708841] RDX: 0000000000000001 RSI: ffffffff948b357c RDI: 00000000ffffffff [ 610.708842] RBP: ffffaf0b80767ae0 R08: 0000000000000000 R09: ffffaf0b80767900 [ 610.708843] R10: 0000000000000003 R11: ffff9c191b7fffe8 R12: 0000000000000002 [ 610.708845] R13: 0000000000000000 R14: ffff9c16a3044450 R15: ffff9c15e342ce40 [ 610.708846] FS: 0000000000000000(0000) GS:ffff9c18fd6c0000(0000) knlGS:0000000000000000 [ 610.708848] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 610.708849] CR2: 00001d40ba7bd008 CR3: 00000001d6c26002 CR4: 0000000000770ee0 [ 610.708850] PKRU: 55555554 [ 610.708851] Call Trace: [ 610.708852] <TASK> [ 610.708856] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708862] ? wwan_port_fops_read+0x1b0/0x1b0 [ 610.708867] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708872] ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708877] wwan_rtnl_newlink+0x7e/0xd0 [ 610.708880] wwan_create_default_link+0x24c/0x2e0 [ 610.708890] wwan_register_ops+0x71/0x90 [ 610.708893] ipc_wwan_init+0x48/0x90 [iosm] [ 610.708897] ipc_imem_wwan_channel_init+0x81/0xa0 [iosm] [ 610.708902] ipc_imem_run_state_worker+0xab/0x1b0 [iosm] [ 610.708907] process_one_work+0x254/0x570 [ 610.708914] worker_thread+0x4f/0x3a0 [ 610.708917] ? process_one_work+0x570/0x570 [ 610.708919] kthread+0xf2/0x120 [ 610.708922] ? kthread_complete_and_exit+0x20/0x20 [ 610.708924] ret_from_fork+0x1f/0x30 [ 610.708931] </TASK> [ 610.708931] irq event stamp: 89949 [ 610.708933] hardirqs last enabled at (89949): [<ffffffff93ebc630>] _raw_spin_unlock_irqrestore+0x30/0x60 [ 610.708936] hardirqs last disabled at (89948): [<ffffffff93ebc3bf>] _raw_spin_lock_irqsave+0x5f/0x70 [ 610.708938] softirqs last enabled at (89876): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708942] softirqs last disabled at (89874): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708944] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede <hdegoede@redhat.com>
wwan_register_ops() ends up calls ipc_wwan_newlink() before it returns. ipc_wwan_newlink() uses pc_wwan->if_mutex, so we must initialize it before calling wwan_register_ops(). This fixes the following WARN() when lock-debugging is enabled: [ 610.708713] ------------[ cut here ]------------ [ 610.708721] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 610.708727] WARNING: CPU: 11 PID: 506 at kernel/locking/mutex.c:582 __mutex_lock+0x3e4/0x7e0 [ 610.708736] Modules linked in: iosm snd_seq_dummy snd_hrtimer rfcomm qrtr bnep binfmt_misc snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_soc_dmic iTCO_wdt intel_pmc_bxt mei_hdcp mei_pxp iTCO_vendor_support pmt_telemetry intel_rapl_msr pmt_class intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass rapl intel_cstate intel_uncore pcspkr think_lmi firmware_attributes_class wmi_bmof snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core iwlmvm snd_hwdep snd_seq btusb snd_seq_device btrtl btbcm snd_pcm [ 610.708767] btintel mei_me mac80211 i2c_i801 btmtk libarc4 i2c_smbus snd_timer mei bluetooth hid_sensor_gyro_3d iwlwifi hid_sensor_accel_3d idma64 hid_sensor_trigger hid_sensor_iio_common ecdh_generic industrialio_triggered_buffer kfifo_buf cfg80211 joydev industrialio int3403_thermal soc_button_array ov2740 v4l2_fwnode v4l2_async videodev mc intel_skl_int3472_tps68470 tps68470_regulator clk_tps68470 intel_skl_int3472_discrete intel_hid sparse_keymap int3400_thermal acpi_thermal_rel acpi_tad acpi_pad vfat fat processor_thermal_device_pci processor_thermal_device processor_thermal_rfim processor_thermal_mbox processor_thermal_rapl thunderbolt intel_rapl_common intel_vsec int340x_thermal_zone igen6_edac zram dm_crypt hid_sensor_hub intel_ishtp_hid i915 thinkpad_acpi drm_buddy drm_display_helper snd soundcore ledtrig_audio crct10dif_pclmul wacom platform_profile crc32_pclmul cec nvme intel_ish_ipc rfkill crc32c_intel ucsi_acpi hid_multitouch serio_raw typec_ucsi ghash_clmulni_intel [ 610.708798] nvme_core video intel_ishtp ttm typec i2c_hid_acpi i2c_hid wmi pinctrl_tigerlake ip6_tables ip_tables i2c_dev fuse [ 610.708806] CPU: 11 PID: 506 Comm: kworker/11:2 Tainted: G W 6.0.0+ torvalds#505 [ 610.708809] Hardware name: LENOVO 21CEZ9Q3US/21CEZ9Q3US, BIOS N3AET66W (1.31 ) 09/09/2022 [ 610.708811] Workqueue: events ipc_imem_run_state_worker [iosm] [ 610.708831] RIP: 0010:__mutex_lock+0x3e4/0x7e0 [ 610.708836] Code: ff 85 c0 0f 84 9b fc ff ff 8b 15 6f 54 11 01 85 d2 0f 85 8d fc ff ff 48 c7 c6 f0 f0 84 94 48 c7 c7 83 07 83 94 e8 91 33 f8 ff <0f> 0b e9 73 fc ff ff f6 83 d1 0c 00 00 01 0f 85 4b ff ff ff 4c 89 [ 610.708837] RSP: 0018:ffffaf0b80767a50 EFLAGS: 00010282 [ 610.708840] RAX: 0000000000000028 RBX: 0000000000000000 RCX: 0000000000000000 [ 610.708841] RDX: 0000000000000001 RSI: ffffffff948b357c RDI: 00000000ffffffff [ 610.708842] RBP: ffffaf0b80767ae0 R08: 0000000000000000 R09: ffffaf0b80767900 [ 610.708843] R10: 0000000000000003 R11: ffff9c191b7fffe8 R12: 0000000000000002 [ 610.708845] R13: 0000000000000000 R14: ffff9c16a3044450 R15: ffff9c15e342ce40 [ 610.708846] FS: 0000000000000000(0000) GS:ffff9c18fd6c0000(0000) knlGS:0000000000000000 [ 610.708848] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 610.708849] CR2: 00001d40ba7bd008 CR3: 00000001d6c26002 CR4: 0000000000770ee0 [ 610.708850] PKRU: 55555554 [ 610.708851] Call Trace: [ 610.708852] <TASK> [ 610.708856] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708862] ? wwan_port_fops_read+0x1b0/0x1b0 [ 610.708867] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708872] ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708877] wwan_rtnl_newlink+0x7e/0xd0 [ 610.708880] wwan_create_default_link+0x24c/0x2e0 [ 610.708890] wwan_register_ops+0x71/0x90 [ 610.708893] ipc_wwan_init+0x48/0x90 [iosm] [ 610.708897] ipc_imem_wwan_channel_init+0x81/0xa0 [iosm] [ 610.708902] ipc_imem_run_state_worker+0xab/0x1b0 [iosm] [ 610.708907] process_one_work+0x254/0x570 [ 610.708914] worker_thread+0x4f/0x3a0 [ 610.708917] ? process_one_work+0x570/0x570 [ 610.708919] kthread+0xf2/0x120 [ 610.708922] ? kthread_complete_and_exit+0x20/0x20 [ 610.708924] ret_from_fork+0x1f/0x30 [ 610.708931] </TASK> [ 610.708931] irq event stamp: 89949 [ 610.708933] hardirqs last enabled at (89949): [<ffffffff93ebc630>] _raw_spin_unlock_irqrestore+0x30/0x60 [ 610.708936] hardirqs last disabled at (89948): [<ffffffff93ebc3bf>] _raw_spin_lock_irqsave+0x5f/0x70 [ 610.708938] softirqs last enabled at (89876): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708942] softirqs last disabled at (89874): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708944] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede <hdegoede@redhat.com>
wwan_register_ops() ends up calls ipc_wwan_newlink() before it returns. ipc_wwan_newlink() uses pc_wwan->if_mutex, so we must initialize it before calling wwan_register_ops(). This fixes the following WARN() when lock-debugging is enabled: [ 610.708713] ------------[ cut here ]------------ [ 610.708721] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 610.708727] WARNING: CPU: 11 PID: 506 at kernel/locking/mutex.c:582 __mutex_lock+0x3e4/0x7e0 [ 610.708736] Modules linked in: iosm snd_seq_dummy snd_hrtimer rfcomm qrtr bnep binfmt_misc snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_soc_dmic iTCO_wdt intel_pmc_bxt mei_hdcp mei_pxp iTCO_vendor_support pmt_telemetry intel_rapl_msr pmt_class intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass rapl intel_cstate intel_uncore pcspkr think_lmi firmware_attributes_class wmi_bmof snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core iwlmvm snd_hwdep snd_seq btusb snd_seq_device btrtl btbcm snd_pcm [ 610.708767] btintel mei_me mac80211 i2c_i801 btmtk libarc4 i2c_smbus snd_timer mei bluetooth hid_sensor_gyro_3d iwlwifi hid_sensor_accel_3d idma64 hid_sensor_trigger hid_sensor_iio_common ecdh_generic industrialio_triggered_buffer kfifo_buf cfg80211 joydev industrialio int3403_thermal soc_button_array ov2740 v4l2_fwnode v4l2_async videodev mc intel_skl_int3472_tps68470 tps68470_regulator clk_tps68470 intel_skl_int3472_discrete intel_hid sparse_keymap int3400_thermal acpi_thermal_rel acpi_tad acpi_pad vfat fat processor_thermal_device_pci processor_thermal_device processor_thermal_rfim processor_thermal_mbox processor_thermal_rapl thunderbolt intel_rapl_common intel_vsec int340x_thermal_zone igen6_edac zram dm_crypt hid_sensor_hub intel_ishtp_hid i915 thinkpad_acpi drm_buddy drm_display_helper snd soundcore ledtrig_audio crct10dif_pclmul wacom platform_profile crc32_pclmul cec nvme intel_ish_ipc rfkill crc32c_intel ucsi_acpi hid_multitouch serio_raw typec_ucsi ghash_clmulni_intel [ 610.708798] nvme_core video intel_ishtp ttm typec i2c_hid_acpi i2c_hid wmi pinctrl_tigerlake ip6_tables ip_tables i2c_dev fuse [ 610.708806] CPU: 11 PID: 506 Comm: kworker/11:2 Tainted: G W 6.0.0+ torvalds#505 [ 610.708809] Hardware name: LENOVO 21CEZ9Q3US/21CEZ9Q3US, BIOS N3AET66W (1.31 ) 09/09/2022 [ 610.708811] Workqueue: events ipc_imem_run_state_worker [iosm] [ 610.708831] RIP: 0010:__mutex_lock+0x3e4/0x7e0 [ 610.708836] Code: ff 85 c0 0f 84 9b fc ff ff 8b 15 6f 54 11 01 85 d2 0f 85 8d fc ff ff 48 c7 c6 f0 f0 84 94 48 c7 c7 83 07 83 94 e8 91 33 f8 ff <0f> 0b e9 73 fc ff ff f6 83 d1 0c 00 00 01 0f 85 4b ff ff ff 4c 89 [ 610.708837] RSP: 0018:ffffaf0b80767a50 EFLAGS: 00010282 [ 610.708840] RAX: 0000000000000028 RBX: 0000000000000000 RCX: 0000000000000000 [ 610.708841] RDX: 0000000000000001 RSI: ffffffff948b357c RDI: 00000000ffffffff [ 610.708842] RBP: ffffaf0b80767ae0 R08: 0000000000000000 R09: ffffaf0b80767900 [ 610.708843] R10: 0000000000000003 R11: ffff9c191b7fffe8 R12: 0000000000000002 [ 610.708845] R13: 0000000000000000 R14: ffff9c16a3044450 R15: ffff9c15e342ce40 [ 610.708846] FS: 0000000000000000(0000) GS:ffff9c18fd6c0000(0000) knlGS:0000000000000000 [ 610.708848] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 610.708849] CR2: 00001d40ba7bd008 CR3: 00000001d6c26002 CR4: 0000000000770ee0 [ 610.708850] PKRU: 55555554 [ 610.708851] Call Trace: [ 610.708852] <TASK> [ 610.708856] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708862] ? wwan_port_fops_read+0x1b0/0x1b0 [ 610.708867] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708872] ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708877] wwan_rtnl_newlink+0x7e/0xd0 [ 610.708880] wwan_create_default_link+0x24c/0x2e0 [ 610.708890] wwan_register_ops+0x71/0x90 [ 610.708893] ipc_wwan_init+0x48/0x90 [iosm] [ 610.708897] ipc_imem_wwan_channel_init+0x81/0xa0 [iosm] [ 610.708902] ipc_imem_run_state_worker+0xab/0x1b0 [iosm] [ 610.708907] process_one_work+0x254/0x570 [ 610.708914] worker_thread+0x4f/0x3a0 [ 610.708917] ? process_one_work+0x570/0x570 [ 610.708919] kthread+0xf2/0x120 [ 610.708922] ? kthread_complete_and_exit+0x20/0x20 [ 610.708924] ret_from_fork+0x1f/0x30 [ 610.708931] </TASK> [ 610.708931] irq event stamp: 89949 [ 610.708933] hardirqs last enabled at (89949): [<ffffffff93ebc630>] _raw_spin_unlock_irqrestore+0x30/0x60 [ 610.708936] hardirqs last disabled at (89948): [<ffffffff93ebc3bf>] _raw_spin_lock_irqsave+0x5f/0x70 [ 610.708938] softirqs last enabled at (89876): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708942] softirqs last disabled at (89874): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708944] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede <hdegoede@redhat.com>
wwan_register_ops() ends up calls ipc_wwan_newlink() before it returns. ipc_wwan_newlink() uses pc_wwan->if_mutex, so we must initialize it before calling wwan_register_ops(). This fixes the following WARN() when lock-debugging is enabled: [ 610.708713] ------------[ cut here ]------------ [ 610.708721] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 610.708727] WARNING: CPU: 11 PID: 506 at kernel/locking/mutex.c:582 __mutex_lock+0x3e4/0x7e0 [ 610.708736] Modules linked in: iosm snd_seq_dummy snd_hrtimer rfcomm qrtr bnep binfmt_misc snd_ctl_led snd_soc_skl_hda_dsp snd_soc_intel_hda_dsp_common snd_soc_hdac_hdmi snd_sof_probes snd_soc_dmic iTCO_wdt intel_pmc_bxt mei_hdcp mei_pxp iTCO_vendor_support pmt_telemetry intel_rapl_msr pmt_class intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass rapl intel_cstate intel_uncore pcspkr think_lmi firmware_attributes_class wmi_bmof snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core iwlmvm snd_hwdep snd_seq btusb snd_seq_device btrtl btbcm snd_pcm [ 610.708767] btintel mei_me mac80211 i2c_i801 btmtk libarc4 i2c_smbus snd_timer mei bluetooth hid_sensor_gyro_3d iwlwifi hid_sensor_accel_3d idma64 hid_sensor_trigger hid_sensor_iio_common ecdh_generic industrialio_triggered_buffer kfifo_buf cfg80211 joydev industrialio int3403_thermal soc_button_array ov2740 v4l2_fwnode v4l2_async videodev mc intel_skl_int3472_tps68470 tps68470_regulator clk_tps68470 intel_skl_int3472_discrete intel_hid sparse_keymap int3400_thermal acpi_thermal_rel acpi_tad acpi_pad vfat fat processor_thermal_device_pci processor_thermal_device processor_thermal_rfim processor_thermal_mbox processor_thermal_rapl thunderbolt intel_rapl_common intel_vsec int340x_thermal_zone igen6_edac zram dm_crypt hid_sensor_hub intel_ishtp_hid i915 thinkpad_acpi drm_buddy drm_display_helper snd soundcore ledtrig_audio crct10dif_pclmul wacom platform_profile crc32_pclmul cec nvme intel_ish_ipc rfkill crc32c_intel ucsi_acpi hid_multitouch serio_raw typec_ucsi ghash_clmulni_intel [ 610.708798] nvme_core video intel_ishtp ttm typec i2c_hid_acpi i2c_hid wmi pinctrl_tigerlake ip6_tables ip_tables i2c_dev fuse [ 610.708806] CPU: 11 PID: 506 Comm: kworker/11:2 Tainted: G W 6.0.0+ torvalds#505 [ 610.708809] Hardware name: LENOVO 21CEZ9Q3US/21CEZ9Q3US, BIOS N3AET66W (1.31 ) 09/09/2022 [ 610.708811] Workqueue: events ipc_imem_run_state_worker [iosm] [ 610.708831] RIP: 0010:__mutex_lock+0x3e4/0x7e0 [ 610.708836] Code: ff 85 c0 0f 84 9b fc ff ff 8b 15 6f 54 11 01 85 d2 0f 85 8d fc ff ff 48 c7 c6 f0 f0 84 94 48 c7 c7 83 07 83 94 e8 91 33 f8 ff <0f> 0b e9 73 fc ff ff f6 83 d1 0c 00 00 01 0f 85 4b ff ff ff 4c 89 [ 610.708837] RSP: 0018:ffffaf0b80767a50 EFLAGS: 00010282 [ 610.708840] RAX: 0000000000000028 RBX: 0000000000000000 RCX: 0000000000000000 [ 610.708841] RDX: 0000000000000001 RSI: ffffffff948b357c RDI: 00000000ffffffff [ 610.708842] RBP: ffffaf0b80767ae0 R08: 0000000000000000 R09: ffffaf0b80767900 [ 610.708843] R10: 0000000000000003 R11: ffff9c191b7fffe8 R12: 0000000000000002 [ 610.708845] R13: 0000000000000000 R14: ffff9c16a3044450 R15: ffff9c15e342ce40 [ 610.708846] FS: 0000000000000000(0000) GS:ffff9c18fd6c0000(0000) knlGS:0000000000000000 [ 610.708848] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 610.708849] CR2: 00001d40ba7bd008 CR3: 00000001d6c26002 CR4: 0000000000770ee0 [ 610.708850] PKRU: 55555554 [ 610.708851] Call Trace: [ 610.708852] <TASK> [ 610.708856] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708862] ? wwan_port_fops_read+0x1b0/0x1b0 [ 610.708867] ? ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708872] ipc_wwan_newlink+0x46/0xb0 [iosm] [ 610.708877] wwan_rtnl_newlink+0x7e/0xd0 [ 610.708880] wwan_create_default_link+0x24c/0x2e0 [ 610.708890] wwan_register_ops+0x71/0x90 [ 610.708893] ipc_wwan_init+0x48/0x90 [iosm] [ 610.708897] ipc_imem_wwan_channel_init+0x81/0xa0 [iosm] [ 610.708902] ipc_imem_run_state_worker+0xab/0x1b0 [iosm] [ 610.708907] process_one_work+0x254/0x570 [ 610.708914] worker_thread+0x4f/0x3a0 [ 610.708917] ? process_one_work+0x570/0x570 [ 610.708919] kthread+0xf2/0x120 [ 610.708922] ? kthread_complete_and_exit+0x20/0x20 [ 610.708924] ret_from_fork+0x1f/0x30 [ 610.708931] </TASK> [ 610.708931] irq event stamp: 89949 [ 610.708933] hardirqs last enabled at (89949): [<ffffffff93ebc630>] _raw_spin_unlock_irqrestore+0x30/0x60 [ 610.708936] hardirqs last disabled at (89948): [<ffffffff93ebc3bf>] _raw_spin_lock_irqsave+0x5f/0x70 [ 610.708938] softirqs last enabled at (89876): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708942] softirqs last disabled at (89874): [<ffffffff93bc2509>] __netdev_alloc_skb+0xe9/0x150 [ 610.708944] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede <hdegoede@redhat.com>
typically TRIM cost shorter time than ERASE, so we expect max_trim as max_discard. But when ERASE timeout is too long, it did happened actually rather than theoretically. A type of Toshiba eMMC's ERASE_TIMEOUT_MULT is too long and controller's max_busy_timeout is relatively small, then max_discard could be 0, even max_trim is available, but max_trim < max_disable can't be true, so we get a result of 0 instead of max_trim.