Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp121963lqh; Wed, 27 Mar 2024 17:29:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1M/+Cga9UIKweTwzzvObmjBx5W3opu27YVgWta9GvslOqoAwQEAwp2cThzDYhH9zRAEKPr0yrVI3gqI+yMBZedE9JkKuBmJ5sAV2p6w== X-Google-Smtp-Source: AGHT+IGuf7nlFXpkJhVxFSdjPbLXIrpwlYxkHKuiu5W3FwoYK8PBceCBSXje3bc/3G8JldDhttKv X-Received: by 2002:a05:6808:64b:b0:3c3:d56d:a5dd with SMTP id z11-20020a056808064b00b003c3d56da5ddmr1285062oih.18.1711585757983; Wed, 27 Mar 2024 17:29:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711585757; cv=pass; d=google.com; s=arc-20160816; b=hSyKNK0ASOpeEnRR9HgmhElFAk4DE+sdYnkIAPbg/AIxNT1l9fvEJfTkxSJ1SbYN/A 9tCd+/41txR3f2Uf97JBt0SKHcahPCZxB731FK5LJJ6+/ADvhZAOA/g1d0B/XWfA22ah /LlBjt5hXPAz+L+/zljzllHvaT5QJWaMHGAjNo2UYRx3v+YN59FgtTMTgqjv0J4BCCF9 XIQk3PVWlnCEKgCK+V7szjNfhg8Q+nPkl+y7vBnkWvGeqmGWSzi9LL4t0nPsm2SaoFK3 245Ow6uNZTesSBzev7mstgjfxwDyzeVP0bekIXrGmRTqtVQdsK+4QNeVZYzLLrln7Cki ZBYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=wrkfJcTuEi+D+HvBe61cn2FoxEmO6/EMkOnHD/GfbVk=; fh=whdQqntVeHVO9JnApDAUwhT1YUB+IBm8ksiuV9ey2UE=; b=Xn5GJOItX8u1Ru2oNcAnL5KNVtFxCmDy+88CC++mhSB1futPZPU4XemTy8RHKHJvZ5 hNZwfssRApxAXLj71cSJ4NfQko6blp2YbLhHhc7mXbJTMqBprt1xKUMTHtRJo3YNGX3h W2BUJ1taXiku6xuaWt0wS23y+qwB2zZNrqF28oeWGJYP4fo7aYlA0kihIw59xkDHdduO Y+cFdhbWw53PGbZ8g+G51ou+QUx8liiXqMUbewjkXBax19O+VAHzD9PErj/+eNLeEkp9 3boubll5dF+JkhUNmouKNJNnXMcwZr5XGaLgP4apdvfcaNg5hlSlZ67viGWOtUQfWayC vOag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Zj6lr0AL; 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-122230-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122230-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v5-20020aa78505000000b006e77fdb25e2si275518pfn.111.2024.03.27.17.29.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 17:29:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122230-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Zj6lr0AL; 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-122230-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122230-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D69B42A6C21 for ; Thu, 28 Mar 2024 00:26:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B003BF4FC; Thu, 28 Mar 2024 00:23:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Zj6lr0AL" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 CF5951E498; Thu, 28 Mar 2024 00:23:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711585406; cv=none; b=BcMuXeUGWUHaEnLQZrWpY7tOyYqu/jtojRcgXwxVCS9KWjXsTKghUjddymbpy6MMSSehi0ZyM51pQmmBPCKgm4RNMZbMFRATShioxfK5XHEFpmiyDx82TNEJS27Pk4duPOHAI4Mz8dsE+QO1ONwucvS69pC/9I6z8ArJxx9BxI0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711585406; c=relaxed/simple; bh=QBhJNdXt3ZDE1KYix7kVNCLNrhefe3LPg7AK/U9VUX4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EYmj9afwlijNeXYr1FVsyj/Z2f78J8j71Jh9MS1Qf9Sm2rvNtI712wmFC67qvMvmSJcHl8CLO4sWcnTASgpYdjM84X/HKWQ+h8wc5xgLb4THgdu38q6Spv3wOSTofdbAZaq3KSqTUybb7TZl2Bc3SFU4Kp0a1G88EyaQgSTxbuM= 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=Zj6lr0AL; arc=none smtp.client-ip=217.70.183.199 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 71C63FF802; Thu, 28 Mar 2024 00:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1711585396; 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: in-reply-to:in-reply-to:references:references; bh=wrkfJcTuEi+D+HvBe61cn2FoxEmO6/EMkOnHD/GfbVk=; b=Zj6lr0AL5lpyDHEmBNKHoDUp8yYNVdu+j6B2c/n+9L4YqqNlPbqUykWamyW25LRM7Zl2n0 4gBIpQViRbWJi50k/2DGDhQoluW7Mx2v5juh32IvkijyCIXq/oTpkCD7HT5VRhJwcATOWL j38C8hYFXRA+OjFsOorQUiUzwWY7DgvKekSna9OBvnB9/jLcp0E4G0CY48x5zSfA78ec/h 6jlZrsYjsyOWsxKeOrtZVbJpLTr1z86o74MT4buG1l3QBFMb8gAN0ZUR6z2aadu1DpZrOU kaugZr7iYw0QuWll34OHEdvLE9nN2GQhGces5PpaaOA23A7wp3LNPmxlAYDeYg== Date: Thu, 28 Mar 2024 01:23:13 +0100 From: Miquel Raynal To: Lizhi Hou Cc: Louis Chauvet , Brian Xu , Raj Kumar Rampelli , Vinod Koul , Michal Simek , Jan Kuliga , , , , Subject: Re: [PATCH 2/3] dmaengine: xilinx: xdma: Fix synchronization issue Message-ID: <20240328012257.4a5955f2@xps-13> In-Reply-To: References: <20240327-digigram-xdma-fixes-v1-0-45f4a52c0283@bootlin.com> <20240327-digigram-xdma-fixes-v1-2-45f4a52c0283@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) 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: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com Hi Lizhi, > > @@ -376,6 +378,8 @@ static int xdma_xfer_start(struct xdma_chan *xchan) > > return ret; =20 > > > xchan->busy =3D true; =20 > > + xchan->stop_requested =3D false; > > + reinit_completion(&xchan->last_interrupt); =20 >=20 > If stop_requested is true, it should not start another transfer. So I wou= ld suggest to add >=20 > =C2=A0=C2=A0=C2=A0=C2=A0 if (xchan->stop_requested) >=20 > =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 return -ENODEV; Maybe -EBUSY in this case? I thought synchronize() was mandatory in-between. If that's not the case then indeed we need to block or error-out if a new transfer gets started. >=20 > at the beginning of xdma_xfer_start(). >=20 > xdma_xfer_start() is protected by chan lock. >=20 > > > return 0; =20 > > } Thanks, Miqu=C3=A8l