All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] common/memsize.c: Increase save array for supporting memory size > 4GB
@ 2018-06-20  7:06 tien.fong.chee at intel.com
  2018-06-21  4:34 ` Marek Vasut
  2018-07-11 12:42 ` [U-Boot] [U-Boot, " Tom Rini
  0 siblings, 2 replies; 8+ messages in thread
From: tien.fong.chee at intel.com @ 2018-06-20  7:06 UTC (permalink / raw)
  To: u-boot

From: Tien Fong Chee <tien.fong.chee@intel.com>

In ARM 64-bits, memory size can be supported is more than 4GB,
hence increasing save array is needed to cope with testing larger memory.

Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
---

Changes in v2:
- Change save array size to save[BITS_PER_LONG - 1]
---
 common/memsize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/memsize.c b/common/memsize.c
index 5670e95..13b0047 100644
--- a/common/memsize.c
+++ b/common/memsize.c
@@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR;
 long get_ram_size(long *base, long maxsize)
 {
 	volatile long *addr;
-	long           save[31];
+	long           save[BITS_PER_LONG - 1];
 	long           save_base;
 	long           cnt;
 	long           val;
-- 
2.2.0

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

* [U-Boot] [PATCH v2] common/memsize.c: Increase save array for supporting memory size > 4GB
  2018-06-20  7:06 [U-Boot] [PATCH v2] common/memsize.c: Increase save array for supporting memory size > 4GB tien.fong.chee at intel.com
@ 2018-06-21  4:34 ` Marek Vasut
  2018-06-21  6:31   ` Chee, Tien Fong
  2018-07-11 12:42 ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 1 reply; 8+ messages in thread
From: Marek Vasut @ 2018-06-21  4:34 UTC (permalink / raw)
  To: u-boot

On 06/20/2018 09:06 AM, tien.fong.chee at intel.com wrote:
> From: Tien Fong Chee <tien.fong.chee@intel.com>
> 
> In ARM 64-bits, memory size can be supported is more than 4GB,
> hence increasing save array is needed to cope with testing larger memory.
> 
> Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> ---
> 
> Changes in v2:
> - Change save array size to save[BITS_PER_LONG - 1]
> ---
>  common/memsize.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/memsize.c b/common/memsize.c
> index 5670e95..13b0047 100644
> --- a/common/memsize.c
> +++ b/common/memsize.c
> @@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR;
>  long get_ram_size(long *base, long maxsize)
>  {
>  	volatile long *addr;
> -	long           save[31];
> +	long           save[BITS_PER_LONG - 1];
>  	long           save_base;
>  	long           cnt;
>  	long           val;
> 
Does this work with LPAE systems, where bits per long == 32 and the
address space is bigger ? Or with similar setups ? I mean, you can have
> 4 GiB of RAM on 32bit system ...

-- 
Best regards,
Marek Vasut

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

* [U-Boot] [PATCH v2] common/memsize.c: Increase save array for supporting memory size > 4GB
  2018-06-21  4:34 ` Marek Vasut
@ 2018-06-21  6:31   ` Chee, Tien Fong
  2018-06-23  3:29     ` Marek Vasut
  0 siblings, 1 reply; 8+ messages in thread
From: Chee, Tien Fong @ 2018-06-21  6:31 UTC (permalink / raw)
  To: u-boot

On Thu, 2018-06-21 at 06:34 +0200, Marek Vasut wrote:
> On 06/20/2018 09:06 AM, tien.fong.chee at intel.com wrote:
> > 
> > From: Tien Fong Chee <tien.fong.chee@intel.com>
> > 
> > In ARM 64-bits, memory size can be supported is more than 4GB,
> > hence increasing save array is needed to cope with testing larger
> > memory.
> > 
> > Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> > ---
> > 
> > Changes in v2:
> > - Change save array size to save[BITS_PER_LONG - 1]
> > ---
> >  common/memsize.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/common/memsize.c b/common/memsize.c
> > index 5670e95..13b0047 100644
> > --- a/common/memsize.c
> > +++ b/common/memsize.c
> > @@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR;
> >  long get_ram_size(long *base, long maxsize)
> >  {
> >  	volatile long *addr;
> > -	long           save[31];
> > +	long           save[BITS_PER_LONG - 1];
> >  	long           save_base;
> >  	long           cnt;
> >  	long           val;
> > 
> Does this work with LPAE systems, where bits per long == 32 and the
> address space is bigger ? Or with similar setups ? I mean, you can
> have
> > 
> > 4 GiB of RAM on 32bit system ...
This function is designed to work with 32bit or 64 bits system, for
example the argument such as maxsize can be 32bit or 64 bit, if value
larger than 4GiB is passed as maxsize argument with 32bit system, the
whole thing will go wrong.

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

* [U-Boot] [PATCH v2] common/memsize.c: Increase save array for supporting memory size > 4GB
  2018-06-21  6:31   ` Chee, Tien Fong
@ 2018-06-23  3:29     ` Marek Vasut
  2018-07-02 13:51       ` Chee, Tien Fong
  0 siblings, 1 reply; 8+ messages in thread
From: Marek Vasut @ 2018-06-23  3:29 UTC (permalink / raw)
  To: u-boot

On 06/21/2018 08:31 AM, Chee, Tien Fong wrote:
> On Thu, 2018-06-21 at 06:34 +0200, Marek Vasut wrote:
>> On 06/20/2018 09:06 AM, tien.fong.chee at intel.com wrote:
>>>
>>> From: Tien Fong Chee <tien.fong.chee@intel.com>
>>>
>>> In ARM 64-bits, memory size can be supported is more than 4GB,
>>> hence increasing save array is needed to cope with testing larger
>>> memory.
>>>
>>> Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
>>> ---
>>>
>>> Changes in v2:
>>> - Change save array size to save[BITS_PER_LONG - 1]
>>> ---
>>>  common/memsize.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/common/memsize.c b/common/memsize.c
>>> index 5670e95..13b0047 100644
>>> --- a/common/memsize.c
>>> +++ b/common/memsize.c
>>> @@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR;
>>>  long get_ram_size(long *base, long maxsize)
>>>  {
>>>  	volatile long *addr;
>>> -	long           save[31];
>>> +	long           save[BITS_PER_LONG - 1];
>>>  	long           save_base;
>>>  	long           cnt;
>>>  	long           val;
>>>
>> Does this work with LPAE systems, where bits per long == 32 and the
>> address space is bigger ? Or with similar setups ? I mean, you can
>> have
>>>
>>> 4 GiB of RAM on 32bit system ...
> This function is designed to work with 32bit or 64 bits system, for
> example the argument such as maxsize can be 32bit or 64 bit, if value
> larger than 4GiB is passed as maxsize argument with 32bit system, the
> whole thing will go wrong.

And what do you do when you identify a problem in mainline ? :-)

-- 
Best regards,
Marek Vasut

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

* [U-Boot] [PATCH v2] common/memsize.c: Increase save array for supporting memory size > 4GB
  2018-06-23  3:29     ` Marek Vasut
@ 2018-07-02 13:51       ` Chee, Tien Fong
  0 siblings, 0 replies; 8+ messages in thread
From: Chee, Tien Fong @ 2018-07-02 13:51 UTC (permalink / raw)
  To: u-boot

On Sat, 2018-06-23 at 05:29 +0200, Marek Vasut wrote:
> On 06/21/2018 08:31 AM, Chee, Tien Fong wrote:
> > 
> > On Thu, 2018-06-21 at 06:34 +0200, Marek Vasut wrote:
> > > 
> > > On 06/20/2018 09:06 AM, tien.fong.chee at intel.com wrote:
> > > > 
> > > > 
> > > > From: Tien Fong Chee <tien.fong.chee@intel.com>
> > > > 
> > > > In ARM 64-bits, memory size can be supported is more than 4GB,
> > > > hence increasing save array is needed to cope with testing
> > > > larger
> > > > memory.
> > > > 
> > > > Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> > > > ---
> > > > 
> > > > Changes in v2:
> > > > - Change save array size to save[BITS_PER_LONG - 1]
> > > > ---
> > > >  common/memsize.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/common/memsize.c b/common/memsize.c
> > > > index 5670e95..13b0047 100644
> > > > --- a/common/memsize.c
> > > > +++ b/common/memsize.c
> > > > @@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR;
> > > >  long get_ram_size(long *base, long maxsize)
> > > >  {
> > > >  	volatile long *addr;
> > > > -	long           save[31];
> > > > +	long           save[BITS_PER_LONG - 1];
> > > >  	long           save_base;
> > > >  	long           cnt;
> > > >  	long           val;
> > > > 
> > > Does this work with LPAE systems, where bits per long == 32 and
> > > the
> > > address space is bigger ? Or with similar setups ? I mean, you
> > > can
> > > have
> > > > 
> > > > 
> > > > 4 GiB of RAM on 32bit system ...
> > This function is designed to work with 32bit or 64 bits system, for
> > example the argument such as maxsize can be 32bit or 64 bit, if
> > value
> > larger than 4GiB is passed as maxsize argument with 32bit system,
> > the
> > whole thing will go wrong.
> And what do you do when you identify a problem in mainline ? :-)
> 
I have no idea at this moment, how about fixing the issue for save
array in 64-bit 1st?

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

* [U-Boot] [U-Boot, v2] common/memsize.c: Increase save array for supporting memory size > 4GB
  2018-06-20  7:06 [U-Boot] [PATCH v2] common/memsize.c: Increase save array for supporting memory size > 4GB tien.fong.chee at intel.com
  2018-06-21  4:34 ` Marek Vasut
@ 2018-07-11 12:42 ` Tom Rini
  2018-07-11 12:48   ` Marek Vasut
  1 sibling, 1 reply; 8+ messages in thread
From: Tom Rini @ 2018-07-11 12:42 UTC (permalink / raw)
  To: u-boot

On Wed, Jun 20, 2018 at 03:06:20PM +0800, tien.fong.chee at intel.com wrote:

> From: Tien Fong Chee <tien.fong.chee@intel.com>
> 
> In ARM 64-bits, memory size can be supported is more than 4GB,
> hence increasing save array is needed to cope with testing larger memory.
> 
> Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>

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: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180711/8d4c4a4e/attachment.sig>

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

* [U-Boot] [U-Boot, v2] common/memsize.c: Increase save array for supporting memory size > 4GB
  2018-07-11 12:42 ` [U-Boot] [U-Boot, " Tom Rini
@ 2018-07-11 12:48   ` Marek Vasut
  2018-07-11 12:50     ` Tom Rini
  0 siblings, 1 reply; 8+ messages in thread
From: Marek Vasut @ 2018-07-11 12:48 UTC (permalink / raw)
  To: u-boot

On 07/11/2018 02:42 PM, Tom Rini wrote:
> On Wed, Jun 20, 2018 at 03:06:20PM +0800, tien.fong.chee at intel.com wrote:
> 
>> From: Tien Fong Chee <tien.fong.chee@intel.com>
>>
>> In ARM 64-bits, memory size can be supported is more than 4GB,
>> hence increasing save array is needed to cope with testing larger memory.
>>
>> Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> 
> Applied to u-boot/master, thanks!

There were review comments on this patch which were not addressed,
please drop.

-- 
Best regards,
Marek Vasut

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

* [U-Boot] [U-Boot, v2] common/memsize.c: Increase save array for supporting memory size > 4GB
  2018-07-11 12:48   ` Marek Vasut
@ 2018-07-11 12:50     ` Tom Rini
  0 siblings, 0 replies; 8+ messages in thread
From: Tom Rini @ 2018-07-11 12:50 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 11, 2018 at 02:48:34PM +0200, Marek Vasut wrote:
> On 07/11/2018 02:42 PM, Tom Rini wrote:
> > On Wed, Jun 20, 2018 at 03:06:20PM +0800, tien.fong.chee at intel.com wrote:
> > 
> >> From: Tien Fong Chee <tien.fong.chee@intel.com>
> >>
> >> In ARM 64-bits, memory size can be supported is more than 4GB,
> >> hence increasing save array is needed to cope with testing larger memory.
> >>
> >> Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> > 
> > Applied to u-boot/master, thanks!
> 
> There were review comments on this patch which were not addressed,
> please drop.

I thought I had put them in my message here, sorry.  I agree with Tien
that we should fix the issue we have now and address the enhancement in
a follow up patch.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180711/c5ba83a2/attachment.sig>

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

end of thread, other threads:[~2018-07-11 12:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-20  7:06 [U-Boot] [PATCH v2] common/memsize.c: Increase save array for supporting memory size > 4GB tien.fong.chee at intel.com
2018-06-21  4:34 ` Marek Vasut
2018-06-21  6:31   ` Chee, Tien Fong
2018-06-23  3:29     ` Marek Vasut
2018-07-02 13:51       ` Chee, Tien Fong
2018-07-11 12:42 ` [U-Boot] [U-Boot, " Tom Rini
2018-07-11 12:48   ` Marek Vasut
2018-07-11 12:50     ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.