Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13645754rwl; Wed, 4 Jan 2023 10:57:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXuioaLi3E9TrXvJv1brVrWbvuyoyak7FlHHPI4mh4M1Ydlbh0auoOhhc4ckI+4XqTB4Qo0e X-Received: by 2002:a05:6a21:3988:b0:ad:a09c:5734 with SMTP id ad8-20020a056a21398800b000ada09c5734mr71719024pzc.44.1672858624722; Wed, 04 Jan 2023 10:57:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672858624; cv=none; d=google.com; s=arc-20160816; b=CUEj4lnNfra5/z9RC313k0ayGr3wZ2eAnE3ok7drFmY/8OZmp5mWy6OM62pDiWqen+ 7IhKqM58g4ZllYcZy63i7Jq0ETZlDyqZx7ochkt5V5nvcS3eWEJF+jW6rLGmgrjiXABw P97f7UvxuQeFt1b4VSflrC5he5j+3vTOJSodYrI/oHBegPwqP53FG6vCP1C09QL0bBwl OcVrBjnbdjvQ7fie1pIIcaSQ7L8Gt7/+MbFyQbhOfkOpT0P8Ha3Fn27KgF1bKVMGI6G/ 8LDwlhNI/kinvKGSzw/KMMMs7v5ELELcgVeheiNonrekg9y7NzkcoGsWul52gRPy5oZb n7tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=YYSIgMlQfy8nhbpy+QV8N4ee9GqthCgUiYM6Fhi27Bw=; b=NBdTUGhdYLgcsxizudsv/YYtZ4rIU5uIccKYzp37/YdV8idFKMZrVgArB5zf/b9w2L fbqPmeTTDwbWn7KI/qCFCeJ0xaBQ6nMZWzh3hfRYLJRteG38SG0Ls/+qU3BlG2St1EGz S0g2hhPqHut4Wiwm5gGWutXA30DXazHw7um17009AuKyBd6lhhmkMD8E547ah04awGSA kZd5zaR5Ebw8YvE9U2Axe+/SU/b9EiBvwMzMXs8Rr7Q4hALE1zQv1RTiEOkxEOOWVa+8 ju+dM6HqusqxzdFqffd9dwUo4/gtLFQgLVCHS5/30YZWl7vLODmtfPSbj5PyJrkt6O7E 3EaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b="ANgi4/tn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a65490d000000b0046fef65f738si36477680pgs.793.2023.01.04.10.56.57; Wed, 04 Jan 2023 10:57:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b="ANgi4/tn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239852AbjADSOF (ORCPT + 56 others); Wed, 4 Jan 2023 13:14:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233421AbjADSOD (ORCPT ); Wed, 4 Jan 2023 13:14:03 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2B6B17E2B; Wed, 4 Jan 2023 10:14:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1672855886; bh=QAtVPb8/maBAbEqyYYU7IL6BXcXNEnFbxuu32oqJJJI=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=ANgi4/tnT+LdcOQfKXgDnOzpKxKHZajftGHzP36ewHMDwUsc8LOpFG11eZQAVYUkm effb8tGWZecMTmwsiw41ptMcbturL4t7yuO3L9MFOV/rBqdXxZp0uLdPWptEsmr512 ig3vEBmwMXFLSoAKTIYYUK5froS9xZyhZLZOyldxSa1kqdUEOCOTTqo3wUxqFaE1sx gvZYZqgH6L+Vph8ZuoerFfvit8e89Jqm24VsyHzLrQzEQy3m3OhJCnPHgrVMXlMsVq LqQmy7DK2SYpfAQjEFAJaY9kh3jjgsO65dmcK4rrWZiGZ/angNVI/cn7pWyGA3eQ+6 Dsjnr6i37i2Dw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.20.60] ([92.116.135.20]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N2V0H-1onx0z2eI3-013uIe; Wed, 04 Jan 2023 19:11:26 +0100 Message-ID: Date: Wed, 4 Jan 2023 19:11:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH] fbdev: omapfb: avoid stack overflow warning Content-Language: en-US To: Arnd Bergmann Cc: Arnd Bergmann , Zhang Qilong , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20221215170234.2515030-1-arnd@kernel.org> From: Helge Deller In-Reply-To: <20221215170234.2515030-1-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:o7jEKVSLoyMQ1mu2kGuybgdfN422oA9LLfcwWrY3jDvf/72dkTw jkaB7DZ6/dKNZJeUACKaGCerZFkZzKeinzt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ae0r+ Fx46LrxSaqPWA6UuYboGMyiuLuRHMUmQnTpqj3pVISBVg2R9wpRcuNIsbJjDsBL2W+XZsBw66 9ptsJA== X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/15/22 18:02, Arnd Bergmann wrote: > From: Arnd Bergmann > > The dsi_irq_stats structure is a little too big to fit on the > stack of a 32-bit task, depending on the specific gcc options: > > fbdev/omap2/omapfb/dss/dsi.c: In function 'dsi_dump_dsidev_irqs': > fbdev/omap2/omapfb/dss/dsi.c:1621:1: error: the frame size of 1064 bytes= is larger than 1024 bytes [-Werror=3Dframe-larger-than=3D] > > Since this is only a debugfs file, performance is not critical, > so just dynamically allocate it, and print an error message > in there in place of a failure code when the allocation fails. > > Signed-off-by: Arnd Bergmann applied to fbdev git tree. Thanks! Helge > --- > drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 28 ++++++++++++++-------- > 1 file changed, 18 insertions(+), 10 deletions(-) > > diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/= fbdev/omap2/omapfb/dss/dsi.c > index 54b0f034c2ed..7cddb7b8ae34 100644 > --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c > +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c > @@ -1536,22 +1536,28 @@ static void dsi_dump_dsidev_irqs(struct platform= _device *dsidev, > { > struct dsi_data *dsi =3D dsi_get_dsidrv_data(dsidev); > unsigned long flags; > - struct dsi_irq_stats stats; > + struct dsi_irq_stats *stats; > + > + stats =3D kzalloc(sizeof(*stats), GFP_KERNEL); > + if (!stats) { > + seq_printf(s, "out of memory\n"); > + return; > + } > > spin_lock_irqsave(&dsi->irq_stats_lock, flags); > > - stats =3D dsi->irq_stats; > + *stats =3D dsi->irq_stats; > memset(&dsi->irq_stats, 0, sizeof(dsi->irq_stats)); > dsi->irq_stats.last_reset =3D jiffies; > > spin_unlock_irqrestore(&dsi->irq_stats_lock, flags); > > seq_printf(s, "period %u ms\n", > - jiffies_to_msecs(jiffies - stats.last_reset)); > + jiffies_to_msecs(jiffies - stats->last_reset)); > > - seq_printf(s, "irqs %d\n", stats.irq_count); > + seq_printf(s, "irqs %d\n", stats->irq_count); > #define PIS(x) \ > - seq_printf(s, "%-20s %10d\n", #x, stats.dsi_irqs[ffs(DSI_IRQ_##x)-1]) > + seq_printf(s, "%-20s %10d\n", #x, stats->dsi_irqs[ffs(DSI_IRQ_##x)-1]) > > seq_printf(s, "-- DSI%d interrupts --\n", dsi->module_id + 1); > PIS(VC0); > @@ -1575,10 +1581,10 @@ static void dsi_dump_dsidev_irqs(struct platform= _device *dsidev, > > #define PIS(x) \ > seq_printf(s, "%-20s %10d %10d %10d %10d\n", #x, \ > - stats.vc_irqs[0][ffs(DSI_VC_IRQ_##x)-1], \ > - stats.vc_irqs[1][ffs(DSI_VC_IRQ_##x)-1], \ > - stats.vc_irqs[2][ffs(DSI_VC_IRQ_##x)-1], \ > - stats.vc_irqs[3][ffs(DSI_VC_IRQ_##x)-1]); > + stats->vc_irqs[0][ffs(DSI_VC_IRQ_##x)-1], \ > + stats->vc_irqs[1][ffs(DSI_VC_IRQ_##x)-1], \ > + stats->vc_irqs[2][ffs(DSI_VC_IRQ_##x)-1], \ > + stats->vc_irqs[3][ffs(DSI_VC_IRQ_##x)-1]); > > seq_printf(s, "-- VC interrupts --\n"); > PIS(CS); > @@ -1594,7 +1600,7 @@ static void dsi_dump_dsidev_irqs(struct platform_d= evice *dsidev, > > #define PIS(x) \ > seq_printf(s, "%-20s %10d\n", #x, \ > - stats.cio_irqs[ffs(DSI_CIO_IRQ_##x)-1]); > + stats->cio_irqs[ffs(DSI_CIO_IRQ_##x)-1]); > > seq_printf(s, "-- CIO interrupts --\n"); > PIS(ERRSYNCESC1); > @@ -1618,6 +1624,8 @@ static void dsi_dump_dsidev_irqs(struct platform_d= evice *dsidev, > PIS(ULPSACTIVENOT_ALL0); > PIS(ULPSACTIVENOT_ALL1); > #undef PIS > + > + kfree(stats); > } > > static void dsi1_dump_irqs(struct seq_file *s)