From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752041AbbFRVNM (ORCPT ); Thu, 18 Jun 2015 17:13:12 -0400 Received: from www.linutronix.de ([62.245.132.108]:55591 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751892AbbFRVM6 (ORCPT ); Thu, 18 Jun 2015 17:12:58 -0400 Date: Thu, 18 Jun 2015 23:12:49 +0200 (CEST) From: Thomas Gleixner To: Andi Kleen cc: peterz@infradead.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 3/3] x86, perf, uncore: Don't make MSR uncore depend on PCI uncore In-Reply-To: <1434660362-4083-4-git-send-email-andi@firstfloor.org> Message-ID: References: <1434660362-4083-1-git-send-email-andi@firstfloor.org> <1434660362-4083-4-git-send-email-andi@firstfloor.org> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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