Re: [PATCH v2] ath10k: skip the wait for completion to recovery in shutdown path

From: Sai Prakash Ranjan
Date: Tue Dec 08 2020 - 03:27:06 EST


On Thu, Nov 26, 2020 at 9:16 AM Youghandhar Chintala
<youghand@xxxxxxxxxxxxxx> wrote:
> --- a/drivers/net/wireless/ath/ath10k/snoc.c
> +++ b/drivers/net/wireless/ath/ath10k/snoc.c
> @@ -1790,9 +1790,6 @@ static int ath10k_snoc_remove(struct platform_device *pdev)
>
> reinit_completion(&ar->driver_recovery);
>
> - if (test_bit(ATH10K_SNOC_FLAG_RECOVERY, &ar_snoc->flags))
> - wait_for_completion_timeout(&ar->driver_recovery, 3 * HZ);

You are skipping recovery in ath10k_snoc_remove() which is a remove callback
and also called in shutdown callback. So that means it is also called when
you unload the ath10k module and not just when the system reboots/shutdown.
While it makes sense to not skip recovery in shutdown/reboot sequence because
the system is going down, it might very well be needed in case of unloading
the module because we expect the system to be up and stable after unloading
the ath10k module and we should be able to reload the ath10k module smoothly.

If you remove that now and try to reload the ath10k module, won't that leave
the system in possibly an inconsistent state because we skipped recovery in
module remove and then we are trying to load the ath10k module when the
recovery is not yet complete? In other words, you need to test ath10k module
load/unload as well in addition to reboot tests to make sure this works as
expected or else you will need a separate shutdown callback which skips the
recovery part.

Thanks,
Sai
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation