[PATCH v2 07/10] ath10k: add fw-powerup-fail to ethtool stats.
Kalle Valo
kvalo at qca.qualcomm.com
Mon Sep 29 01:24:36 PDT 2014
greearb at candelatech.com writes:
> From: Ben Greear <greearb at candelatech.com>
>
> This gives user-space a normal-ish way to detect that
> firmware has failed to start and that a reboot is
> probably required.
>
> Signed-off-by: Ben Greear <greearb at candelatech.com>
[...]
> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -1851,7 +1851,7 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
> ret);
>
> if (ath10k_pci_reset_mode == ATH10K_PCI_RESET_WARM_ONLY)
> - return ret;
> + goto out;
>
> ath10k_warn(ar, "trying cold reset\n");
>
> @@ -1859,11 +1859,17 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
> if (ret) {
> ath10k_err(ar, "failed to power up target using cold reset too (%d)\n",
> ret);
> - return ret;
> + goto out;
> }
> }
>
> - return 0;
> +out:
> + /* If we have failed to power-up, it may take a reboot to
> + * get the NIC back online.
> + * Set flag accordinly so that user-space can know.
> + */
> + ar->fw_powerup_failed = !!ret;
> + return ret;
> }
Would it be better to use ATH10K_STATE_WEDGED for this and then just
export the state value to user space? Or should we have two different
states, like FW_WEDGED and HW_WEDGED?
--
Kalle Valo
More information about the ath10k
mailing list