Message ID | 37cc31242d0edda1bb0900cc62bba87954a7e892.1668403214.git.rtanwar@maxlinear.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2055115wru; Mon, 14 Nov 2022 01:42:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf4XpW6emXlZXChtxiDXwfNFsTnwMEQj7osmaJnVDNNrGF6PlqeQezf7TkWF63zt7FiN6KzD X-Received: by 2002:a17:907:765c:b0:7ad:49b8:1687 with SMTP id kj28-20020a170907765c00b007ad49b81687mr9695687ejc.407.1668418923042; Mon, 14 Nov 2022 01:42:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668418923; cv=none; d=google.com; s=arc-20160816; b=Axr4Uat0JkVVY14euxHPeFTzHTN1hbcm4TsZKsJpem+GDYxHgwwxbWRc1QFbG8LUOX YOwsevMzV+KZfLjaKpP5AKMkA2NqkKG5HquJongfeHxwSVj54RXSftfqAXVNthXCd9sS Vey+B6McoUP+M8LqR4OEaOxEQsUdjPOadGMTa6/dBKUCckWRXFrqx0leBIE4CSxu6R1F nZEp87hl1aZY/VOWKtzUqbRUZkBLHAOZeFDIGy3t2rwTI76f2GYOYvcy7ow4b7Z7i+RN zlQn+C6gwOkhnwgmXRJjPbogBMg+H/pcgoJtGcjm+rUYpMtB+Z5k0mi7uwQ+NxfOCl7q X40A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YgauXixAJJD9XtFDMaahyOPCpv34fcIn9lLW9e+Ynmc=; b=lLghc/inS9t/zwQIvT7+V/62wowBD7pXRPRJwHr+rHXKfUBhUSP7SQQF1oi+h0JlAu LADAck2sukbegJGWf3R7+N/2cno+ur965tdt0Bd4+EYGWY6+qi0900N5VPU/9bFvRVao 5NsoRcYaWAIx97tbtnNZ/nuLaOnELaC+tAL/gD7RN+Jh+oGg3fWi9tx/DC/9EPFnmBUQ oITmKxgpmDwsQ/1Uww7iYncdcvhcMvuTRMRSq9RY0Xrzumsj8YPGIhiD57AeVTO9tD6J 69hYCqP5gtXYafSTYa/9ieBKoV0guOdEjoZuRYkTMJCiIfIjXOXfhOkjqDXGZFiIwAWM iYDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maxlinear.com header.s=selector header.b=I0ZaDDgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=maxlinear.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he19-20020a1709073d9300b007ae814af686si9880871ejc.974.2022.11.14.01.41.39; Mon, 14 Nov 2022 01:42:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@maxlinear.com header.s=selector header.b=I0ZaDDgx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=maxlinear.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236644AbiKNJVf (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Mon, 14 Nov 2022 04:21:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236421AbiKNJVX (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 04:21:23 -0500 Received: from us-smtp-delivery-115.mimecast.com (us-smtp-delivery-115.mimecast.com [170.10.129.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A154FE0C7 for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 01:20:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maxlinear.com; s=selector; t=1668417619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YgauXixAJJD9XtFDMaahyOPCpv34fcIn9lLW9e+Ynmc=; b=I0ZaDDgxWT3olqzTC5InMn8OBB+lpfHlIHdS8g7FsIHM2DksUc+Ddsi4zRFtwsmJfgoJVO GwmFRjU+8u/J4Kqhtq0z6N+I0BcYrwQGWhljiOOPimYHgDv/HqtD47gcJbEAhUOPnLr5Yz EdnaGIqFqk0bDNc1rQllF9O8Zn30eAQuw5ss0LLo7j2tWvIz2b3QARxu2NXNW7FVtC3yDp D2Nh9cggkL7Oc0k+JLMF33SqVTxtzdSVnjvAdXvzzU1NGDQ34KIy4xMkfFnVB30dQAnymf N0/+9gUViJKM3jga1UCsvvLj4fDQ3Ty1iTNXQvG2/3rj2wo/9BFIQa/b/EbvOQ== Received: from mail.maxlinear.com (174-47-1-83.static.ctl.one [174.47.1.83]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id us-mta-185-dNQ69yRpNIGhgA6xj5F7cw-1; Mon, 14 Nov 2022 04:20:18 -0500 X-MC-Unique: dNQ69yRpNIGhgA6xj5F7cw-1 Received: from sgsxdev001.isng.phoenix.local (10.226.81.111) by mail.maxlinear.com (10.23.38.120) with Microsoft SMTP Server id 15.1.2375.24; Mon, 14 Nov 2022 01:20:13 -0800 From: Rahul Tanwar <rtanwar@maxlinear.com> To: <bigeasy@linutronix.de>, <robh@kernel.org>, <tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>, <x86@kernel.org>, <hpa@zytor.com> CC: <andriy.shevchenko@linux.intel.com>, <dave.hansen@linux.intel.com>, <linux-kernel@vger.kernel.org>, <linux-lgm-soc@maxlinear.com>, Rahul Tanwar <rtanwar@maxlinear.com> Subject: [PATCH RESEND 1/1] x86/of: Add support for boot time interrupt mode config Date: Mon, 14 Nov 2022 17:20:06 +0800 Message-ID: <37cc31242d0edda1bb0900cc62bba87954a7e892.1668403214.git.rtanwar@maxlinear.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <cover.1668403214.git.rtanwar@maxlinear.com> References: <cover.1668403214.git.rtanwar@maxlinear.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: maxlinear.com Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749464040650239765?= X-GMAIL-MSGID: =?utf-8?q?1749464040650239765?= |
Series |
x86/of: Fix a bug in x86 arch OF support
|
|
Commit Message
Rahul Tanwar
Nov. 14, 2022, 9:20 a.m. UTC
Presently, init/boot time interrupt delivery mode is enumerated only
for ACPI enabled systems by parsing MADT table or for older systems
by parsing MP table. But for OF based x86 systems, it is assumed &
fixed to legacy PIC mode.
Add support for configuration of init time interrupt delivery mode for
x86 OF based systems by introducing a new optional boolean property
'intel,no-imcr' for interrupt-controller node of local APIC. This
property emulates IMCRP Bit 7 of MP feature info byte 2 of MP
floating pointer structure.
Defaults to legacy PIC mode if absent. Configures it to virtual wire
compatibility mode if present.
Fixes: 3879a6f329483 ("x86: dtb: Add early parsing of IO_APIC")
Signed-off-by: Rahul Tanwar <rtanwar@maxlinear.com>
---
arch/x86/kernel/devicetree.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Comments
On Mon, Nov 14, 2022 at 05:20:06PM +0800, Rahul Tanwar wrote: > Presently, init/boot time interrupt delivery mode is enumerated only > for ACPI enabled systems by parsing MADT table or for older systems > by parsing MP table. But for OF based x86 systems, it is assumed & > fixed to legacy PIC mode. > > Add support for configuration of init time interrupt delivery mode for > x86 OF based systems by introducing a new optional boolean property > 'intel,no-imcr' for interrupt-controller node of local APIC. This > property emulates IMCRP Bit 7 of MP feature info byte 2 of MP > floating pointer structure. > > Defaults to legacy PIC mode if absent. Configures it to virtual wire > compatibility mode if present. ... > + if (of_property_read_bool(dn, "intel,no-imcr")) { I can't find this property in the Documentation/devicetree/bindings. Moreover, I prefer to see positive one, something like: intel,virtual-wire-bla-bla-bla Please consult with DT people on how properly name it. > + pr_info(" Virtual Wire compatibility mode.\n"); > + pic_mode = 0; > + } else { > + pr_info(" IMCR and PIC compatibility mode.\n"); > + pic_mode = 1; > + }
Hi Andy, Thanks for response. On 14/11/2022 5:45 pm, Andy Shevchenko wrote: > This email was sent from outside of MaxLinear. > > > On Mon, Nov 14, 2022 at 05:20:06PM +0800, Rahul Tanwar wrote: >> Presently, init/boot time interrupt delivery mode is enumerated only >> for ACPI enabled systems by parsing MADT table or for older systems >> by parsing MP table. But for OF based x86 systems, it is assumed & >> fixed to legacy PIC mode. >> >> Add support for configuration of init time interrupt delivery mode for >> x86 OF based systems by introducing a new optional boolean property >> 'intel,no-imcr' for interrupt-controller node of local APIC. This >> property emulates IMCRP Bit 7 of MP feature info byte 2 of MP >> floating pointer structure. >> >> Defaults to legacy PIC mode if absent. Configures it to virtual wire >> compatibility mode if present. > > ... > >> + if (of_property_read_bool(dn, "intel,no-imcr")) { > > I can't find this property in the Documentation/devicetree/bindings. > > Moreover, I prefer to see positive one, something like: > > intel,virtual-wire-bla-bla-bla > > Please consult with DT people on how properly name it. Yes, agree. Need to add it in bindings doc after finalizing the property name. I chose "intel,no-imcr" to have a direct correlation with the MPS spec defined data field for the same purpose. It reads below bit in mpparse code to detect PIC mode or virtual wire mode. Bit 7: IMCRP. When the IMCR presence bit is set, the IMCR is present and PIC Mode is implemented; otherwise, Virtual Wire Mode is implemented. Please refer [1] [1] https://www.manualslib.com/manual/77733/Intel Multiprocessor.html?page=40#manual Regards, Rahul > >> + pr_info(" Virtual Wire compatibility mode.\n"); >> + pic_mode = 0; >> + } else { >> + pr_info(" IMCR and PIC compatibility mode.\n"); >> + pic_mode = 1; >> + } > > -- > With Best Regards, > Andy Shevchenko > > >
On Mon, Nov 14, 2022 at 10:00:02AM +0000, Rahul Tanwar wrote: > On 14/11/2022 5:45 pm, Andy Shevchenko wrote: > > On Mon, Nov 14, 2022 at 05:20:06PM +0800, Rahul Tanwar wrote: ... > >> + if (of_property_read_bool(dn, "intel,no-imcr")) { > > > > I can't find this property in the Documentation/devicetree/bindings. > > > > Moreover, I prefer to see positive one, something like: > > > > intel,virtual-wire-bla-bla-bla > > > > Please consult with DT people on how properly name it. > > > Yes, agree. Need to add it in bindings doc after finalizing the property > name. I chose "intel,no-imcr" to have a direct correlation with the MPS > spec defined data field for the same purpose. The problems with it are: - it's negative - it's too cryptic to one who doesn't know area well enough > It reads below bit in > mpparse code to detect PIC mode or virtual wire mode. > > Bit 7: IMCRP. When the IMCR presence bit is set, the IMCR is present and > PIC Mode is implemented; otherwise, Virtual Wire Mode is implemented. > > Please refer [1] > > [1] https://www.manualslib.com/manual/77733/Intel > Multiprocessor.html?page=40#manual This is good reference for DT people to suggest you a better name.
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 5cd51f25f446..1e4ed420478b 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -167,7 +167,14 @@ static void __init dtb_lapic_setup(void) return; } smp_found_config = 1; - pic_mode = 1; + if (of_property_read_bool(dn, "intel,no-imcr")) { + pr_info(" Virtual Wire compatibility mode.\n"); + pic_mode = 0; + } else { + pr_info(" IMCR and PIC compatibility mode.\n"); + pic_mode = 1; + } + register_lapic_address(lapic_addr); }