Skip to contentSkip to conversation

arm: Fix to mistake clean the memory space

PATCH Superseded Zhong Hongbo 3 participants 6 messages Jul 7, 2012 – Jul 12, 2012 Arm (32-bit)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 arm: Fix to mistake clean the memory space

From: Zhong Hongbo <[email protected]>

In currently, when __bss_start is equal to __bss_end__, The bss loop will clear all the things in memory space.

But just only when __bss_end__ greater than __bss_start__, we do the clear bss section operation.

---
Change for V2
- Fixed bss clear operation, no just skip it.
- Adjust the commit information
Change for V3
- Modify all the bss clean operation for arm platform
- Adjust the title

---
 arch/arm/cpu/arm1136/start.S   |    8 +++++---
 arch/arm/cpu/arm1176/start.S   |    9 +++++----
 arch/arm/cpu/arm720t/start.S   |    8 +++++---
 arch/arm/cpu/arm920t/start.S   |    8 +++++---
 arch/arm/cpu/arm925t/start.S   |    8 +++++---
 arch/arm/cpu/arm946es/start.S  |    8 +++++---
 arch/arm/cpu/arm_intcm/start.S |    8 +++++---
 arch/arm/cpu/armv7/start.S     |    8 +++++---
 arch/arm/cpu/ixp/start.S       |    8 +++++---
 arch/arm/cpu/lh7a40x/start.S   |    8 +++++---
 arch/arm/cpu/pxa/start.S       |    8 +++++---
 arch/arm/cpu/s3c44b0/start.S   |    8 +++++---
 arch/arm/cpu/sa1100/start.S    |    8 +++++---
 13 files changed, 65 insertions(+), 40 deletions(-)
arch/arm/cpu/arm1136/start.S +5 -3
index c0db96c..2483c63 100644
@@ -251,10 +251,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 #endif	/* #ifndef CONFIG_SPL_BUILD */
 
 /*
arch/arm/cpu/arm1176/start.S +5 -4
index 848144a..d613641 100644
@@ -351,11 +351,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
-
+	b	clbss_l
+clbss_e:
 #ifndef CONFIG_NAND_SPL
 	bl coloured_LED_init
 	bl red_led_on
arch/arm/cpu/arm720t/start.S +5 -3
index 540e3c2..3b97e80 100644
@@ -228,10 +228,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 
 	bl coloured_LED_init
 	bl red_led_on
arch/arm/cpu/arm920t/start.S +5 -3
index 8c5612c..9b8604e 100644
@@ -271,10 +271,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 
 	bl coloured_LED_init
 	bl red_led_on
arch/arm/cpu/arm925t/start.S +5 -3
index dbb93ef..1a54416 100644
@@ -265,10 +265,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 
 	bl coloured_LED_init
 	bl red_led_on
arch/arm/cpu/arm946es/start.S +5 -3
index 89ba558..b4d1d2d 100644
@@ -236,10 +236,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	blo	clbss_l
+	b	clbss_l
+clbss_e:
 #endif
 
 /*
arch/arm/cpu/arm_intcm/start.S +5 -3
index 2033b36..b85e7d4 100644
@@ -232,10 +232,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 
 	bl coloured_LED_init
 	bl red_led_on
arch/arm/cpu/armv7/start.S +5 -3
index 22a3ced..aee27fd 100644
@@ -259,10 +259,12 @@ clear_bss:
 #endif
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 
 /*
  * We are done. Do not return, instead branch to second part of board
arch/arm/cpu/ixp/start.S +5 -3
index cb32121..59c359a 100644
@@ -334,10 +334,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 
 	bl coloured_LED_init
 	bl red_led_on
arch/arm/cpu/lh7a40x/start.S +5 -3
index 62de8b8..bd68cd4 100644
@@ -245,10 +245,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 #endif
 
 /*
arch/arm/cpu/pxa/start.S +5 -3
index ba0de8f..33c73f6 100644
@@ -258,10 +258,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 #endif	/* #ifndef CONFIG_SPL_BUILD */
 
 /*
arch/arm/cpu/s3c44b0/start.S +5 -3
index a29d5b4..8daf26c 100644
@@ -217,10 +217,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 
 	bl coloured_LED_init
 	bl red_led_on
arch/arm/cpu/sa1100/start.S +5 -3
index 92546d8..bcea2a8 100644
@@ -221,10 +221,12 @@ clear_bss:
 	add	r1, r1, r4
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop... */
+	bhs	clbss_e			/* if reached end of bss, exit */
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 #endif
 
 /*
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH v3 1/1 arm: Fix to mistake clean the memory space

Hi Zhong Hongbo,

Quoted 9 lines · Zhong Hongbo

From: Zhong Hongbo <[email protected]>

In currently, when __bss_start is equal to __bss_end__, The bss loop will clear all the things in memory space.

But just only when __bss_end__ greater than __bss_start__, we do the clear bss section operation.

Quoted 8 lines

---
Change for V2
- Fixed bss clear operation, no just skip it.
- Adjust the commit information
Change for V3
- Modify all the bss clean operation for arm platform
- Adjust the title
---

Almost there... The PATCH part is missing, i.e. you should not tag "[V3]" but "[PATCH V3]".

Just to make sure patchwork gets it right, please repost a V4 of this properly tagged with "[PATCH V4]".

Amicalement,

Signature · 1 line
Albert.
#2 lore raw

PATCH v3 1/1 arm: Fix to mistake clean the memory space

Quoted 21 lines · Albert ARIBAUD

Hi Zhong Hongbo,

Quoted 9 lines · Zhong Hongbo

From: Zhong Hongbo <[email protected]>

In currently, when __bss_start is equal to __bss_end__, The bss loop will clear all the things in memory space.

But just only when __bss_end__ greater than __bss_start__, we do the clear bss section operation.

Quoted 8 lines

---
Change for V2
- Fixed bss clear operation, no just skip it.
- Adjust the commit information
Change for V3
- Modify all the bss clean operation for arm platform
- Adjust the title
---

Quoted 2 lines

Almost there... The PATCH part is missing, i.e. you should not tag "[V3]" but "[PATCH V3]".

Ok,

Quoted 3 lines

Just to make sure patchwork gets it right, please repost a V4 of this properly tagged with "[PATCH V4]".

Ok,

Thanks,
hongbo

Quoted 3 lines

Amicalement,

#3 lore raw

PATCH v3 1/1 arm: Fix to mistake clean the memory space

Dear Zhong Hongbo,

Quoted 10 lines · Zhong Hongbo
Quoted 7 lines · Albert ARIBAUD

Hi Zhong Hongbo,

Quoted 1 line · Zhong Hongbo

From: Zhong Hongbo <[email protected]>

Almost there... The PATCH part is missing, i.e. you should not tag "[V3]" but "[PATCH V3]".

Ok,

well, you sent v4 but didn't respect this comment. Please read
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
especially this part:

---8<---
Make an appropriate note that this is a re-submission in the subject line, eg. "[PATCH v2] Add support for feature X". git format-patch --subject-prefix="PATCH v2" can be used in this case. --->8---

Another option is to use 'git send-email --annotate ...' and change the subject line.

Quoted 2 lines
Quoted 2 lines

Just to make sure patchwork gets it right, please repost a V4 of this properly tagged with "[PATCH V4]".

I think patchwork got it right http://patchwork.ozlabs.org/patch/169595/
and http://patchwork.ozlabs.org/patch/169572/. So I would say you do not need to resend a v5 of the same patch cause of this formal 'fault'. Albert, do you have the same opinion?

Albert, I think we should count this a fix and pull into this upcoming release. How do you think about?

Best regards

Andreas Bie?mann

#4 lore raw

PATCH v3 1/1 arm: Fix to mistake clean the memory space

Hi Andreas,

Quoted 28 lines · Andreas Bie?mann

Dear Zhong Hongbo,

Quoted 11 lines · Zhong Hongbo
Quoted 8 lines · Albert ARIBAUD

Hi Zhong Hongbo,

Quoted 1 line · Zhong Hongbo

From: Zhong Hongbo <[email protected]>

Almost there... The PATCH part is missing, i.e. you should not tag "[V3]" but "[PATCH V3]".

Ok,

well, you sent v4 but didn't respect this comment. Please read
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
especially this part:

---8<---
Make an appropriate note that this is a re-submission in the subject line, eg. "[PATCH v2] Add support for feature X". git format-patch --subject-prefix="PATCH v2" can be used in this case. --->8---

Another option is to use 'git send-email --annotate ...' and change the subject line.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

Just to make sure patchwork gets it right, please repost a V4 of this properly tagged with "[PATCH V4]".

I think patchwork got it right
http://patchwork.ozlabs.org/patch/169595/ and
http://patchwork.ozlabs.org/patch/169572/. So I would say you do not need to resend a v5 of the same patch cause of this formal 'fault'. Albert, do you have the same opinion?

(sigh) No, I don't have the same opinion.

But I will accept... for this once.

Quoted 2 lines

Albert, I think we should count this a fix and pull into this upcoming release. How do you think about?

This was my intent from the start. :)

Quoted 3 lines

Best regards

Andreas Bie?mann

Amicalement,

Signature · 1 line
Albert.
#5 lore raw

PATCH v3 1/1 arm: Fix to mistake clean the memory space

Dear Albert Aribaud,

Quoted 35 lines · Albert ARIBAUD

Hi Andreas,

Quoted 31 lines · Andreas Bie?mann

Dear Zhong Hongbo,

Quoted 11 lines · Zhong Hongbo
Quoted 8 lines · Albert ARIBAUD

Hi Zhong Hongbo,

Quoted 1 line · Zhong Hongbo

From: Zhong Hongbo <[email protected]>

Almost there... The PATCH part is missing, i.e. you should not tag "[V3]" but "[PATCH V3]".

Ok,

well, you sent v4 but didn't respect this comment. Please read
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
especially this part:

---8<---
Make an appropriate note that this is a re-submission in the subject line, eg. "[PATCH v2] Add support for feature X". git format-patch --subject-prefix="PATCH v2" can be used in this case. --->8---

Another option is to use 'git send-email --annotate ...' and change the subject line.

Quoted 2 lines
Quoted 2 lines

Just to make sure patchwork gets it right, please repost a V4 of this properly tagged with "[PATCH V4]".

Quoted 7 lines
Quoted 5 lines

I think patchwork got it right
http://patchwork.ozlabs.org/patch/169595/ and
http://patchwork.ozlabs.org/patch/169572/. So I would say you do not need to resend a v5 of the same patch cause of this formal 'fault'. Albert, do you have the same opinion?

(sigh) No, I don't have the same opinion.

Ouch, sorry for that. I will notice this and do not force your opinion. I should have asked before.

Best regards

Andreas Bie?mann