Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6287546rdb; Thu, 14 Dec 2023 13:50:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8R0Sb3r+v7uK0uWEkRp8mdF4kBe7sB2R/gTjgwM9QynegZNEaBgCNkY+Z7+rAN83lBVsP X-Received: by 2002:a50:9fa4:0:b0:552:5e64:7a6c with SMTP id c33-20020a509fa4000000b005525e647a6cmr2304279edf.20.1702590628495; Thu, 14 Dec 2023 13:50:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702590628; cv=none; d=google.com; s=arc-20160816; b=Pzw3nh/cR+9PngWS4RoaBZ7gAovgEuexikWoieFrV7/4Ab7EMqr73AOKQaTqBVQOyd pu7IOxQBx3NMtNaxnLKL3MGlIiWbIMJxikyh/ndDmweYYY8Z8cg/3G2rPh7NMoMW8TqN xFqEPkvv9fib+YZu+dV94V+ev4kjdWDnX6y1XkCgC2tQJ5Ft/DYO/m0mS/clFqdmAXet MY7tdZPWBt5sqxVHu+pDzPvguw4nuggSexwL0PWLUdCgPM7uGc5xC/pT6w4o2/khwLDp AGSNwCRst7+BDBjm0A4/IvDQjGOtsOOwkkgd3a4lgdFWireBOLc0TRhcIoI5I2o5tP/S d8wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=LOFqTQUzvtmRfrSQlOTKMZjii55qYZJSlxbj8fXqyOo=; fh=xtUdhGXxJ7xsOJmkXAl4Q7Snk2VxYGl08b9LcXSGwbw=; b=0JE7wk2JBARwhtjNFc0Y+6kGDUzG/p1zEZxFeDNzUVzhk7HMYvJJfXcVmoooASsuVm SUrvoDvqMI2eO9j6qa9A30P2tY70erTew9r3Zm44mlV4jShxSN/e8FPBJnoboWsDwS9U nbbnMbPJc6/2KuBnRgx/wke3t5CcQ2kL75/clBVFhxbQh0zcpeudUa96zt3kot0QW/1W zJ3UQYCbd+PoiUJT4hQpEffl7pJEImYBroKlrvFUThs4Dql390F1I0uFAt0lkMXvBgRI wE4ZbDddVI8A1fz1eLU9CnaFLidoigu7nnK5Ya2MLA4GKxj8VTuWgiLHShZ4cYetpCYy Jz3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="oAZ/Pakb"; spf=pass (google.com: domain of linux-kernel+bounces-162-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a29-20020a509b5d000000b005528220ca89si624259edj.575.2023.12.14.13.50.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 13:50:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="oAZ/Pakb"; spf=pass (google.com: domain of linux-kernel+bounces-162-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 447841F2271F for ; Thu, 14 Dec 2023 21:50:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 636512C694; Thu, 14 Dec 2023 21:50:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="oAZ/Pakb" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 19085671FA; Thu, 14 Dec 2023 21:50:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E681BC433C8; Thu, 14 Dec 2023 21:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1702590618; bh=On3GH+H5OWqs4RSfoU5sLErw51EY3L9vRvQWeh0ze6s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oAZ/PakbstrORQJCz0NFk8psHpQ6Ymb8y74hf8k/nwZIG8BMfmZTodR39KIKAPTVN 3wi6r6WhGHGktYGMqS5SS8rhV7NMH7A7CdAmX4lF8JkV9/uU2cNA/UKMxHnyJfioal hADKG1FiqDptFxi07RPSL3NlqBePTLk9NCk42NL0= Date: Thu, 14 Dec 2023 13:50:16 -0800 From: Andrew Morton To: Arnd Bergmann Cc: Arnd Bergmann , "kernelci . org bot" , Thomas Bogendoerfer , Zi Yan , Jiaxun Yang , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mips: fix r3k_cache_init build regression Message-Id: <20231214135016.85cfc8580a26677ab13c9e2c@linux-foundation.org> In-Reply-To: <20231214205506.310402-1-arnd@kernel.org> References: <20231214205506.310402-1-arnd@kernel.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 14 Dec 2023 20:54:47 +0000 Arnd Bergmann wrote: > From: Arnd Bergmann > > My earlier patch removed __weak function declarations that used to > be turned into wild branches by the linker, instead causing > a link failure when the called functions are unavailable: > > mips-linux-ld: arch/mips/mm/cache.o: in function `cpu_cache_init': > cache.c:(.text+0x670): undefined reference to `r3k_cache_init' > > The __weak method seems suboptimal, so rather than putting that > back, make the function calls conditional on the Kconfig symbol > that controls the compilation. Cool, thanks. > Reported-by: kernelci.org bot Please don't forget the Closes: - they're sometimes handy. > Fixes: 66445677f01e ("mips: move cache declarations into header") > Signed-off-by: Arnd Bergmann > --- > My broken patch is currently in linux-mm, so the fix should > be applied on top. The mm-nonmm-stable branch of mm.git. So I'll queue this separately and we'll have a minor bisection hole. > --- a/arch/mips/mm/cache.c > +++ b/arch/mips/mm/cache.c > @@ -205,14 +205,14 @@ static inline void setup_protection_map(void) > > void cpu_cache_init(void) > { > - if (cpu_has_3k_cache) { > + if (IS_ENABLED(CONFIG_CPU_R3000) && cpu_has_3k_cache) { > r3k_cache_init(); > } > - if (cpu_has_4k_cache) { > + if (IS_ENABLED(CONFIG_CPU_R4K_CACHE_TLB) && cpu_has_4k_cache) { > r4k_cache_init(); > } > > - if (cpu_has_octeon_cache) { > + if (IS_ENABLED(CONFIG_CPU_CAVIUM_OCTEON) && cpu_has_octeon_cache) { > octeon_cache_init(); > } I just can't help myself. --- a/arch/mips/mm/cache.c~mips-fix-r3k_cache_init-build-regression-fix +++ a/arch/mips/mm/cache.c @@ -205,16 +205,13 @@ static inline void setup_protection_map( void cpu_cache_init(void) { - if (IS_ENABLED(CONFIG_CPU_R3000) && cpu_has_3k_cache) { + if (IS_ENABLED(CONFIG_CPU_R3000) && cpu_has_3k_cache) r3k_cache_init(); - } - if (IS_ENABLED(CONFIG_CPU_R4K_CACHE_TLB) && cpu_has_4k_cache) { + if (IS_ENABLED(CONFIG_CPU_R4K_CACHE_TLB) && cpu_has_4k_cache) r4k_cache_init(); - } - if (IS_ENABLED(CONFIG_CPU_CAVIUM_OCTEON) && cpu_has_octeon_cache) { + if (IS_ENABLED(CONFIG_CPU_CAVIUM_OCTEON) && cpu_has_octeon_cache) octeon_cache_init(); - } setup_protection_map(); } The rest of the file doesn't do the over-bracing, so there.