From patchwork Tue Jan 10 07:01:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 6136 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 1389523F84 for ; Tue, 10 Jan 2012 07:02:22 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id EEDB9A184E3 for ; Tue, 10 Jan 2012 07:02:21 +0000 (UTC) Received: by mail-bk0-f52.google.com with SMTP id zu5so295178bkb.11 for ; Mon, 09 Jan 2012 23:02:21 -0800 (PST) Received: by 10.205.126.137 with SMTP id gw9mr8052198bkc.135.1326178941772; Mon, 09 Jan 2012 23:02:21 -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.205.82.144 with SMTP id ac16cs74702bkc; Mon, 9 Jan 2012 23:02:21 -0800 (PST) Received: by 10.50.219.226 with SMTP id pr2mr1202615igc.30.1326178939751; Mon, 09 Jan 2012 23:02:19 -0800 (PST) Received: from VA3EHSOBE008.bigfish.com (va3ehsobe001.messaging.microsoft.com. [216.32.180.11]) by mx.google.com with ESMTPS id a13si46494444igk.3.2012.01.09.23.02.19 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jan 2012 23:02:19 -0800 (PST) Received-SPF: neutral (google.com: 216.32.180.11 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) client-ip=216.32.180.11; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.180.11 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) smtp.mail=richard.zhao@linaro.org Received: from mail136-va3-R.bigfish.com (10.7.14.238) by VA3EHSOBE008.bigfish.com (10.7.40.28) with Microsoft SMTP Server id 14.1.225.23; Tue, 10 Jan 2012 07:02:18 +0000 Received: from mail136-va3 (localhost [127.0.0.1]) by mail136-va3-R.bigfish.com (Postfix) with ESMTP id 9E0722C02F4; Tue, 10 Jan 2012 07:02:18 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dhc1ahc1bh87h2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail136-va3 (localhost.localdomain [127.0.0.1]) by mail136-va3 (MessageSwitch) id 1326178938425616_5691; Tue, 10 Jan 2012 07:02:18 +0000 (UTC) Received: from VA3EHSMHS020.bigfish.com (unknown [10.7.14.235]) by mail136-va3.bigfish.com (Postfix) with ESMTP id 5FD9510007E; Tue, 10 Jan 2012 07:02:18 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS020.bigfish.com (10.7.99.30) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 10 Jan 2012 07:02:10 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.355.3; Tue, 10 Jan 2012 01:02:09 -0600 Received: from b20223-02.ap.freescale.net (b20223-02.ap.freescale.net [10.192.242.124]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id q0A71qKn000113; Tue, 10 Jan 2012 01:02:06 -0600 (CST) From: Richard Zhao To: , CC: , , , , , , Richard Zhao Subject: [PATCH 6/6] dma/imx-sdma: check whether event_id0 < 32 when set event_mask Date: Tue, 10 Jan 2012 15:01:50 +0800 Message-ID: <1326178910-14044-6-git-send-email-richard.zhao@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1326178910-14044-1-git-send-email-richard.zhao@linaro.org> References: <1326178910-14044-1-git-send-email-richard.zhao@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com Signed-off-by: Richard Zhao --- drivers/dma/imx-sdma.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 22fd561..1d5b6ab 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -753,8 +753,11 @@ static int sdma_config_channel(struct sdma_channel *sdmac) if (sdmac->event_id0 > 31) sdmac->watermark_level |= 1 << 30; } else { - sdmac->event_mask0 = 1 << sdmac->event_id0; - sdmac->event_mask1 = 1 << (sdmac->event_id0 - 32); + if (sdmac->event_id0 < 32) + sdmac->event_mask0 = 1 << sdmac->event_id0; + else + sdmac->event_mask1 = + 1 << (sdmac->event_id0 - 32); } /* Watermark Level */ sdmac->watermark_level |= sdmac->watermark_level;