From patchwork Sun Jun 16 20:54:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2728681 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 78404C0AB1 for ; Sun, 16 Jun 2013 20:54:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CABD20174 for ; Sun, 16 Jun 2013 20:54:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C967920171 for ; Sun, 16 Jun 2013 20:54:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755594Ab3FPUyt (ORCPT ); Sun, 16 Jun 2013 16:54:49 -0400 Received: from mail-bk0-f50.google.com ([209.85.214.50]:36722 "EHLO mail-bk0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755571Ab3FPUyr (ORCPT ); Sun, 16 Jun 2013 16:54:47 -0400 Received: by mail-bk0-f50.google.com with SMTP id ik8so895988bkc.37 for ; Sun, 16 Jun 2013 13:54:46 -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:x-mailer:in-reply-to:references; bh=GSMAUPxwzT2IzFvkO0vSaaOe7zhWV/8PBJ73JaDAp/A=; b=BSdSqpSHVB7IOxXXRAVc7OtnTeiYUO+jGR6+hWQGJwg5vZMSrZLe20l8P5Q/WmqZ4y WSh4X5w1acKKh67u/2WWJDBw5a08I0Cs/StNolN46qsjdJ89CgQNY/nbnK5QKRds56Va cLF22mRWNI5ENxcFzsifMwPm8avdb7FrkyjPUy1gyq1f0+yY4a+ueAJAHaGHHuKzzAck BrQby8l8G8s90ADSDGZ7uyjyaRXmlAxjkTDXE7bASPczXN51YjEdsj8DmyLVTohwEB53 uOQtayuax3JMGMInYkk2xzLXPh1dRSl4iiJYYL7XJfL5VmoPcrwhZ4K48r86s6bidM4d YwBQ== X-Received: by 10.205.25.198 with SMTP id rj6mr1439447bkb.2.1371416085997; Sun, 16 Jun 2013 13:54:45 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id m6sm1996010bki.7.2013.06.16.13.54.43 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Jun 2013 13:54:45 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, alsa-devel@alsa-project.org, Kukjin Kim , Vinod Koul , Dan Williams , Linus Walleij , Alessandro Rubini , Giancarlo Asnaghi , Mark Brown , Grant Likely , Sangbeom Kim , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Padmavathi Venna , Thomas Abraham , Arnd Bergmann , Olof Johansson , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Sylwester Nawrocki , Russell King - ARM Linux , Alban Bedel , Tomasz Figa Subject: [RFC PATCH 07/11] dmaengine: PL08x: Fix reading the byte count in cctl Date: Sun, 16 Jun 2013 22:54:14 +0200 Message-Id: <1371416058-22047-8-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1371416058-22047-1-git-send-email-tomasz.figa@gmail.com> References: <1371416058-22047-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=-7.9 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 --- 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 0da5539..bb3b36b 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -471,6 +471,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; @@ -489,6 +491,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;