summaryrefslogtreecommitdiff
path: root/lib/igt_kmod.h
AgeCommit message (Collapse)Author
2022-05-18lib/igt_kmod: don't leak who from module unload routinesMauro Carvalho Chehab
Add code to free allocated strings at the module unload routines from igt_kmod. Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-05-18tests/core_hotunplug: properly finish processes using audio devicesMauro Carvalho Chehab
Before unloading or unbinding an audio driver, all processes that are using it must be terminated. The current logic seeks only for alsactl, but ignore other processes, including pulseaudio. Make the logic more general, extending it to any processes that could have an open device under /dev/snd. It should be noticed that some distros like Fedora and openSUSE are now migrating from pulseaudio into pipewire-pulse. Right now, there's no standard distribution-agnostic way to request pipewire-pulse to stop using audio devices, but there's a new patch upstream that will make things easier: https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/6ad6300ec657c88322a8cd6f3548261d3dc05359 Which should be available for pipewire-pulse versions 0.3.50 and upper. Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-02-15lib: Add silent __igt_i915_driver_unloadAnshuman Gupta
Add silent __igt_i915_driver_unload(), which will not print any warning in case of passed argument is NULL. This will be used by some igt test, which marks i915 module busy and expect i915 module unload to fail. These tests requires a silent lib function to unload the i915 module correctly. v2: - Change commit log. [Ashutosh] - Change whom to who. [Ashutosh] - When aux audule unload fails mark who with module name. [Ashutosh] - Keep same type of return type in __igt_i915_driver_unload(). [Ashutosh] Cc: Chris Wilson <chris.p.wilson@intel.com> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-06-16tests/amdgpu: Add amdgpu module reload testVictor Lu
Test to ensure unloading and loading of amdgpu driver works Tested on: ASIC: NAVI14 Changes since v1: * Added documentaion * Updated commit message Signed-off-by: Victor Lu <victorchengchi.lu@amd.com> Co-developed-by: Anson Jacob <Anson.Jacob@amd.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Cc: Mark Yacoub <markyacoub@google.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
2019-11-12lib/igt_list: Update, clean-up and document igt_listArkadiusz Hiler
Our list was something between Wayland and Linux Kernel list implementations, right in the uncanny valley. On top of that it falsely claimed that it's a straight copy from the Wayland project. Let's make our impl more akin to the kernel one to ease the cognitive dissonance for the developers working on all those projects. This patch: * mimics the current kernel list interface * separates IGT helpers in the source files * adds brief explanation and code example for igt-doc * introduces igt_list.c as static inlines are not visible in the docs v2: mimic the kernel instead of wayland (Chris) - _head suffix for the sentinel/link struct - _entry_ in iterator names that go over the elements v3: I forgot to merge this in time and there was another call site that had to be converted in gem_spin_batch.c Cc: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-10-29tests/i915_module_load: Use new name of fault injection module parameterJanusz Krzysztofik
Name of the i915 module parameter providing fault injection function is changing for consistency with a new convention of naming i915 driver internal functions called from the driver PCI .probe entry point. Adjust the test to use the new name. [ickle: keep the old parameter name around for stable testing] Suggested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> Cc: Michał Wajdeczko <michal.wajdeczko@intel.com> Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Piotr Piórkowski <piotr.piorkowski@intel.com> Cc: Tomasz Lis <tomasz.lis@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-07-13lib/gt: Make use of dummyload library to create recursive batchAntonio Argenziano
An hanging batch is nothing more than a spinning batch that never gets stopped, so re-use the routines implemented in dummyload.c. v2: Let caller decide spin loop size v3: Only use loose loops for hangs (Chris) v4: No requires v5: Free the spinner v6: Chamelium exists. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> #v3 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2017-11-29igt: Remove Android supportArkadiusz Hiler
This patch gets rid of the Android support, deleting all the hacks and moving code around to the places it belongs. Android build is not really maintained properly and rots rather fast. With recent push for Meson here and Android going for Soong it will only accelerate. It's a good time to drop the illusion of providing any support. Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Kalyan Kondapally <kalyan.kondapally@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2017-06-07Android.mk: Fix libkmod useArkadiusz Hiler
On Android libkmod.h is nested under libkmod directory, so we should include appropriately. Also we need to link with it. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-03-23lib: system() is bad, use libkmod insteadChris Wilson
For an as of yet unknown reason, calling system("modprobe") from inside igt/gem_wait causes kasan to spend 1-5 minutes copying the process pagetables. This evaporates if we replace the fork-happy call to system with a call to load the module using libkmod. So be it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-13Revert "Always expose IGT subtests for known kernel selftests"Chris Wilson
This reverts commit 7ab5c97924bf971a348ff4a1768da624ba2f564c.
2017-03-13Always expose IGT subtests for known kernel selftestsPetri Latvala
Even when the running kernel does not support selftests, make subtest enumeration list known kselftests. The list is generated using selftest listing headers copied from the kernel. If the running kernel gains new selftest subtests, they are listed even without copying the headers over and rebuilding IGT. v2: Use correct names for the testcases Signed-off-by: Petri Latvala <petri.latvala@intel.com>
2017-02-08lib/kselftests: Split up igt_kselftests()Chris Wilson
To make it easier to reuse, split up the the single function up into stages. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-22lib/selftest: Query module parameter for error code.Chris Wilson
"Live" selftesting of i915.ko happens during device probing which eats the error code and does not propagate it back to module loading. Workaround this by writing the error code back to the module parameter and probing it after a "successful" install. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-07igt/drv_selftest: Adapt to mock/late splitChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-01igt: Add kselftest runner for i915Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-01lib/igt_kmod: Adopt igt_kselftests()Chris Wilson
Extract the automagic kselftest runner from tests/drm_mm.c to the new lib/igt_kmod.c Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-01lib/igt_kmod: New library to support driver loading/unloading and additional ↵Marius Vlad
helpers. lib/igt_aux: Added igt_pkill and igt_lsof helper. lib/igt_kmod: Added load/unload kmod helpers. v7: - document the case where leaving stray fd from drm_open_driver() might fail reloading the driver. - list also current opened files from /dev/dri in case we could not unload the driver. - convert igt_info to igt_warn (Chris Wilson) - added KMOD_|PROCPS CFLAGS (Chris Wilson) v6: - include latest modifications from tests/drv_module_reload: display all loaded modules and list information about opened files by processes (Petri Latvala) v5: - added igt_i915_driver_{load/unload}. - added kick_snd_hda_intel() to match current tests/drv_module_reload_basic and integrated into igt_i915_driver_load/unload. - added gtk-doc section for lib/igt_kmod v4: - decided to split libkmod helpers into their own file as there's another user lib/igt_gvt or tests/gvt_basic. - fixed some gtk-doc documentation. v3: - return -errno (igt_pkill()) in case of failure (Cris Wilson) - return bool for igt_kmod_is_loaded(), replaced strncasecmp with strncmp (Chris Wilson) v2: - Renamed libkmod helpers (Chris Wilson) - Removed SIGTERM/SIGKILL case where we repeatedly tried to terminate the process: just call kill(2) once (Chris Wilson) - Removed redundant check in igt_kmod_unload(), igt_module_in_use() (Chris Wilson) - Pass flags to igt_kmod_unload() from the caller (Chris Wilson) - Removed useless function igt_kill() which acts just as kill(2) (Chris Wilson) Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>