Re: [PATCH 3/3] x86, perf, uncore: Don't make MSR uncore depend on PCI uncore

From: Thomas Gleixner
Date: Thu Jun 18 2015 - 17:13:16 EST


On Thu, 18 Jun 2015, Andi Kleen wrote:
> static int __init intel_uncore_init(void)
> {
> - int ret;
> + int ret1, ret2;
>
> if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
> return -ENODEV;
> @@ -1295,19 +1297,12 @@ static int __init intel_uncore_init(void)
> if (cpu_has_hypervisor)
> return -ENODEV;
>
> - ret = uncore_pci_init();
> - if (ret)
> - goto fail;
> - ret = uncore_cpu_init();
> - if (ret) {
> - uncore_pci_exit();
> - goto fail;
> + ret1 = uncore_pci_init();
> + ret2 = uncore_cpu_init();
> + if (!ret1 || !ret2) {
> + uncore_cpumask_init();
> + uncore_pmus_register();
> }
> - uncore_cpumask_init();
> -
> - uncore_pmus_register();
> return 0;

So now we return success, if nothing is there or stuff failed?

One possible solution is to split the initcall and have one
for uncore_pci and one for uncode_msr, but that does not work well if
you want to make it a module.

But we should at least have some indication, what worked and what went
wrong instead of unconditionally returning success.

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/