From patchwork Tue Oct 1 13:31:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 2970001 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9A615BFF0B for ; Tue, 1 Oct 2013 13:31:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03761201CD for ; Tue, 1 Oct 2013 13:31:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DD542012D for ; Tue, 1 Oct 2013 13:31:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752371Ab3JANbV (ORCPT ); Tue, 1 Oct 2013 09:31:21 -0400 Received: from svenfoo.org ([82.94.215.22]:50971 "EHLO mail.zonque.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752560Ab3JANbU (ORCPT ); Tue, 1 Oct 2013 09:31:20 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.zonque.de (Postfix) with ESMTP id 46A98C1701; Tue, 1 Oct 2013 15:31:18 +0200 (CEST) Received: from mail.zonque.de ([127.0.0.1]) by localhost (rambrand.bugwerft.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yeGvbrcGDy2u; Tue, 1 Oct 2013 15:31:18 +0200 (CEST) Received: from tamtam.teufel.local (unknown [212.87.41.14]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.zonque.de (Postfix) with ESMTPSA id F042FC1740; Tue, 1 Oct 2013 15:31:16 +0200 (CEST) From: Daniel Mack To: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org, neumann@teufel.de, bigeasy@linutronix.de, vinod.koul@intel.com, dan.j.williams@intel.com, balbi@ti.com, Daniel Mack Subject: [PATCH 3/3] dma: cppi41: move -EAGAIN in tear_down Date: Tue, 1 Oct 2013 15:31:11 +0200 Message-Id: <1380634271-27588-4-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1380634271-27588-1-git-send-email-zonque@gmail.com> References: <1380634271-27588-1-git-send-email-zonque@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In cppi41_tear_down_chan(), bail out earlier in case td_seen is unset instead of popping another descriptor when td_desc_seen is also unset. My system ran into WARN() condition multiple times when cppi41_tear_down_chan() was called for channels that had all of td_queued, td_seen and td_seen set to false. Signed-off-by: Daniel Mack --- drivers/dma/cppi41.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index 7747bf7..6decf34 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -586,6 +586,9 @@ static int cppi41_tear_down_chan(struct cppi41_channel *c) } c->td_seen = 1; } + + if (c->td_retry) + return -EAGAIN; } if (!c->td_desc_seen) { desc_phys = cppi41_pop_desc(cdd, c->q_comp_num); @@ -606,8 +609,6 @@ static int cppi41_tear_down_chan(struct cppi41_channel *c) * descriptor before the TD we fetch it from enqueue, it has to be * there waiting for us. */ - if (!c->td_seen && c->td_retry) - return -EAGAIN; WARN_ON(!c->td_retry); if (!c->td_desc_seen) {