[Intel-gfx] [i-g-t PATCH] tests: do snd_hda_intel unbind before unload in module reload test

Jani Nikula jani.nikula at intel.com
Mon Oct 31 09:05:31 UTC 2016


On Mon, 31 Oct 2016, "Yang, Libin" <libin.yang at intel.com> wrote:
>> -----Original Message-----
>> From: Nikula, Jani
>> Sent: Monday, October 31, 2016 4:40 PM
>> To: intel-gfx at lists.freedesktop.org
>> Cc: Nikula, Jani <jani.nikula at intel.com>; Zhang, Keqiao
>> <keqiao.zhang at intel.com>; Yang, Libin <libin.yang at intel.com>
>> Subject: [i-g-t PATCH] tests: do snd_hda_intel unbind before unload in
>> module reload test
>> 
>> Try to make sure the snd_hda_intel module is not in use, and can be
>> unloaded.
>> 
>> Cc: Keqiao Zhang <keqiao.zhang at intel.com>
>> Cc: Libin Yang <libin.yang at intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
>> 
>> ---
>> 
>> Keqiao, Libin, here's the script this patch is against:
>> 
>> https://cgit.freedesktop.org/drm/igt-gpu-
>> tools/tree/tests/drv_module_reload_basic
>> ---
>>  tests/drv_module_reload_basic | 3 +++
>>  1 file changed, 3 insertions(+)
>> 
>> diff --git a/tests/drv_module_reload_basic b/tests/drv_module_reload_basic
>> index b8cad88133e9..c0676fc65db0 100755
>> --- a/tests/drv_module_reload_basic
>> +++ b/tests/drv_module_reload_basic
>> @@ -33,6 +33,9 @@ function reload() {
>>  	pkill alsactl
>>  	snd_hda_intel_unloaded=0
>>  	if mod_loaded snd_hda_intel; then
>> +		if [ -e /sys/bus/pci/drivers/snd_hda_intel/unbind ]; then
>> +			echo "0000:00:03.0" >
>
> "0000:00:03.0" is platform related.
> We should check lspci -vvv |grep Audio to get the number.
> Or we can check /sys/bus/pci/drivers/snd_hda_intel/ folder to get the number.
> And sometimes there are 2 sound cards to unbind.

How about this?

for f in $(find /sys/bus/pci/drivers/snd_hda_intel -name "0000:*" -printf %f); do
	echo $f > /sys/bus/pci/drivers/snd_hda_intel/unbind
done

BR,
Jani.


>
> Regards,
> Libin
>
>> /sys/bus/pci/drivers/snd_hda_intel/unbind
>> +		fi
>>  		if rmmod snd_hda_intel; then
>>  			snd_hda_intel_unloaded=1
>>  		else
>> --
>> 2.1.4
>

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the Intel-gfx mailing list