* [bug report] net: wwan: t7xx: Add control DMA interface
@ 2022-05-17 11:49 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2022-05-17 11:49 UTC (permalink / raw)
To: haijun.liu; +Cc: linux-mediatek
Hello Haijun Liu,
The patch 39d439047f1d: "net: wwan: t7xx: Add control DMA interface"
from May 6, 2022, leads to the following Smatch static checker
warning:
drivers/net/wwan/t7xx/t7xx_hif_cldma.c:805 t7xx_cldma_clear_rxq()
warn: sleeping in atomic context
drivers/net/wwan/t7xx/t7xx_hif_cldma.c
780 static int t7xx_cldma_clear_rxq(struct cldma_ctrl *md_ctrl, int qnum)
781 {
782 struct cldma_queue *rxq = &md_ctrl->rxq[qnum];
783 struct cldma_request *req;
784 struct cldma_gpd *gpd;
785 unsigned long flags;
786 int ret = 0;
787
788 spin_lock_irqsave(&rxq->ring_lock, flags);
^^^^^^^^^
Holding a spin lock
789 t7xx_cldma_q_reset(rxq);
790 list_for_each_entry(req, &rxq->tr_ring->gpd_ring, entry) {
791 gpd = req->gpd;
792 gpd->flags = GPD_FLAGS_IOC | GPD_FLAGS_HWO;
793 gpd->data_buff_len = 0;
794
795 if (req->skb) {
796 req->skb->len = 0;
797 skb_reset_tail_pointer(req->skb);
798 }
799 }
800
801 list_for_each_entry(req, &rxq->tr_ring->gpd_ring, entry) {
802 if (req->skb)
803 continue;
804
--> 805 ret = t7xx_cldma_alloc_and_map_skb(md_ctrl, req, rxq->tr_ring->pkt_size);
^^^^^
Doing a sleeping allocation. This is a bug. Will trigger a stack trace
depending on the CONFIG_ debug options enabled.
806 if (ret)
807 break;
808
809 t7xx_cldma_gpd_set_data_ptr(req->gpd, req->mapped_buff);
810 }
811 spin_unlock_irqrestore(&rxq->ring_lock, flags);
812
813 return ret;
814 }
regards,
dan carpenter
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-17 11:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-17 11:49 [bug report] net: wwan: t7xx: Add control DMA interface Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.