Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1216551 > unrolled thread

[PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it

Started byStephen Boyd <sboyd@codeaurora.org>
First post2015-09-01 03:50 +0200
Last post2015-09-01 22:40 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it Stephen Boyd <sboyd@codeaurora.org> - 2015-09-01 03:50 +0200
    Re: [PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of  open-coding it Bjorn Andersson <bjorn.andersson@sonymobile.com> - 2015-09-01 07:10 +0200
      Re: [PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of  open-coding it Stephen Boyd <sboyd@codeaurora.org> - 2015-09-01 20:10 +0200
        Re: [PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of  open-coding it Stephen Boyd <sboyd@codeaurora.org> - 2015-09-01 22:40 +0200

#1216551 — [PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it

FromStephen Boyd <sboyd@codeaurora.org>
Date2015-09-01 03:50 +0200
Subject[PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it
Message-ID<q3IRX-pM-15@gated-at.bofh.it>
We already have a function to do this and it silences some sparse
warnings along the way.

Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/soc/qcom/smd.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/soc/qcom/smd.c b/drivers/soc/qcom/smd.c
index c16547b85e05..91b7f5668962 100644
--- a/drivers/soc/qcom/smd.c
+++ b/drivers/soc/qcom/smd.c
@@ -371,20 +371,15 @@ static void qcom_smd_channel_set_state(struct qcom_smd_channel *channel,
 /*
  * Copy count bytes of data using 32bit accesses, if that's required.
  */
-static void smd_copy_to_fifo(void __iomem *_dst,
-			     const void *_src,
+static void smd_copy_to_fifo(void __iomem *dst,
+			     const void *src,
 			     size_t count,
 			     bool word_aligned)
 {
-	u32 *dst = (u32 *)_dst;
-	u32 *src = (u32 *)_src;
-
 	if (word_aligned) {
-		count /= sizeof(u32);
-		while (count--)
-			writel_relaxed(*src++, dst++);
+		__iowrite32_copy(dst, src, count / sizeof(u32));
 	} else {
-		memcpy_toio(_dst, _src, count);
+		memcpy_toio(dst, src, count);
 	}
 }
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1216593 — Re: [PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it

FromBjorn Andersson <bjorn.andersson@sonymobile.com>
Date2015-09-01 07:10 +0200
SubjectRe: [PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it
Message-ID<q3LZv-59u-9@gated-at.bofh.it>
In reply to#1216551
On Mon 31 Aug 18:39 PDT 2015, Stephen Boyd wrote:

> We already have a function to do this and it silences some sparse
> warnings along the way.
> 

Didn't know that, thanks. Do you know why there's no equivalent for
transfers in the other direction? Should we hack one up to do the same
simplification in smd_copy_from_fifo()?

Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1217007 — Re: [PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it

FromStephen Boyd <sboyd@codeaurora.org>
Date2015-09-01 20:10 +0200
SubjectRe: [PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it
Message-ID<q3Yam-5I4-19@gated-at.bofh.it>
In reply to#1216593
On 08/31, Bjorn Andersson wrote:
> On Mon 31 Aug 18:39 PDT 2015, Stephen Boyd wrote:
> 
> > We already have a function to do this and it silences some sparse
> > warnings along the way.
> > 
> 
> Didn't know that, thanks. Do you know why there's no equivalent for
> transfers in the other direction? Should we hack one up to do the same
> simplification in smd_copy_from_fifo()?

Don't know. We can certainly write one although it would be nice
if we had two users. I'll take a look.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1217072 — Re: [PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it

FromStephen Boyd <sboyd@codeaurora.org>
Date2015-09-01 22:40 +0200
SubjectRe: [PATCH 2/3] soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it
Message-ID<q40vw-uu-21@gated-at.bofh.it>
In reply to#1217007
On 09/01/2015 11:03 AM, Stephen Boyd wrote:
> On 08/31, Bjorn Andersson wrote:
>> On Mon 31 Aug 18:39 PDT 2015, Stephen Boyd wrote:
>>
>>> We already have a function to do this and it silences some sparse
>>> warnings along the way.
>>>
>> Didn't know that, thanks. Do you know why there's no equivalent for
>> transfers in the other direction? Should we hack one up to do the same
>> simplification in smd_copy_from_fifo()?
> Don't know. We can certainly write one although it would be nice
> if we had two users. I'll take a look.
>

Looks like we can convert smd and bcm47xx_nvram over. Also, we need to
add it or move the readl_relaxed() to a __raw_readl() in
smd_copy_from_fifo() because it's doing byte swapping that we don't want.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web