Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp891993lqt; Fri, 7 Jun 2024 01:34:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWshIbJlNFo9KYrgi/Nqt6sN3LfK0YbZ+EXR9qD58zlpJToEidTrVhsN4hoKfjLrMgKnXiI9EDaf8XUZWVHkS78qWZvry2SXgb8agTgMA== X-Google-Smtp-Source: AGHT+IH/AQEiNmtEDJyxSU8oDnFDf3F1A3W7rkoI2miGCA1WlIY10N1IK9phUc0Y12KU3WU3Lpqt X-Received: by 2002:a17:906:7f8b:b0:a6c:7221:60e6 with SMTP id a640c23a62f3a-a6cdb201bbamr125894366b.57.1717749293931; Fri, 07 Jun 2024 01:34:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717749293; cv=pass; d=google.com; s=arc-20160816; b=fC0HbvoVkHHdz3nLQcCPeiDg+Pc30j9eO3GoDDkv6rlg9Q4gojOz4N7dU4cw74PKKc Ubq2nPRzkmf6SN9RnmuMjorrDaCa+F2+m2utnczOaLPyg7j6j0VXOxUqZ/WvszEmS3vL j0pv1HlFLdgSI78OkxDJNJ+u4IQUtE+TYaqEFJ4Mj2ntOeKTBQNA+zfmTTpt1bHOMMdI jt0PdcaJ9qPrEvqxv/AXJP9GNye7g/L9Sb9lxG4vLjehN1UQM3g77N5GxYvwZlEXXyrb dkTamCZtWNlbDuqX3B9ohWKcb/qDiu91T+mEh+x5+KckmDxJGnWmzuGh0Bn4qwRvcR6M yJwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=kC7Mkqte1GNcI58Ap7NFvmtEPtCKep5B67HlI4T5e9o=; fh=4Uq8k353wjOIbpj9nWPYXceYDUfCs2Jdo2oHRjqn0Ig=; b=IhR+lrAKvpRbiJVyNnDTIeYbvNSRU0kg4bGsQ9t2aA1NZdEw4njEvlhW1ajoL7jj+F 8HI68Bfd11LBBkfm8hii7cBonfSeo7n4UQss5K3g87kOaKr+gHh9s38GW6NSKUQmZ4bJ yu753WoFdhRY4PWjPg7CZq+gn1t7s393s1OIy9AcE6Qlp0sajp2/bRykNXh8sG3jyliP jyIgHaoIPgeTCLaBM0GMRvk0nRiBEOU7cadBnpPipoaSyBqAGXJNKz43cIsZpCxQY1Y5 w35kjw7X/myXzxfB8NffLzSjWbzHcTHoeccWWJR+H3wAWCMsmkhqlkZJpnGmkGOgmAz3 QTYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Zg8h1t+i; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-205610-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205610-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6de0dd0425si42161766b.542.2024.06.07.01.34.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 01:34:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205610-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Zg8h1t+i; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-205610-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205610-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8FE881F236F0 for ; Fri, 7 Jun 2024 08:34:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48C7A15B120; Fri, 7 Jun 2024 08:34:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Zg8h1t+i" Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (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 2337E15AD9B; Fri, 7 Jun 2024 08:34:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717749283; cv=none; b=Eq54W5HMcsJvQHhhoA2nzqU+0N8kcgXxvReEKeSYWyNZw580iWJ2F9oX0FWL8ubEGzPfpdK97wZwIN29rV4Qgq8UXsis3LH1bNy2Dp+Ib0iWLcLKubLVQ3PomyAjUFEQ6ueSqpScdcn4fwbndm5ttg4sowYuik9HCKdTF6s0wZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717749283; c=relaxed/simple; bh=zPRpjAYUt97meGMe/dTkxWNci342kzEvUmNIKExzJy0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=TRSFbt9N7pOn9YE6YXM+n1Mredc/apP7Kwnr4SPC30LpOwHsuRDe1fklr2G8QvjLUgXwNUsfVq7PKLb+W0kiTApO9rTES5xJ6+qQ3089LCwPl3FP8dyO21SEpu/gCKziqSslUzSOREJkd6RfhmAseaZerl2wkaLqYLGPRTKSZF4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Zg8h1t+i; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com 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() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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(-) 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) --- base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 change-id: 20240527-xdma-fixes-74bbe2dcbeb8 Best regards, -- Louis Chauvet