Received: by 10.223.185.116 with SMTP id b49csp8721694wrg; Fri, 2 Mar 2018 06:54:33 -0800 (PST) X-Google-Smtp-Source: AG47ELtrBvi20LoPq3nSB4/oUAAxCTGoem6GhE0hvgpCLM9mNtTktTbb1flUzlEOAPpvqng9FJlW X-Received: by 10.98.64.73 with SMTP id n70mr5988353pfa.142.1520002472935; Fri, 02 Mar 2018 06:54:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520002472; cv=none; d=google.com; s=arc-20160816; b=CqoyeVtASjiNGGwnFVpZcC7whQK6eprYJAjVN9GMtH5+M035GErQRE7wQJXTkJilqa KYNYdrZ6c1c6HTJKj25oJ/Mb6O1QgYpbX7L2YupPMbhBukVbinRFB0GrzGlVE2oUa5iS PR+YhBt0ONTSgcb07MjcO6njg0ceoi0/s/JVgPUyzNkQ+K/0I+kLA4Of0GAd28AVXK3K PraBwkl/JSwcGxPUuJ4rjEAcgv4iFUYh5K4M27wsvzijmgS/PtOCTaCin0XMWHl5hfHp obb5uiAM5OWv/PUN24MlGGzsS6luVJlr+zsa3GDRijKcocdZ2Upo+eEtRpogyDUNw45A UteQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=Pr458a++DJLD8Bc+tnwag16HPNdvynZmOcM2mqKBC18=; b=KiHSsLmRfCRMin0ePcgYnYhg21rGkjdF8xUPaqz0XIeeeGFcz2+v+7LTvE4xiqdA2D W9QW989KHDdFcnUCEEzC8r9MvxWTpX2AS+bCyIXhWtutZ9x73HrvhYn+LRbPENEA1R7t JfA9fGKo5vWCCbVnaW3v8//wbdL22Z25GtRu3b/GqycN41MJrjBszWE95J7TgBn/5flz +V4zEVqguVO2yaxZX+cq6mUoJ+PrV8F/NUZ/7Es5H8U4mkLauXLLvQSYDjdAEwtvSjS6 j+wp5ioLTF/joU4FeWUR1NxN8vwk70W/vQo07WbC7Sv0M7NnzKc6F8RxILR1/Vv5djlo 0YEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q84si4976702pfa.358.2018.03.02.06.54.18; Fri, 02 Mar 2018 06:54:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426537AbeCBKo1 (ORCPT + 99 others); Fri, 2 Mar 2018 05:44:27 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:53624 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423977AbeCBKoW (ORCPT ); Fri, 2 Mar 2018 05:44:22 -0500 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1eri7D-0003xr-Kk; Fri, 02 Mar 2018 11:40:39 +0100 Date: Fri, 2 Mar 2018 11:44:18 +0100 (CET) From: Thomas Gleixner To: Ivan Gorinov cc: Linux Kernel Mailing List , Ingo Molnar Subject: Re: [PATCH v3 2/3] x86: devicetree: enable multiprocessing in DT In-Reply-To: <20180301230640.GA48521@intel.com> Message-ID: References: <20180301230640.GA48521@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 1 Mar 2018, Ivan Gorinov wrote: The patch order is wrong. Fixes first and then features simply because you cannot test the feature patch standalone as the fix (3/3) is missing .... > Adding code to register the processors described in Device Tree. 'Adding code...' is a pointless filler phrase. > APIC ID is specified in 'intel-apic_id' propery as used in U-Boot. s/propery/property/ Also this has nothing to do with U-Boot. The DT properties are described in the DT bindings and not specified in U-Boot. Where is the matching devicetree binding documented? This should be a separate patch and needs to go into Documentation/devicetree/x86/ Please Cc the DT maintainers as we need their ack for that. > First address specified in 'reg' is used as default APIC ID. Changelogs should describe the context/problem and the approach how this is fixed or made working. Something like this: The current x86 device tree implementation does not support SMP. Use the new DT bindings for describing CPUs and their APIC resources. Hmm? > Signed-off-by: Ivan Gorinov > --- > arch/x86/kernel/devicetree.c | 26 ++++++++++++++++++++++++-- > 1 file changed, 24 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c > index 44189ee..ef1cd85 100644 > --- a/arch/x86/kernel/devicetree.c > +++ b/arch/x86/kernel/devicetree.c > @@ -130,6 +130,29 @@ static void __init dtb_setup_hpet(void) > #endif > } > > +static void __init dtb_cpu_setup(void) > +{ > + struct device_node *dn; > + struct resource r; > + const void *prop; > + int apic_id, version; > + int ret; > + > + version = GET_APIC_VERSION(apic_read(APIC_LVR)); > + for_each_node_by_type(dn, "cpu") { > + prop = of_get_property(dn, "intel,apic-id", NULL); > + if (prop) { > + apic_id = be32_to_cpup(prop); > + } else { > + ret = of_address_to_resource(dn, 0, &r); > + if (WARN_ON_ONCE(ret)) > + continue; > + apic_id = r.start; > + } What kind of logic is this? If a CPU node does not have apic id property then it's invalid. That else clause is just voodoo programming at least without a proper comment explaining it. Thanks, tglx