From patchwork Fri May 21 15:30:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 101437 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4LFSaYe004767 for ; Fri, 21 May 2010 15:29:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758180Ab0EUP35 (ORCPT ); Fri, 21 May 2010 11:29:57 -0400 Received: from mail.gmx.net ([213.165.64.20]:36287 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1758080Ab0EUP34 (ORCPT ); Fri, 21 May 2010 11:29:56 -0400 Received: (qmail invoked by alias); 21 May 2010 15:29:54 -0000 Received: from p57BD1D79.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.29.121] by mail.gmx.net (mp011) with SMTP; 21 May 2010 17:29:54 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX18rY/YA+egrA16RoXG1iBKZBwm7Iae52IkzDcanQh ds+y720FzLIvYC Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1OFUAu-0005rU-Ic; Fri, 21 May 2010 17:30:12 +0200 Date: Fri, 21 May 2010 17:30:12 +0200 (CEST) From: Guennadi Liakhovetski To: "linux-sh@vger.kernel.org" cc: Dan Williams Subject: [PATCH] sh: guard cookie consistency across termination in the DMA driver Message-ID: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 21 May 2010 15:29:57 +0000 (UTC) diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index 58563a0..041c6a3 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c @@ -714,6 +714,10 @@ static void sh_dmae_chan_ld_cleanup(struct sh_dmae_chan *sh_chan, bool all) { while (__ld_cleanup(sh_chan, all)) ; + + if (all) + /* Terminating - forgive uncompleted cookies */ + sh_chan->completed_cookie = sh_chan->common.cookie; } static void sh_chan_xfer_ld_queue(struct sh_dmae_chan *sh_chan)