From patchwork Thu May 3 08:32:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 134882 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1635260lji; Thu, 3 May 2018 01:32:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrVld+uKz60B8P0KesTo0Jgf9Kk38oaJZNi6VGDtUpK4IxFf4BfOGJcAP8z3X0PkNFrv9Hu X-Received: by 10.98.178.208 with SMTP id z77mr22249980pfl.122.1525336378115; Thu, 03 May 2018 01:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525336378; cv=none; d=google.com; s=arc-20160816; b=M5D/Jzqx5QYgzzXce+wkj4tKQzXRHuNFti9eQGNzNHmpMsTWK2gaan8a4P85Firy9e sGqbvtUaM44AOEY9G2HNMyUh7oLftDK6HYi0CXPkLd/9r57gMzUpWqu4OFzDr69QXKpg YEwj+o29k/WmW+L+83XSmNPJwZuej2PJznoL399VXeun64eMiWkcePs0YKsRp2UMAIsm 0IKr1jcyrhsniuORa4nKoozxQAhLh4vrHEdPxvU3Cs/DIxoVvovL4+j+h4FOck06OyEp YoRcQRhwnu5mg35SJ1b+hSQhdwR6phBnwWliRjbMk46JUk9dVpfcskxBLP9siKmQp7Jy kAPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ESOcQ9cfaoHScIdRFoE9W9/JBLle7jtN2XGLxWwFN8k=; b=MUiq0FpWgPtB3FAOwly6JY+SdWF7KOtaPymingwdi/S3O8JBKfavmBiQ/o4WExRirl yI4I6WJnp6LKlKadTE8EX4sgdjBQ8d012V+JrJoeP/hj9YjDxqrY9p5WFAW6iRD2tc4I zCbjwWluXrLmDInZN9LloA1rJKOf1kecMpIzj1X0wBwmgXm+ypbcU/+135/MqoohxELX c42qysD7MfS+hGbyu1Vkk5v8yU0YsAbHOE99bGY2fNYg3mjhqjACmqBudKKgsD6B6T/c HDJzBNVkbBdy04jhDMTJwzJoJIuTem/7BxNVNoQpDo7WrSKMUQBoQtrfCySt5lrol67Q Lp8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E5wwSCkW; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2si13690285pfh.215.2018.05.03.01.32.57; Thu, 03 May 2018 01:32:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E5wwSCkW; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750945AbeECIcz (ORCPT + 10 others); Thu, 3 May 2018 04:32:55 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:43055 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbeECIcx (ORCPT ); Thu, 3 May 2018 04:32:53 -0400 Received: by mail-pg0-f68.google.com with SMTP id k11-v6so11492183pgo.10 for ; Thu, 03 May 2018 01:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=ESOcQ9cfaoHScIdRFoE9W9/JBLle7jtN2XGLxWwFN8k=; b=E5wwSCkWn0woIeR2PIJnTBF/3dgL8dNmAM+RnQLRrguKJPFSNRGYdDG43vsn+nDDR+ gMluZzGN4Nrr4uSWmUUm+L+TZAmkmX5UpC5PnzeH+g/jtMDpyVfKzKS4PWJn1htxilJR gh8LxXoxpnvqJ4RZobAJ/KMvqVyoUzK8flj/E= 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=ESOcQ9cfaoHScIdRFoE9W9/JBLle7jtN2XGLxWwFN8k=; b=D50EH5/XnI6MfR5EwWna2tZLfy10KP7lX42VL3LsvfxXVnmjGWvMUVP92QH6hNtMSi SXeVl68Ad6CrVKuOVZBjXuH52vYrOGuGBGFE+dGOprXMijA9MBFpypVLCJONugTw66b3 UI2CZ4HQ0bAyXkKij8+wlpqNrqcVP7uQyF8i1gY4/n0gTtS7F6Ll7GAsfNzCztfP1ybb 1E3jdwcXT8zQZQipXkMseqWXPfT8OXdjUjPOnlfZkeDTiesJO6oYyYrXcEf5EB13PW5W YpbVpbJRYXqUixfjLTpRCHlDLxzFbfLBVJMK4mJ8OWTLH1sp4ZOXC2VGxxRy44rosGi6 58Xw== X-Gm-Message-State: ALQs6tBTcyYOK2sZsO6TSKRaliHEafJkJRUj59Q4RDA/CFzVhiCHmUBp PyGTRoK1PsAZds3E5fNVQG0hOw== X-Received: by 2002:a65:4244:: with SMTP id d4-v6mr18416974pgq.234.1525336372366; Thu, 03 May 2018 01:32:52 -0700 (PDT) Received: from localhost ([122.167.163.112]) by smtp.gmail.com with ESMTPSA id s20-v6sm20420981pgv.14.2018.05.03.01.32.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 May 2018 01:32:51 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , ulf.hansson@linaro.org, Thierry Reding , Jonathan Hunter Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , rnayak@codeaurora.org, linux-tegra@vger.kernel.org Subject: [PATCH V2] soc/tegra: pmc: Don't allocate struct tegra_powergate on stack Date: Thu, 3 May 2018 14:02:48 +0530 Message-Id: <9b50f005ec748528cda2dde4ce03e2f958fe288a.1525336111.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org With a later commit an instance of the struct device will be added to struct genpd and with that the size of the struct tegra_powergate will be over 1024 bytes. That generates following warning: drivers/soc/tegra/pmc.c:579:1: warning: the frame size of 1200 bytes is larger than 1024 bytes [-Wframe-larger-than=] Avoid such warnings by allocating the structure dynamically. Signed-off-by: Viresh Kumar --- V2: - Based of latest changes. - Compile tested only. @Jon: This was sent long back[1], but then the genpd series wasn't finalized, which is going to get merged [2] very soon now. Can I have your Ack for this patch so that I can apply it at the beginning of that series ? [1] https://lkml.kernel.org/r/3fe40fcd427e49cbeac31e14721fea569d230b6e.1490073884.git.viresh.kumar@linaro.org [2] https://lkml.kernel.org/r/cover.1523273291.git.viresh.kumar@linaro.org drivers/soc/tegra/pmc.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) -- 2.15.0.194.g9af6a3dea062 Acked-by: Thierry Reding diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index d9fcdb592b39..3e3d12ce4587 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -559,22 +559,28 @@ EXPORT_SYMBOL(tegra_powergate_remove_clamping); int tegra_powergate_sequence_power_up(unsigned int id, struct clk *clk, struct reset_control *rst) { - struct tegra_powergate pg; + struct tegra_powergate *pg; int err; if (!tegra_powergate_is_available(id)) return -EINVAL; - pg.id = id; - pg.clks = &clk; - pg.num_clks = 1; - pg.reset = rst; - pg.pmc = pmc; + pg = kzalloc(sizeof(*pg), GFP_KERNEL); + if (!pg) + return -ENOMEM; - err = tegra_powergate_power_up(&pg, false); + pg->id = id; + pg->clks = &clk; + pg->num_clks = 1; + pg->reset = rst; + pg->pmc = pmc; + + err = tegra_powergate_power_up(pg, false); if (err) pr_err("failed to turn on partition %d: %d\n", id, err); + kfree(pg); + return err; } EXPORT_SYMBOL(tegra_powergate_sequence_power_up);