From patchwork Thu Mar 22 13:51:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 7409 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 757A023E2F for ; Thu, 22 Mar 2012 13:52:03 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 21F95A18439 for ; Thu, 22 Mar 2012 13:52:03 +0000 (UTC) Received: by iage36 with SMTP id e36so4140549iag.11 for ; Thu, 22 Mar 2012 06:52:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:message-id :subject:from:to:cc:date:in-reply-to:references:content-type :x-mailer:content-transfer-encoding:mime-version:x-gm-message-state; bh=pfOjF1GCNpn0QwUMmhac6fkF0TZV8tZqJ8ScaE0yT7I=; b=V+HYFxTFDs6Ihz1PWY5lHwu59T2OuGbjkUKU8hTWFSQg7RjovnZ5E5lTDOsrRZpY8M hvbq5+93jJRa/EFZRqp/JtvZ7g7WsefDdPHon/HlSfMm8nufx9gUKu0XmsTaQXETKWll Q2ojdv8wbejM/KPYheLqIl1LxBNBSYqn44+L0MCogmxKMeIA5VFeNoXyt+w6ZSvTI+LE MYvvC5BIhDxRhRrCyP9rgEsKGGYRbuFfmq0hRBf88SKM8n4QWELf4EQuWfNcw/fJc4fv RO7l997Fwm1xto2FyVyGjWNwuu59vAuI1WtIz9VevcNkotmFt2R0pIwHM/c51LrlhmEI OQxg== Received: by 10.50.156.226 with SMTP id wh2mr1733005igb.2.1332424322454; Thu, 22 Mar 2012 06:52:02 -0700 (PDT) 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.231.203.79 with SMTP id fh15csp49162ibb; Thu, 22 Mar 2012 06:52:01 -0700 (PDT) Received: by 10.60.0.195 with SMTP id 3mr9856629oeg.2.1332424320722; Thu, 22 Mar 2012 06:52:00 -0700 (PDT) Received: from bedivere.hansenpartnership.com (bedivere.hansenpartnership.com. [66.63.167.143]) by mx.google.com with ESMTP id du9si2285140obb.36.2012.03.22.06.51.57; Thu, 22 Mar 2012 06:52:00 -0700 (PDT) Received-SPF: pass (google.com: domain of James.Bottomley@hansenpartnership.com designates 66.63.167.143 as permitted sender) client-ip=66.63.167.143; Authentication-Results: mx.google.com; spf=pass (google.com: domain of James.Bottomley@hansenpartnership.com designates 66.63.167.143 as permitted sender) smtp.mail=James.Bottomley@hansenpartnership.com Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id D0E658EE136; Thu, 22 Mar 2012 06:51:56 -0700 (PDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aYPwBl8Vt7ej; Thu, 22 Mar 2012 06:51:56 -0700 (PDT) Received: from [10.0.1.10] (host90-152-44-174.ipv4.regusnet.com [90.152.44.174]) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 4582D8EE0A3; Thu, 22 Mar 2012 06:51:53 -0700 (PDT) Message-ID: <1332424311.2946.15.camel@dabdike.int.hansenpartnership.com> Subject: Re: [PATCH v3 0/5] [SCSI] ufshcd: UFS Host Controller Driver From: James Bottomley To: Santosh Y Cc: linux-scsi@vger.kernel.org, patches@linaro.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, arnd.bergmann@linaro.org, saugata.das@linaro.org, dsaxena@linaro.org, stephen.doel@linaro.org, venkat@linaro.org, ilho215.lee@samsung.com, nala.la@samsung.com, girish.shivananjappa@linaro.org, vishak.g@samsung.com, k.rajesh@samsung.com, yejin.moon@samsung.com, sreekumar.c@samsung.com, vinholikatti@gmail.com, linkinjeon@gmail.com, michaelc@cs.wisc.edu Date: Thu, 22 Mar 2012 13:51:51 +0000 In-Reply-To: <1330497714-26504-1-git-send-email-santoshsy@gmail.com> References: <1330497714-26504-1-git-send-email-santoshsy@gmail.com> X-Mailer: Evolution 3.2.1 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQlOE5Iv067TMOhFvBlDQ63sKythK9p4v/wJyT8bAEVs9a6M5MwRSTd9jI7aqsQYVQVDjNk3 On Wed, 2012-02-29 at 12:11 +0530, Santosh Y wrote: > From: Santosh Yaraganavi > > UFS: > Universal Flash Storage is a storage specification for flash devices. > It is aimed to provide a universal storage interface for both > embedded and removable flash memory based storage in mobile > devices such as smart phones and tablet computers. The specification > is defined by JEDEC Solid State Technology Association. UFS is based > on MIPI M-PHY physical layer standard. UFS uses MIPI M-PHY as the > physical layer and MIPI Unipro as the link layer. This doesn't compile correctly on a 32 bit platform: CC [M] drivers/scsi/ufs/ufshcd.o drivers/scsi/ufs/ufshcd.c: In function ‘ufshcd_map_sg’: drivers/scsi/ufs/ufshcd.c:555:5: warning: right shift count >= width of type [enabled by default] drivers/scsi/ufs/ufshcd.c: In function ‘ufshcd_host_memory_configure’: drivers/scsi/ufs/ufshcd.c:831:5: warning: right shift count >= width of type [enabled by default] drivers/scsi/ufs/ufshcd.c: In function ‘ufshcd_initialize_hba’: drivers/scsi/ufs/ufshcd.c:1037:2: warning: right shift count >= width of type [enabled by default] drivers/scsi/ufs/ufshcd.c:1041:2: warning: right shift count >= width of type [enabled by default] That's because you use >> 32 for the upper address bits. I did the replacement below to use macros which do this correctly (basically trick the compiler). James diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 07ec973..52b96e8 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -550,9 +550,9 @@ static int ufshcd_map_sg(struct ufshcd_lrb *lrbp) prd_table[i].size = cpu_to_le32(((u32) sg_dma_len(sg))-1); prd_table[i].base_addr = - cpu_to_le32(sg->dma_address); + cpu_to_le32(lower_32_bits(sg->dma_address)); prd_table[i].upper_addr = - cpu_to_le32((sg->dma_address >> 32)); + cpu_to_le32(upper_32_bits(sg->dma_address)); } } else { lrbp->utr_descriptor_ptr->prd_table_length = 0; @@ -826,9 +826,9 @@ static void ufshcd_host_memory_configure(struct ufs_hba *hba) cmd_desc_element_addr = (cmd_desc_dma_addr + (cmd_desc_size * i)); utrdlp[i].command_desc_base_addr_lo = - cpu_to_le32(cmd_desc_element_addr); + cpu_to_le32(lower_32_bits(cmd_desc_element_addr)); utrdlp[i].command_desc_base_addr_hi = - cpu_to_le32(cmd_desc_element_addr >> 32); + cpu_to_le32(upper_32_bits(cmd_desc_element_addr)); /* Response upiu and prdt offset should be in double words */ utrdlp[i].response_upiu_offset = @@ -1034,11 +1034,11 @@ static int ufshcd_initialize_hba(struct ufs_hba *hba) /* Configure UTRL and UTMRL base address registers */ writel(hba->utrdl_dma_addr, (hba->mmio_base + REG_UTP_TRANSFER_REQ_LIST_BASE_L)); - writel((hba->utrdl_dma_addr >> 32), + writel(lower_32_bits(hba->utrdl_dma_addr), (hba->mmio_base + REG_UTP_TRANSFER_REQ_LIST_BASE_H)); writel(hba->utmrdl_dma_addr, (hba->mmio_base + REG_UTP_TASK_REQ_LIST_BASE_L)); - writel((hba->utmrdl_dma_addr >> 32), + writel(upper_32_bits(hba->utmrdl_dma_addr), (hba->mmio_base + REG_UTP_TASK_REQ_LIST_BASE_H)); /* Initialize unipro link startup procedure */