Skip to content

sof_remove.sh: print FAILED and run lsmod when rmmod fails silently - #682

Merged
fredoh9 merged 2 commits into
thesofproject:mainfrom
marc-hb:loud-rmmod-fail
Jun 1, 2021
Merged

fredoh9 merged 2 commits into
thesofproject:mainfrom
marc-hb:loud-rmmod-fail

Conversation

@marc-hb

@marc-hb marc-hb commented Jun 1, 2021

Copy link
Copy Markdown
Collaborator

In my example this changes the output from a totally quiet and cryptic:

SKIP	snd_usb_audio  	not loaded
SKIP	snd_hda_intel  	not loaded
SKIP	snd_sof_pci_intel_tng  	not loaded
RMMOD	snd_sof_pci_intel_apl

to this instead:

SKIP	snd_usb_audio  	not loaded
SKIP	snd_hda_intel  	not loaded
SKIP	snd_sof_pci_intel_tng  	not loaded
RMMOD	snd_sof_pci_intel_apl
snd_sof_pci_intel_apl    16384  -1
snd_sof_intel_hda_common    77824  1 snd_sof_pci_intel_apl
snd_sof_pci            20480  2 snd_sof_intel_hda_common,snd_sof_pci_intel_apl
snd_soc_acpi_intel_match    40960  1 snd_sof_pci_intel_apl
snd_soc_acpi           16384  2 snd_soc_acpi_intel_match,snd_sof_intel_hda_common
snd_sof               126976  2 snd_sof_pci,snd_sof_intel_hda_common
snd_soc_core          253952  1 snd_sof
snd_sof_xtensa_dsp     16384  1 snd_sof_intel_hda_common
snd_intel_dspcfg       28672  1 snd_sof_intel_hda_common
snd_pcm               118784  3 snd_sof,snd_sof_intel_hda_common,snd_soc_core
snd_usbmidi_lib        36864  0
ledtrig_audio          16384  1 snd_sof
snd_seq_midi           20480  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            36864  2 snd_seq_midi,snd_usbmidi_lib
snd_seq                81920  2 snd_seq_midi,snd_seq_midi_event
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
snd_timer              36864  2 snd_seq,snd_pcm
snd                    86016  7 snd_seq,snd_seq_device,snd_usbmidi_lib,snd_timer,snd_soc_core,snd_pcm,snd_rawmidi
soundcore              16384  1 snd
drm_kms_helper        200704  1 i915
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
drm                   434176  3 drm_kms_helper,i915
./sof-test/tools/kmod/sof_remove.sh FAILED

Another "rmmod snd_sof_pci_intel_apl" instance was stuck when this happened.

Signed-off-by: Marc Herbert marc.herbert@intel.com

marc-hb added 2 commits May 31, 2021 18:15
Saves about 0.2s on my system. strace lsmod shows that reading
/proc/modules is what lsmod does too.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
In my example this changes the output from a totally quiet and cryptic:

SKIP	snd_usb_audio  	not loaded
SKIP	snd_hda_intel  	not loaded
SKIP	snd_sof_pci_intel_tng  	not loaded
RMMOD	snd_sof_pci_intel_apl

to this instead:

SKIP	snd_usb_audio  	not loaded
SKIP	snd_hda_intel  	not loaded
SKIP	snd_sof_pci_intel_tng  	not loaded
RMMOD	snd_sof_pci_intel_apl
snd_sof_pci_intel_apl    16384  -1
snd_sof_intel_hda_common    77824  1 snd_sof_pci_intel_apl
snd_sof_pci            20480  2 snd_sof_intel_hda_common,snd_sof_pci_intel_apl
snd_soc_acpi_intel_match    40960  1 snd_sof_pci_intel_apl
snd_soc_acpi           16384  2 snd_soc_acpi_intel_match,snd_sof_intel_hda_common
snd_sof               126976  2 snd_sof_pci,snd_sof_intel_hda_common
snd_soc_core          253952  1 snd_sof
snd_sof_xtensa_dsp     16384  1 snd_sof_intel_hda_common
snd_intel_dspcfg       28672  1 snd_sof_intel_hda_common
snd_pcm               118784  3 snd_sof,snd_sof_intel_hda_common,snd_soc_core
snd_usbmidi_lib        36864  0
ledtrig_audio          16384  1 snd_sof
snd_seq_midi           20480  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            36864  2 snd_seq_midi,snd_usbmidi_lib
snd_seq                81920  2 snd_seq_midi,snd_seq_midi_event
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
snd_timer              36864  2 snd_seq,snd_pcm
snd                    86016  7 snd_seq,snd_seq_device,snd_usbmidi_lib,snd_timer,snd_soc_core,snd_pcm,snd_rawmidi
soundcore              16384  1 snd
drm_kms_helper        200704  1 i915
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
drm                   434176  3 drm_kms_helper,i915
./sof-test/tools/kmod/sof_remove.sh FAILED

Another "rmmod snd_sof_pci_intel_apl" instance was stuck when this happened.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
@marc-hb

marc-hb commented Jun 1, 2021

Copy link
Copy Markdown
Collaborator Author

Probably related to thesofproject/linux#2954

@marc-hb
marc-hb marked this pull request as ready for review June 1, 2021 02:01
@marc-hb
marc-hb requested review from a team and plbossart as code owners June 1, 2021 02:01

@fredoh9 fredoh9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point

@fredoh9
fredoh9 merged commit 1e95bb7 into thesofproject:main Jun 1, 2021
@marc-hb
marc-hb deleted the loud-rmmod-fail branch July 22, 2021 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants