From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Santosh Y <santoshsy@gmail.com>
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
Subject: Re: [PATCH v3 0/5] [SCSI] ufshcd: UFS Host Controller Driver
Date: Thu, 22 Mar 2012 13:51:51 +0000 [thread overview]
Message-ID: <1332424311.2946.15.camel@dabdike.int.hansenpartnership.com> (raw)
In-Reply-To: <1330497714-26504-1-git-send-email-santoshsy@gmail.com>
On Wed, 2012-02-29 at 12:11 +0530, Santosh Y wrote:
> From: Santosh Yaraganavi <santoshsy@gmail.com>
>
> 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 */
prev parent reply other threads:[~2012-03-22 13:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 6:41 Santosh Y
2012-02-29 6:41 ` [PATCH v3 1/5] [SCSI] ufshcd: UFS Host controller driver Santosh Y
2012-03-26 4:32 ` KOBAYASHI Yoshitake
2012-03-27 4:01 ` Santosh Y
2012-02-29 6:41 ` [PATCH v3 2/5] [SCSI] ufshcd: UFS UTP Transfer requests handling Santosh Y
2012-03-26 4:34 ` KOBAYASHI Yoshitake
2012-03-27 4:03 ` Santosh Y
2012-03-27 5:52 ` Santosh Y
2012-03-29 1:40 ` KOBAYASHI Yoshitake
2012-04-10 11:08 ` Venkatraman S
2012-02-29 6:41 ` [PATCH v3 3/5] [SCSI] ufshcd: UFSHCI error handling Santosh Y
2012-02-29 6:41 ` [PATCH v3 4/5] [SCSI] ufshcd: SCSI " Santosh Y
2012-02-29 6:41 ` [PATCH v3 5/5] Documentation: UFS Host Controller Driver Santosh Y
2012-03-22 13:51 ` James Bottomley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1332424311.2946.15.camel@dabdike.int.hansenpartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=arnd.bergmann@linaro.org \
--cc=dsaxena@linaro.org \
--cc=girish.shivananjappa@linaro.org \
--cc=ilho215.lee@samsung.com \
--cc=k.rajesh@samsung.com \
--cc=linkinjeon@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
--cc=nala.la@samsung.com \
--cc=patches@linaro.org \
--cc=santoshsy@gmail.com \
--cc=saugata.das@linaro.org \
--cc=sreekumar.c@samsung.com \
--cc=stephen.doel@linaro.org \
--cc=venkat@linaro.org \
--cc=vinholikatti@gmail.com \
--cc=vishak.g@samsung.com \
--cc=yejin.moon@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®