Re: [PATCH] mmc: dw_mmc: fix timeout calculate method

2019-09-02 Thread Tom Rini
On Mon, Sep 02, 2019 at 12:24:42PM +, Alexey Brodkin wrote:
> Hi Kever,
> 
> > -Original Message-
> > From: Kever Yang 
> > Sent: Monday, September 2, 2019 11:05 AM
> > To: Alexey Brodkin 
> > Cc: tr...@konsulko.com; eugeniy.palt...@synopsys.com; Simon Glass 
> > ; Peng Fan
> > ; u-b...@lists.denx.de
> > Subject: Re: [PATCH] mmc: dw_mmc: fix timeout calculate method
> >
> > Hi Alexey,
> >
> > On 2019/8/30 下午9:28, Alexey Brodkin wrote:
> > > Hi Kever,
> > >
> > > [snip]
> > >
> > >> I think this tree does not including this patch, Peng drop it because of
> > >> this issue,
> > >> so you need to apply this patch in your branch to reproduce the problem.
> > >> I have send out V2 patch for this fix with only using 32bit variable
> > > Could you please refer me to the problematic patch so I may try it?
> >
> > This is the patch with problem, and here is the link on patchwork:
> > https://patchwork.ozlabs.org/patch/1146845/
> 
> Please find my fixes here:
> https://patchwork.ozlabs.org/patch/1156541/
> https://patchwork.ozlabs.org/patch/1156617/
> 
> Tom do we want https://patchwork.ozlabs.org/patch/1146845/ and fixes for it
> (see 2 items above) to become a part of upcoming v2019.10 release or
> it will be slated for the next one?

I think we should aim to get all the fixes in for this release.

-- 
Tom


signature.asc
Description: PGP signature
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 03/26] m68k, microblaze: remove ioremap_fullcache

2019-09-02 Thread Michal Simek
On 17. 08. 19 9:32, Christoph Hellwig wrote:
> No callers of this function.
> 
> Signed-off-by: Christoph Hellwig 
> ---
>  arch/m68k/include/asm/kmap.h | 7 ---
>  arch/microblaze/include/asm/io.h | 1 -
>  2 files changed, 8 deletions(-)
> 
> diff --git a/arch/m68k/include/asm/kmap.h b/arch/m68k/include/asm/kmap.h
> index aac7f045f7f0..03d904fe6087 100644
> --- a/arch/m68k/include/asm/kmap.h
> +++ b/arch/m68k/include/asm/kmap.h
> @@ -43,13 +43,6 @@ static inline void __iomem *ioremap_wt(unsigned long 
> physaddr,
>   return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
>  }
>  
> -#define ioremap_fullcache ioremap_fullcache
> -static inline void __iomem *ioremap_fullcache(unsigned long physaddr,
> -   unsigned long size)
> -{
> - return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
> -}
> -
>  #define memset_io memset_io
>  static inline void memset_io(volatile void __iomem *addr, unsigned char val,
>int count)
> diff --git a/arch/microblaze/include/asm/io.h 
> b/arch/microblaze/include/asm/io.h
> index c7968139486f..86c95b2a1ce1 100644
> --- a/arch/microblaze/include/asm/io.h
> +++ b/arch/microblaze/include/asm/io.h
> @@ -40,7 +40,6 @@ extern void iounmap(volatile void __iomem *addr);
>  
>  extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
>  #define ioremap_nocache(addr, size)  ioremap((addr), (size))
> -#define ioremap_fullcache(addr, size)ioremap((addr), (size))
>  #define ioremap_wc(addr, size)   ioremap((addr), (size))
>  #define ioremap_wt(addr, size)   ioremap((addr), (size))
>  
> 

Acked-by: Michal Simek  (for Microblaze)

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs




signature.asc
Description: OpenPGP digital signature
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


RE: [PATCH] mmc: dw_mmc: fix timeout calculate method

2019-09-02 Thread Alexey Brodkin
Hi Kever,

> -Original Message-
> From: Kever Yang 
> Sent: Monday, September 2, 2019 11:05 AM
> To: Alexey Brodkin 
> Cc: tr...@konsulko.com; eugeniy.palt...@synopsys.com; Simon Glass 
> ; Peng Fan
> ; u-b...@lists.denx.de
> Subject: Re: [PATCH] mmc: dw_mmc: fix timeout calculate method
> 
> Hi Alexey,
> 
> On 2019/8/30 下午9:28, Alexey Brodkin wrote:
> > Hi Kever,
> >
> > [snip]
> >
> >> I think this tree does not including this patch, Peng drop it because of
> >> this issue,
> >> so you need to apply this patch in your branch to reproduce the problem.
> >> I have send out V2 patch for this fix with only using 32bit variable
> > Could you please refer me to the problematic patch so I may try it?
> 
> This is the patch with problem, and here is the link on patchwork:
> https://patchwork.ozlabs.org/patch/1146845/

Please find my fixes here:
https://patchwork.ozlabs.org/patch/1156541/
https://patchwork.ozlabs.org/patch/1156617/

Tom do we want https://patchwork.ozlabs.org/patch/1146845/ and fixes for it
(see 2 items above) to become a part of upcoming v2019.10 release or
it will be slated for the next one?

-Alexey


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH] arc: emsdp: Add more platform-specific compiler options

2019-09-02 Thread Alexey Brodkin
Even though EM SDP is FPGA-based board and different FPGA
images (known as .bit-files) are awailable for the board still
there's a common subset of options we may rely on for all configs.

These are:
 * Normalizer
 * Swap instructions
 * Simple multiplier
 * Barrel-shifter
 * Floating-point unit
 * Shorter instructions (code density)

This among other improvements allows to compile code with
64-bit divisions, see [1].

[1] https://patchwork.ozlabs.org/patch/1156541/

Signed-off-by: Alexey Brodkin 
Cc: Kever Yang 
---
 board/synopsys/emsdp/config.mk | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 board/synopsys/emsdp/config.mk

diff --git a/board/synopsys/emsdp/config.mk b/board/synopsys/emsdp/config.mk
new file mode 100644
index 00..67fd7bf82a
--- /dev/null
+++ b/board/synopsys/emsdp/config.mk
@@ -0,0 +1,2 @@
+PLATFORM_CPPFLAGS += -mlittle-endian -mnorm -mswap -mmpy-option=3 \
+ -mbarrel-shifter -mfpu=fpuda_all -mcode-density
-- 
2.16.2


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


RE: [PATCH] arc: libgcc: Import __udivdi3 & __udivmoddi4 to allow 64-bit division

2019-09-02 Thread Alexey Brodkin
Hi,

> -Original Message-
> From: Alexey Brodkin 
> Sent: Monday, September 2, 2019 12:43 PM
> To: u-b...@lists.denx.de
> Cc: uboot-snps-...@synopsys.com; linux-snps-arc@lists.infradead.org; Alexey 
> Brodkin
> ; Kever Yang 
> Subject: [PATCH] arc: libgcc: Import __udivdi3 & __udivmoddi4 to allow 64-bit 
> division
> 
> As reported by Kever here [1] we were unable to compile 64-bit division
> code due to missing definition of __udivdi3().
> 
> Import its implementation and __udivmoddi4() as its direct dependency
> from today's libgcc [2].
> 
> [1] https://patchwork.ozlabs.org/patch/1146845/
> [2] 
> https://github.com/gcc-mirror/gcc/commit/5d8723600bc0eed41226b5a6785bc02a053b45d5
> 
> Signed-off-by: Alexey Brodkin 
> Cc: Kever Yang 

For the record for EM SDP (emsdp_defconfig) building still
fails this way:
->8-
arc-linux-ld.bfd: arch/arc/lib/lib.a(libgcc2.o): in function `__udivmoddi4':
.../arch/arc/lib/libgcc2.c:195: undefined reference to `__clzdi2'
arc-linux-ld.bfd: .../arch/arc/lib/libgcc2.c:195: undefined reference to 
`__clzdi2'
arc-linux-ld.bfd: .../arch/arc/lib/libgcc2.c:196: undefined reference to 
`__clzdi2'
arc-linux-ld.bfd: .../arch/arc/lib/libgcc2.c:196: undefined reference to 
`__clzdi2'
->8-

That happens because we use a very simple -mcpu=arcem which doesn't use
HW normalizer unit. I'm preparing a patch that will improve EM SDP's compiler
options.

-Alexey

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH] arc: libgcc: Import __udivdi3 & __udivmoddi4 to allow 64-bit division

2019-09-02 Thread Alexey Brodkin
As reported by Kever here [1] we were unable to compile 64-bit division
code due to missing definition of __udivdi3().

Import its implementation and __udivmoddi4() as its direct dependency
from today's libgcc [2].

[1] https://patchwork.ozlabs.org/patch/1146845/
[2] 
https://github.com/gcc-mirror/gcc/commit/5d8723600bc0eed41226b5a6785bc02a053b45d5

Signed-off-by: Alexey Brodkin 
Cc: Kever Yang 
---
 arch/arc/lib/libgcc2.c | 75 ++
 1 file changed, 75 insertions(+)

diff --git a/arch/arc/lib/libgcc2.c b/arch/arc/lib/libgcc2.c
index b92a841a37..ab1dbe1c13 100644
--- a/arch/arc/lib/libgcc2.c
+++ b/arch/arc/lib/libgcc2.c
@@ -158,3 +158,78 @@ __umodsi3(long a, long b)
 {
return udivmodsi4(a, b, 1);
 }
+
+UDWtype
+__udivmoddi4(UDWtype n, UDWtype d, UDWtype *rp)
+{
+   UDWtype q = 0, r = n, y = d;
+   UWtype lz1, lz2, i, k;
+
+   /*
+* Implements align divisor shift dividend method. This algorithm
+* aligns the divisor under the dividend and then perform number of
+* test-subtract iterations which shift the dividend left. Number of
+* iterations is k + 1 where k is the number of bit positions the
+* divisor must be shifted left  to align it under the dividend.
+* quotient bits can be saved in the rightmost positions of the
+* dividend as it shifts left on each test-subtract iteration.
+*/
+
+   if (y <= r) {
+   lz1 = __builtin_clzll(d);
+   lz2 = __builtin_clzll(n);
+
+   k = lz1 - lz2;
+   y = (y << k);
+
+   /*
+* Dividend can exceed 2 ^ (width - 1) - 1 but still be less
+* than the aligned divisor. Normal iteration can drops the
+* high order bit of the dividend. Therefore, first
+* test-subtract iteration is a special case, saving its
+* quotient bit in a separate location and not shifting
+* the dividend.
+*/
+
+   if (r >= y) {
+   r = r - y;
+   q = (1ULL << k);
+   }
+
+   if (k > 0) {
+   y = y >> 1;
+
+   /*
+* k additional iterations where k regular test
+* subtract shift dividend iterations are done.
+*/
+   i = k;
+   do {
+   if (r >= y)
+   r = ((r - y) << 1) + 1;
+   else
+   r = (r << 1);
+   i = i - 1;
+   } while (i != 0);
+
+   /*
+* First quotient bit is combined with the quotient
+* bits resulting from the k regular iterations.
+*/
+   q = q + r;
+   r = r >> k;
+   q = q - (r << k);
+   }
+   }
+
+   if (rp)
+   *rp = r;
+
+   return q;
+}
+
+UDWtype
+__udivdi3(UDWtype n, UDWtype d)
+{
+   return __udivmoddi4(n, d, (UDWtype *)0);
+}
-- 
2.16.2


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 08/26] m68k: simplify ioremap_nocache

2019-09-02 Thread Geert Uytterhoeven
Hi Christoph,

On Fri, Aug 30, 2019 at 6:06 PM Christoph Hellwig  wrote:
> On Mon, Aug 19, 2019 at 10:56:02AM +0200, Geert Uytterhoeven wrote:
> > On Sat, Aug 17, 2019 at 9:48 AM Christoph Hellwig  wrote:
> > > Just define ioremap_nocache to ioremap instead of duplicating the
> > > inline.  Also defined ioremap_uc in terms of ioremap instead of
> > > the using a double indirection.
> > >
> > > Signed-off-by: Christoph Hellwig 
> >
> > Acked-by: Geert Uytterhoeven 
>
> Do you mind picking this up through the m68k tree?

Sure. Applied and queued for v5.4.

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc