qcacmn: balance spin_lock_create (napi)

Adding lock stats print upon spinlock & mutex destroy.
Without the destroy api invoked the lock stats are not printed.

Change-Id: Id3c432e1f6982ea47bdf1de5c15f1a3568df4eb9
CRs-Fixed: 1100505
This commit is contained in:
Houston Hoffman
2016-12-12 12:52:45 -08:00
committad av qcabuildsw
förälder 1ced412f80
incheckning 3c84105dc1
2 ändrade filer med 6 tillägg och 5 borttagningar

Visa fil

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -248,7 +248,7 @@ struct qca_napi_cpu {
* A variable of this type will be stored in hif module context.
*/
struct qca_napi_data {
spinlock_t lock;
qdf_spinlock_t lock;
uint32_t state;
uint32_t ce_map; /* bitmap of created/registered NAPI
instances, indexed by pipe_id,

Visa fil

@@ -120,7 +120,7 @@ int hif_napi_create(struct hif_opaque_softc *hif_ctx,
napid = &(hif->napi_data);
if (0 == (napid->state & HIF_NAPI_INITED)) {
memset(napid, 0, sizeof(struct qca_napi_data));
spin_lock_init(&(napid->lock));
qdf_spinlock_create(&(napid->lock));
napid->state |= HIF_NAPI_INITED;
@@ -263,6 +263,7 @@ int hif_napi_destroy(struct hif_opaque_softc *hif_ctx,
rc = hif_napi_cpu_deinit(hif_ctx);
/* caller is tolerant to receiving !=0 rc */
qdf_spinlock_destroy(&(napid->lock));
memset(napid,
0, sizeof(struct qca_napi_data));
HIF_INFO("%s: no NAPI instances. Zapped.",
@@ -473,7 +474,7 @@ int hif_napi_event(struct hif_opaque_softc *hif_ctx, enum qca_napi_event event,
__func__);
return -EINVAL;
}
spin_lock_bh(&(napid->lock));
qdf_spin_lock_bh(&(napid->lock));
prev_state = napid->state;
switch (event) {
case NAPI_EVT_INI_FILE:
@@ -584,7 +585,7 @@ int hif_napi_event(struct hif_opaque_softc *hif_ctx, enum qca_napi_event event,
}; /* switch */
spin_unlock_bh(&(napid->lock));
qdf_spin_unlock_bh(&(napid->lock));
/* Call this API without spin_locks hif_napi_cpu_blacklist */
switch (blacklist_pending) {