From patchwork Mon Jul 10 14:44:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9833151 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1D79A60350 for ; Mon, 10 Jul 2017 14:46:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D55027CAF for ; Mon, 10 Jul 2017 14:46:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00B33283AF; Mon, 10 Jul 2017 14:46:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E0D527CAF for ; Mon, 10 Jul 2017 14:46:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754014AbdGJOpm (ORCPT ); Mon, 10 Jul 2017 10:45:42 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:56187 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753394AbdGJOpl (ORCPT ); Mon, 10 Jul 2017 10:45:41 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0MfE8E-1dJ5Rr2nm6-00OmEK; Mon, 10 Jul 2017 16:44:33 +0200 From: Arnd Bergmann To: x86@kernel.org Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Kalle Valo , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Arnd Bergmann Subject: [RFC 2/2] wl3501_cs: reduce stack size for KASAN Date: Mon, 10 Jul 2017 16:44:25 +0200 Message-Id: <20170710144425.2238584-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170710144425.2238584-1-arnd@arndb.de> References: <20170710144425.2238584-1-arnd@arndb.de> X-Provags-ID: V03:K0:hQK/HbOz94xxVR2UHagG2MTeGlCYF2GHgozK4pZlGbQd3HXFYZR sDGLSGg5tpdV5cBYCqrWWh1H43ImPJ+LH7jzBnX3pADiYMnhErzTmIZnAg/JHyoBd4vX5F/ 0MMtXO3j428zXc+aLZgPjTXj7AsPjV5Gtps9uHbRfJdtA/9lSeZLESdWjubT4EeT5eeGf6h cg2o3VEJiaNKjRWqYBrDw== X-UI-Out-Filterresults: notjunk:1; V01:K0:bTltFPUyps0=:I8zf4c4NslDBBIWC9s/GNQ 7PLKMjlaVAilBYpaTPnECER175fsEPfQ6aq+iqV5x0tdTHt4xWRStqJpZRZNngrmo45/Nd29F m/LcwtKbXoP03I2l5S514J4QzxWBm8Hsga0sqhJv0o38M/akxJ3vHwuLBjdDvRWy9uVwz91P0 UgEVb8mm8x5FKEshBF/9lb7Pd+r1qkb25RxIPWdRH1Tt+B2val7xujWBkF4Appc2VCTUOwKJp snZP979WBRVqUnqaytyJ6ZL+bMSx/zV1hSdzBvg0LrwK7oSw0mnc+cgcGHydIIH3nXF43Uk8w NMBGX2Uu+0UET/0hnmtz8nRmQL0n6b6i5zLGdNEf3Aj34zFg8T/6Ty9qqcPixCR+rlr6lp4iM POMWgurNBTJhL9uPgu7DKyk+dTVUHhXo/DSvD1gTVQOh1JRhpJpoqu9bYXzytxll/w4zLvDVh yipiapazqdnuRU5UIPKUzh+dttAjvCu64YaEQ8E8CGK99mtyxi9TmeMws5oBRx2VEaXXn2Rl3 BYIk3rSFCu2rlYSTdExDEjXu3yCBi2V3veReFHcntOTGGqCHBJPDzoYIMpDTHSnzDi1CnFCQT 9yKEr+/PsxRhr/1ry1PsTiDviP5AP9kw9vPTjC3hO+ueVseknjqcpB3VDlKax/7dC26nwqXdM BnyfsNiVGkGGwhegVl3mX85tL7vZrgLSB+BqZpJ+5QM0oPkQEiJ3Ec2YvDubTWdrEu8M= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Inlining functions with local variables can lead to excessive stack usage with KASAN after a previous patch that modifies the outsb/insb helpers on x86. drivers/net/wireless/wl3501_cs.c: In function 'wl3501_rx_interrupt': drivers/net/wireless/wl3501_cs.c:1103:1: error: the frame size of 2232 bytes is larger than 1536 bytes [-Werror=frame-larger-than=] Marking the two callers of insb/outb 'noinline' prevents the compiler from adding up the stack usage for each of the local variables passed into those, reducing the maximum stack frame size to 800 bytes with KASAN again. Signed-off-by: Arnd Bergmann --- drivers/net/wireless/wl3501_cs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index acec0d9ec422..2cce22571b4c 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c @@ -242,8 +242,8 @@ static int wl3501_get_flash_mac_addr(struct wl3501_card *this) * * Move 'size' bytes from PC to card. (Shouldn't be interrupted) */ -static void wl3501_set_to_wla(struct wl3501_card *this, u16 dest, void *src, - int size) +static noinline void wl3501_set_to_wla(struct wl3501_card *this, + u16 dest, void *src, int size) { /* switch to SRAM Page 0 */ wl3501_switch_page(this, (dest & 0x8000) ? WL3501_BSS_SPAGE1 : @@ -264,8 +264,8 @@ static void wl3501_set_to_wla(struct wl3501_card *this, u16 dest, void *src, * * Move 'size' bytes from card to PC. (Shouldn't be interrupted) */ -static void wl3501_get_from_wla(struct wl3501_card *this, u16 src, void *dest, - int size) +static noinline void wl3501_get_from_wla(struct wl3501_card *this, + u16 src, void *dest, int size) { /* switch to SRAM Page 0 */ wl3501_switch_page(this, (src & 0x8000) ? WL3501_BSS_SPAGE1 :