From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1DF8E3B19D1; Mon, 4 May 2026 14:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777903856; cv=none; b=bYu7kRARAtnKOq0sOheXpmo4T478KPfC79QYsrH+junS7giLJtuJtTvu4gQiZLJGJy0d/UDuEYRiSosQqug2JojfENeQUzLvOIMWotjrRXg6YtWNqvzUHHSK1N1ax77+N2bC/1jmi1lDp9dhZTxYEDJpjr1j6QhtfbQv/siKz/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777903856; c=relaxed/simple; bh=8H6nPpO5KXG3CA2TRdc4/JmZmyBoloZxmu+pqwgvqwk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gL3ouvEPIaYoQrwole3plaJfRBZjq1qYiKNc2Sz9r7+/aJJK8PKdm38BpPbt7ktTbVQlklmbn8CgieE938tOFAbPkiXx6OUM9Srl0siN/qqeGoCA+T9/0+aaH/VftNuxirt2OZlPQbLqbwTEXY9Kiro/z2LP3TZmxtsINH2vqAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jt1QEosA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jt1QEosA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7A22C2BCB8; Mon, 4 May 2026 14:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777903856; bh=8H6nPpO5KXG3CA2TRdc4/JmZmyBoloZxmu+pqwgvqwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jt1QEosAcZ7QKOc0nRH62svSqTS3Z2E7pPNrfu8qiHcgzxRyvUTxtxjUc5UzcNMf5 eUStQcTCaJJKGiR4YY6a3xurc4+/uDUcXrcuO4V0kJtiYqWOkFKMYTXORqm5EkTRTl YI7WFp+W5mcqQtvVH0I/xqDScmMGsJm8X3gd7DuA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Daniel Hodges , Manivannan Sadhasivam , Krishna Chaitanya Chundru Subject: [PATCH 6.18 055/275] PCI: epf-mhi: Return 0, not remaining timeout, when eDMA ops complete Date: Mon, 4 May 2026 15:49:55 +0200 Message-ID: <20260504135144.980276760@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260504135142.929052779@linuxfoundation.org> References: <20260504135142.929052779@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: Daniel Hodges commit 36bfc3642b19a98f1302aed4437c331df9b481f0 upstream. pci_epf_mhi_edma_read() and pci_epf_mhi_edma_write() start DMA operations and wait for completion with a timeout. On successful completion, they previously returned the remaining timeout, which callers may treat as an error. In particular, mhi_ep_ring_add_element(), which calls pci_epf_mhi_edma_write() via mhi_cntrl->write_sync(), interprets any non-zero return value as failure. Return 0 on success instead of the remaining timeout to prevent mhi_ep_ring_add_element() from treating successful completion as an error. Fixes: 7b99aaaddabb ("PCI: epf-mhi: Add eDMA support") Signed-off-by: Daniel Hodges [mani: changed commit log as per https://lore.kernel.org/linux-pci/20260227191510.GA3904799@bhelgaas] Signed-off-by: Manivannan Sadhasivam Reviewed-by: Krishna Chaitanya Chundru Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260206200529.10784-1-git@danielhodges.dev Signed-off-by: Greg Kroah-Hartman --- drivers/pci/endpoint/functions/pci-epf-mhi.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -367,6 +367,8 @@ static int pci_epf_mhi_edma_read(struct dev_err(dev, "DMA transfer timeout\n"); dmaengine_terminate_sync(chan); ret = -ETIMEDOUT; + } else { + ret = 0; } err_unmap: @@ -438,6 +440,8 @@ static int pci_epf_mhi_edma_write(struct dev_err(dev, "DMA transfer timeout\n"); dmaengine_terminate_sync(chan); ret = -ETIMEDOUT; + } else { + ret = 0; } err_unmap: