qcacmn: pkt_log: Use qdf_spin_lock APIs debug infrastructure
Use QDF spin_lock APIs so that we can make use the debug infra. This will help to identify catch issue related to unbalanced lock operations or unexpectedely long locks. Change-Id: I318bcb90340d98813f19862fda14e6ada30bbed6 CRs-Fixed: 2349308
此提交包含在:
@@ -112,13 +112,13 @@ int pktlog_alloc_buf(struct hif_opaque_softc *scn)
|
||||
|
||||
page_cnt = (sizeof(*(pl_info->buf)) + pl_info->buf_size) / PAGE_SIZE;
|
||||
|
||||
spin_lock_bh(&pl_info->log_lock);
|
||||
qdf_spin_lock_bh(&pl_info->log_lock);
|
||||
if (pl_info->buf != NULL) {
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
printk(PKTLOG_TAG "Buffer is already in use\n");
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
|
||||
buffer = vmalloc((page_cnt + 2) * PAGE_SIZE);
|
||||
if (buffer == NULL) {
|
||||
@@ -139,12 +139,12 @@ int pktlog_alloc_buf(struct hif_opaque_softc *scn)
|
||||
SetPageReserved(vpg);
|
||||
}
|
||||
|
||||
spin_lock_bh(&pl_info->log_lock);
|
||||
qdf_spin_lock_bh(&pl_info->log_lock);
|
||||
if (pl_info->buf != NULL)
|
||||
pktlog_release_buf(scn);
|
||||
|
||||
pl_info->buf = buffer;
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -514,13 +514,13 @@ static void pktlog_detach(struct hif_opaque_softc *scn)
|
||||
remove_proc_entry(WLANDEV_BASENAME, g_pktlog_pde);
|
||||
pktlog_sysctl_unregister(pl_dev);
|
||||
|
||||
spin_lock_bh(&pl_info->log_lock);
|
||||
qdf_spin_lock_bh(&pl_info->log_lock);
|
||||
|
||||
if (pl_info->buf) {
|
||||
pktlog_release_buf(scn);
|
||||
pl_dev->tgt_pktlog_alloced = false;
|
||||
}
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
pktlog_cleanup(pl_info);
|
||||
|
||||
if (pl_dev) {
|
||||
@@ -700,14 +700,14 @@ pktlog_read_proc_entry(char *buf, size_t nbytes, loff_t *ppos,
|
||||
int fold_offset, ppos_data, cur_rd_offset, cur_wr_offset;
|
||||
struct ath_pktlog_buf *log_buf;
|
||||
|
||||
spin_lock_bh(&pl_info->log_lock);
|
||||
qdf_spin_lock_bh(&pl_info->log_lock);
|
||||
log_buf = pl_info->buf;
|
||||
|
||||
*read_complete = false;
|
||||
|
||||
if (log_buf == NULL) {
|
||||
*read_complete = true;
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -824,7 +824,7 @@ rd_done:
|
||||
*read_complete = true;
|
||||
}
|
||||
}
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
@@ -849,11 +849,11 @@ __pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
|
||||
if (!pl_info)
|
||||
return 0;
|
||||
|
||||
spin_lock_bh(&pl_info->log_lock);
|
||||
qdf_spin_lock_bh(&pl_info->log_lock);
|
||||
log_buf = pl_info->buf;
|
||||
|
||||
if (log_buf == NULL) {
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -862,7 +862,7 @@ __pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
|
||||
* When issuing cat command, ensure to send
|
||||
* pktlog disable command first.
|
||||
*/
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -880,14 +880,14 @@ __pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
|
||||
|
||||
if (*ppos < bufhdr_size) {
|
||||
count = QDF_MIN((bufhdr_size - *ppos), rem_len);
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
if (copy_to_user(buf, ((char *)&log_buf->bufhdr) + *ppos,
|
||||
count)) {
|
||||
return -EFAULT;
|
||||
}
|
||||
rem_len -= count;
|
||||
ret_val += count;
|
||||
spin_lock_bh(&pl_info->log_lock);
|
||||
qdf_spin_lock_bh(&pl_info->log_lock);
|
||||
}
|
||||
|
||||
start_offset = log_buf->rd_offset;
|
||||
@@ -929,7 +929,7 @@ __pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
|
||||
goto rd_done;
|
||||
|
||||
count = QDF_MIN(rem_len, (end_offset - ppos_data + 1));
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
|
||||
if (copy_to_user(buf + ret_val,
|
||||
log_buf->log_data + ppos_data, count)) {
|
||||
@@ -938,11 +938,11 @@ __pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
|
||||
|
||||
ret_val += count;
|
||||
rem_len -= count;
|
||||
spin_lock_bh(&pl_info->log_lock);
|
||||
qdf_spin_lock_bh(&pl_info->log_lock);
|
||||
} else {
|
||||
if (ppos_data <= fold_offset) {
|
||||
count = QDF_MIN(rem_len, (fold_offset - ppos_data + 1));
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
if (copy_to_user(buf + ret_val,
|
||||
log_buf->log_data + ppos_data,
|
||||
count)) {
|
||||
@@ -950,7 +950,7 @@ __pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
|
||||
}
|
||||
ret_val += count;
|
||||
rem_len -= count;
|
||||
spin_lock_bh(&pl_info->log_lock);
|
||||
qdf_spin_lock_bh(&pl_info->log_lock);
|
||||
}
|
||||
|
||||
if (rem_len == 0)
|
||||
@@ -962,7 +962,7 @@ __pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
|
||||
|
||||
if (ppos_data <= end_offset) {
|
||||
count = QDF_MIN(rem_len, (end_offset - ppos_data + 1));
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
if (copy_to_user(buf + ret_val,
|
||||
log_buf->log_data + ppos_data,
|
||||
count)) {
|
||||
@@ -970,7 +970,7 @@ __pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
|
||||
}
|
||||
ret_val += count;
|
||||
rem_len -= count;
|
||||
spin_lock_bh(&pl_info->log_lock);
|
||||
qdf_spin_lock_bh(&pl_info->log_lock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -981,7 +981,7 @@ rd_done:
|
||||
}
|
||||
*ppos += ret_val;
|
||||
|
||||
spin_unlock_bh(&pl_info->log_lock);
|
||||
qdf_spin_unlock_bh(&pl_info->log_lock);
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
|
新增問題並參考
封鎖使用者