public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH] i2c: i2c-uclass-compat: avoid any BSS usage
@ 2016-07-25 10:56 Vignesh R
  2016-07-26  6:23 ` Heiko Schocher
  2016-08-10  0:45 ` [U-Boot] [U-Boot, RFC] " Tom Rini
  0 siblings, 2 replies; 6+ messages in thread
From: Vignesh R @ 2016-07-25 10:56 UTC (permalink / raw)
  To: u-boot

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 <vigneshr@ti.com>
---
 drivers/i2c/i2c-uclass-compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 <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)
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [RFC PATCH] i2c: i2c-uclass-compat: avoid any BSS usage
  2016-07-25 10:56 [U-Boot] [RFC PATCH] i2c: i2c-uclass-compat: avoid any BSS usage Vignesh R
@ 2016-07-26  6:23 ` Heiko Schocher
  2016-07-28  5:54   ` Vignesh R
  2016-08-10  0:45 ` [U-Boot] [U-Boot, RFC] " Tom Rini
  1 sibling, 1 reply; 6+ messages in thread
From: Heiko Schocher @ 2016-07-26  6:23 UTC (permalink / raw)
  To: u-boot

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 <vigneshr@ti.com>
> ---
>   drivers/i2c/i2c-uclass-compat.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Heiko Schocher<hs@denx.de>

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 <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)
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [RFC PATCH] i2c: i2c-uclass-compat: avoid any BSS usage
  2016-07-26  6:23 ` Heiko Schocher
@ 2016-07-28  5:54   ` Vignesh R
  2016-07-29  3:37     ` Heiko Schocher
  0 siblings, 1 reply; 6+ messages in thread
From: Vignesh R @ 2016-07-28  5:54 UTC (permalink / raw)
  To: u-boot



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 <vigneshr@ti.com>
>> ---
>>   drivers/i2c/i2c-uclass-compat.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Acked-by: Heiko Schocher<hs@denx.de>
> 

Thanks! Would you be picking up this patch?

>>
>> 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 <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)
>>
> 

-- 
Regards
Vignesh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [RFC PATCH] i2c: i2c-uclass-compat: avoid any BSS usage
  2016-07-28  5:54   ` Vignesh R
@ 2016-07-29  3:37     ` Heiko Schocher
  2016-08-01  1:03       ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Heiko Schocher @ 2016-07-29  3:37 UTC (permalink / raw)
  To: u-boot

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 <vigneshr@ti.com>
>>> ---
>>>    drivers/i2c/i2c-uclass-compat.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Acked-by: Heiko Schocher<hs@denx.de>
>>
>
> 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 <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)
>>>
>>
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [RFC PATCH] i2c: i2c-uclass-compat: avoid any BSS usage
  2016-07-29  3:37     ` Heiko Schocher
@ 2016-08-01  1:03       ` Simon Glass
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2016-08-01  1:03 UTC (permalink / raw)
  To: u-boot

On 28 July 2016 at 21:37, Heiko Schocher <hs@denx.de> wrote:
> 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 <vigneshr@ti.com>
>>>> ---
>>>>    drivers/i2c/i2c-uclass-compat.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>>
>>> Acked-by: Heiko Schocher<hs@denx.de>
>>>
>>
>> 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.

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [U-Boot, RFC] i2c: i2c-uclass-compat: avoid any BSS usage
  2016-07-25 10:56 [U-Boot] [RFC PATCH] i2c: i2c-uclass-compat: avoid any BSS usage Vignesh R
  2016-07-26  6:23 ` Heiko Schocher
@ 2016-08-10  0:45 ` Tom Rini
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Rini @ 2016-08-10  0:45 UTC (permalink / raw)
  To: u-boot

On Mon, Jul 25, 2016 at 04:26:45PM +0530, Vignesh R wrote:

> 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 <vigneshr@ti.com>
> Acked-by: Heiko Schocher<hs@denx.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-08-10  0:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-25 10:56 [U-Boot] [RFC PATCH] i2c: i2c-uclass-compat: avoid any BSS usage Vignesh R
2016-07-26  6:23 ` Heiko Schocher
2016-07-28  5:54   ` Vignesh R
2016-07-29  3:37     ` Heiko Schocher
2016-08-01  1:03       ` Simon Glass
2016-08-10  0:45 ` [U-Boot] [U-Boot, RFC] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox