From patchwork Fri Jun 7 08:34:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Chauvet X-Patchwork-Id: 13689479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EBD04C27C53 for ; Fri, 7 Jun 2024 08:35:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ptFcXDEHlKEcL4vaPau07GYXNhIocykVIdXs9/aJR+4=; b=QABc1QLJHwOXTn u8kgnIp392dfIJOX8M3tnQruAJiFtx99Men0r5WX7z/tQvyGMIHBGHeFSIdidk7m2apWMUQzfERoZ emjsBmY+OPCLVztHuqgAh1AMXc6Rq2ZdgMjLBKYDS8w0tBl0a6mwUz48i0GBPuDhX2RLUirckOzPf S8DjJlCGSwpfwK+g4aku5icK+yIzlRPTAGX92wRO2pAKo5x9GFs2prs9rBZd0Mm0bDHx1cfqbIw/j 4wHxW87+5dhg34pN/Fuvg0fnk+cA4nXqx/4iN5o1T9DB5LNSdDWRd1fYK4NODn6e+QNh3zLaInknz X+CrsifeV/yjcxEB5ncg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFV3i-0000000D8zs-0tp1; Fri, 07 Jun 2024 08:34:50 +0000 Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFV3d-0000000D8vC-3oXr for linux-arm-kernel@lists.infradead.org; Fri, 07 Jun 2024 08:34:48 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 9175860002; Fri, 7 Jun 2024 08:34:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1717749279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kC7Mkqte1GNcI58Ap7NFvmtEPtCKep5B67HlI4T5e9o=; b=Zg8h1t+ieDdEbmuX3VesTFo5fRadzqvA4p5CwE/eJXnsg3o1UvORmAnp6iquxrWto4odGu LiF0CfNob79FA/cAZmWMo8toGWTI7qcx+VVPHy3Zp2Z1H9yYYRntYJLNV4mfIreF4Nv2Om ohqNBnRVMOY9oDfN7flr2GXLfUtLGfWWxTXo2XolLCSyYTHN6ANOevzBTutoiJsywbDXSe V2sMxttnDoJzKBu5EK0y3MRw8i0puGfyFYsxrZ8ykAPCOA870jC9mFJvZuFynt/2BcfXbj ZGi4YRzBg0/qyfW0WzNZK+yQpiYNnoy9rWeskilrxkCcEk/jHYBnc3acYSthdA== From: Louis Chauvet Date: Fri, 07 Jun 2024 10:34:38 +0200 Subject: [PATCH v2] dmaengine: xilinx: xdma: Fix data synchronisation in xdma_channel_isr() MIME-Version: 1.0 Message-Id: <20240607-xdma-fixes-v2-1-0282319ce345@bootlin.com> X-B4-Tracking: v=1; b=H4sIAB3GYmYC/22MTQ6DIBBGr2JmXRoZsZqueo/GhcBYJ6lgwBAbw 91LXXf5vp93QKTAFOFeHRAocWTvCuClAjOP7kWCbWHAGlXdYid2u4xi4p2i6JTWhNZo0j2Uwxr oLMr+ORSeOW4+fE53kr/0ryZJIcXUSNUo3d56hQ/t/fZmdzV+gSHn/AUlKr6rpgAAAA== To: Lizhi Hou , Brian Xu , Raj Kumar Rampelli , Vinod Koul , Michal Simek Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, markus.elfring@web.de, stable@vger.kernel.org, Louis Chauvet X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1148; i=louis.chauvet@bootlin.com; h=from:subject:message-id; bh=zPRpjAYUt97meGMe/dTkxWNci342kzEvUmNIKExzJy0=; b=owEBbQKS/ZANAwAIASCtLsZbECziAcsmYgBmYsYe6MaFjYQCt+CSytoKScFCdjwkqda9Yw8IU LUD4haz1TOJAjMEAAEIAB0WIQRPj7g/vng8MQxQWQQgrS7GWxAs4gUCZmLGHgAKCRAgrS7GWxAs 4m6XD/42ttI5gdQT0NeEFycj9oQdOtaolq+foYxCmvvs/FJuyFmVxvsEFezkLsjjXjp9swRiwwM /wjKCrgggWcBKNiQ1TyuualeA5XEgzVHWC5mbcVLjZXkPVFTn7mSHH5C+p0es/6TCZ4pegjs0Jj HnxhKHSKzyGSBT+MZKiG5NW5W0ogzXIYBzk0NkdEeUQDIzZzYWe8fmrOcY7Dnxz0FVxi+pzRvQW R5qS8KHL7q8qvbNIYsAifBYqZsCaBVEydWqJPoYqmMOPdXEPg/b7AbmjQgZggLIdQ+p3eFeGvZ+ 8FxalgcU+Bjg+s2YuQu0VEErlmk2ph0DaSBTaLIagUdUb2r/BoRhsz77r9eUG1ktwctGhGs5Bi6 Zvf2GAcSpu+N/sf1YRim3tbn+GlPQSzbCOzoqTwPSXfv9rLJI9ZUJYWFIi/akNvzQ+tU308kD39 TcxwztK+OcOBXjevvndKrE4LRQO/9RcCEzqjFtiWNH31LTrStXOvke49nnKmWFQzqZXf1XN8iQa r2PSL2Nqsomb1WRVXudK8yrE/HYG2htrrCITY+NIzPKcz8GR52nYHb+HoLJ9nDMg5WuM4egk++a QPGRdVQ3nI4VVmIh65P/nobvTBD1dREsogPuOZTd8MFtuTEdW2AxsBx3BlTTpUiOGAl7Z1scJrB KdQtP+WqkgZN2RQ== X-Developer-Key: i=louis.chauvet@bootlin.com; a=openpgp; fpr=8B7104AE9A272D6693F527F2EC1883F55E0B40A5 X-GND-Sasl: louis.chauvet@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240607_013446_361797_B1F70039 X-CRM114-Status: GOOD ( 10.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Requests the vchan lock before using xdma->stop_request. Fixes: 6a40fb824596 ("dmaengine: xilinx: xdma: Fix synchronization issue") Cc: stable@vger.kernel.org Signed-off-by: Louis Chauvet --- Changes in v2: - Apply comments from Markus - Link to v1: https://lore.kernel.org/r/20240527-xdma-fixes-v1-1-f31434b56842@bootlin.com --- drivers/dma/xilinx/xdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 change-id: 20240527-xdma-fixes-74bbe2dcbeb8 Best regards, diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c index e143a7330816..718842fdaf98 100644 --- a/drivers/dma/xilinx/xdma.c +++ b/drivers/dma/xilinx/xdma.c @@ -885,11 +885,11 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id) u32 st; bool repeat_tx; + spin_lock(&xchan->vchan.lock); + if (xchan->stop_requested) complete(&xchan->last_interrupt); - spin_lock(&xchan->vchan.lock); - /* get submitted request */ vd = vchan_next_desc(&xchan->vchan); if (!vd)