Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09c6c30e authored by Borislav Petkov's avatar Borislav Petkov Committed by Ingo Molnar
Browse files

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: default avatarBorislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Battersby <tonyb@cybernetics.com>
Link: http://lkml.kernel.org/r/1466097230-5333-3-git-send-email-bp@alien8.de


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 35c88cab
Loading
Loading
Loading
Loading
+14 −23
Original line number Original line Diff line number Diff line
@@ -219,24 +219,22 @@ int amd_set_subcaches(int cpu, unsigned long mask)
	return 0;
	return 0;
}
}


static int amd_cache_gart(void)
static void amd_cache_gart(void)
{
{
	u16 i;
	u16 i;


	if (!amd_nb_has_feature(AMD_NB_GART))
	if (!amd_nb_has_feature(AMD_NB_GART))
               return 0;
		return;


	flush_words = kmalloc(amd_nb_num() * sizeof(u32), GFP_KERNEL);
	flush_words = kmalloc(amd_nb_num() * sizeof(u32), GFP_KERNEL);
	if (!flush_words) {
	if (!flush_words) {
		amd_northbridges.flags &= ~AMD_NB_GART;
		amd_northbridges.flags &= ~AMD_NB_GART;
               return -ENOMEM;
		pr_notice("Cannot initialize GART flush words, GART support disabled\n");
		return;
	}
	}


	for (i = 0; i != amd_nb_num(); i++)
	for (i = 0; i != amd_nb_num(); i++)
               pci_read_config_dword(node_to_amd_nb(i)->misc, 0x9c,
		pci_read_config_dword(node_to_amd_nb(i)->misc, 0x9c, &flush_words[i]);
                                     &flush_words[i]);

       return 0;
}
}


void amd_flush_garts(void)
void amd_flush_garts(void)
@@ -278,17 +276,10 @@ EXPORT_SYMBOL_GPL(amd_flush_garts);


static __init int init_amd_nbs(void)
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)
	return 0;
		pr_notice("Cannot initialize GART flush words, GART support disabled\n");

	return err;
}
}


/* This has to go after the PCI subsystem */
/* This has to go after the PCI subsystem */