From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9227753D0B8; Wed, 9 Sep 2026 14:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788963421; cv=none; b=EjBtA8z0Qdtm5Gm8YrnmI4Fj6SC7f2C/aiE92ooCi5JxVDwyfHQlDfdtyajsR5yMkp/a6M5yxHNhMCMCxOKwuN+scjHPwkiR2DZw9nKb41rSRbzYkaqI2V0NDdHN5uTJjDQir91SJ/o7Eb8qbIiKZUOmMADSE3FxxOdtVOgqoms= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788963421; c=relaxed/simple; bh=ewNCBL72mXGnegG+D5PDpBbLufgAdInJE9Bc9utKYd0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eXmRCSX4Wv7H+KThqEFqF0k5c1dfCcO1ZtWKpA0ocjLEFLKqJDSwKtXjKyj/GmvnLa8K6VsKQ4ISa/SMCQ9MXgYpNQtc8Vf5PD5uv+UK+cLoZLgqE3Ue6o45/t0mQ9y+SCRs9wdx7QUVdB1XgtXirCapDPM0ysO4A2uvXiVWzQk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=a7D8SsZ8; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="a7D8SsZ8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9FF11F00A3A; Wed, 9 Sep 2026 14:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788963420; bh=0lCgRXWuhj7gMdGf0uugxrUC82yJQ0HzZJerKNoCaao=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=a7D8SsZ8LWNExq+X/2CWejUbAYVyZjzt8VLBPbNMcakRvbebeEM3gT7sB/l5/oMO/ lVYLqlNfxOPz/3NH4yYCNVunqTGFphQJ2pqRKYqx76HUoZWTvwhBnlTi4vFbl8yBoD Uhq2Wz947KM9iz+5B6J0TfFB5WEyy5AlXEgofxNc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Frank Li , Koichiro Den , Vinod Koul Subject: [PATCH 6.18 072/583] dmaengine: dw-edma: Complete descriptors before pausing Date: Wed, 9 Sep 2026 15:35:57 +0200 Message-ID: <20260909134240.577613502@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260909134237.773280130@linuxfoundation.org> References: <20260909134237.773280130@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Koichiro Den commit c154060016a9db2ac889bfdb0a3c1322f9be8ded upstream. If PAUSE is requested while the final burst of a descriptor is in flight, the DONE interrupt takes the PAUSE path without checking whether the descriptor has been depleted. The depleted descriptor remains on the issued list and the channel enters EDMA_ST_PAUSE. On resume, dw_edma_start_transfer() can select that depleted descriptor again even though no burst remains, leaving the channel in an invalid busy state. Check for descriptor completion before acknowledging PAUSE. If there is no work to start on resume, leave the channel idle. Also ignore DONE interrupts while the channel is paused so a stale or repeated interrupt cannot change its state or start queued work. Fixes: e63d79d1ffcd ("dmaengine: Add Synopsys eDMA IP core driver") Cc: stable@vger.kernel.org Reviewed-by: Frank Li Signed-off-by: Koichiro Den Link: https://patch.msgid.link/20260717180639.2643243-5-den@valinux.co.jp Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/dw-edma/dw-edma-core.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) --- a/drivers/dma/dw-edma/dw-edma-core.c +++ b/drivers/dma/dw-edma/dw-edma-core.c @@ -260,7 +260,8 @@ static int dw_edma_device_resume(struct err = -EPERM; } else { chan->status = EDMA_ST_BUSY; - dw_edma_start_transfer(chan); + if (!dw_edma_start_transfer(chan)) + chan->status = EDMA_ST_IDLE; } return err; @@ -610,10 +611,16 @@ static void dw_edma_done_interrupt(struc unsigned long flags; spin_lock_irqsave(&chan->vc.lock, flags); + if (chan->status == EDMA_ST_PAUSE) { + spin_unlock_irqrestore(&chan->vc.lock, flags); + return; + } + vd = vchan_next_desc(&chan->vc); if (vd) { switch (chan->request) { case EDMA_REQ_NONE: + case EDMA_REQ_PAUSE: desc = vd2dw_edma_desc(vd); if (!desc->chunks_alloc) { dw_hdma_set_callback_result(vd, @@ -622,6 +629,12 @@ static void dw_edma_done_interrupt(struc vchan_cookie_complete(vd); } + if (chan->request == EDMA_REQ_PAUSE) { + chan->request = EDMA_REQ_NONE; + chan->status = EDMA_ST_PAUSE; + break; + } + /* Continue transferring if there are remaining chunks or issued requests. */ chan->status = dw_edma_start_transfer(chan) ? EDMA_ST_BUSY : EDMA_ST_IDLE; @@ -634,11 +647,6 @@ static void dw_edma_done_interrupt(struc chan->status = EDMA_ST_IDLE; break; - case EDMA_REQ_PAUSE: - chan->request = EDMA_REQ_NONE; - chan->status = EDMA_ST_PAUSE; - break; - default: break; }