Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3417194pxy; Mon, 26 Apr 2021 00:56:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzI3LVRXWBgO3jZM9mfR2IQCB8SE3BstoZxYhk/3zVqnFuFwucrBWcsCg7hJpgnAaNZH6td X-Received: by 2002:a62:1d8a:0:b029:24c:4aa1:ad01 with SMTP id d132-20020a621d8a0000b029024c4aa1ad01mr16336604pfd.27.1619423792778; Mon, 26 Apr 2021 00:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619423792; cv=none; d=google.com; s=arc-20160816; b=mI4+bFi13d2nnlAxogHLjIdpPCt0Gxev43MZh0RdecPnkBcKJFc0PLYqkv/iYrGGzm UK4t2p38e3KKjxp1zNOJRQgDuzCA5kT0bFTFBLprcoeWHJTIsy9Akdb7kWm1iUMQi70b 6iAeMC5g9AGzfJzCbqLB1scN3L0TjCBxAixNjUjJXi3kMXRkMXhTfMxOHAuWIsGQ7BVy PTv1Dx95fmlRjflsnYo1QcmePpcsVncUke5bv7Puh6DTYfrE+aU0jWmQeQdsLIpsCirV IfO+sdfK55YOq8ei5UtMQBO/1CG/buuqU7wb+OXFg5vCO+AlaREKA5ESY3K7bsei5CBu xs8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gDCC6PwNqIsMjfjWATC2JsKZcLKHUYK27/p6v0njS2k=; b=iNtkM1skdB7b+ny0bM4+2BPI2gLdSspFpLBQV/RefB4E1oL57o4DDfoVIMNMbioArB bQ7FjXk3sXreGx4NvN7LgOvGG7Fuqs19+KyYL0X+HOGOPtbPvJ+je9HJ15DBph2ucWtN Ta0jjQ/sKDOHW0RixRvl6xxXgWTZiPvkim5lpwESF2P1qsuMHjSAxjB5FgHyUvG+CZc5 uib91H2kDgzCdIo6Av5LERbEY9sZ02CJiVPOR+GkCoXWPAW6l9ViP2RPdDj+XYDnsYtE Ql+IcoLu2xorJxPtBJMRYV59iO98DF3kCO3sq1XVoXsEsjZUj+NJYUyo6sfpGQr6r3cZ GwOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mE+ELAv1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c21si3418602plo.353.2021.04.26.00.56.20; Mon, 26 Apr 2021 00:56:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mE+ELAv1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234524AbhDZHye (ORCPT + 99 others); Mon, 26 Apr 2021 03:54:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:59578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233774AbhDZHoK (ORCPT ); Mon, 26 Apr 2021 03:44:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5EBFA613D3; Mon, 26 Apr 2021 07:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619422827; bh=OfTZhQVCkfP1iUoe6FXBgYEwvVROmP5JhRAWr8lWs4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mE+ELAv1IsRxgCBqv0cIov6R9HCIX4ar+emJ7RijcEm/tNgEoBs3JaSyQ4mqstZ4K aSoL84aW5HCvJZbvYiVZa191Inl4iIDInyIh+nQJ93XAWDEClXyc9im3VKumOyIZ5q K1/HWYbHv/XzhyPs2q7yownCm+/yXMw/hq7HRS7c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Laurent Pinchart , Vinod Koul , Sasha Levin Subject: [PATCH 5.10 24/36] dmaengine: xilinx: dpdma: Fix race condition in done IRQ Date: Mon, 26 Apr 2021 09:30:06 +0200 Message-Id: <20210426072819.616178987@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210426072818.777662399@linuxfoundation.org> References: <20210426072818.777662399@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Laurent Pinchart [ Upstream commit 868833fbffbe51c487df4f95d4de9194264a4b30 ] The active descriptor pointer is accessed from different contexts, including different interrupt handlers, and its access must be protected by the channel's lock. This wasn't done in the done IRQ handler. Fix it. Signed-off-by: Laurent Pinchart Link: https://lore.kernel.org/r/20210307040629.29308-3-laurent.pinchart@ideasonboard.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/xilinx/xilinx_dpdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c index d504112c609e..70b29bd079c9 100644 --- a/drivers/dma/xilinx/xilinx_dpdma.c +++ b/drivers/dma/xilinx/xilinx_dpdma.c @@ -1048,13 +1048,14 @@ static int xilinx_dpdma_chan_stop(struct xilinx_dpdma_chan *chan) */ static void xilinx_dpdma_chan_done_irq(struct xilinx_dpdma_chan *chan) { - struct xilinx_dpdma_tx_desc *active = chan->desc.active; + struct xilinx_dpdma_tx_desc *active; unsigned long flags; spin_lock_irqsave(&chan->lock, flags); xilinx_dpdma_debugfs_desc_done_irq(chan); + active = chan->desc.active; if (active) vchan_cyclic_callback(&active->vdesc); else -- 2.30.2