Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp342094ybz; Wed, 29 Apr 2020 00:58:52 -0700 (PDT) X-Google-Smtp-Source: APiQypJ42b/9CsLa4FfwviLgmU511UVJ1ZBmt44DIYnneOr6YMx30EpKfS1kWaEaDC5gmaIP3ZoU X-Received: by 2002:a05:6402:1a46:: with SMTP id bf6mr1297740edb.44.1588147131942; Wed, 29 Apr 2020 00:58:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588147131; cv=none; d=google.com; s=arc-20160816; b=y9yyegupdakO79prQ/G7A+oPQIjkIWvXhtfDR67nZ5g9G72jG0yxZu7tKteP7AwlMV io6ZRbsiPXTdui8qBJ6y2D8khybbO8PmzaodwD/nL+Ee0CGlKsSmfvQ/FsVmlFbuOpGE HH91Oyqh8V5uQWn5g76mNMgaVQJvgtBWVZdX73kBIVZiJN/Tqi2X2CwbWKvtDCp45sNB p5INVobqvQKLoDst0dONCjbUbBu++FptzcMA0UiAEAzw4+UNXxVfdm80mws61S+7LfMF 6Eo6nuAyYls+dHM1MiPtoTckBaWP9mX3des+iD7IpJaDs4euAxIM5gy6Px0FIacGyqdq +29g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=n4pmfRipX17yviyXCDK8at/AM0pg14P8PWeY9w6wQmA=; b=ZSFSGChK5GC7FVhNCKbg0dpMH3pJjLmYQ4swEMOfT1DQ6k5oBwkDuBwFI9JD0tue6b 3wbZciU5kBqo4Y36IRqham625D6gaVdwnpAhlzMgn9bHP7JzbRdDgklyreitdtj7DcKq U2Sn5zdFwGtzmSA4YBpPjvHyApsK4J1bHuxSCu049Y/qMWC9BtNqjZwJOXJLw3mFjYKq bG9aoypsC9vluuaDF3JgJEu4hADMl/eSTRSiH80wLPYW6QhowMPE+WdviWL0gpDJNyGZ yYfUYUx1y2tBIBKkPMOFyfsSJfpkUssTVCAnYP80V81chZ4GDObKgZgdL/g0MkCQWdfi yeRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XDfkkNuU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si3078335edl.558.2020.04.29.00.58.28; Wed, 29 Apr 2020 00:58:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XDfkkNuU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726618AbgD2H4l (ORCPT + 99 others); Wed, 29 Apr 2020 03:56:41 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:54284 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726381AbgD2H4l (ORCPT ); Wed, 29 Apr 2020 03:56:41 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 03T7uN8w007867; Wed, 29 Apr 2020 02:56:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1588146983; bh=n4pmfRipX17yviyXCDK8at/AM0pg14P8PWeY9w6wQmA=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=XDfkkNuUPYbFAV2lKtYm2z5y+m4/7Qo7STPFfnkln0JgNbc19/pUDC16TTyYK5sXU nucf2/Vc057I3eFohiLDCxffAjvn4V7jzRRwHQMobraXzKpC5x7rTcq6jFO4loa1TL 0HeWsLMASeQNvQ4qgAkJK0RYBVKc6/W/G/SaptDo= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 03T7uNgE116017 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 29 Apr 2020 02:56:23 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 29 Apr 2020 02:56:22 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 29 Apr 2020 02:56:22 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 03T7uJJV074144; Wed, 29 Apr 2020 02:56:20 -0500 Subject: Re: [PATCH] drm/bridge: fix stack usage warning on old gcc To: Arnd Bergmann , Andrzej Hajda , Neil Armstrong , David Airlie , Daniel Vetter , Peter Ujfalusi CC: Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Boris Brezillon , Sebastian Reichel , , References: <20200428215408.4111675-1-arnd@arndb.de> From: Tomi Valkeinen Message-ID: <22ee464b-f59a-69a3-b669-f821d567fbf5@ti.com> Date: Wed, 29 Apr 2020 10:56:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200428215408.4111675-1-arnd@arndb.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/04/2020 00:53, Arnd Bergmann wrote: > Some older versions of gcc badly optimize code that passes > an inline function argument into another function by reference, > causing huge stack usage: > > drivers/gpu/drm/bridge/tc358768.c: In function 'tc358768_bridge_pre_enable': > drivers/gpu/drm/bridge/tc358768.c:840:1: error: the frame size of 2256 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] > > Use a temporary variable as a workaround and add a comment pointing > to the gcc bug. > > Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") > Signed-off-by: Arnd Bergmann > --- > drivers/gpu/drm/bridge/tc358768.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c > index 1b39e8d37834..6650fe4cfc20 100644 > --- a/drivers/gpu/drm/bridge/tc358768.c > +++ b/drivers/gpu/drm/bridge/tc358768.c > @@ -178,6 +178,8 @@ static int tc358768_clear_error(struct tc358768_priv *priv) > > static void tc358768_write(struct tc358768_priv *priv, u32 reg, u32 val) > { > + /* work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 */ > + int tmpval = val; > size_t count = 2; > > if (priv->error) > @@ -187,7 +189,7 @@ static void tc358768_write(struct tc358768_priv *priv, u32 reg, u32 val) > if (reg < 0x100 || reg >= 0x600) > count = 1; > > - priv->error = regmap_bulk_write(priv->regmap, reg, &val, count); > + priv->error = regmap_bulk_write(priv->regmap, reg, &tmpval, count); > } > > static void tc358768_read(struct tc358768_priv *priv, u32 reg, u32 *val) > tc358768_write is not inline. What is the inline function here? Or is tc358768_write optimized to inline by the compiler? Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki