From patchwork Sun Aug 11 17:59:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2842783 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1F0F29F294 for ; Sun, 11 Aug 2013 18:02:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50ED020253 for ; Sun, 11 Aug 2013 18:02:38 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 128FC20276 for ; Sun, 11 Aug 2013 18:02:37 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8ZxL-00077R-Qr; Sun, 11 Aug 2013 18:01:33 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Zwx-0006kE-IT; Sun, 11 Aug 2013 18:01:07 +0000 Received: from mail-bk0-x22b.google.com ([2a00:1450:4008:c01::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Zw7-0006Zf-Vs for linux-arm-kernel@lists.infradead.org; Sun, 11 Aug 2013 18:00:18 +0000 Received: by mail-bk0-f43.google.com with SMTP id mz13so1598107bkb.16 for ; Sun, 11 Aug 2013 10:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LeQDmZkKSwyVGK1eVbx4WOulXbzoEg+2fUS1Apx97Vo=; b=YzVvijmaSUa1pHIlLdqupG76F1oZVy77h67X86VdT+yb3voJc4WknCfMuCj4HeMLE6 dy8RqJ236TYzKhZzz2IicAxkbZ6ZtmkZLz/8w2RhW1F2txqK4o+2o1bgJw68lzKuWGsY DZAMLg3mb/rLHDRPJ5OAtpSGKezm8EPNq3ayP/+HPVxhVu94xkLm3v/3SC50ZD6JgNH5 MkZciEavEbIaKEBwImqa5/X9DLXRqB9hbfSlB3YKe8Nsh/Bx8rSo1QOCDLlmb/Ca95rT RIwCmaPJGLH8a7Ds8zRLBzZSEbkRzGBW8n/FrDwQPZ+QTr+Pdb4n+X4oDypMh5MHucyC XGPQ== X-Received: by 10.204.224.142 with SMTP id io14mr3096025bkb.27.1376243998802; Sun, 11 Aug 2013 10:59:58 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id nv4sm4838824bkb.3.2013.08.11.10.59.56 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 11 Aug 2013 10:59:57 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 07/18] dmaengine: PL08x: Fix reading the byte count in cctl Date: Sun, 11 Aug 2013 19:59:19 +0200 Message-Id: <1376243970-6489-8-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1376243970-6489-1-git-send-email-tomasz.figa@gmail.com> References: <1376243970-6489-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130811_140016_383161_D29078A6 X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) Cc: alsa-devel@alsa-project.org, Kukjin Kim , Mike Turquette , Tomasz Figa , Liam Girdwood , Sangbeom Kim , Vinod Koul , Linus Walleij , Padmavathi Venna , linux-kernel@vger.kernel.org, Jaroslav Kysela , Takashi Iwai , Mark Brown , Dan Williams , Russell King , linux-spi@vger.kernel.org, Alban Bedel , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Alban Bedel There are more fields than just SWIDTH in CH_CONTROL register, so read register value must be masked in addition to shifting. Signed-off-by: Alban Bedel Signed-off-by: Tomasz Figa Reviewed-by: Linus Walleij --- drivers/dma/amba-pl08x.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 4e4c3df..6b9cba2 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -480,6 +480,8 @@ static inline u32 get_bytes_in_cctl(u32 cctl) /* The source width defines the number of bytes */ u32 bytes = cctl & PL080_CONTROL_TRANSFER_SIZE_MASK; + cctl &= PL080_CONTROL_SWIDTH_MASK; + switch (cctl >> PL080_CONTROL_SWIDTH_SHIFT) { case PL080_WIDTH_8BIT: break; @@ -498,6 +500,8 @@ static inline u32 get_bytes_in_cctl_pl080s(u32 cctl, u32 cctl1) /* The source width defines the number of bytes */ u32 bytes = cctl1 & PL080S_CONTROL_TRANSFER_SIZE_MASK; + cctl &= PL080_CONTROL_SWIDTH_MASK; + switch (cctl >> PL080_CONTROL_SWIDTH_SHIFT) { case PL080_WIDTH_8BIT: break;