From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9C2DC43217 for ; Tue, 15 Mar 2022 17:30:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350587AbiCORcD (ORCPT ); Tue, 15 Mar 2022 13:32:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349106AbiCORcC (ORCPT ); Tue, 15 Mar 2022 13:32:02 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3106956774; Tue, 15 Mar 2022 10:30:49 -0700 (PDT) Received: from zn.tnic (p5de8e440.dip0.t-ipconnect.de [93.232.228.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D198F1EC0501; Tue, 15 Mar 2022 18:30:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1647365443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=9YqUb6EkoE47lz1fFg2iC4xCBZkBID1oDN6LQgAf/3U=; b=kWOQRb69xh3Fj1RO8HggjEHuHTUYXIGG6yK6k7mUfVYswNX06JkAhEOZDyMfqh4aLibpzJ VHJOKfcKxzYI4TAHOAb0qq7nu4c2j5RkxvhnHCYcSz5Ff6fhSI1LWst9f/FBu9PclFSJlK o5/p6a/efP6sAmdBDhKUk83fv5HyqEw= Date: Tue, 15 Mar 2022 18:28:29 +0100 From: Borislav Petkov To: Naveen Krishna Chatradhi Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, mingo@redhat.com, mchehab@kernel.org, airlied@linux.ie, Muralidhara M K Subject: Re: [PATCH 1/1] x86/amd_nb: unexport amd_cache_northbridges() Message-ID: References: <20220228161154.54539-1-nchatrad@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220228161154.54539-1-nchatrad@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 28, 2022 at 09:41:54PM +0530, Naveen Krishna Chatradhi wrote: > From: Muralidhara M K > > amd_cache_northbridges() is called from init_amd_nbs(), during > fs_initcall() and need not be called explicitly. Kernel components > can directly call amd_nb_num() to get the initialized number of > north bridges. > > unexport amd_cache_northbridges(), update dependent modules to > call amd_nb_num() instead. While at it, simplify the while checks > in amd_cache_northbridges(). What I am missing in this commit message is why is it ok to do that? AFAIR, previously, amd_cache_northbridges() wasn't an initcall so the module or builtin - which came first - was forcing the NB caching through the explicit call to amd_cache_northbridges(). fs_inicall() does that now unconditionally so the question is, why can the module init functions assume that the northbridges have been cached already and can simply get the NB number? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette:wq