瀏覽代碼

qcacmn: Debug print rate limiting

Implement driver debug print rate limiting in HIF SDIO RX
path and QDF nbuf allocation path to avoid driver
inactivity watch dog time out when the platform is facing
great memory pressure.

Change-Id: Ifa4fe3e7027150fd1469df58049776fca8aa6f2f
CRs-Fixed: 2148314
wadesong 7 年之前
父節點
當前提交
41f857eb31
共有 3 個文件被更改,包括 8 次插入3 次删除
  1. 2 0
      hif/inc/hif.h
  2. 4 2
      hif/src/sdio/hif_sdio_dev.c
  3. 2 1
      qdf/linux/src/qdf_nbuf.c

+ 2 - 0
hif/inc/hif.h

@@ -52,6 +52,8 @@ extern "C" {
 typedef void __iomem *A_target_id_t;
 typedef void *hif_handle_t;
 
+#define HIF_DBG_PRINT_RATE 1000
+
 #define HIF_TYPE_AR6002   2
 #define HIF_TYPE_AR6003   3
 #define HIF_TYPE_AR6004   5

+ 4 - 2
hif/src/sdio/hif_sdio_dev.c

@@ -190,8 +190,10 @@ HTC_PACKET *hif_dev_alloc_rx_buffer(struct hif_sdio_device *pdev)
 	headsize = sizeof(HTC_PACKET);
 	netbuf = qdf_nbuf_alloc(NULL, bufsize + headsize, 0, 4, false);
 	if (netbuf == NULL) {
-		AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
-				("(%s)Allocate netbuf failed\n", __func__));
+		QDF_TRACE_RATE_LIMITED(HIF_DBG_PRINT_RATE, QDF_MODULE_ID_HIF,
+				       QDF_TRACE_LEVEL_ERROR,
+				       "(%s)Allocate netbuf failed\n",
+				       __func__);
 		return NULL;
 	}
 	packet = (HTC_PACKET *) qdf_nbuf_data(netbuf);

+ 2 - 1
qdf/linux/src/qdf_nbuf.c

@@ -400,7 +400,8 @@ struct sk_buff *__qdf_nbuf_alloc(qdf_device_t osdev, size_t size, int reserve,
 	skb = pld_nbuf_pre_alloc(size);
 
 	if (!skb) {
-		pr_info("ERROR:NBUF alloc failed\n");
+		pr_err_ratelimited("ERROR:NBUF alloc failed, size = %zu\n",
+				   size);
 		__qdf_nbuf_start_replenish_timer();
 		return NULL;
 	} else {