From patchwork Sun Sep 17 13:38:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 814651 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="u0yd+xok"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xw9GL6CrTz9s81 for ; Sun, 17 Sep 2017 23:39:05 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 581FBC21E40; Sun, 17 Sep 2017 13:39:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4D8EBC21CB3; Sun, 17 Sep 2017 13:38:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 17D1FC21CB3; Sun, 17 Sep 2017 13:38:13 +0000 (UTC) Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) by lists.denx.de (Postfix) with ESMTPS id 90169C21C62 for ; Sun, 17 Sep 2017 13:38:12 +0000 (UTC) Received: by mail-qk0-f193.google.com with SMTP id d70so4079704qkc.1 for ; Sun, 17 Sep 2017 06:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=jKbOnipKB4HLvJuAhBvrklI1CFtKN4/LD9wlfMBztlQ=; b=u0yd+xokAHYeIC3FzB01OIp2ucx+Qwg1oqZNiiiu0iSZSCcUwLh9mC6p1ze4MhgZmH 06HecvS3e23oyainF1jk4fGYWh2h4HmNBP/133OlGNj/1qLz7tVrlL70zd7KHn0ZMgAR 5P0i4aViKkpkTOo9ltP5gUHxVd9e7AEc7M8ilZauqzU35cdlAzuJixoWYOA+QGjpHiBq F3g4biv3CYrcc5swfhfDeyO19OY3Rqgbt2lSriOE3xgrlOO1PdLEKwHo1ELT/Jowslce JimfRVMeSZUQUw2Qtpb0354yg6SLU036ZaFe0GSf9c84RewldO1MJ/D+DfAzIHA+3esM opJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jKbOnipKB4HLvJuAhBvrklI1CFtKN4/LD9wlfMBztlQ=; b=YQvEsTUNt6U2InnFf/RUaUp4ELTOD6DkmTTBtWBEra02mqOictZrewdg/z4f/iXytv IB6AFtCIhtduC4JhGZ5J9NvaYE24eR6nAAG7CgRmpm5EKdzzwJchFRR4roTPDJE/F6lI R+nVFBrxAvRdJgTVx6ZQGIubed8lx3tFPSgEwRB+3hFU+/loAptRlPBatlX8Y1YAA8Ro 8xyRHSsg5nJT6YZqaTgkhbsjT7CHtvuL+56HJULNcGTSeZe75rptATY+ipupffDksr6N 3X6sCPT9fvx1XRmJsKbBsQYte5DTAEtlPH8MS7pkDlxd44LTcdi33T4i5hCZmzGME38f Mrsg== X-Gm-Message-State: AHPjjUiwkTSlpe2eArnSsmBskmMDI8ZVdC8WxIVWjqFQQkGixDvObOJx BJjrgyvh+VrV3hUxlzk= X-Google-Smtp-Source: AOwi7QAb97++//08p42M1PJVqNGy0TYD/dA2QLtWQHiQYdu0FuSgCv9eR/qp+X5UceUNx1mQq6EekA== X-Received: by 10.55.41.206 with SMTP id p75mr16508728qkp.227.1505655490988; Sun, 17 Sep 2017 06:38:10 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id n85sm3544264qke.53.2017.09.17.06.38.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Sep 2017 06:38:09 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Sun, 17 Sep 2017 09:38:04 -0400 Message-Id: <20170917133807.16819-1-robdclark@gmail.com> X-Mailer: git-send-email 2.13.5 Cc: Tom Rini , =?utf-8?q?Stefan_Br=C3=BCns?= Subject: [U-Boot] [PATCH please test] fs/fat: reduce stack usage for SPL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" It seems like stack usage is a problem for SPL builds. So move itrblock off the stack. Please test this and see if it helps w/ current issues with SPL builds. Long term, I'm not sure if it is better to do this conditional on SPL builds, or move to malloc()? At any rate, if this fixes SPL builds it should be a perfectly ok short term solution. Signed-off-by: Rob Clark Tested-by: Tom Rini Tested-by: Adam Ford --- fs/fat/fat.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/fat/fat.c b/fs/fat/fat.c index f0284398b4..93140c9bcb 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -1031,10 +1031,12 @@ int file_fat_detectfs(void) return 0; } +static fat_itr itrblock; + int fat_exists(const char *filename) { fsdata fsdata; - fat_itr itrblock, *itr = &itrblock; + fat_itr *itr = &itrblock; int ret; ret = fat_itr_root(itr, &fsdata); @@ -1049,7 +1051,7 @@ int fat_exists(const char *filename) int fat_size(const char *filename, loff_t *size) { fsdata fsdata; - fat_itr itrblock, *itr = &itrblock; + fat_itr *itr = &itrblock; int ret; ret = fat_itr_root(itr, &fsdata); @@ -1081,7 +1083,7 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer, loff_t maxsize, loff_t *actread) { fsdata fsdata; - fat_itr itrblock, *itr = &itrblock; + fat_itr *itr = &itrblock; int ret; ret = fat_itr_root(itr, &fsdata);