Re: [PATCH net-next v13 3/6] net: wwan: t9xx: Add control DMA interface

From
Wu. JackBB (GSM) <hidden>
Date
2026-11-30 08:02:06
Also in
linux-doc, linux-mediatek, lkml, netdev
Reply to
netdev-bot+sashiko@kernel.org, 2026-11-29
Thanks for the review.
The comments in mtk_cldma_hw_recovery() and mtk_cldma_drv_init() say the
device can switch the CLDMA block's power domain off by itself. Is
anything holding the domain on for this sequence?

mtk_cldma_start_xfer()
    mtk_cldma_get_tx_start_addr()      <- reads a non-zero address
    [device gates the power domain here]
    mtk_cldma_resume_queue() / mtk_cldma_start_queue()   <- write lost

rearm_lock and ring_lock only serialize the host side. As far as I can
tell, nothing stops the device from gating the domain between the address
check and the doorbell write.

If the write is lost, the descriptor stays at HWO=1, no XFER_DONE comes
in and tx_done_work never runs. The queue then seems to stay stuck until
a later TX submission reads the zero start address and recovers. In a
request/response control exchange that is waiting for the reply to the
stuck message, that later submission may never happen.

The same applies if the domain is still off when mtk_cldma_hw_recovery()
runs. The register rewrites in mtk_cldma_rearm_queues() would be lost and
the read-back would be zero. The TX then fails with -EIO and gets flushed,
and the device is never woken.

I couldn't find a device sleep lock, a wake handshake or any pm_runtime
use in the t9xx tree, including in the later patches of the series. For
comparison, the t7xx CLDMA send path calls t7xx_pci_disable_sleep() and
waits for t7xx_pci_sleep_disable_complete() before it touches CLDMA
registers. Does this driver need a similar handshake?
Will fix in v14: probe holds the device's low-power state off, with the
same DISABLE_ASPM_LOWPWR write t7xx does in t7xx_pci_pm_init(), waits
for the device to report its resources active, and this series never
releases it, so the block is not gated while the driver is bound.  The
comments in mtk_cldma_hw_recovery() and mtk_cldma_drv_init() are
reworded to match.
This isn't a bug, but the commit message doesn't mention that these writes
turn ILLEGAL_MEMORY_CHECK off for both TX and RX. With the check off, the
engine no longer flags a zero GPD/BD/data pointer.

The commit message also doesn't mention that any TX kick can
re-initialize the whole instance:

mtk_cldma_start_xfer()
    if (unlikely(!val))
        mtk_cldma_hw_recovery()
            mtk_cldma_rearm_queues()
                mtk_cldma_drv_init()
                reprograms every published TX queue
                sets need_restart on every RX queue

The only reset behaviour the changelog describes is the escalation when a
queue stop times out:

  A queue that does not stop within the poll escalates to a reset of
  its CLDMA instance, which also cuts the instance's other queues.

Could both of these changes be described in the commit message? None of
the later patches in the series describe them either.
Will fix in v14: the commit message says that mtk_cldma_drv_init() turns
the illegal memory check off for TX and RX, and that the check only
flags a zero GPD, BD or data pointer through an L3 interrupt the driver
does not service.  It also describes the second way into the re-arm: a
TX submission that reads a zero start address rewrites the configuration
and re-arms every open queue of the instance, like the reset after a
stop timeout.

Thanks,
Jack
--
pw-bot: cr
Thread (15 messages) 15 messages, 3 authors, last reply 3d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help