From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754417AbcIILk2 (ORCPT ); Fri, 9 Sep 2016 07:40:28 -0400 Received: from mga07.intel.com ([134.134.136.100]:15045 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753017AbcIILk0 (ORCPT ); Fri, 9 Sep 2016 07:40:26 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,304,1470726000"; d="scan'208";a="1047827124" Date: Fri, 9 Sep 2016 17:18:40 +0530 From: Vinod Koul To: Hsin-Yu Chao Cc: Dan Williams , "open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM" , open list Subject: Re: [PATCH] dmaengine: pl330: use lock of dma channel in pl330_update Message-ID: <20160909114840.GO9355@localhost> References: <1471611828-15548-1-git-send-email-hychao@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471611828-15548-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 Fri, Aug 19, 2016 at 09:03:48PM +0800, Hsin-Yu Chao wrote: > The content of pl330_thread could be modified in pl330_update > without protection by the lock from the dma channel who currently > holding this thread. This could cause bug to the calculation of > in pl330_tx_status, if the running request has just been done and > moving to next request while calculating the residual number, an > invalid number from BUSY descriptor could be added up. > --- > drivers/dma/pl330.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c > index 31e9c49..2449cb7 100644 > --- a/drivers/dma/pl330.c > +++ b/drivers/dma/pl330.c > @@ -1564,6 +1564,19 @@ static void pl330_dotask(unsigned long data) > return; > } > > +static struct dma_pl330_chan *get_dma_channel(struct pl330_dmac *pl330, > + struct pl330_thread *thrd) > +{ > + struct dma_pl330_chan *pch; > + int i; empty line here please -- ~Vinod