diff mbox

[U-Boot,07/10] ARM: tegra: fix malloc region sizing

Message ID 1441425831-3441-7-git-send-email-swarren@wwwdotorg.org
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Stephen Warren Sept. 5, 2015, 4:03 a.m. UTC
From: Stephen Warren <swarren@nvidia.com>

Commit 52a7c98a1772 "tegra-common: increase malloc pool len by dfu mmc
file buffer size" updated the definition of CONFIG_SYS_MALLOC_LEN for
Tegra to take account of the DFU buffer size. However, this change had
no effect, since typical Tegra board config headers don't set the DFU-
related defines until after tegra-common.h is included. Fix this by
moving the affected conditional code to tegra-common-post.h, which is
included last. Also move the definition of SYS_NONCACHED_MEMORY since
it's a related and adjacent definition.

Fix the condition to test for the DFU feature, rather than specifically
MMC DFU support, so it applies in all cases.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 include/configs/tegra-common-post.h | 14 ++++++++++++++
 include/configs/tegra-common.h      | 14 --------------
 2 files changed, 14 insertions(+), 14 deletions(-)

Comments

Stephen Warren Sept. 8, 2015, 9:45 p.m. UTC | #1
On 09/08/2015 09:53 AM, Tom Warren wrote:
> Stephen,
> 
> Stephen Warren wrote at Friday, September 04, 2015 9:04 PM:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> Commit 52a7c98a1772 "tegra-common: increase malloc pool len by dfu mmc file
>> buffer size" updated the definition of CONFIG_SYS_MALLOC_LEN for Tegra to
>> take account of the DFU buffer size. However, this change had no effect, since
>> typical Tegra board config headers don't set the DFU- related defines until after
>> tegra-common.h is included. Fix this by moving the affected conditional code to
>> tegra-common-post.h, which is included last. Also move the definition of
>> SYS_NONCACHED_MEMORY since it's a related and adjacent definition.
>>
>> Fix the condition to test for the DFU feature, rather than specifically MMC DFU
>> support, so it applies in all cases.
>>
>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>
> Do you want me to take these last four in to u-boot-tegra for the pending PR, or do you expect them to go in another way?

I believe the 4 "ARM: tegra:" patches can go through the Tegra tree
since they're independent from the other patches in the series. Thanks.
Stephen Warren Sept. 8, 2015, 9:52 p.m. UTC | #2
On 09/08/2015 02:45 PM, Stephen Warren wrote:
> On 09/08/2015 09:53 AM, Tom Warren wrote:
>> Stephen,
>>
>> Stephen Warren wrote at Friday, September 04, 2015 9:04 PM:
>>> From: Stephen Warren <swarren@nvidia.com>
>>>
>>> Commit 52a7c98a1772 "tegra-common: increase malloc pool len by dfu mmc file
>>> buffer size" updated the definition of CONFIG_SYS_MALLOC_LEN for Tegra to
>>> take account of the DFU buffer size. However, this change had no effect, since
>>> typical Tegra board config headers don't set the DFU- related defines until after
>>> tegra-common.h is included. Fix this by moving the affected conditional code to
>>> tegra-common-post.h, which is included last. Also move the definition of
>>> SYS_NONCACHED_MEMORY since it's a related and adjacent definition.
>>>
>>> Fix the condition to test for the DFU feature, rather than specifically MMC DFU
>>> support, so it applies in all cases.
>>>
>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>
>> Do you want me to take these last four in to u-boot-tegra for the pending PR, or do you expect them to go in another way?
> 
> I believe the 4 "ARM: tegra:" patches can go through the Tegra tree
> since they're independent from the other patches in the series. Thanks.

I note that Lukasz has ack'd all the other patches, so perhaps you can
just take the whole series through the Tegra tree? At least the DFU
patches since he's maintainer there. Perhaps TomR can ack the ext4
patches since they don't seem to have a maintainer.
Stephen Warren Sept. 8, 2015, 9:56 p.m. UTC | #3
On 09/08/2015 02:56 PM, Tom Rini wrote:
> On Tue, Sep 08, 2015 at 02:52:06PM -0700, Stephen Warren wrote:
>> On 09/08/2015 02:45 PM, Stephen Warren wrote:
>>> On 09/08/2015 09:53 AM, Tom Warren wrote:
>>>> Stephen,
>>>> 
>>>> Stephen Warren wrote at Friday, September 04, 2015 9:04 PM:
>>>>> From: Stephen Warren <swarren@nvidia.com>
>>>>> 
>>>>> Commit 52a7c98a1772 "tegra-common: increase malloc pool len
>>>>> by dfu mmc file buffer size" updated the definition of
>>>>> CONFIG_SYS_MALLOC_LEN for Tegra to take account of the DFU
>>>>> buffer size. However, this change had no effect, since 
>>>>> typical Tegra board config headers don't set the DFU-
>>>>> related defines until after tegra-common.h is included. Fix
>>>>> this by moving the affected conditional code to 
>>>>> tegra-common-post.h, which is included last. Also move the
>>>>> definition of SYS_NONCACHED_MEMORY since it's a related and
>>>>> adjacent definition.
>>>>> 
>>>>> Fix the condition to test for the DFU feature, rather than
>>>>> specifically MMC DFU support, so it applies in all cases.
>>>>> 
>>>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>>> 
>>>> Do you want me to take these last four in to u-boot-tegra for
>>>> the pending PR, or do you expect them to go in another way?
>>> 
>>> I believe the 4 "ARM: tegra:" patches can go through the Tegra
>>> tree since they're independent from the other patches in the
>>> series. Thanks.
>> 
>> I note that Lukasz has ack'd all the other patches, so perhaps
>> you can just take the whole series through the Tegra tree? At
>> least the DFU patches since he's maintainer there. Perhaps TomR
>> can ack the ext4 patches since they don't seem to have a
>> maintainer.
> 
> I think I snagged them all in patchwork for myself.  Do the Tegra
> ones depend on anything else?

I don't believe the Tegra patches depend on anything to compile or
run; they're just all conceptually related to DFU support on Tegra.
Tom Rini Sept. 8, 2015, 9:56 p.m. UTC | #4
On Tue, Sep 08, 2015 at 02:52:06PM -0700, Stephen Warren wrote:
> On 09/08/2015 02:45 PM, Stephen Warren wrote:
> > On 09/08/2015 09:53 AM, Tom Warren wrote:
> >> Stephen,
> >>
> >> Stephen Warren wrote at Friday, September 04, 2015 9:04 PM:
> >>> From: Stephen Warren <swarren@nvidia.com>
> >>>
> >>> Commit 52a7c98a1772 "tegra-common: increase malloc pool len by dfu mmc file
> >>> buffer size" updated the definition of CONFIG_SYS_MALLOC_LEN for Tegra to
> >>> take account of the DFU buffer size. However, this change had no effect, since
> >>> typical Tegra board config headers don't set the DFU- related defines until after
> >>> tegra-common.h is included. Fix this by moving the affected conditional code to
> >>> tegra-common-post.h, which is included last. Also move the definition of
> >>> SYS_NONCACHED_MEMORY since it's a related and adjacent definition.
> >>>
> >>> Fix the condition to test for the DFU feature, rather than specifically MMC DFU
> >>> support, so it applies in all cases.
> >>>
> >>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> >>
> >> Do you want me to take these last four in to u-boot-tegra for the pending PR, or do you expect them to go in another way?
> > 
> > I believe the 4 "ARM: tegra:" patches can go through the Tegra tree
> > since they're independent from the other patches in the series. Thanks.
> 
> I note that Lukasz has ack'd all the other patches, so perhaps you can
> just take the whole series through the Tegra tree? At least the DFU
> patches since he's maintainer there. Perhaps TomR can ack the ext4
> patches since they don't seem to have a maintainer.

I think I snagged them all in patchwork for myself.  Do the Tegra ones
depend on anything else?
Ɓukasz Majewski Sept. 9, 2015, 6:51 a.m. UTC | #5
Hi Stephen,

> On 09/08/2015 02:45 PM, Stephen Warren wrote:
> > On 09/08/2015 09:53 AM, Tom Warren wrote:
> >> Stephen,
> >>
> >> Stephen Warren wrote at Friday, September 04, 2015 9:04 PM:
> >>> From: Stephen Warren <swarren@nvidia.com>
> >>>
> >>> Commit 52a7c98a1772 "tegra-common: increase malloc pool len by
> >>> dfu mmc file buffer size" updated the definition of
> >>> CONFIG_SYS_MALLOC_LEN for Tegra to take account of the DFU buffer
> >>> size. However, this change had no effect, since typical Tegra
> >>> board config headers don't set the DFU- related defines until
> >>> after tegra-common.h is included. Fix this by moving the affected
> >>> conditional code to tegra-common-post.h, which is included last.
> >>> Also move the definition of SYS_NONCACHED_MEMORY since it's a
> >>> related and adjacent definition.
> >>>
> >>> Fix the condition to test for the DFU feature, rather than
> >>> specifically MMC DFU support, so it applies in all cases.
> >>>
> >>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> >>
> >> Do you want me to take these last four in to u-boot-tegra for the
> >> pending PR, or do you expect them to go in another way?
> > 
> > I believe the 4 "ARM: tegra:" patches can go through the Tegra tree
> > since they're independent from the other patches in the series.
> > Thanks.
> 
> I note that Lukasz has ack'd all the other patches, so perhaps you can
> just take the whole series through the Tegra tree? At least the DFU
> patches since he's maintainer there. 

I personally would opt for applying this series to one tree. I've
already ack'ed those patches, so those can go to any other tree (or
even -dfu one when nobody wants to pick them :-)).

> Perhaps TomR can ack the ext4
> patches since they don't seem to have a maintainer.

Lack of FS (FAT, EXT4) maintainer is PITTA. I hope that somebody would
step up for this position.
Tom Rini Sept. 12, 2015, 12:51 p.m. UTC | #6
On Fri, Sep 04, 2015 at 10:03:48PM -0600, Stephen Warren wrote:

> From: Stephen Warren <swarren@nvidia.com>
> 
> Commit 52a7c98a1772 "tegra-common: increase malloc pool len by dfu mmc
> file buffer size" updated the definition of CONFIG_SYS_MALLOC_LEN for
> Tegra to take account of the DFU buffer size. However, this change had
> no effect, since typical Tegra board config headers don't set the DFU-
> related defines until after tegra-common.h is included. Fix this by
> moving the affected conditional code to tegra-common-post.h, which is
> included last. Also move the definition of SYS_NONCACHED_MEMORY since
> it's a related and adjacent definition.
> 
> Fix the condition to test for the DFU feature, rather than specifically
> MMC DFU support, so it applies in all cases.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h
index e67ff7b95715..594fa456d17f 100644
--- a/include/configs/tegra-common-post.h
+++ b/include/configs/tegra-common-post.h
@@ -8,6 +8,20 @@ 
 #ifndef __TEGRA_COMMON_POST_H
 #define __TEGRA_COMMON_POST_H
 
+/*
+ * Size of malloc() pool
+ */
+#ifdef CONFIG_USB_FUNCTION_DFU
+#define CONFIG_SYS_MALLOC_LEN		((4 << 20) + \
+						CONFIG_SYS_DFU_DATA_BUF_SIZE)
+#else
+#define CONFIG_SYS_MALLOC_LEN		(4 << 20)	/* 4MB  */
+#endif
+
+#ifndef CONFIG_ARM64
+#define CONFIG_SYS_NONCACHED_MEMORY	(1 << 20)	/* 1 MiB */
+#endif
+
 #ifndef CONFIG_SPL_BUILD
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 1) \
diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
index 6fe5f2ce6543..b886c6450763 100644
--- a/include/configs/tegra-common.h
+++ b/include/configs/tegra-common.h
@@ -37,20 +37,6 @@ 
 #define CONFIG_ENV_SIZE			0x2000	/* Total Size Environment */
 
 /*
- * Size of malloc() pool
- */
-#ifdef CONFIG_DFU_MMC
-#define CONFIG_SYS_MALLOC_LEN		((4 << 20) + \
-					CONFIG_SYS_DFU_DATA_BUF_SIZE)
-#else
-#define CONFIG_SYS_MALLOC_LEN		(4 << 20)	/* 4MB  */
-#endif
-
-#ifndef CONFIG_ARM64
-#define CONFIG_SYS_NONCACHED_MEMORY	(1 << 20)       /* 1 MiB */
-#endif
-
-/*
  * NS16550 Configuration
  */
 #define CONFIG_TEGRA_SERIAL