From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Fri, 29 Jul 2016 05:37:11 +0200 Subject: [U-Boot] [RFC PATCH] i2c: i2c-uclass-compat: avoid any BSS usage In-Reply-To: <43fd4bda-660b-3273-097c-e4ae05077b06@ti.com> References: <20160725105645.27308-1-vigneshr@ti.com> <579701E2.8050401@denx.de> <43fd4bda-660b-3273-097c-e4ae05077b06@ti.com> Message-ID: <579ACF67.2030602@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Vignesh, added Simon to cc... Am 28.07.2016 um 07:54 schrieb Vignesh R: > > > On Tuesday 26 July 2016 11:53 AM, Heiko Schocher wrote: >> Hello Vignesh, >> >> Am 25.07.2016 um 12:56 schrieb 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 >>> --- >>> drivers/i2c/i2c-uclass-compat.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> Acked-by: Heiko Schocher >> > > 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 > >>> >>> diff --git a/drivers/i2c/i2c-uclass-compat.c >>> b/drivers/i2c/i2c-uclass-compat.c >>> index 5606d1f807f6..de78db6a887f 100644 >>> --- a/drivers/i2c/i2c-uclass-compat.c >>> +++ b/drivers/i2c/i2c-uclass-compat.c >>> @@ -9,7 +9,7 @@ >>> #include >>> #include >>> >>> -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) >>> >> > -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany