Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7710cd2e authored by Michal Kazior's avatar Michal Kazior Committed by Kalle Valo
Browse files

ath10k: don't wait for device init if it crashed



When warm resetting it's possible for device to
crash during initialization. Instead of waiting 3
seconds just return failure as soon as
FW_IND_EVENT_PENDING is set.

This speeds up device bootup and recovery in some
cases.

Signed-off-by: default avatarMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 6a4f6e1d
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -2452,6 +2452,10 @@ static int ath10k_pci_wait_for_target_init(struct ath10k *ar)
		if (val == 0xffffffff)
		if (val == 0xffffffff)
			continue;
			continue;


		/* the device has crashed so don't bother trying anymore */
		if (val & FW_IND_EVENT_PENDING)
			break;

		if (val & FW_IND_INITIALIZED)
		if (val & FW_IND_INITIALIZED)
			break;
			break;


@@ -2470,6 +2474,12 @@ static int ath10k_pci_wait_for_target_init(struct ath10k *ar)
		goto out;
		goto out;
	}
	}


	if (val & FW_IND_EVENT_PENDING) {
		ath10k_warn("device has crashed during init\n");
		ret = -ECOMM;
		goto out;
	}

	if (!(val & FW_IND_INITIALIZED)) {
	if (!(val & FW_IND_INITIALIZED)) {
		ath10k_err("failed to receive initialized event from target: %08x\n",
		ath10k_err("failed to receive initialized event from target: %08x\n",
			   val);
			   val);