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: 2842790 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 2B0ADBF546 for ; Sun, 11 Aug 2013 18:03:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 603D620284 for ; Sun, 11 Aug 2013 18:03:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 97A332027F for ; Sun, 11 Aug 2013 18:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754834Ab3HKSDW (ORCPT ); Sun, 11 Aug 2013 14:03:22 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:53216 "EHLO mail-bk0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754331Ab3HKSAA (ORCPT ); Sun, 11 Aug 2013 14:00:00 -0400 Received: by mail-bk0-f45.google.com with SMTP id mx11so1575653bkb.18 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 Cc: linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Dan Williams , Jaroslav Kysela , Kukjin Kim , Liam Girdwood , Linus Walleij , Mark Brown , Mike Turquette , Padmavathi Venna , Russell King , Sangbeom Kim , Takashi Iwai , Vinod Koul , Alban Bedel , Tomasz Figa 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> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 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;