Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1967755lqp; Sat, 23 Mar 2024 18:24:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVFhcuXLF82UvKGfZYIkgcvKKwS1Xra+ia8s4wS7MPGo2ABriBid3bPOvkJ7NliZ7qrLfi2ummowXM0opX/5JuYBEl96iBRf+B8ST1kMw== X-Google-Smtp-Source: AGHT+IG+bJnnQZn7Z6E78xtW5ClJOcniH83/Ls8YH/McIEVxZOrLqme9/QJ7tHGwTN7UaWP1X0PE X-Received: by 2002:a05:6870:a90d:b0:220:aaf1:d35f with SMTP id eq13-20020a056870a90d00b00220aaf1d35fmr4212672oab.16.1711243451306; Sat, 23 Mar 2024 18:24:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711243451; cv=pass; d=google.com; s=arc-20160816; b=rI0BdufgDmQiHBkroYgIfkLSmQ50fuoELXrFp0VURDahN5CSFISmNFLaCaaPMCD3H+ 01yeiFdIOIpeVtfrLx9u2FeH+2n6xv7OLPH3jMltTtYSXe+HOalHrr51WRA4Dbbac9zQ Zyk4A/nu/cPPxaSzaJD8lEbkKN6eI009wAUOpGH//RUyN3VWFu0AQR3TRWJ2RWTm/Btw TbiDj8oE4Cmr2ewLuPmTG7aKlSMVP3jomd/vpECmpa81GYQjvg4r94XC72BezQ1D1BYx w6xkSUHzX5c5SLTIehDfHMxwhJUlz2WGWB+NsgtbAjvpHpUDyXopPXzmvuaHAlLPrwvf Nong== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=9L1Ixhk4fnArxEJyLsZSUrzBMXeZlWcbrA4YzaHi20w=; fh=bUX/u1bFaO4oyyaEQdqBNqwa+u+rMIQADyjHnGTseLY=; b=rN2iGcmBbwCdoVCVWJ1WZAuNGOrhOU02fKqY4SoBmIpzfMMokl+TtQavxmyfuh7tRm vS+w1Qmj+jlmL2eFYd7Zf0uGdFWsIIOHMDlGVPYIJZ1EF+D2qd38+uR5eIa46AQDDTGk UUzDDkVsQTeJlKa+kzkDYxcW6j+k8xDaECfPNrtClc5z53nUXyr64sYyrn1gxm7agwnu xSZodEJWg0MXVYGr/wEhU3PpXRpAPz2KE/y5pBfTVxEvabJ4g3pohsfl06m6/r8MJwAW hOFKq7/qM1upJxsaZOosd+C8gijesPjm+AS+euqs6OfPUYhBNyYWTW38ULRVTDRtqGpV Rw7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YA2pouGY; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-112540-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112540-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y11-20020a62f24b000000b006e6ac562c2bsi2469735pfl.129.2024.03.23.18.24.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 18:24:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112540-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YA2pouGY; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-112540-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112540-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E177C281E13 for ; Sun, 24 Mar 2024 01:24:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D4F217F3; Sun, 24 Mar 2024 01:24:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="YA2pouGY" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0A5881E; Sun, 24 Mar 2024 01:24:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711243445; cv=none; b=NKGWWa/Zc80Cgx8a5kL20J34XDH6ehEVz7w4KKk6GUCrC59dScHFVo0BC1teRUR7RtJxkEVZipSxWtNeaJlSOeXYjGOfLvXGlL3LJTrFSS09weIZL6/xO8m1gEb5+FjtNH257sOSBURnvwE4jPVocclzqHqOxEuL98Twcutyay0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711243445; c=relaxed/simple; bh=z5T/Is5Bg9OGNmyXLfTmrOgmviP/fWKoY24e9neivqg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JyIRLKH5nbBSOJxihMzI5xjF8J5EzTc8mO2A++fEGvHMmqIv4X+ST/w8GSmcL6hh+/Dcq+VnZKef4E/TPUbkEE5T/0BcAhjPE0kkpux/TLbMOjLYoaMpFLEl/jvQNZwaIFKcYpG61y2bzyPb93t99cqeHF4KBjfW0xdAU16Ro8k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=YA2pouGY; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description; bh=9L1Ixhk4fnArxEJyLsZSUrzBMXeZlWcbrA4YzaHi20w=; b=YA2pouGYKw+A1B1ZIA+oI6t2rI UYxXKX1FyWHN+OefjkwIVXw4TNo2VrjTkRW3dZ2Wf2zhvExCxBvCWOcSJ3LYgofNlBeFk7Ztq09kg JS4590P83CDq8iyIqcMv2rboSQgYeZfcood6A2dm+tsrAQ/EAKcUY1y7UCFYkTak2F6ex8d98lJjq DVcAU2/Eo6n4wZ1nZrcCLuGXPzo4SZwVfEwpBArmyX1ZphR8NWKbik+JA5aZ6R0WMGSKMvObGyoyK QYhOltp6I6ISOtWRJ+q4ram0fpdYpUVH6WWiBGwZGO435jiP632dleLidpJfJFPwmmLPEBJk8gxP/ OhOiKkjQ==; Received: from fpd2fa7e2a.ap.nuro.jp ([210.250.126.42] helo=[192.168.1.8]) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1roCaO-0000000CxgD-1YTP; Sun, 24 Mar 2024 01:23:44 +0000 Message-ID: <415f4af0-f44a-49fb-b1fa-76f64ed09ec6@infradead.org> Date: Sun, 24 Mar 2024 10:23:36 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH] powerpc: Fix PS3 allmodconfig warning Content-Language: en-US To: Arnd Bergmann , Michael Ellerman , Nathan Chancellor , Paul Mackerras , Geert Uytterhoeven Cc: Arnd Bergmann , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Nick Desaulniers , Bill Wendling , Justin Stitt , Kevin Hao , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev References: <20240320180333.151043-1-arnd@kernel.org> From: Geoff Levand In-Reply-To: <20240320180333.151043-1-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit The struct ps3_notification_device in the ps3_probe_thread routine is too large to be on the stack, causing a warning for an allmodconfig build with clang. Change the struct ps3_notification_device from a variable on the stack to a dynamically allocated variable. Reported-by: Arnd Bergmann Signed-off-by: Geoff Levand diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c index 878bc160246e..03292869e6a1 100644 --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c @@ -770,49 +770,51 @@ static struct task_struct *probe_task; static int ps3_probe_thread(void *data) { - struct ps3_notification_device dev; + struct { + struct ps3_notification_device dev; + u8 buf[512]; + } *local; + struct ps3_notify_cmd *notify_cmd; + struct ps3_notify_event *notify_event; int res; unsigned int irq; u64 lpar; - void *buf; - struct ps3_notify_cmd *notify_cmd; - struct ps3_notify_event *notify_event; pr_debug(" -> %s:%u: kthread started\n", __func__, __LINE__); - buf = kzalloc(512, GFP_KERNEL); - if (!buf) + local = kzalloc(sizeof(local), GFP_KERNEL); + if (!local) return -ENOMEM; - lpar = ps3_mm_phys_to_lpar(__pa(buf)); - notify_cmd = buf; - notify_event = buf; + lpar = ps3_mm_phys_to_lpar(__pa(&local->buf)); + notify_cmd = (struct ps3_notify_cmd *)&local->buf; + notify_event = (struct ps3_notify_event *)&local->buf; /* dummy system bus device */ - dev.sbd.bus_id = (u64)data; - dev.sbd.dev_id = PS3_NOTIFICATION_DEV_ID; - dev.sbd.interrupt_id = PS3_NOTIFICATION_INTERRUPT_ID; + local->dev.sbd.bus_id = (u64)data; + local->dev.sbd.dev_id = PS3_NOTIFICATION_DEV_ID; + local->dev.sbd.interrupt_id = PS3_NOTIFICATION_INTERRUPT_ID; - res = lv1_open_device(dev.sbd.bus_id, dev.sbd.dev_id, 0); + res = lv1_open_device(local->dev.sbd.bus_id, local->dev.sbd.dev_id, 0); if (res) { pr_err("%s:%u: lv1_open_device failed %s\n", __func__, __LINE__, ps3_result(res)); goto fail_free; } - res = ps3_sb_event_receive_port_setup(&dev.sbd, PS3_BINDING_CPU_ANY, - &irq); + res = ps3_sb_event_receive_port_setup(&local->dev.sbd, + PS3_BINDING_CPU_ANY, &irq); if (res) { pr_err("%s:%u: ps3_sb_event_receive_port_setup failed %d\n", __func__, __LINE__, res); goto fail_close_device; } - spin_lock_init(&dev.lock); - rcuwait_init(&dev.wait); + spin_lock_init(&local->dev.lock); + rcuwait_init(&local->dev.wait); res = request_irq(irq, ps3_notification_interrupt, 0, - "ps3_notification", &dev); + "ps3_notification", &local->dev); if (res) { pr_err("%s:%u: request_irq failed %d\n", __func__, __LINE__, res); @@ -823,7 +825,7 @@ static int ps3_probe_thread(void *data) notify_cmd->operation_code = 0; /* must be zero */ notify_cmd->event_mask = 1UL << notify_region_probe; - res = ps3_notification_read_write(&dev, lpar, 1); + res = ps3_notification_read_write(&local->dev, lpar, 1); if (res) goto fail_free_irq; @@ -834,36 +836,37 @@ static int ps3_probe_thread(void *data) memset(notify_event, 0, sizeof(*notify_event)); - res = ps3_notification_read_write(&dev, lpar, 0); + res = ps3_notification_read_write(&local->dev, lpar, 0); if (res) break; pr_debug("%s:%u: notify event type 0x%llx bus id %llu dev id %llu" " type %llu port %llu\n", __func__, __LINE__, - notify_event->event_type, notify_event->bus_id, - notify_event->dev_id, notify_event->dev_type, - notify_event->dev_port); + notify_event->event_type, notify_event->bus_id, + notify_event->dev_id, notify_event->dev_type, + notify_event->dev_port); if (notify_event->event_type != notify_region_probe || - notify_event->bus_id != dev.sbd.bus_id) { + notify_event->bus_id != local->dev.sbd.bus_id) { pr_warn("%s:%u: bad notify_event: event %llu, dev_id %llu, dev_type %llu\n", __func__, __LINE__, notify_event->event_type, notify_event->dev_id, notify_event->dev_type); continue; } - ps3_find_and_add_device(dev.sbd.bus_id, notify_event->dev_id); + ps3_find_and_add_device(local->dev.sbd.bus_id, + notify_event->dev_id); } while (!kthread_should_stop()); fail_free_irq: - free_irq(irq, &dev); + free_irq(irq, &local->dev); fail_sb_event_receive_port_destroy: - ps3_sb_event_receive_port_destroy(&dev.sbd, irq); + ps3_sb_event_receive_port_destroy(&local->dev.sbd, irq); fail_close_device: - lv1_close_device(dev.sbd.bus_id, dev.sbd.dev_id); + lv1_close_device(local->dev.sbd.bus_id, local->dev.sbd.dev_id); fail_free: - kfree(buf); + kfree(local); probe_task = NULL;