From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796035509; b=ApTOVVEwVWXkEYkVZqR7M1huYUgF++OgThohwujxlwnx2TAF9roJ1jsh8XcRJqqKEEsR NVzM4O8eBnbLdJMtGR22V9AK+6AaXc3vm/PKyyUTDvgIhCkIIYsynYDKSNkTXQNH5xjm5 rk1/q9lM6ASL7O+qHnNHAaE9MBuyXA1bVTwRwR3SjsBMdYDdgDf15pKZQv/IHJwsKcOPE ZvX/PpJHvH6W/ekqKkCb5LCR+sXGFaonfs/Xz1dB2j2f4pwJt/K0CRquNpHOtI/88SWO3 wHgriaqTiBDcljuRiImndNcIY9/z+zG+J/D1hhPF5wummze6fBZ79PouRHuGPhVHAmQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796035509; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=hvRg445WTKRwrSPubJyE3WFz26w96mGVnH7edTbO2Pw=; b=wpJlx8uEv5SaDTNvOQ3C0HcVRNvIHtmPNh/3LNMQYUfgR0pbp6yt91w/mo3sd+qN89ri PLMuQrYcoSR13/+KJYkKc2k9T1a1vJwASgxazOtwLW7Yx3sd2aOBJgTjx/KyRurjRGavs nQCcrS2d3z4hE5INtyjdSi3196vHzY/xVIeuFBT7Gjr7g1CIj8/egPb/QZ4yoimEwYGuc 16f+k/PULVGA06BBK+wvceLzmXczvtfwTZ+drHAsKXd8TNphc64caf4Am1zmKSiLHEa/A AGJdwo9fsWqy5i5e5WpcJpnt1qXXvbXIKk4DBo0mvigIEqqP7D9HvenjSCLC88b1S8g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=k4TixIah; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13AE7606A31C for ; Mon, 30 Nov 2026 10:45:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=k4TixIah Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29F591F00897; Mon, 30 Nov 2026 10:45:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796035508; bh=hvRg445WTKRwrSPubJyE3WFz26w96mGVnH7edTbO2Pw=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=k4TixIahVdJONnO9zqtsscgKCT/oL01kgh/4G+sJD6qKO2NVfA/Xx8gbxvivnDzJP EjEEVFysIz7Cb7A02ZPOyFPxUEkjK6g0yKQw47PWS50B8zYv5k76iKciXs7lnwFjlW 47lAv1WGYEvhqL788SUd/6F37g/mRVXS2upQvX3FUphr8HrK/QNh3tIuLa6BBlxS5S EEBMJ+2pcz+fQ/KPPD5OvF24zEU1scAm01ayCVkixGf/cItM918qRmdZ7ed6Nmrl+W BDLlG5ftlDG7etiD1iSI7VNmB2Lv4Qzs2BlrEnwitT27jv+m9i55PcA+qthYPFHVdn 6l9VfoJxv+pJQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] dmaengine: mediatek: mtk-cqdma: fix list entry type and locking in tx_status Reply-To: sashiko-reviews@lists.linux.dev To: "Ziheng Wei" Cc: dmaengine@vger.kernel.org, vkoul@kernel.org, Frank.Li@kernel.org In-Reply-To: <20261130103317.1383850-1-zihengw03@163.com> References: <20261130103317.1383850-1-zihengw03@163.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 10:45:07 +0000 X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] dmaengine: mediatek: missing channel check in mtk_cqdma_find_active_desc() -- commit 1493321485f8d0688e40f18ce0044f36476d4227 Author: Ziheng Wei dmaengine: mediatek: mtk-cqdma: fix list entry type and locking in tx_status This commit updates mtk_cqdma_find_active_desc() to iterate over pc->queue using struct mtk_cqdma_vdesc instead of struct virt_dma_desc, and moves the cvd->residue read in mtk_cqdma_tx_status() inside the spinlock critical section. > diff --git a/drivers/dma/mediatek/mtk-cqdma.c b/drivers/dma/mediatek/mtk-= cqdma.c > index a7000608ddeac..61fd98a9206b0 100644 > --- a/drivers/dma/mediatek/mtk-cqdma.c > +++ b/drivers/dma/mediatek/mtk-cqdma.c > @@ -419,12 +419,12 @@ static struct virt_dma_desc *mtk_cqdma_find_active_= desc(struct dma_chan *c, > dma_cookie_t cookie) > { > struct mtk_cqdma_vchan *cvc =3D to_cqdma_vchan(c); > + struct mtk_cqdma_vdesc *cvd; > struct virt_dma_desc *vd; > =20 > - list_for_each_entry(vd, &cvc->pc->queue, node) > - if (vd->tx.cookie =3D=3D cookie) { > - return vd; > - } > + list_for_each_entry(cvd, &cvc->pc->queue, node) > + if (cvd->vd.tx.cookie =3D=3D cookie) > + return &cvd->vd; [Severity: Medium] Can this match a descriptor belonging to a different virtual channel? Up to 32 virtual channels are multiplexed across 3 physical channels and share cvc->pc->queue, while each virtual channel assigns cookies from its own per-channel counter starting at DMA_MIN_COOKIE. Unlike mtk_cqdma_is_vchan_active(), this loop does not check that cvd->ch =3D=3D c= , so mtk_cqdma_tx_status() can match another virtual channel's active descriptor with the same cookie and report the wrong residue. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130103317.1383= 850-1-zihengw03@163.com?part=3D1