ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [ath6kl:ath11k-bringup 89/93] drivers/net/wireless/ath/ath11k/core.c:621 ath11k_qmi_firmware_indication() warn: inconsistent returns 'mutex:&ab->core_lock'.
@ 2019-04-15  8:10 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2019-04-15  8:10 UTC (permalink / raw)
  To: kbuild, Anilkumar Kolli; +Cc: Kalle Valo, kbuild-all, ath10k

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath11k-bringup
head:   9bcbbf4cedb7a1f30cb547cf87dc480d7f8a5e87
commit: 426598fdbef82ace7b4a728445f61ecf034f233c [89/93] ath11k: add qmi API support and rproc_boot for Q6

New smatch warnings:
drivers/net/wireless/ath/ath11k/core.c:621 ath11k_qmi_firmware_indication() warn: inconsistent returns 'mutex:&ab->core_lock'.
  Locked on:   line 621
  Unlocked on: line 591
  Locked on:   line 714
  Unlocked on: line 747

# https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?id=426598fdbef82ace7b4a728445f61ecf034f233c
git remote add ath6kl https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
git remote update ath6kl
git checkout 426598fdbef82ace7b4a728445f61ecf034f233c
vim +621 drivers/net/wireless/ath/ath11k/core.c

426598fd Anilkumar Kolli 2019-04-04  584  int ath11k_qmi_firmware_indication(struct ath11k_base *ab)
426598fd Anilkumar Kolli 2019-04-04  585  {
426598fd Anilkumar Kolli 2019-04-04  586  	int ret;
426598fd Anilkumar Kolli 2019-04-04  587  
426598fd Anilkumar Kolli 2019-04-04  588  	ret = ath11k_ce_init_pipes(ab);
426598fd Anilkumar Kolli 2019-04-04  589  	if (ret) {
426598fd Anilkumar Kolli 2019-04-04  590  		ath11k_err(ab, "failed to initialize CE: %d\n", ret);
426598fd Anilkumar Kolli 2019-04-04  591  		return ret;
426598fd Anilkumar Kolli 2019-04-04  592  	}
426598fd Anilkumar Kolli 2019-04-04  593  
426598fd Anilkumar Kolli 2019-04-04  594  	ret = ath11k_dp_alloc(ab);
426598fd Anilkumar Kolli 2019-04-04  595  	if (ret) {
426598fd Anilkumar Kolli 2019-04-04  596  		ath11k_err(ab, "failed to init DP: %d\n", ret);
426598fd Anilkumar Kolli 2019-04-04  597  		return ret;
426598fd Anilkumar Kolli 2019-04-04  598  	}
426598fd Anilkumar Kolli 2019-04-04  599  
426598fd Anilkumar Kolli 2019-04-04  600  	mutex_lock(&ab->core_lock);
                                                           ^^^^^^^^^^^^^^

The static checker doesn't complain but is this a double lock actually?
It looks like we took the lock eaerlier in ath11k_core_restart().  This
is restart code so it's probably hard to test.

426598fd Anilkumar Kolli 2019-04-04  601  	ret = ath11k_core_start(ab, ATH11K_FIRMWARE_MODE_NORMAL);
426598fd Anilkumar Kolli 2019-04-04  602  	if (ret) {
426598fd Anilkumar Kolli 2019-04-04  603  		ath11k_err(ab, "failed to start core: %d\n", ret);
426598fd Anilkumar Kolli 2019-04-04  604  		goto err_dp_free;
                                                        ^^^^^^^^^^^^^^^^
426598fd Anilkumar Kolli 2019-04-04  605  	}
426598fd Anilkumar Kolli 2019-04-04  606  
426598fd Anilkumar Kolli 2019-04-04  607  	ret = ath11k_core_pdev_create(ab);
426598fd Anilkumar Kolli 2019-04-04  608  	if (ret) {
426598fd Anilkumar Kolli 2019-04-04  609  		ath11k_err(ab, "failed to create pdev core: %d\n", ret);
426598fd Anilkumar Kolli 2019-04-04  610  		goto err_core_stop;
426598fd Anilkumar Kolli 2019-04-04  611  	}
426598fd Anilkumar Kolli 2019-04-04  612  	ath11k_ahb_ext_irq_enable(ab);
426598fd Anilkumar Kolli 2019-04-04  613  	mutex_unlock(&ab->core_lock);
426598fd Anilkumar Kolli 2019-04-04  614  
426598fd Anilkumar Kolli 2019-04-04  615  	return 0;
426598fd Anilkumar Kolli 2019-04-04  616  
426598fd Anilkumar Kolli 2019-04-04  617  err_core_stop:
426598fd Anilkumar Kolli 2019-04-04  618  	ath11k_core_stop(ab);
426598fd Anilkumar Kolli 2019-04-04  619  err_dp_free:
426598fd Anilkumar Kolli 2019-04-04  620  	ath11k_dp_free(ab);
426598fd Anilkumar Kolli 2019-04-04 @621  	return ret;
426598fd Anilkumar Kolli 2019-04-04  622  }

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-15  8:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-15  8:10 [ath6kl:ath11k-bringup 89/93] drivers/net/wireless/ath/ath11k/core.c:621 ath11k_qmi_firmware_indication() warn: inconsistent returns 'mutex:&ab->core_lock' Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox