aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2015-01-24 05:14:48 -0500
committerKalle Valo <kvalo@qca.qualcomm.com>2015-01-27 08:59:27 -0500
commit1a7fecb766c83dace747f42b25bbb544b00a0163 (patch)
tree777cc850b3cb9b4917fd5fb4e832eff5efa260a0 /drivers/net/wireless/ath
parentc545070e404bfb20e5b72ae725332fe512e5d22c (diff)
ath10k: reset chip before reading chip_id in probe
There are some very rare cases with some hardware configuration that the device doesn't init quickly enough in which case reading chip_id yielded 0. This caused driver to subsequently fail to setup the device. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath10k/pci.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index b98354c004f5..e0c9f4633a82 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2544,18 +2544,6 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
2544 goto err_release; 2544 goto err_release;
2545 } 2545 }
2546 2546
2547 chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS);
2548 if (chip_id == 0xffffffff) {
2549 ath10k_err(ar, "failed to get chip id\n");
2550 goto err_sleep;
2551 }
2552
2553 if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) {
2554 ath10k_err(ar, "device %04x with chip_id %08x isn't supported\n",
2555 pdev->device, chip_id);
2556 goto err_sleep;
2557 }
2558
2559 ret = ath10k_pci_alloc_pipes(ar); 2547 ret = ath10k_pci_alloc_pipes(ar);
2560 if (ret) { 2548 if (ret) {
2561 ath10k_err(ar, "failed to allocate copy engine pipes: %d\n", 2549 ath10k_err(ar, "failed to allocate copy engine pipes: %d\n",
@@ -2582,6 +2570,24 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
2582 goto err_deinit_irq; 2570 goto err_deinit_irq;
2583 } 2571 }
2584 2572
2573 ret = ath10k_pci_chip_reset(ar);
2574 if (ret) {
2575 ath10k_err(ar, "failed to reset chip: %d\n", ret);
2576 goto err_free_irq;
2577 }
2578
2579 chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS);
2580 if (chip_id == 0xffffffff) {
2581 ath10k_err(ar, "failed to get chip id\n");
2582 goto err_free_irq;
2583 }
2584
2585 if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) {
2586 ath10k_err(ar, "device %04x with chip_id %08x isn't supported\n",
2587 pdev->device, chip_id);
2588 goto err_sleep;
2589 }
2590
2585 ath10k_pci_sleep(ar); 2591 ath10k_pci_sleep(ar);
2586 2592
2587 ret = ath10k_core_register(ar, chip_id); 2593 ret = ath10k_core_register(ar, chip_id);