From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754394AbcIILoy (ORCPT ); Fri, 9 Sep 2016 07:44:54 -0400 Received: from mga11.intel.com ([192.55.52.93]:11729 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753715AbcIILow (ORCPT ); Fri, 9 Sep 2016 07:44:52 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,304,1470726000"; d="scan'208";a="166209847" Date: Fri, 9 Sep 2016 17:23:05 +0530 From: Vinod Koul To: Hsin-Yu Chao Cc: smbarber@chromium.org, groeck@chromium.org, Dan Williams , "open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM" , open list Subject: Re: [PATCH] dmaengine: pl330: Acquire dmac's spinlock in pl330_tx_status Message-ID: <20160909115305.GQ9355@localhost> References: <1471943815-30977-1-git-send-email-hychao@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471943815-30977-1-git-send-email-hychao@chromium.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 23, 2016 at 05:16:55PM +0800, Hsin-Yu Chao wrote: > There is a racing when accessing dmac thread in pl330_tx_status that > the pl330_update is handling active request at the same time and > changing the status of descriptors. This could cause an invalid > transferred count from BUSY descriptor added up to the residual number. > Fix the bug by using the dmac's spinlock in pl330_tx_status to protect > thread resources from changing. > Note that the nested order of holding dmac's and dma_chan's spinlock is > consistent with the rest of the driver: dma_chan first and then dmac, > so it is safe from deadlock scenario. Applied, thanks -- ~Vinod