Re: [PATCH V6 10/33] csky: IRQ handling

2018-09-29 Thread Guo Ren
On Thu, Sep 27, 2018 at 08:49:18AM -0700, Christoph Hellwig wrote: > > --- /dev/null > > +++ b/arch/csky/include/asm/irq.h > > @@ -0,0 +1,9 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. > > + > > +#ifndef __ASM_CSKY_IRQ_H > > +#define

Re: [PATCH V6 13/33] csky: Library functions

2018-09-29 Thread Guo Ren
___constant_swab64(u); > > > +unsigned int notrace __bswapsi2(unsigned int u) > > +{ > > + return (((u) & 0xff00) >> 24) | > > + (((u) & 0x00ff) >> 8) | > > + (((u) & 0xff00) << 8) | > > + (((u) & 0x00ff) << 24); > > +} > > Same here. OK. #include unsigned int notrace __bswapsi2(unsigned int u) { return ___constant_swab32(u); } Thx Guo Ren

Re: [PATCH V6 13/33] csky: Library functions

2018-09-29 Thread Guo Ren
___constant_swab64(u); > > > +unsigned int notrace __bswapsi2(unsigned int u) > > +{ > > + return (((u) & 0xff00) >> 24) | > > + (((u) & 0x00ff) >> 8) | > > + (((u) & 0xff00) << 8) | > > + (((u) & 0x00ff) << 24); > > +} > > Same here. OK. #include unsigned int notrace __bswapsi2(unsigned int u) { return ___constant_swab32(u); } Thx Guo Ren

Re: [PATCH V6 20/33] csky/dma: fix up dma_mapping error

2018-09-29 Thread Guo Ren
On Fri, Sep 28, 2018 at 09:21:16AM -0700, Christoph Hellwig wrote: > On Fri, Sep 28, 2018 at 08:51:17AM +0800, Guo Ren wrote: > > The arch_sync_dma_for_cpu()/arch_sync_dma_for_device() implementation is > > broken for some combinations that end up in a BUG() instead of performing &g

Re: [PATCH V6 20/33] csky/dma: fix up dma_mapping error

2018-09-29 Thread Guo Ren
On Fri, Sep 28, 2018 at 09:21:16AM -0700, Christoph Hellwig wrote: > On Fri, Sep 28, 2018 at 08:51:17AM +0800, Guo Ren wrote: > > The arch_sync_dma_for_cpu()/arch_sync_dma_for_device() implementation is > > broken for some combinations that end up in a BUG() instead of performing &g

Re: [PATCH V6 08/33] csky: Process management and Signal

2018-09-28 Thread Guo Ren
On Thu, Sep 27, 2018 at 09:50:43PM +0200, Eric W. Biederman wrote: > Guo Ren writes: > > > --- /dev/null > > +++ b/arch/csky/abiv2/fpu.c > > +void fpu_fpe(struct pt_regs * regs) > > +{ > > + int sig; > > + unsigned int fesr; > > + si

Re: [PATCH V6 08/33] csky: Process management and Signal

2018-09-28 Thread Guo Ren
On Thu, Sep 27, 2018 at 09:50:43PM +0200, Eric W. Biederman wrote: > Guo Ren writes: > > > --- /dev/null > > +++ b/arch/csky/abiv2/fpu.c > > +void fpu_fpe(struct pt_regs * regs) > > +{ > > + int sig; > > + unsigned int fesr; > > + si

Re: [PATCH V6 10/33] csky: IRQ handling

2018-09-28 Thread Guo Ren
On Thu, Sep 27, 2018 at 08:49:18AM -0700, Christoph Hellwig wrote: > > --- /dev/null > > +++ b/arch/csky/include/asm/irq.h > > @@ -0,0 +1,9 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. > > + > > +#ifndef __ASM_CSKY_IRQ_H > > +#define

Re: [PATCH V6 10/33] csky: IRQ handling

2018-09-28 Thread Guo Ren
On Thu, Sep 27, 2018 at 08:49:18AM -0700, Christoph Hellwig wrote: > > --- /dev/null > > +++ b/arch/csky/include/asm/irq.h > > @@ -0,0 +1,9 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. > > + > > +#ifndef __ASM_CSKY_IRQ_H > > +#define

Re: [PATCH V6 07/33] csky: MMU and page table management

2018-09-28 Thread Guo Ren
ed long vaddr; > > + > > + if (PageHighMem(page)) > > + vaddr = (unsigned long) kmap_atomic(page); > > This isn't going to work as the size might be larger than PAGE_SIZE. Yes, you are right. I must fix it up. Thank you Best Regards Guo Ren

Re: [PATCH V6 07/33] csky: MMU and page table management

2018-09-28 Thread Guo Ren
ed long vaddr; > > + > > + if (PageHighMem(page)) > > + vaddr = (unsigned long) kmap_atomic(page); > > This isn't going to work as the size might be larger than PAGE_SIZE. Yes, you are right. I must fix it up. Thank you Best Regards Guo Ren

Re: [PATCH V5 18/30] dt-bindings: csky CPU Bindings

2018-09-28 Thread Guo Ren
On Fri, Sep 28, 2018 at 06:32:34AM -0500, Rob Herring wrote: > On Thu, Sep 27, 2018 at 8:03 PM Guo Ren wrote: > > > > On Thu, Sep 27, 2018 at 11:43:17AM -0500, Rob Herring wrote: > > > On Tue, Sep 25, 2018 at 07:39:21AM +0800, Guo Ren wrote: > > > > This patc

Re: [PATCH V5 18/30] dt-bindings: csky CPU Bindings

2018-09-28 Thread Guo Ren
On Fri, Sep 28, 2018 at 06:32:34AM -0500, Rob Herring wrote: > On Thu, Sep 27, 2018 at 8:03 PM Guo Ren wrote: > > > > On Thu, Sep 27, 2018 at 11:43:17AM -0500, Rob Herring wrote: > > > On Tue, Sep 25, 2018 at 07:39:21AM +0800, Guo Ren wrote: > > > > This patc

Re: [PATCH V5 23/30] dt-bindings: interrupt-controller: C-SKY SMP intc

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 11:50:44AM -0500, Rob Herring wrote: > On Tue, Sep 25, 2018 at 07:39:26AM +0800, Guo Ren wrote: > > - Dt-bindings doc about C-SKY Multi-processors interrupt controller. > > > > Signed-off-by: Guo Ren > > --- > > .../bindings/interrupt

Re: [PATCH V5 23/30] dt-bindings: interrupt-controller: C-SKY SMP intc

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 11:50:44AM -0500, Rob Herring wrote: > On Tue, Sep 25, 2018 at 07:39:26AM +0800, Guo Ren wrote: > > - Dt-bindings doc about C-SKY Multi-processors interrupt controller. > > > > Signed-off-by: Guo Ren > > --- > > .../bindings/interrupt

Re: [PATCH V5 18/30] dt-bindings: csky CPU Bindings

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 11:43:17AM -0500, Rob Herring wrote: > On Tue, Sep 25, 2018 at 07:39:21AM +0800, Guo Ren wrote: > > This patch adds the documentation to describe that how to add cpu nodes in > > dts for SMP. > > > > Signed-off-by: Guo Ren > > --- >

Re: [PATCH V5 18/30] dt-bindings: csky CPU Bindings

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 11:43:17AM -0500, Rob Herring wrote: > On Tue, Sep 25, 2018 at 07:39:21AM +0800, Guo Ren wrote: > > This patch adds the documentation to describe that how to add cpu nodes in > > dts for SMP. > > > > Signed-off-by: Guo Ren > > --- >

[PATCH V6 32/33] csky: fix flush_cache_range and tlb_start_vma

2018-09-27 Thread Guo Ren
In flush_cache_range(vma, ...) cache_wbinv_range() couldn't deal with vma->mm's asid for cache_flush_line. So we use cache_wbinv_all() first and we'll improve with cache_flush(vma, start, end) in future. For tlb_start_vma, we make it the same as other arch. Signed-off-by: Guo Ren --- arch/c

[PATCH V6 32/33] csky: fix flush_cache_range and tlb_start_vma

2018-09-27 Thread Guo Ren
In flush_cache_range(vma, ...) cache_wbinv_range() couldn't deal with vma->mm's asid for cache_flush_line. So we use cache_wbinv_all() first and we'll improve with cache_flush(vma, start, end) in future. For tlb_start_vma, we make it the same as other arch. Signed-off-by: Guo Ren --- arch/c

[PATCH V6 29/33] dt-bindings: timer: gx6605s SOC timer

2018-09-27 Thread Guo Ren
- Dt-bindings doc for gx6605s SOC's system timer. Signed-off-by: Guo Ren Reviewed-by: Rob Herring --- .../bindings/timer/csky,gx6605s-timer.txt | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky,gx6605s

[PATCH V6 29/33] dt-bindings: timer: gx6605s SOC timer

2018-09-27 Thread Guo Ren
- Dt-bindings doc for gx6605s SOC's system timer. Signed-off-by: Guo Ren Reviewed-by: Rob Herring --- .../bindings/timer/csky,gx6605s-timer.txt | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky,gx6605s

[PATCH V6 31/33] csky: fix compile error in linux/bug.h with SMP enabled

2018-09-27 Thread Guo Ren
, from ./include/linux/rcupdate.h:38, from ./include/linux/init_task.h:5, from init/init_task.c:2: The asm/bitops.h will lose asm/atomic.h for cycle include. Signed-off-by: Guo Ren --- arch/csky/include/asm/cmpxchg.h | 7 --- 1 file changed

[PATCH V6 30/33] clocksource: add gx6605s SOC system timer

2018-09-27 Thread Guo Ren
Changelog: - Add License and Copyright - Use timer-of framework - Change name with upstream feedback - Use clksource_mmio framework Signed-off-by: Guo Ren --- drivers/clocksource/Kconfig | 8 ++ drivers/clocksource/Makefile| 1 + drivers/clocksource/timer-gx6605s.c | 150

[PATCH V6 31/33] csky: fix compile error in linux/bug.h with SMP enabled

2018-09-27 Thread Guo Ren
, from ./include/linux/rcupdate.h:38, from ./include/linux/init_task.h:5, from init/init_task.c:2: The asm/bitops.h will lose asm/atomic.h for cycle include. Signed-off-by: Guo Ren --- arch/csky/include/asm/cmpxchg.h | 7 --- 1 file changed

[PATCH V6 30/33] clocksource: add gx6605s SOC system timer

2018-09-27 Thread Guo Ren
Changelog: - Add License and Copyright - Use timer-of framework - Change name with upstream feedback - Use clksource_mmio framework Signed-off-by: Guo Ren --- drivers/clocksource/Kconfig | 8 ++ drivers/clocksource/Makefile| 1 + drivers/clocksource/timer-gx6605s.c | 150

[PATCH V6 19/33] dt-bindings: Add vendor prefix for csky

2018-09-27 Thread Guo Ren
Add csky vendor definition. Signed-off-by: Guo Ren --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 2c3fc51..a728ee3

[PATCH V6 25/33] dt-bindings: timer: C-SKY Multi-processor timer

2018-09-27 Thread Guo Ren
- Dt-bingdings doc for C-SKY SMP system setting. Signed-off-by: Guo Ren --- .../devicetree/bindings/timer/csky,mptimer.txt | 46 ++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky,mptimer.txt diff --git a/Documentation

[PATCH V6 19/33] dt-bindings: Add vendor prefix for csky

2018-09-27 Thread Guo Ren
Add csky vendor definition. Signed-off-by: Guo Ren --- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 2c3fc51..a728ee3

[PATCH V6 25/33] dt-bindings: timer: C-SKY Multi-processor timer

2018-09-27 Thread Guo Ren
- Dt-bingdings doc for C-SKY SMP system setting. Signed-off-by: Guo Ren --- .../devicetree/bindings/timer/csky,mptimer.txt | 46 ++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/csky,mptimer.txt diff --git a/Documentation

[PATCH V6 33/33] csky: use asm-generic/bitops/atomic.h for all

2018-09-27 Thread Guo Ren
Specific implementation do not improve the performance, fall back to asm-generic/bitops/atomic.h. Signed-off-by: Guo Ren --- arch/csky/include/asm/bitops.h | 201 - 1 file changed, 201 deletions(-) diff --git a/arch/csky/include/asm/bitops.h b/arch/csky

[PATCH V6 24/33] clocksource: add C-SKY SMP timer

2018-09-27 Thread Guo Ren
. - Coding convention with upstream feed-back. Signed-off-by: Guo Ren --- drivers/clocksource/Kconfig| 8 ++ drivers/clocksource/Makefile | 1 + drivers/clocksource/csky_mptimer.c | 176 + include/linux/cpuhotplug.h | 1 + 4 files changed

[PATCH V6 23/33] dt-bindings: interrupt-controller: C-SKY SMP intc

2018-09-27 Thread Guo Ren
- Dt-bindings doc about C-SKY Multi-processors interrupt controller. Signed-off-by: Guo Ren --- .../bindings/interrupt-controller/csky,mpintc.txt | 40 ++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/csky

[PATCH V6 21/33] csky: remove irq_mapping from smp.c

2018-09-27 Thread Guo Ren
g return value not directly use IPI_IRQ. The modification also involves csky_mpintc. Signed-off-by: Guo Ren --- arch/csky/include/asm/smp.h | 4 +++- arch/csky/kernel/smp.c | 27 +++ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/arch/csky/inclu

[PATCH V6 27/33] dt-bindings: interrupt-controller: C-SKY APB intc

2018-09-27 Thread Guo Ren
- Dt-bindings doc about C-SKY apb bus interrupt controller. Signed-off-by: Guo Ren --- .../interrupt-controller/csky,apb-intc.txt | 62 ++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/csky,apb-intc.txt

[PATCH V6 33/33] csky: use asm-generic/bitops/atomic.h for all

2018-09-27 Thread Guo Ren
Specific implementation do not improve the performance, fall back to asm-generic/bitops/atomic.h. Signed-off-by: Guo Ren --- arch/csky/include/asm/bitops.h | 201 - 1 file changed, 201 deletions(-) diff --git a/arch/csky/include/asm/bitops.h b/arch/csky

[PATCH V6 24/33] clocksource: add C-SKY SMP timer

2018-09-27 Thread Guo Ren
. - Coding convention with upstream feed-back. Signed-off-by: Guo Ren --- drivers/clocksource/Kconfig| 8 ++ drivers/clocksource/Makefile | 1 + drivers/clocksource/csky_mptimer.c | 176 + include/linux/cpuhotplug.h | 1 + 4 files changed

[PATCH V6 23/33] dt-bindings: interrupt-controller: C-SKY SMP intc

2018-09-27 Thread Guo Ren
- Dt-bindings doc about C-SKY Multi-processors interrupt controller. Signed-off-by: Guo Ren --- .../bindings/interrupt-controller/csky,mpintc.txt | 40 ++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/csky

[PATCH V6 21/33] csky: remove irq_mapping from smp.c

2018-09-27 Thread Guo Ren
g return value not directly use IPI_IRQ. The modification also involves csky_mpintc. Signed-off-by: Guo Ren --- arch/csky/include/asm/smp.h | 4 +++- arch/csky/kernel/smp.c | 27 +++ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/arch/csky/inclu

[PATCH V6 27/33] dt-bindings: interrupt-controller: C-SKY APB intc

2018-09-27 Thread Guo Ren
- Dt-bindings doc about C-SKY apb bus interrupt controller. Signed-off-by: Guo Ren --- .../interrupt-controller/csky,apb-intc.txt | 62 ++ 1 file changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/csky,apb-intc.txt

[PATCH V6 26/33] MAINTAINERS: Add csky

2018-09-27 Thread Guo Ren
Add a maintainer information for the csky(C-SKY) architecture. Signed-off-by: Guo Ren --- MAINTAINERS | 16 1 file changed, 16 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d870cb5..6b7c1be 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3211,6 +3211,22 @@ T

[PATCH V6 18/33] dt-bindings: csky CPU Bindings

2018-09-27 Thread Guo Ren
This patch adds the documentation to describe that how to add cpu nodes in dts for SMP. Signed-off-by: Guo Ren --- Documentation/devicetree/bindings/csky/cpus.txt | 70 + 1 file changed, 70 insertions(+) create mode 100644 Documentation/devicetree/bindings/csky/cpus.txt

[PATCH V6 20/33] csky/dma: fix up dma_mapping error

2018-09-27 Thread Guo Ren
TO_DEV writeback nonewriteback none TO_CPU invalidate invalidate* invalidate invalidate* BIDIR writeback invalidate writeback invalidate Link: https://lore.kernel.org/lkml/20180518215548.gh17...@n2100.armlinux.org.uk/ Signed-off-by: Guo

[PATCH V6 22/33] irqchip: add C-SKY SMP interrupt controller

2018-09-27 Thread Guo Ren
irq map, reserve soft_irq & private_irq space - Add License and Copyright - Support set_affinity for irq balance in SMP Signed-off-by: Guo Ren --- drivers/irqchip/Kconfig | 8 ++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-csky-mpintc.c |

[PATCH V6 28/33] irqchip: add C-SKY APB bus interrupt controller

2018-09-27 Thread Guo Ren
rq-pending - remove CSKY_VECIRQ_LEGENCY - change to generic irq chip framework - add License and Copyright - use irq_domain_add_linear instead of leagcy Signed-off-by: Guo Ren --- drivers/irqchip/Kconfig | 8 ++ drivers/irqchip/Makefile| 1 + drivers/irqchip/irq-c

[PATCH V6 26/33] MAINTAINERS: Add csky

2018-09-27 Thread Guo Ren
Add a maintainer information for the csky(C-SKY) architecture. Signed-off-by: Guo Ren --- MAINTAINERS | 16 1 file changed, 16 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d870cb5..6b7c1be 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3211,6 +3211,22 @@ T

[PATCH V6 18/33] dt-bindings: csky CPU Bindings

2018-09-27 Thread Guo Ren
This patch adds the documentation to describe that how to add cpu nodes in dts for SMP. Signed-off-by: Guo Ren --- Documentation/devicetree/bindings/csky/cpus.txt | 70 + 1 file changed, 70 insertions(+) create mode 100644 Documentation/devicetree/bindings/csky/cpus.txt

[PATCH V6 20/33] csky/dma: fix up dma_mapping error

2018-09-27 Thread Guo Ren
TO_DEV writeback nonewriteback none TO_CPU invalidate invalidate* invalidate invalidate* BIDIR writeback invalidate writeback invalidate Link: https://lore.kernel.org/lkml/20180518215548.gh17...@n2100.armlinux.org.uk/ Signed-off-by: Guo

[PATCH V6 22/33] irqchip: add C-SKY SMP interrupt controller

2018-09-27 Thread Guo Ren
irq map, reserve soft_irq & private_irq space - Add License and Copyright - Support set_affinity for irq balance in SMP Signed-off-by: Guo Ren --- drivers/irqchip/Kconfig | 8 ++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-csky-mpintc.c |

[PATCH V6 28/33] irqchip: add C-SKY APB bus interrupt controller

2018-09-27 Thread Guo Ren
rq-pending - remove CSKY_VECIRQ_LEGENCY - change to generic irq chip framework - add License and Copyright - use irq_domain_add_linear instead of leagcy Signed-off-by: Guo Ren --- drivers/irqchip/Kconfig | 8 ++ drivers/irqchip/Makefile| 1 + drivers/irqchip/irq-c

[PATCH V6 16/33] csky: SMP support

2018-09-27 Thread Guo Ren
This patch adds boot, ipi, hotplug code for SMP. Signed-off-by: Guo Ren --- arch/csky/include/asm/smp.h | 26 + arch/csky/kernel/smp.c | 234 2 files changed, 260 insertions(+) create mode 100644 arch/csky/include/asm/smp.h create mode

[PATCH V6 17/33] csky: Misc headers

2018-09-27 Thread Guo Ren
This patch adds csky register definition, byteorder, asm-offsets codes. Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/reg_ops.h | 27 arch/csky/abiv1/inc/abi/regdef.h | 26 +++ arch/csky/abiv2/inc/abi/reg_ops.h | 17 ++ arch/csky/abiv2/inc/abi/regdef.h | 26

[PATCH V6 16/33] csky: SMP support

2018-09-27 Thread Guo Ren
This patch adds boot, ipi, hotplug code for SMP. Signed-off-by: Guo Ren --- arch/csky/include/asm/smp.h | 26 + arch/csky/kernel/smp.c | 234 2 files changed, 260 insertions(+) create mode 100644 arch/csky/include/asm/smp.h create mode

[PATCH V6 17/33] csky: Misc headers

2018-09-27 Thread Guo Ren
This patch adds csky register definition, byteorder, asm-offsets codes. Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/reg_ops.h | 27 arch/csky/abiv1/inc/abi/regdef.h | 26 +++ arch/csky/abiv2/inc/abi/reg_ops.h | 17 ++ arch/csky/abiv2/inc/abi/regdef.h | 26

[PATCH V6 14/33] csky: User access

2018-09-27 Thread Guo Ren
This patch adds "user access from kernel" codes. Signed-off-by: Guo Ren --- arch/csky/include/asm/uaccess.h | 399 arch/csky/lib/usercopy.c| 271 +++ 2 files changed, 670 insertions(+) create mode 100644 arch/cs

[PATCH V6 10/33] csky: IRQ handling

2018-09-27 Thread Guo Ren
This patch adds IRQ handling files. Signed-off-by: Guo Ren --- arch/csky/include/asm/irq.h | 9 arch/csky/include/asm/irqflags.h | 50 arch/csky/kernel/irq.c | 22 ++ 3 files changed, 81 insertions(+) create mode

[PATCH V6 14/33] csky: User access

2018-09-27 Thread Guo Ren
This patch adds "user access from kernel" codes. Signed-off-by: Guo Ren --- arch/csky/include/asm/uaccess.h | 399 arch/csky/lib/usercopy.c| 271 +++ 2 files changed, 670 insertions(+) create mode 100644 arch/cs

[PATCH V6 10/33] csky: IRQ handling

2018-09-27 Thread Guo Ren
This patch adds IRQ handling files. Signed-off-by: Guo Ren --- arch/csky/include/asm/irq.h | 9 arch/csky/include/asm/irqflags.h | 50 arch/csky/kernel/irq.c | 22 ++ 3 files changed, 81 insertions(+) create mode

[PATCH V6 13/33] csky: Library functions

2018-09-27 Thread Guo Ren
This patch adds string optimize codes and some auxiliary code. Signed-off-by: Chen Linfei Signed-off-by: Mao Han Signed-off-by: Guo Ren --- arch/csky/abiv1/bswapdi.c| 19 +++ arch/csky/abiv1/bswapsi.c| 15 ++ arch/csky/abiv1/inc/abi/string.h | 13 ++ arch/csky/abiv1

[PATCH V6 13/33] csky: Library functions

2018-09-27 Thread Guo Ren
This patch adds string optimize codes and some auxiliary code. Signed-off-by: Chen Linfei Signed-off-by: Mao Han Signed-off-by: Guo Ren --- arch/csky/abiv1/bswapdi.c| 19 +++ arch/csky/abiv1/bswapsi.c| 15 ++ arch/csky/abiv1/inc/abi/string.h | 13 ++ arch/csky/abiv1

[PATCH V6 11/33] csky: Atomic operations

2018-09-27 Thread Guo Ren
This patch adds atomic, cmpxchg, spinlock files. - SMP supported - ticklock supported - queue-rwlock supported Signed-off-by: Guo Ren --- arch/csky/include/asm/atomic.h | 213 ++ arch/csky/include/asm/cmpxchg.h| 70 + arch/csky/include/asm

[PATCH V6 12/33] csky: ELF and module probe

2018-09-27 Thread Guo Ren
This patch adds ELF definition and module relocate codes. Signed-off-by: Guo Ren --- arch/csky/include/asm/elf.h | 150 arch/csky/kernel/module.c | 83 2 files changed, 233 insertions(+) create mode 100644 arch/csky

[PATCH V6 15/33] csky: Debug and Ptrace GDB

2018-09-27 Thread Guo Ren
This patch adds arch ptrace implementation, stack dump and bug.h. Signed-off-by: Guo Ren --- arch/csky/include/asm/bug.h | 26 +++ arch/csky/include/uapi/asm/ptrace.h | 104 arch/csky/kernel/dumpstack.c| 65 arch/csky/kernel/ptrace.c | 318

[PATCH V6 11/33] csky: Atomic operations

2018-09-27 Thread Guo Ren
This patch adds atomic, cmpxchg, spinlock files. - SMP supported - ticklock supported - queue-rwlock supported Signed-off-by: Guo Ren --- arch/csky/include/asm/atomic.h | 213 ++ arch/csky/include/asm/cmpxchg.h| 70 + arch/csky/include/asm

[PATCH V6 12/33] csky: ELF and module probe

2018-09-27 Thread Guo Ren
This patch adds ELF definition and module relocate codes. Signed-off-by: Guo Ren --- arch/csky/include/asm/elf.h | 150 arch/csky/kernel/module.c | 83 2 files changed, 233 insertions(+) create mode 100644 arch/csky

[PATCH V6 15/33] csky: Debug and Ptrace GDB

2018-09-27 Thread Guo Ren
This patch adds arch ptrace implementation, stack dump and bug.h. Signed-off-by: Guo Ren --- arch/csky/include/asm/bug.h | 26 +++ arch/csky/include/uapi/asm/ptrace.h | 104 arch/csky/kernel/dumpstack.c| 65 arch/csky/kernel/ptrace.c | 318

[PATCH V6 04/33] csky: Exception handling and mm-fault

2018-09-27 Thread Guo Ren
This patch adds exception handling code, cpuinfo and mm-fault code. Signed-off-by: Guo Ren --- arch/csky/abiv1/alignment.c | 332 + arch/csky/abiv1/inc/abi/entry.h | 160 arch/csky/abiv2/inc/abi/entry.h | 157 arch/csky

[PATCH V6 04/33] csky: Exception handling and mm-fault

2018-09-27 Thread Guo Ren
This patch adds exception handling code, cpuinfo and mm-fault code. Signed-off-by: Guo Ren --- arch/csky/abiv1/alignment.c | 332 + arch/csky/abiv1/inc/abi/entry.h | 160 arch/csky/abiv2/inc/abi/entry.h | 157 arch/csky

[PATCH V6 07/33] csky: MMU and page table management

2018-09-27 Thread Guo Ren
(1GB) - abiv1 CPU (CK610) is VIPT cache and it doesn't support highmem. - abiv2 CPUs are all PIPT cache and they could support highmem. Lowmem is directly mapped by msa0 & msa1 reg, and we needn't setup memory page table for it. Signed-off-by: Guo Ren --- arch/csky/abiv1/inc

[PATCH V6 09/33] csky: VDSO and rt_sigreturn

2018-09-27 Thread Guo Ren
This patch adds files related to VDSO and our VDSO only support rt_sigreturn. Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/vdso.h | 18 + arch/csky/abiv2/inc/abi/vdso.h | 24 arch/csky/include/asm/vdso.h | 13 +++ arch/csky/kernel/vdso.c| 85

[PATCH V6 07/33] csky: MMU and page table management

2018-09-27 Thread Guo Ren
(1GB) - abiv1 CPU (CK610) is VIPT cache and it doesn't support highmem. - abiv2 CPUs are all PIPT cache and they could support highmem. Lowmem is directly mapped by msa0 & msa1 reg, and we needn't setup memory page table for it. Signed-off-by: Guo Ren --- arch/csky/abiv1/inc

[PATCH V6 09/33] csky: VDSO and rt_sigreturn

2018-09-27 Thread Guo Ren
This patch adds files related to VDSO and our VDSO only support rt_sigreturn. Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/vdso.h | 18 + arch/csky/abiv2/inc/abi/vdso.h | 24 arch/csky/include/asm/vdso.h | 13 +++ arch/csky/kernel/vdso.c| 85

[PATCH V6 05/33] csky: System Call

2018-09-27 Thread Guo Ren
This patch adds files related to syscall. Signed-off-by: Guo Ren --- arch/csky/include/asm/syscall.h | 69 + arch/csky/include/asm/syscalls.h| 15 arch/csky/include/uapi/asm/unistd.h | 10 ++ arch/csky/kernel/syscall.c | 42

[PATCH V6 05/33] csky: System Call

2018-09-27 Thread Guo Ren
This patch adds files related to syscall. Signed-off-by: Guo Ren --- arch/csky/include/asm/syscall.h | 69 + arch/csky/include/asm/syscalls.h| 15 arch/csky/include/uapi/asm/unistd.h | 10 ++ arch/csky/kernel/syscall.c | 42

[PATCH V6 08/33] csky: Process management and Signal

2018-09-27 Thread Guo Ren
This patch adds files related to task_switch, sigcontext, signal. Signed-off-by: Guo Ren --- arch/csky/abiv2/fpu.c | 281 + arch/csky/abiv2/inc/abi/fpu.h | 66 ++ arch/csky/include/asm/mmu_context.h | 149 ++ arch/csky

[PATCH V6 08/33] csky: Process management and Signal

2018-09-27 Thread Guo Ren
This patch adds files related to task_switch, sigcontext, signal. Signed-off-by: Guo Ren --- arch/csky/abiv2/fpu.c | 281 + arch/csky/abiv2/inc/abi/fpu.h | 66 ++ arch/csky/include/asm/mmu_context.h | 149 ++ arch/csky

[PATCH V6 03/33] csky: Kernel booting

2018-09-27 Thread Guo Ren
This patch add boot code. Thx boot params is all in dtb and it's the only way to let kernel get bootloader param information. Signed-off-by: Guo Ren --- arch/csky/kernel/head.S| 78 + arch/csky/kernel/setup.c | 151

[PATCH V6 06/33] csky: Cache and TLB routines

2018-09-27 Thread Guo Ren
This patch adds cache and tlb sync codes for abiv1 & abiv2. Signed-off-by: Guo Ren --- arch/csky/abiv1/cacheflush.c | 51 arch/csky/abiv1/inc/abi/cacheflush.h | 43 +++ arch/csky/abiv1/inc/abi/tlb.h | 12 ++ arch/csky/abiv2/cacheflush.c |

[PATCH V6 03/33] csky: Kernel booting

2018-09-27 Thread Guo Ren
This patch add boot code. Thx boot params is all in dtb and it's the only way to let kernel get bootloader param information. Signed-off-by: Guo Ren --- arch/csky/kernel/head.S| 78 + arch/csky/kernel/setup.c | 151

[PATCH V6 06/33] csky: Cache and TLB routines

2018-09-27 Thread Guo Ren
This patch adds cache and tlb sync codes for abiv1 & abiv2. Signed-off-by: Guo Ren --- arch/csky/abiv1/cacheflush.c | 51 arch/csky/abiv1/inc/abi/cacheflush.h | 43 +++ arch/csky/abiv1/inc/abi/tlb.h | 12 ++ arch/csky/abiv2/cacheflush.c |

[PATCH V6 00/33] C-SKY(csky) Linux Kernel Port

2018-09-27 Thread Guo Ren
g select. 590c7e6 csky: bugfix compile error with CONFIG_AUDIT 1989292 csky: revert some back with cleanup unistd.h f1454fe csky: cleanup unistd.h 5d2985f csky: cleanup Kconfig and Makefile. 423d97e csky: cancel subdirectories cae2af4 csky: use asm-generic/fcntl.h Guo Ren (33): csky: Build i

[PATCH V6 00/33] C-SKY(csky) Linux Kernel Port

2018-09-27 Thread Guo Ren
g select. 590c7e6 csky: bugfix compile error with CONFIG_AUDIT 1989292 csky: revert some back with cleanup unistd.h f1454fe csky: cleanup unistd.h 5d2985f csky: cleanup Kconfig and Makefile. 423d97e csky: cancel subdirectories cae2af4 csky: use asm-generic/fcntl.h Guo Ren (33): csky: Build i

[PATCH V6 01/33] csky: Build infrastructure

2018-09-27 Thread Guo Ren
This patch adds Makefile, Kconfig for build infrastructure. Signed-off-by: Guo Ren --- arch/csky/Kconfig | 204 + arch/csky/Kconfig.debug| 8 ++ arch/csky/Makefile | 92 +++ arch/csky/abiv1

[PATCH V6 01/33] csky: Build infrastructure

2018-09-27 Thread Guo Ren
This patch adds Makefile, Kconfig for build infrastructure. Signed-off-by: Guo Ren --- arch/csky/Kconfig | 204 + arch/csky/Kconfig.debug| 8 ++ arch/csky/Makefile | 92 +++ arch/csky/abiv1

[PATCH V6 02/33] csky: defconfig

2018-09-27 Thread Guo Ren
This patch adds csky defconfig. Signed-off-by: Guo Ren --- arch/csky/configs/defconfig | 61 + 1 file changed, 61 insertions(+) create mode 100644 arch/csky/configs/defconfig diff --git a/arch/csky/configs/defconfig b/arch/csky/configs/defconfig new

[PATCH V6 02/33] csky: defconfig

2018-09-27 Thread Guo Ren
This patch adds csky defconfig. Signed-off-by: Guo Ren --- arch/csky/configs/defconfig | 61 + 1 file changed, 61 insertions(+) create mode 100644 arch/csky/configs/defconfig diff --git a/arch/csky/configs/defconfig b/arch/csky/configs/defconfig new

Re: [PATCH] csky: fixups after bootmem removal

2018-09-27 Thread Guo Ren
=bc3ec75de5452db59b683487867ba562b950708a Thx! Guo Ren On Wed, Sep 26, 2018 at 02:27:45PM +0300, Mike Rapoport wrote: > Hi, > > The below patch fixes the bootmem leftovers in csky. It is based on the > current mmots and csky build there fails because of undefined reference to > dma_direct_ops: > > MODPO

Re: [PATCH] csky: fixups after bootmem removal

2018-09-27 Thread Guo Ren
=bc3ec75de5452db59b683487867ba562b950708a Thx! Guo Ren On Wed, Sep 26, 2018 at 02:27:45PM +0300, Mike Rapoport wrote: > Hi, > > The below patch fixes the bootmem leftovers in csky. It is based on the > current mmots and csky build there fails because of undefined reference to > dma_direct_ops: > > MODPO

Re: [PATCH V5 06/30] csky: Cache and TLB routines

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 11:01:34AM +0200, Peter Zijlstra wrote: > On Thu, Sep 27, 2018 at 04:11:42PM +0800, Guo Ren wrote: > > On Thu, Sep 27, 2018 at 09:08:59AM +0200, Peter Zijlstra wrote: > > > > That's not what I meant; I meant you need something like: > > > &

Re: [PATCH V5 06/30] csky: Cache and TLB routines

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 11:01:34AM +0200, Peter Zijlstra wrote: > On Thu, Sep 27, 2018 at 04:11:42PM +0800, Guo Ren wrote: > > On Thu, Sep 27, 2018 at 09:08:59AM +0200, Peter Zijlstra wrote: > > > > That's not what I meant; I meant you need something like: > > > &

Re: [PATCH V5 06/30] csky: Cache and TLB routines

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 09:08:59AM +0200, Peter Zijlstra wrote: > On Thu, Sep 27, 2018 at 01:27:38PM +0800, Guo Ren wrote: > > On Tue, Sep 25, 2018 at 09:24:07AM +0200, Peter Zijlstra wrote: > > > On Mon, Sep 24, 2018 at 10:36:22PM +0800, Guo Ren wrote: > > > > diff -

Re: [PATCH V5 06/30] csky: Cache and TLB routines

2018-09-27 Thread Guo Ren
On Thu, Sep 27, 2018 at 09:08:59AM +0200, Peter Zijlstra wrote: > On Thu, Sep 27, 2018 at 01:27:38PM +0800, Guo Ren wrote: > > On Tue, Sep 25, 2018 at 09:24:07AM +0200, Peter Zijlstra wrote: > > > On Mon, Sep 24, 2018 at 10:36:22PM +0800, Guo Ren wrote: > > > > diff -

Re: [PATCH V5 06/30] csky: Cache and TLB routines

2018-09-26 Thread Guo Ren
On Tue, Sep 25, 2018 at 09:24:07AM +0200, Peter Zijlstra wrote: > On Mon, Sep 24, 2018 at 10:36:22PM +0800, Guo Ren wrote: > > diff --git a/arch/csky/abiv1/inc/abi/cacheflush.h > > b/arch/csky/abiv1/inc/abi/cacheflush.h > > new file mode 100644 > > index 000

Re: [PATCH V5 06/30] csky: Cache and TLB routines

2018-09-26 Thread Guo Ren
On Tue, Sep 25, 2018 at 09:24:07AM +0200, Peter Zijlstra wrote: > On Mon, Sep 24, 2018 at 10:36:22PM +0800, Guo Ren wrote: > > diff --git a/arch/csky/abiv1/inc/abi/cacheflush.h > > b/arch/csky/abiv1/inc/abi/cacheflush.h > > new file mode 100644 > > index 000

Re: [PATCH V5 17/30] csky: Misc headers

2018-09-26 Thread Guo Ren
inline void change_bit(int nr, volatile unsigned long *addr) > > > +{ > > > + unsigned long mask = BIT_MASK(nr); > > > + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); > > > + unsigned long tmp; > > > + > > > + /* *p ^= mask; */ > > > + smp_mb(); > > > + asm volatile ( > > > + "1: ldex.w %0, (%2)\n" > > > + " xor32 %0, %0, %1 \n" > > > + " stex.w %0, (%2)\n" > > > + " bez %0, 1b \n" > > > + : "="(tmp) > > > + : "r"(mask), "r"(p) > > > + : "memory"); > > > + smp_mb(); > > > +} > > > > The {set,clear,change}_bit() operations don't have to be ordered: you > > might want to remove the above smp_mb()s (and adjust the comments). I confused it with cmpxchg, seems cmpxchg need smp_mb() before See: https://lkml.org/lkml/2018/7/6/383 > Better yet, you can entirely delete all that and use > asm-generic/bitops/atomic.h instead. Yes, approve. Seems I only need care about asm/atomic.h, it's good for me. Best Regards Guo Ren

Re: [PATCH V5 17/30] csky: Misc headers

2018-09-26 Thread Guo Ren
inline void change_bit(int nr, volatile unsigned long *addr) > > > +{ > > > + unsigned long mask = BIT_MASK(nr); > > > + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); > > > + unsigned long tmp; > > > + > > > + /* *p ^= mask; */ > > > + smp_mb(); > > > + asm volatile ( > > > + "1: ldex.w %0, (%2)\n" > > > + " xor32 %0, %0, %1 \n" > > > + " stex.w %0, (%2)\n" > > > + " bez %0, 1b \n" > > > + : "="(tmp) > > > + : "r"(mask), "r"(p) > > > + : "memory"); > > > + smp_mb(); > > > +} > > > > The {set,clear,change}_bit() operations don't have to be ordered: you > > might want to remove the above smp_mb()s (and adjust the comments). I confused it with cmpxchg, seems cmpxchg need smp_mb() before See: https://lkml.org/lkml/2018/7/6/383 > Better yet, you can entirely delete all that and use > asm-generic/bitops/atomic.h instead. Yes, approve. Seems I only need care about asm/atomic.h, it's good for me. Best Regards Guo Ren

Re: [PATCH] csky: fixups after bootmem removal

2018-09-26 Thread Guo Ren
fd2791b..46c5aaa 100644 > --- a/arch/csky/mm/init.c > +++ b/arch/csky/mm/init.c > @@ -14,7 +14,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -44,7 +43,7 @@ void __init mem_init(void) > #endif > high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); > > - free_all_bootmem(); > + memblock_free_all(); > > #ifdef CONFIG_HIGHMEM > for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) { The patch looks good for me. Thx Guo Ren

Re: [PATCH] csky: fixups after bootmem removal

2018-09-26 Thread Guo Ren
fd2791b..46c5aaa 100644 > --- a/arch/csky/mm/init.c > +++ b/arch/csky/mm/init.c > @@ -14,7 +14,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -44,7 +43,7 @@ void __init mem_init(void) > #endif > high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); > > - free_all_bootmem(); > + memblock_free_all(); > > #ifdef CONFIG_HIGHMEM > for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) { The patch looks good for me. Thx Guo Ren

Re: [PATCH V7 1/2] csky/dma: bugfix dma_sync_for_cpu/device

2018-09-25 Thread Guo Ren
On Tue, Sep 25, 2018 at 11:59:48AM +0200, Arnd Bergmann wrote: > On Tue, Sep 25, 2018 at 11:46 AM Guo Ren wrote: > > > > On Mon, Sep 24, 2018 at 10:38:04PM +0200, Arnd Bergmann wrote: > > > On Tue, Sep 18, 2018 at 3:48 PM Guo Ren wrote: > > > > > > >

Re: [PATCH V7 1/2] csky/dma: bugfix dma_sync_for_cpu/device

2018-09-25 Thread Guo Ren
On Tue, Sep 25, 2018 at 11:59:48AM +0200, Arnd Bergmann wrote: > On Tue, Sep 25, 2018 at 11:46 AM Guo Ren wrote: > > > > On Mon, Sep 24, 2018 at 10:38:04PM +0200, Arnd Bergmann wrote: > > > On Tue, Sep 18, 2018 at 3:48 PM Guo Ren wrote: > > > > > > >

Re: [PATCH V7 1/2] csky/dma: bugfix dma_sync_for_cpu/device

2018-09-25 Thread Guo Ren
On Mon, Sep 24, 2018 at 10:38:04PM +0200, Arnd Bergmann wrote: > On Tue, Sep 18, 2018 at 3:48 PM Guo Ren wrote: > > > > ref: https://lkml.org/lkml/2018/5/18/1068 > > > > map for_cpu for_device unmap > > TO_DEV writeback non

<    2   3   4   5   6   7   8   9   10   11   >