i2c: i2c-uclass-compat: avoid any BSS usage
RFC PATCH 1/1 i2c: i2c-uclass-compat: avoid any BSS usage
As I2C can be used before DRAM initialization for reading EEPROM, avoid using static variables stored in BSS, since BSS is in DRAM, which may not have been initialised yet. Explicitly mark "static global" variables as belonging to the .data section.
--- drivers/i2c/i2c-uclass-compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/i2c-uclass-compat.c +1 -1
@@ -9,7 +9,7 @@#include <errno.h> #include <i2c.h> -static int cur_busnum; +static int cur_busnum __attribute__((section(".data")));static int i2c_compat_get_device (uint chip_addr,int alen,struct udevice **devp)
Signature · 1 line
2.9.2
RFC PATCH 1/1 i2c: i2c-uclass-compat: avoid any BSS usage
Hello Vignesh,
Am 25.07.2016 um 12:56 schrieb Vignesh R:
Quoted 9 lines
As I2C can be used before DRAM initialization for reading EEPROM, avoid using static variables stored in BSS, since BSS is in DRAM, which may not have been initialised yet. Explicitly mark "static global" variables as belonging to the .data section.
Signed-off-by Vignesh R <[email protected]>--- drivers/i2c/i2c-uclass-compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bye,
Heiko
Quoted 15 lines
drivers/i2c/i2c-uclass-compat.c +1
-1@@ -9,7 +9,7 @@#include <errno.h> #include <i2c.h> -static int cur_busnum; +static int cur_busnum __attribute__((section(".data")));static int i2c_compat_get_device (uint chip_addr,int alen,struct udevice **devp)
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
RFC PATCH 1/1 i2c: i2c-uclass-compat: avoid any BSS usage
Quoted 8 lines · Heiko Schocher
Hello Vignesh,
Am 25.07.2016 um 12:56 schrieb Vignesh R:
Quoted 5 lines
As I2C can be used before DRAM initialization for reading EEPROM, avoid using static variables stored in BSS, since BSS is in DRAM, which may not have been initialised yet. Explicitly mark "static global" variables as belonging to the .data section.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Vignesh R <[email protected]>--- drivers/i2c/i2c-uclass-compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Acked-by Heiko Schocher<[email protected]>
Thanks! Would you be picking up this patch?
Quoted 17 lines
Quoted 16 lines
drivers/i2c/i2c-uclass-compat.c +1
-1@@ -9,7 +9,7 @@#include <errno.h> #include <i2c.h> -static int cur_busnum; +static int cur_busnum __attribute__((section(".data")));static int i2c_compat_get_device (uint chip_addr,int alen,struct udevice **devp)
Signature · 2 lines
Regards Vignesh
RFC PATCH 1/1 i2c: i2c-uclass-compat: avoid any BSS usage
Hello Vignesh,
added Simon to cc...
Am 28.07.2016 um 07:54 schrieb Vignesh R:
Quoted 16 lines · Heiko Schocher
Quoted 13 lines
Hello Vignesh,
Am 25.07.2016 um 12:56 schrieb Vignesh R:
Quoted 9 lines
As I2C can be used before DRAM initialization for reading EEPROM, avoid using static variables stored in BSS, since BSS is in DRAM, which may not have been initialised yet. Explicitly mark "static global" variables as belonging to the .data section.
Signed-off-by Vignesh R <[email protected]>--- drivers/i2c/i2c-uclass-compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Quoted 2 lines
Acked-by Heiko Schocher<[email protected]>Thanks! Would you be picking up this patch?
The patch is delegated to Simon, if Simon as no objections I can pick it up.
bye,
Heiko
Quoted 19 lines
Quoted 18 lines
Quoted 17 lines
drivers/i2c/i2c-uclass-compat.c +1
-1@@ -9,7 +9,7 @@#include <errno.h> #include <i2c.h> -static int cur_busnum; +static int cur_busnum __attribute__((section(".data")));static int i2c_compat_get_device (uint chip_addr,int alen,struct udevice **devp)
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
RFC PATCH 1/1 i2c: i2c-uclass-compat: avoid any BSS usage
Quoted 25 lines · Heiko Schocher
Hello Vignesh,
added Simon to cc...
Am 28.07.2016 um 07:54 schrieb Vignesh R:
Quoted 20 lines · Heiko Schocher
Quoted 16 lines
Hello Vignesh,
Am 25.07.2016 um 12:56 schrieb Vignesh R:
Quoted 10 lines
As I2C can be used before DRAM initialization for reading EEPROM, avoid using static variables stored in BSS, since BSS is in DRAM, which may not have been initialised yet. Explicitly mark "static global" variables as belonging to the .data section.
Signed-off-by Vignesh R <[email protected]>--- drivers/i2c/i2c-uclass-compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Acked-by Heiko Schocher<[email protected]>Thanks! Would you be picking up this patch?
The patch is delegated to Simon, if Simon as no objections I can pick it up.
Yes please.
Quoted 8 lines · Vignesh R
As I2C can be used before DRAM initialization for reading EEPROM, avoid using static variables stored in BSS, since BSS is in DRAM, which may not have been initialised yet. Explicitly mark "static global" variables as belonging to the .data section.
Signed-off-by Vignesh R <[email protected]>Acked-by Heiko Schocher<[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160809/99dc7a69/attachment.sig>