[PATCH v2] ARC: [scripted] fix node name and address spelling

2019-01-24 Thread Alexey Brodkin
From: Alexey Brodkin 

1. Remove "0x" prefix from unit-address of node names
--->8
sed -i 's/@0x/@/g' arch/arc/boot/dts/*.dts*
--->8

2. Make all hex addresses lowercase:
--->8
sed -i 's/@\([0-9A-Za-z]*\)/@\L\1/g' arch/arc/boot/dts/*.dts*
sed -i 's/0x\([0-9A-Za-z]*\)/0x\L\1/g' arch/arc/boot/dts/*.dts*
--->8

Inspired by [1] and the like.

[1] http://kisskb.ellerman.id.au/kisskb/buildresult/13612017/

Signed-off-by: Alexey Brodkin 
Cc: Rob Herring 
---

Changes v1 -> v2:

 * Convert all hex addresses to lower-case [Rob]

 arch/arc/boot/dts/abilis_tb100.dtsi| 58 
 arch/arc/boot/dts/abilis_tb100_dvk.dts | 14 
 arch/arc/boot/dts/abilis_tb101.dtsi| 58 
 arch/arc/boot/dts/abilis_tb101_dvk.dts | 14 
 arch/arc/boot/dts/abilis_tb10x.dtsi| 60 +-
 arch/arc/boot/dts/axc001.dtsi  |  6 ++--
 arch/arc/boot/dts/axc003.dtsi  | 16 -
 arch/arc/boot/dts/axc003_idu.dtsi  | 16 -
 arch/arc/boot/dts/axs10x_mb.dtsi   | 22 ++---
 arch/arc/boot/dts/hsdk.dts |  4 +--
 arch/arc/boot/dts/vdk_axc003.dtsi  |  4 +--
 arch/arc/boot/dts/vdk_axc003_idu.dtsi  |  4 +--
 arch/arc/boot/dts/vdk_axs10x_mb.dtsi   | 18 +-
 13 files changed, 147 insertions(+), 147 deletions(-)

diff --git a/arch/arc/boot/dts/abilis_tb100.dtsi 
b/arch/arc/boot/dts/abilis_tb100.dtsi
index 02410b211433..c0bcd97522bb 100644
--- a/arch/arc/boot/dts/abilis_tb100.dtsi
+++ b/arch/arc/boot/dts/abilis_tb100.dtsi
@@ -38,7 +38,7 @@
clock-div = <6>;
};
 
-   iomux: iomux@FF10601c {
+   iomux: iomux@ff10601c {
/* Port 1 */
pctl_tsin_s0: pctl-tsin-s0 {   /* Serial TS-in 0 */
abilis,function = "mis0";
@@ -162,182 +162,182 @@
};
};
 
-   gpioa: gpio@FF14 {
+   gpioa: gpio@ff14 {
compatible = "abilis,tb10x-gpio";
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&tb10x_ictl>;
interrupts = <27 2>;
-   reg = <0xFF14 0x1000>;
+   reg = <0xff14 0x1000>;
gpio-controller;
#gpio-cells = <2>;
abilis,ngpio = <3>;
gpio-ranges = <&iomux 0 0 0>;
gpio-ranges-group-names = "gpioa";
};
-   gpiob: gpio@FF141000 {
+   gpiob: gpio@ff141000 {
compatible = "abilis,tb10x-gpio";
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&tb10x_ictl>;
interrupts = <27 2>;
-   reg = <0xFF141000 0x1000>;
+   reg = <0xff141000 0x1000>;
gpio-controller;
#gpio-cells = <2>;
abilis,ngpio = <2>;
gpio-ranges = <&iomux 0 0 0>;
gpio-ranges-group-names = "gpiob";
};
-   gpioc: gpio@FF142000 {
+   gpioc: gpio@ff142000 {
compatible = "abilis,tb10x-gpio";
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&tb10x_ictl>;
interrupts = <27 2>;
-   reg = <0xFF142000 0x1000>;
+   reg = <0xff142000 0x1000>;
gpio-controller;
#gpio-cells = <2>;
abilis,ngpio = <3>;
gpio-ranges = <&iomux 0 0 0>;
gpio-ranges-group-names = "gpioc";
};
-   gpiod: gpio@FF143000 {
+   gpiod: gpio@ff143000 {
compatible = "abilis,tb10x-gpio";
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <&tb10x_ictl>;
interrupts = <27 2>;
-   reg = <0xFF143000 0x1000>;
+   reg = <0xff143000 0x1000>;
gpio-controller;
#gpio-cells = <2>;
abilis,ngpio = <2>;
gpio-ranges = <&iomux 0 0 0>;
gpio-ranges-group-names = "gpiod";
};
-   gpioe: gpio@FF144000 {
+   gpioe: gpio@ff144000 {
  

Re: [PATCH v2] ARC: [scripted] fix node name and address spelling

2019-01-24 Thread Rob Herring
On Thu, Jan 24, 2019 at 6:17 AM Alexey Brodkin
 wrote:
>
> From: Alexey Brodkin 
>
> 1. Remove "0x" prefix from unit-address of node names
> --->8
> sed -i 's/@0x/@/g' arch/arc/boot/dts/*.dts*
> --->8
>
> 2. Make all hex addresses lowercase:
> --->8
> sed -i 's/@\([0-9A-Za-z]*\)/@\L\1/g' arch/arc/boot/dts/*.dts*
> sed -i 's/0x\([0-9A-Za-z]*\)/0x\L\1/g' arch/arc/boot/dts/*.dts*
> --->8
>
> Inspired by [1] and the like.
>
> [1] http://kisskb.ellerman.id.au/kisskb/buildresult/13612017/
>
> Signed-off-by: Alexey Brodkin 
> Cc: Rob Herring 
> ---
>
> Changes v1 -> v2:
>
>  * Convert all hex addresses to lower-case [Rob]
>
>  arch/arc/boot/dts/abilis_tb100.dtsi| 58 
>  arch/arc/boot/dts/abilis_tb100_dvk.dts | 14 
>  arch/arc/boot/dts/abilis_tb101.dtsi| 58 
>  arch/arc/boot/dts/abilis_tb101_dvk.dts | 14 
>  arch/arc/boot/dts/abilis_tb10x.dtsi| 60 
> +-
>  arch/arc/boot/dts/axc001.dtsi  |  6 ++--
>  arch/arc/boot/dts/axc003.dtsi  | 16 -
>  arch/arc/boot/dts/axc003_idu.dtsi  | 16 -
>  arch/arc/boot/dts/axs10x_mb.dtsi   | 22 ++---
>  arch/arc/boot/dts/hsdk.dts |  4 +--
>  arch/arc/boot/dts/vdk_axc003.dtsi  |  4 +--
>  arch/arc/boot/dts/vdk_axc003_idu.dtsi  |  4 +--
>  arch/arc/boot/dts/vdk_axs10x_mb.dtsi   | 18 +-
>  13 files changed, 147 insertions(+), 147 deletions(-)

Reviewed-by: Rob Herring 

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


Re: [PATCH v2] ARC: [scripted] fix node name and address spelling

2019-01-24 Thread Vineet Gupta
Hi Alexey, Rob,

On 1/24/19 8:28 AM, Rob Herring wrote:
> On Thu, Jan 24, 2019 at 6:17 AM Alexey Brodkin
>  wrote:
>>
>> From: Alexey Brodkin 
>>
>> 1. Remove "0x" prefix from unit-address of node names
>> --->8
>> sed -i 's/@0x/@/g' arch/arc/boot/dts/*.dts*
>> --->8
>>
>> 2. Make all hex addresses lowercase:
>> --->8
>> sed -i 's/@\([0-9A-Za-z]*\)/@\L\1/g' arch/arc/boot/dts/*.dts*
>> sed -i 's/0x\([0-9A-Za-z]*\)/0x\L\1/g' arch/arc/boot/dts/*.dts*
>> --->8
>>
>> Inspired by [1] and the like.
>>
>> [1] http://kisskb.ellerman.id.au/kisskb/buildresult/13612017/
>>
>> Signed-off-by: Alexey Brodkin 
>> Cc: Rob Herring 
>> ---
>>
>> Changes v1 -> v2:
>>
>>  * Convert all hex addresses to lower-case [Rob]
>>
>>  arch/arc/boot/dts/abilis_tb100.dtsi| 58 
>>  arch/arc/boot/dts/abilis_tb100_dvk.dts | 14 
>>  arch/arc/boot/dts/abilis_tb101.dtsi| 58 
>>  arch/arc/boot/dts/abilis_tb101_dvk.dts | 14 
>>  arch/arc/boot/dts/abilis_tb10x.dtsi| 60 
>> +-
>>  arch/arc/boot/dts/axc001.dtsi  |  6 ++--
>>  arch/arc/boot/dts/axc003.dtsi  | 16 -
>>  arch/arc/boot/dts/axc003_idu.dtsi  | 16 -
>>  arch/arc/boot/dts/axs10x_mb.dtsi   | 22 ++---
>>  arch/arc/boot/dts/hsdk.dts |  4 +--
>>  arch/arc/boot/dts/vdk_axc003.dtsi  |  4 +--
>>  arch/arc/boot/dts/vdk_axc003_idu.dtsi  |  4 +--
>>  arch/arc/boot/dts/vdk_axs10x_mb.dtsi   | 18 +-
>>  13 files changed, 147 insertions(+), 147 deletions(-)
> 
> Reviewed-by: Rob Herring 


Thx for the quick look at this. I've added this to ARC for-curr !

Thx,
-Vineet

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


Re: ensure dma_alloc_coherent always returns zeroed memory

2019-01-24 Thread Vineet Gupta
On 12/28/18 9:58 AM, h...@lst.de wrote:
> On Fri, Dec 28, 2018 at 05:46:32PM +, Eugeniy Paltsev wrote:
>> What happens:
>>
>> First coherent allocation (PAL#1):
>> 1) allocate page via alloc_pages(__GFP_ZERO), got page vith paddr 0xbf2d6000
>> 2) zero it via memset [deep inside alloc_pages()]
>> 3) remap it as uncached via ioremap_nocache(), got vaddr 0x70004000
>> 4) flush and invalidate L1 and L2 lines which belongs to allocated page.
>> Everything is OK for now.
>>
>> Second coherent allocation (PAL#2):
>> 1) allocate page via alloc_pages(__GFP_ZERO), got page vith paddr 0xbf2d4000
>> 2) zero it via memset [deep inside alloc_pages()].
>> -> Ooops: ARC memset implementation (due to SW bug) calls 'prefetchw' 
>> instruction
>> for address which lies outside of memset area (it will be 0xbf2d6000 in this 
>> case)
>> So we got one modified (dirty) cache line in the beginning of previous 
>> coherent
>> buffer which has been already flushed and invalidated (in PAL#1).
>>
>> So if we put some real data in this buffer [via virtual (uncached) address)]
>> before this line is flushed - we will got corrupted data.
> We could instead do the memset on the remapped address, which would
> work around this prefetching issue:

Right, it probably would, but that would still be too fragile, there are other 
bad
things in non-dma scenarios which happen due to this.
This needed fixing and Eugeniy's fix is in upstream/master now

2019-01-14 e6a72b7daeeb ARCv2: lib: memeset: fix doing prefetchw outside of
buffer 


>
> diff --git a/arch/arc/mm/dma.c b/arch/arc/mm/dma.c
> index 1525ac00fd02..7c3b47019079 100644
> --- a/arch/arc/mm/dma.c
> +++ b/arch/arc/mm/dma.c
> @@ -33,7 +33,7 @@ void *arch_dma_alloc(struct device *dev, size_t size, 
> dma_addr_t *dma_handle,
>*/
>   BUG_ON(gfp & __GFP_HIGHMEM);
>  
> - page = alloc_pages(gfp | __GFP_ZERO, order);
> + page = alloc_pages(gfp, order);
>   if (!page)
>   return NULL;
>  
> @@ -69,6 +69,7 @@ void *arch_dma_alloc(struct device *dev, size_t size, 
> dma_addr_t *dma_handle,
>   if (need_coh)
>   dma_cache_wback_inv(paddr, size);
>  
> + memset(kvaddr, 0, size);
>   return kvaddr;
>  }


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