Re: [PATCH] dmaengine: DW DMAC: split pdata to hardware properties and platform quirks
On Wed, 2016-10-05 at 15:14 +, Eugeniy Paltsev wrote: > Hi Andy, > what do you think about these changes? I was off for few weeks, will look at this next week. -- Andy Shevchenko Intel Finland Oy ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH] ARCv2: intc: untangle SMP, MCIP and IDU
Hi Vineet, On Thu, 2016-10-06 at 10:10 -0700, Vineet Gupta wrote: > On 10/06/2016 02:10 AM, Alexey Brodkin wrote: > > > > > > > > +struct mcip_bcr { > > > +#ifdef CONFIG_CPU_BIG_ENDIAN > > > + unsigned int pad3:8, > > > + idu:1, llm:1, num_cores:6, > > > + iocoh:1, gfrc:1, dbg:1, pad2:1, > > > + msg:1, sem:1, ipi:1, pad:1, > > > + ver:8; > > > +#else > > > + unsigned int ver:8, > > > + pad:1, ipi:1, sem:1, msg:1, > > > + pad2:1, dbg:1, gfrc:1, iocoh:1, > > > + num_cores:6, llm:1, idu:1, > > > + pad3:8; > > > +#endif > > > +}; > > > > IMHO we should stop using this kind of constructions because they > > are ugly and what's more important not portable. > > They are ugly I agree - but not portable - really ? The whole point is to make > this work on BE w/o changing the src code - this details remains hidden in an > obscure header. That's what I learned the hard way. At least I was beaten a couple of times yet in both Linux kernel community and U-Boot one. > > Even though we have it now working for both LE and BE configurations > > it won't work for 64-bit cores. We'll need to add ifdeffed 32-bit paddings > > then which will make that construction even more ugly. > > When we get to 64-bit a lot things would have to change - and possibly the > aux reg > layout. There is no way to make this exact code 64-bit ready ! Probably but as of now I believe use of offsets for bit-fields is the safest approach which makes code ugly as well but at least that way we reduce risk of erroneous copy-paste in "mirrored" part. -Alexey ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
[PATCH 2/2] ARC: nptl: cancellable wrappers were broken #2
Despite the prev fix, tst-mqueue3 was still segfaulting. The issue was BLINK register not restored properly for return 2690 : 2690: sub r9,r25,0x448 2698: ld r10,[r9] 269c: cmp r10,0 26a0: beq -36 26a4: st.aw blink,[sp,-4] 26a8: st.aw r0,[sp,-4] 26ac: st.aw r1,[sp,-4] 26b0: st.aw r2,[sp,-4] 26b4: st.aw r3,[sp,-4] 26b8: st.aw r4,[sp,-4] 26bc: bl 1e28 <__librt_enable_asynccancel> 26c0: mov r9,r0 26c4: ld.ab r4,[sp,4] 26c8: ld.ab r3,[sp,4] 26cc: ld.ab r2,[sp,4] 26d0: ld.ab r1,[sp,4] 26d4: ld.ab r0,[sp,4] 26d8: ld.ab blink,[sp, 4] < function return BLINK 26dc: mov r8,182 26e0: trap_s 0 26e2: cmp r0,-1024 26e6: st.aw r0,[sp,-4] 26ea: mov r0,r9 26ee: bl 1e90 <__librt_disable_asynccancel> <-- BLINK clobbered to next PC 26f2: ld.ab r0,[sp,4] <| loops here until sp is out of bound 26fa: cmp r0,-1024| 26fe: jls [blink]-| 2702: b 15d8 2706: nop_s So the fix was to retain BLINK on stack before function call, and pop it later - 26d8: ld.ab blink,[sp, 4] + 26d8: ld blink,[sp] <--- restore BLINK, but retain on stack 26dc: mov r8,182 26e0: trap_s 0 26e2: cmp r0,-1024 26e6: st.aw r0,[sp,-4] 26ea: mov r0,r9 26ee: bl 1e90 <__librt_disable_asynccancel> 26f2: ld.ab r0,[sp,4] + 26f6: ld.ab blink,[sp,4]<--- finally pop BLINK 26fa: cmp r0,-1024 26fe: jls [blink] Reported-by: Eugeniy Paltsev Cc: Alexey Brodkin Signed-off-by: Vineet Gupta --- libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h index 918f61d67548..01fd844d13f7 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h @@ -38,6 +38,7 @@ mov r0, r9 /* prep mask for disable_asynccancel */ ` \ CDISABLE ` \ pop r0 /* get syscall ret value back */ ` \ + pop blink /* UNDOCARGS above left blink on stack */ ` \ cmp r0, -1024 ` \ jls [blink] ` \ b __syscall_error@plt ` \ @@ -75,7 +76,9 @@ .endm #define DOCARGS_0 push blink -#define UNDOCARGS_0pop blink + +/* don't pop blink at this point */ +#define UNDOCARGS_0ld blink, [sp] #define DOCARGS_1 DOCARGS_0` push r0 #define UNDOCARGS_1pop r0`UNDOCARGS_0 -- 2.7.4 ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
[PATCH 1/2] ARC: nptl: cancellable wrappers were broken
This was reported as uClicb test suite failures of tst-mqueue3, tst-mqueue5 The syscall args were getting clobbered, so use scratch regs which are not used for syscall args 2690 : ; SINGLE_THREAD_P 2690: sub r1,r25,0x448 <--- clobers r1, r2 2698: ld r2,[r1] 269c: cmp r2,0 26a0: bz mq_timedsend_nocancel ; DOCARGS (saves syscall args but r1, r2 clobbered already) 26a4: st.aw blink,[sp,-4] 26a8: st.aw r0,[sp,-4] 26ac: st.aw r1,[sp,-4] 26b0: st.aw r2,[sp,-4] 26b4: st.aw r3,[sp,-4] 26b8: st.aw r4,[sp,-4] 26bc: bl 1e28 <__librt_enable_asynccancel> Reported-by: Eugeniy Paltsev Cc: Alexey Brodkin Signed-off-by: Vineet Gupta --- libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h index cddd754a8680..918f61d67548 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arc/sysdep-cancel.h @@ -99,9 +99,9 @@ #define UNDOCARGS_7pop r6`UNDOCARGS_6 # define SINGLE_THREAD_P \ -THREAD_SELF r1 ` \ -ldr2, [r1, MULTIPLE_THREADS_OFFSET]` \ -cmpr2, 0 +THREAD_SELF r9 ` \ +ldr10, [r9, MULTIPLE_THREADS_OFFSET]` \ +cmpr10, 0 /*ld r2, [r1, -TLS_PRE_TCB_SIZE + MULTIPLE_THREADS_OFFSET] */ #else /* !__ASSEMBLER__ */ -- 2.7.4 ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH] ARCv2: intc: untangle SMP, MCIP and IDU
On 10/07/2016 10:31 AM, Alexey Brodkin wrote: >> They are ugly I agree - but not portable - really ? The whole point is to >> make >> > this work on BE w/o changing the src code - this details remains hidden in >> > an >> > obscure header. > That's what I learned the hard way. > At least I was beaten a couple of times yet in both Linux kernel community and > U-Boot > one. Beaten for writing code like above - please point me to those discussions. I'd love to be educated in art of writing portable code ! ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH] ARC: [build] Support gz, lzma compressed uImage
On 10/04/2016 04:34 PM, Daniel Mentz wrote: > Add support for lzma compressed uImage. > > Support for gzip was already available but could not be enabled because > we were missing CONFIG_HAVE_KERNEL_GZIP in arch/arc/Kconfig. > > Signed-off-by: Daniel Mentz > Cc: linux-snps-arc@lists.infradead.org > Cc: Vineet Gupta Applied to for-curr. Thx Daniel -Vineet ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc