From patchwork Mon Jan 7 11:21:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 13878 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2F84B23EC8 for ; Mon, 7 Jan 2013 11:25:39 +0000 (UTC) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by fiordland.canonical.com (Postfix) with ESMTP id 001F5A19374 for ; Mon, 7 Jan 2013 11:25:38 +0000 (UTC) Received: by mail-vb0-f51.google.com with SMTP id fq11so18782367vbb.24 for ; Mon, 07 Jan 2013 03:25:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=XtZj/1wvjVZUlO0mOqqlo+Bb8bFLJseQ2FTFLVCOfvs=; b=iCzwTnIegctwRYN+oT5IX+YEg0Io32pYwz6zU6FksMkNgHYDdy7GQ1N0030zhcRiEK 6XTaf/bT6+ix+XfyC2g+m/FxSLRwTRVwnbS6RvtJhJTfyVsGw3VG6/Gt5bXMSznYNpcH ArY2k9CUwdU45cLTRH4WpljR4pYapD+4EE2A8a9Np6cs5fJx3NBkufO4Eb7BQ95WF//r lSrkTy4AkkjK3DG8Zny0cSE7lQupryrj02JYIkf8NhDpTHzlDRdltPhD1wvHz+pmWJ5T haHvjagNq1um1lNhh0YOiiAsTZCael2kqOTVIztioeSNHD02nJ0m0MOaIRbQJnOQld0e eEIg== X-Received: by 10.220.8.18 with SMTP id f18mr80288999vcf.14.1357557938521; Mon, 07 Jan 2013 03:25:38 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp56303veb; Mon, 7 Jan 2013 03:25:37 -0800 (PST) X-Received: by 10.194.21.70 with SMTP id t6mr95181105wje.42.1357557936569; Mon, 07 Jan 2013 03:25:36 -0800 (PST) Received: from mail-we0-f173.google.com (mail-we0-f173.google.com [74.125.82.173]) by mx.google.com with ESMTPS id kt7si13019772wjb.31.2013.01.07.03.25.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 03:25:36 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.173 is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=74.125.82.173; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.173 is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) smtp.mail=fabio.baltieri@linaro.org Received: by mail-we0-f173.google.com with SMTP id z2so9737812wey.32 for ; Mon, 07 Jan 2013 03:25:36 -0800 (PST) X-Received: by 10.180.77.68 with SMTP id q4mr8194091wiw.10.1357557936189; Mon, 07 Jan 2013 03:25:36 -0800 (PST) Received: from localhost ([2a01:2029:1:11e3:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id p2sm13060002wic.7.2013.01.07.03.25.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 03:25:35 -0800 (PST) From: Fabio Baltieri To: Vinod Koul Cc: Dan Williams , Linus Walleij , Srinidhi Kasagar , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Fabio Baltieri , Rabin Vincent Subject: [PATCH 15/16] dmaengine: set_dma40: ignore spurious interrupts Date: Mon, 7 Jan 2013 12:21:57 +0100 Message-Id: <1357557718-15676-16-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1357557718-15676-1-git-send-email-fabio.baltieri@linaro.org> References: <1357557718-15676-1-git-send-email-fabio.baltieri@linaro.org> X-Gm-Message-State: ALoCoQllnRHf6vVrX7Cqcd4sAg8LZYzXUqXkNSls82kGBWUVRPCaeVOYZX/zsAX1XGnM3y6gd7Gs Some DMA channels may be used by other cores in the SoC. This patch modifies the dma interrupt handler to ignore interrupts from unknown channels. Cc: Rabin Vincent Acked-by: Linus Walleij Signed-off-by: Fabio Baltieri --- drivers/dma/ste_dma40.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 2ecefb7..a97bbd3 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -1677,13 +1677,22 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data) row = chan / BITS_PER_LONG; idx = chan & (BITS_PER_LONG - 1); - /* ACK interrupt */ - writel(1 << idx, base->virtbase + il[row].clr); - if (il[row].offset == D40_PHY_CHAN) d40c = base->lookup_phy_chans[idx]; else d40c = base->lookup_log_chans[il[row].offset + idx]; + + if (!d40c) { + /* + * No error because this can happen if something else + * in the system is using the channel. + */ + continue; + } + + /* ACK interrupt */ + writel(1 << idx, base->virtbase + il[row].clr); + spin_lock(&d40c->lock); if (!il[row].is_error)