From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752422AbcGAHrN (ORCPT ); Fri, 1 Jul 2016 03:47:13 -0400 Received: from terminus.zytor.com ([198.137.202.10]:32772 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752147AbcGAHrL (ORCPT ); Fri, 1 Jul 2016 03:47:11 -0400 Date: Fri, 1 Jul 2016 00:46:18 -0700 From: tip-bot for Borislav Petkov Message-ID: Cc: peterz@infradead.org, hpa@zytor.com, mingo@kernel.org, bp@suse.de, tglx@linutronix.de, linux-kernel@vger.kernel.org, tonyb@cybernetics.com, torvalds@linux-foundation.org Reply-To: linux-kernel@vger.kernel.org, tonyb@cybernetics.com, torvalds@linux-foundation.org, peterz@infradead.org, hpa@zytor.com, mingo@kernel.org, bp@suse.de, tglx@linutronix.de In-Reply-To: <1466097230-5333-3-git-send-email-bp@alien8.de> References: <1466097230-5333-3-git-send-email-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cpu] x86/amd_nb: Clean up init path Git-Commit-ID: 09c6c30e72ce6892b21e6cf76b4508ad82a38636 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 09c6c30e72ce6892b21e6cf76b4508ad82a38636 Gitweb: http://git.kernel.org/tip/09c6c30e72ce6892b21e6cf76b4508ad82a38636 Author: Borislav Petkov AuthorDate: Thu, 16 Jun 2016 19:13:50 +0200 Committer: Ingo Molnar CommitDate: Fri, 1 Jul 2016 09:36:12 +0200 x86/amd_nb: Clean up init path The initcall had unnecessary pr_notice() messages which are useless noise on distro kernels. Also, push the GART init error message where it belongs, *after* the check whether the current hw we're loaded on, supports GART at all. Signed-off-by: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Tony Battersby Link: http://lkml.kernel.org/r/1466097230-5333-3-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/amd_nb.c | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c index e991d5c..e45ec2b 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c @@ -219,24 +219,22 @@ int amd_set_subcaches(int cpu, unsigned long mask) return 0; } -static int amd_cache_gart(void) +static void amd_cache_gart(void) { u16 i; - if (!amd_nb_has_feature(AMD_NB_GART)) - return 0; - - flush_words = kmalloc(amd_nb_num() * sizeof(u32), GFP_KERNEL); - if (!flush_words) { - amd_northbridges.flags &= ~AMD_NB_GART; - return -ENOMEM; - } + if (!amd_nb_has_feature(AMD_NB_GART)) + return; - for (i = 0; i != amd_nb_num(); i++) - pci_read_config_dword(node_to_amd_nb(i)->misc, 0x9c, - &flush_words[i]); + flush_words = kmalloc(amd_nb_num() * sizeof(u32), GFP_KERNEL); + if (!flush_words) { + amd_northbridges.flags &= ~AMD_NB_GART; + pr_notice("Cannot initialize GART flush words, GART support disabled\n"); + return; + } - return 0; + for (i = 0; i != amd_nb_num(); i++) + pci_read_config_dword(node_to_amd_nb(i)->misc, 0x9c, &flush_words[i]); } void amd_flush_garts(void) @@ -278,17 +276,10 @@ EXPORT_SYMBOL_GPL(amd_flush_garts); static __init int init_amd_nbs(void) { - int err = 0; + amd_cache_northbridges(); + amd_cache_gart(); - err = amd_cache_northbridges(); - - if (err < 0) - pr_notice("Cannot enumerate AMD northbridges\n"); - - if (amd_cache_gart() < 0) - pr_notice("Cannot initialize GART flush words, GART support disabled\n"); - - return err; + return 0; } /* This has to go after the PCI subsystem */