From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE775606A68B for ; Thu, 3 Dec 2026 09:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=slN7AJ8Y; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jFeGKiSw DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Message-ID:Date :Cc:To:From:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=our0FkRC/jaHCQaQjYhE9nxV3TomDlWuSAu+vbX7894=; b=slN7AJ8YIu7L5+xud3m4swziZS EcgTa1XWQa2Y6jxRnLUzyeEwp878+p4DyLUUQjUH3yeEBnDCt62X7TtOlRqB3AQTUhQSt937cCc4O uDvEyt3d+bowPf18roxOxbBilMv7m6Ccka2+8f49UvQAxT56RtgpRwqiIT71HT2DWzojcVy02VfRB U+YkMPlXOo9KoU5sgYwiVEdVsx5S4WDR4l6uYBbF71RwM03iz8A/xnvnI4C4LobGtM5LXx3mm+1xh CGU1P6R86gJRlPzA6QfuBuXHz9ruXD1Gie+ogqIDNutFWc9jMjVDO/Khb+fc4e3Myqh8Vgj/uwniz 5K1I6l5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ3Oo-0000000E2ao-2Qwk; Thu, 03 Dec 2026 09:46:46 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ3Oi-0000000E2Wm-0bgE; Thu, 03 Dec 2026 09:46:41 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id E1D04413D9; Thu, 3 Dec 2026 09:46:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6354C1F00899; Thu, 3 Dec 2026 09:46:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796291199; bh=our0FkRC/jaHCQaQjYhE9nxV3TomDlWuSAu+vbX7894=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=jFeGKiSwwKFW3YooGSl5zHrE0o1ei6WJk5R5gcjaEh1ihmC/oNomhIiRISKTCm+CV CM3RPMatBKI9gJPkl6BdQ9QMJ94DHCIP9SFVgVwctZ0LW1EQDQfdvV/RqlWe5yGU7Q Y1Pug4OwUBfHTODxLb851+mV064Zlt4hDciM+bHzO350EjI3A1EnSRDWDH0eWP1eEx 2oXdQs60kDcS0bvnZtfT38znJHCY6H6Eh2+PDdmB4/ZKju9pzVW84pPhygsybDOEZX nGx/fsJjlgBkBa14yncgbPCkFcZUeliS1Zbl3dlpZm6TjabHchN2pKukGnuc2vxvyj Pqdw1u6e/vbTg== Subject: Re: [PATCH net-next v14 3/6] net: wwan: t9xx: Add control DMA interface From: netdev-bot+sashiko@kernel.org To: jackbb_wu@compal.com Cc: loic.poulain@oss.qualcomm.com, ryazanov.s.a@gmail.com, johannes@sipsolutions.net, andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, wen-zhi.huang@mediatek.com, shi-wei.yeh@mediatek.com, Minano.tseng@mediatek.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, robert_yu@compal.com, Jeff_Chang@compal.com, edumazet@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-doc@vger.kernel.org Date: Thu, 03 Dec 2026 09:46:37 +0000 Message-ID: <179629119791.3146.810711113974734318@kernel.org> In-Reply-To: <20261202-t9xx_driver_v1-v14-3-08ebc870ea94@compal.com> References: <20261202-t9xx_driver_v1-v14-3-08ebc870ea94@compal.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Archived-By: MIME-Version: 1.0 X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] mtk_cldma_get_rx_curr_addr() (drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.c) re-reads the RX cursor… -- net: wwan: t9xx: Add control DMA interface This commit adds the CLDMA (Cross Layer DMA) driver, which handles the control plane's GPD-ring based TX and RX hardware queues. It also adds the transaction control layer with its TRB service thread. Probe and remove now call new mtk_pci_dev_init()/mtk_pci_dev_exit() hooks, which attach the transaction context to the control plane. > diff --git a/drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.c b/drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.c > new file mode 100644 > index 0000000000000..72c821c4a3cd6 > --- /dev/null > +++ b/drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.c [ ... ] > +u64 mtk_cldma_get_rx_curr_addr(struct cldma_drv_info *drv_info, u32 qno) > +{ > + const struct cldma_hw_regs *hw_regs; > + u32 curr_addr_h, curr_addr_l; > + struct mtk_md_dev *mdev; > + u64 addr_h, addr_l; > + int base; > + > + hw_regs = drv_info->hw_regs; > + base = drv_info->base_addr; > + mdev = drv_info->mdev; > + > + addr_h = base + hw_regs->reg_cldma_so_current_addrh_0 + (u64)qno * ADDR_STRIDE; > + addr_l = base + hw_regs->reg_cldma_so_current_addrl_0 + (u64)qno * ADDR_STRIDE; > + /* the cursor may have moved to a GPD with another high word in between */ > + do { > + curr_addr_h = mtk_pci_read32(mdev, addr_h); > + curr_addr_l = mtk_pci_read32(mdev, addr_l); > + } while (mtk_pci_read32(mdev, addr_h) != curr_addr_h); [Severity: Low] Can this loop run forever? It has no retry bound and no cond_resched(). Only the values the device returns decide when it ends. A dead link does end it, because every read returns 0xFFFFFFFF. A device that keeps changing SO_CUR_ADDRH between the two reads would keep it going, though. Faulty modem firmware, or a partly failed link that returns inconsistent values that are not all-ones, could do that. The caller runs on the CLDMA workqueue: mtk_cldma_rx_done_work() mtk_cldma_check_rx_req() mtk_cldma_get_rx_curr_addr() In that case the kworker would spin on MMIO reads with no way out, and RX processing for the instance would stop. The other device-dependent waits in this patch are bounded: the WAIT_HWO_ROUND loop in mtk_cldma_check_rx_req(), and read_poll_timeout() in mtk_cldma_stop_queue(). Would it make sense to cap the retries and then return 0? The caller would then take its existing -ENXIO path: curr_addr = mtk_cldma_get_rx_curr_addr(drv_info, rxq->rxqno); if (unlikely(!curr_addr)) return -ENXIO; > + /* no GPD address has an all-ones half, so either one means link loss */ > + if (curr_addr_h == LINK_ERROR_VAL || curr_addr_l == LINK_ERROR_VAL) > + return 0; > + return ((u64)curr_addr_h << 32) | curr_addr_l; > +} -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202-t9xx_driver_v1-v14-0-08ebc870ea94%40compal.com