diff --git a/lisa/_kmod.py b/lisa/_kmod.py index b27eb1e41b394493abde6e6e8b456c68234929ce..c5cc99bacf3a4597a9def297511d5104c4df4c0e 100644 --- a/lisa/_kmod.py +++ b/lisa/_kmod.py @@ -2133,7 +2133,13 @@ class DynamicKmod(Loggable): """ Unload the module from the target. """ - self.target.execute(f'rmmod {quote(self.src.mod_name)}') + mod = quote(self.src.mod_name) + execute = self.target.execute + + try: + execute(f'rmmod {mod}') + except TargetStableError: + execute(f'rmmod -f {mod}') @destroyablecontextmanager def run(self, **kwargs):