linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Peng Ma <peng.ma@nxp.com>
Cc: Wen He <wen.he_1@nxp.com>, Leo Li <leoyang.li@nxp.com>,
	Scott Wood <oss@buserror.net>, Zhang Wei <zw@zh-kernel.org>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH] dmaengine: fsldma: Add 64-bit I/O accessors for powerpc64
Date: Sat, 19 Jan 2019 18:28:41 +0530	[thread overview]
Message-ID: <20190119125841.GE4635@vkoul-mobl> (raw)
In-Reply-To: <VI1PR04MB4431C33B5155312CF7035584EDBB0@VI1PR04MB4431.eurprd04.prod.outlook.com>

On 24-12-18, 05:29, Peng Ma wrote:
> Hi Scott,
> 
> Oh, I did not see the in_XX64/out_XX64 supported only __powerpc64__ just now.
> Thanks for your reminder.

Can you send the formal patch for this...

FWIW, fsl patches were not merged last cycle because of reported
regression...

> 
> #ifdef __powerpc64__
> 
> #ifdef __BIG_ENDIAN__
> DEF_MMIO_OUT_D(out_be64, 64, std);
> DEF_MMIO_IN_D(in_be64, 64, ld);
> 
> /* There is no asm instructions for 64 bits reverse loads and stores */
> static inline u64 in_le64(const volatile u64 __iomem *addr)
> {
>         return swab64(in_be64(addr));
> }
> 
> static inline void out_le64(volatile u64 __iomem *addr, u64 val)
> {
>         out_be64(addr, swab64(val));
> }
> #else
> DEF_MMIO_OUT_D(out_le64, 64, std);
> DEF_MMIO_IN_D(in_le64, 64, ld);
> 
> /* There is no asm instructions for 64 bits reverse loads and stores */
> static inline u64 in_be64(const volatile u64 __iomem *addr)
> {
>         return swab64(in_le64(addr));
> }
> 
> static inline void out_be64(volatile u64 __iomem *addr, u64 val)
> {
>         out_le64(addr, swab64(val));
> }
> 
> #endif
> #endif /* __powerpc64__ */
> 
> Best Regards,
> Peng
> >-----Original Message-----
> >From: Scott Wood <oss@buserror.net>
> >Sent: 2018年12月24日 12:46
> >To: Peng Ma <peng.ma@nxp.com>; Leo Li <leoyang.li@nxp.com>; Zhang Wei
> ><zw@zh-kernel.org>
> >Cc: linuxppc-dev@lists.ozlabs.org; dmaengine@vger.kernel.org; Wen He
> ><wen.he_1@nxp.com>
> >Subject: Re: [PATCH] dmaengine: fsldma: Add 64-bit I/O accessors for
> >powerpc64
> >
> >On Mon, 2018-12-24 at 03:42 +0000, Peng Ma wrote:
> >> Hi Scott,
> >>
> >> You are right, we should support powerpc64, so could I changed it as
> >> fallows:
> >>
> >> diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h index
> >> 88db939..057babf 100644
> >> --- a/drivers/dma/fsldma.h
> >> +++ b/drivers/dma/fsldma.h
> >> @@ -202,35 +202,10 @@ struct fsldma_chan {
> >>  #define fsl_iowrite32(v, p)    out_le32(p, v)
> >>  #define fsl_iowrite32be(v, p)  out_be32(p, v)
> >>
> >> -#ifndef __powerpc64__
> >> -static u64 fsl_ioread64(const u64 __iomem *addr) -{
> >> -       u32 fsl_addr = lower_32_bits(addr);
> >> -       u64 fsl_addr_hi = (u64)in_le32((u32 *)(fsl_addr + 1)) << 32;
> >> -
> >> -       return fsl_addr_hi | in_le32((u32 *)fsl_addr);
> >> -}
> >> -
> >> -static void fsl_iowrite64(u64 val, u64 __iomem *addr) -{
> >> -       out_le32((u32 __iomem *)addr + 1, val >> 32);
> >> -       out_le32((u32 __iomem *)addr, (u32)val);
> >> -}
> >> -
> >> -static u64 fsl_ioread64be(const u64 __iomem *addr) -{
> >> -       u32 fsl_addr = lower_32_bits(addr);
> >> -       u64 fsl_addr_hi = (u64)in_be32((u32 *)fsl_addr) << 32;
> >> -
> >> -       return fsl_addr_hi | in_be32((u32 *)(fsl_addr + 1));
> >> -}
> >> -
> >> -static void fsl_iowrite64be(u64 val, u64 __iomem *addr) -{
> >> -       out_be32((u32 __iomem *)addr, val >> 32);
> >> -       out_be32((u32 __iomem *)addr + 1, (u32)val);
> >> -}
> >> -#endif
> >> +#define fsl_ioread64(p)                in_le64(p)
> >> +#define fsl_ioread64be(p)      in_be64(p)
> >> +#define fsl_iowrite64(v, p)    out_le64(p, v)
> >> +#define fsl_iowrite64be(v, p)  out_be64(p, v)
> >>  #endif
> >
> >Then you'll break 32-bit, assuming those fake-it-with-two-32-bit-accesses
> >were actually needed.
> >
> >-Scott
> >
> 

-- 
~Vinod

  reply	other threads:[~2019-01-19 13:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-22  4:34 [PATCH] dmaengine: fsldma: Add 64-bit I/O accessors for powerpc64 Scott Wood
2018-12-24  3:42 ` Peng Ma
2018-12-24  4:45   ` Scott Wood
2018-12-24  5:29     ` Peng Ma
2019-01-19 12:58       ` Vinod Koul [this message]
2019-01-25  5:54         ` Peng Ma
2019-02-04  7:27           ` Vinod Koul
2019-02-11  2:33             ` Peng Ma

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=20190119125841.GE4635@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=oss@buserror.net \
    --cc=peng.ma@nxp.com \
    --cc=wen.he_1@nxp.com \
    --cc=zw@zh-kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).