All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2]  x86/of: Fix a bug in x86 arch OF support
@ 2022-11-16 10:41 ` Rahul Tanwar
  0 siblings, 0 replies; 15+ messages in thread
From: Rahul Tanwar @ 2022-11-16 10:28 UTC (permalink / raw)
  To: devicetree, robh, andriy.shevchenko, tglx, mingo, bp, dave.hansen, x86
  Cc: linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc, Rahul Tanwar

+ devicetree@vger.kernel.org

Hi Sebastian,

All touched part in this patch series was added by you. Hoping for
concerns/comments or best case ACK, reviewed-by tag from you.
I have CCed all others who were involved with you when you added
this changes.

Hi devicetree@vger.kernel.org, Rob,

Since this appears to be entrirely in devicetree domain. Hoping
for feedback, concerns, mistakes or improvement feedbacks from
you.

Hi Andy,

Hoping for a reviewed-by tag from you once you think it is ready
to go. Thanks.


Hi Thomas, Ingo, Boris, Andy, Dave & all x86@kernel.org maintainers,

Resending below details hoping to figure out if the changes are
logically aligned with your understanding & that it will not break
any x86/arch concerns that you might have. Shooting on any mistakes
welcomed :-).


I sent this patch 3 times but for some reasons, never got any response or
attention from anybody so far. Hence, resending with a cover letter to
explain the rationale behind it in detail & to justify the need to add
this fix. Also, hoping to get some feedback in-case i am mistaken in my
understanding which might be the reason why i never got any response.

Background (baseline understanding - pls correct if mistaken anywhere):

References [1], [2] & [6]

For SMP systems, Intel defines three (logically four) interrupt modes
during boot/init time while BIOS/bootloader boots & switches to linux
kernel.

  1. PIC mode - Legacy 8259 PIC interrupt controller.
  2. Virtual wire mode via Local APIC - uses local APIC as virtual wire
  3. Virtual wire mode via I/O APIC - uses I/O APIC as virtual wire
  4. Symmetric I/O mode - final one used by linux for SMP systems. 

BIOS/bootloaders are supposed to boot in either #1 or #2 or #3 and then
switch to #4 in linux for SMP systems.

For our platform, we use #2.

Detection of which interrupt mode the system is booting in is made by using
below global variable in apic.c

int pic_mode __ro_after_init; 

Here pic_mode = 1 means #1 (PIC mode) above.
And pic_mode = 0 means #2 or #3 (basically virtual wire mode via apic).

And apic.c while doing setup_local_APIC() uses below code [3]:

        value = apic_read(APIC_LVT0) & APIC_LVT_MASKED;
        if (!cpu && (pic_mode || !value || skip_ioapic_setup)) {
                value = APIC_DM_EXTINT;
                apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n", cpu);
        } else {
                value = APIC_DM_EXTINT | APIC_LVT_MASKED;
                apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n", cpu);
        }
        apic_write(APIC_LVT0, value);

What i understand from above is that if at this point of time, as long as
it is cpu0 & pic_mode=1, it will set delivery mode to ExtINT (causes the
processor to respond to the interrupt as if the interrupt originated in an
externally connected (8259A-compatible) interrupt controller) and enables/
unmask the interrupts.

pic_mode is presently set/populated/initialized at only two places:
 1. In  mpparse.c [4]
 2. In devicetree.c [7]

For #1 MPPARSE Kconfig definition is as below:

	config X86_MPPARSE
        	bool "Enable MPS table" if ACPI
        	default y
        	depends on X86_LOCAL_APIC
        	help
          	For old smp systems that do not have proper acpi support. Newer systems
          	(esp with 64bit cpus) with acpi support, MADT and DSDT will override it

As seen above, if ACPI is not enabled, then mpparse by default is always
enabled. Presently, there is no way to disable MPPARSE (if ACPI is not
enabled). This to me appears to be another bug which needs fixing. As per
theory, MPPARSE was to support MPS spec [1] as a temporary solution to
support SMP systems until a final ACPI standard was added. But now if ACPI
is not enabled, it will rely on MPPARSE driver to read MP floating pointer
structure's IMCRP Bit 7 of MP feature info byte 2 [5] to figure out if it
supports PIC mode or virtual wire mode and initialize pic_mode variable
accordingly. If ACPI is enabled, the ACPI code overrides it by using the
MADT table spec'ed in ACPI spec [2]. 

For #2 devicetree.c presently hardcodes pic_mode = 1 (PIC Mode). There is
no support to configure virtual wire mode via devicetree path for OF based
systems.

Now we have a platform which is OF based & does not use legacy 8259 PIC
interrupt controller. Non ACPI compliant as well as non MPPARSE compliant.

For such platforms, it appears to me that hardcoding pic_mode = 1 (PIC Mode)
and giving no other choice to choose virtual wire mode is a bug for OF
based x86 platforms. 

Just like mpparse relies on IMCRP bit 7 of MP feature info byte2 [5] to
select pic_mode to PIC mode or virtual wire mode. arch/x86/kernel/devicetree.c
should also provide some similar configurability to choose interrupt
delivery mode & not hardcode it to PIC mode.

This patch is to fix above explained bug in x86/of support for interrupt
delivery mode configuration. Please let me know if you find any mistake
in above understanding or if you have a alternative better suggestion to
solve it or if you find anything odd here in our platform/system. TIA.

The patch is baselined on below git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core

[1] https://pdos.csail.mit.edu/6.828/2008/readings/ia32/MPspec.pdf
[2] https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf
[3] https://elixir.bootlin.com/linux/v6.1-rc5/source/arch/x86/kernel/apic/apic.c#L1691
[4] https://elixir.bootlin.com/linux/v6.1-rc5/source/arch/x86/kernel/mpparse.c#L517
[5] https://www.manualslib.com/manual/77733/Intel-Multiprocessor.html?page=40#manual
[6] https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html
[7] https://elixir.bootlin.com/linux/v6.1-rc5/source/arch/x86/kernel/devicetree.c#L170

v2:
- Address review concern from Andy - rename property name to make
  it a bit more positive & self explanatory.
- Found that the bindings document for these HW's (APIC) are a bit
  off/obsolete and still in text format. Created new YAML schemas
  one for each - lapic & ioapic. Updated these schemas with latest
  info and add in new optional property details in the updated
  schema for lapic. Delete/let go of the text binding doc.
- CC devicetree@vger.kernel.org as these changes appear to be
  mainly targeted for devicetree maintainers review & approval.
- Increase CCed list to include all possible people who touched
  and were involved this part of code/feature addition.

v1:
- Initial draft



Rahul Tanwar (2):
  x86/of: Add support for boot time interrupt delivery mode
    configuration
  x86/of: Convert & update Intel's APIC related binding schemas

 .../intel,ce4100-ioapic.txt                   | 26 --------
 .../intel,ce4100-ioapic.yaml                  | 62 ++++++++++++++++++
 .../intel,ce4100-lapic.yaml                   | 63 +++++++++++++++++++
 arch/x86/kernel/devicetree.c                  |  9 ++-
 4 files changed, 133 insertions(+), 27 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml

-- 
2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 1/2] x86/of: Add support for boot time interrupt delivery mode configuration
@ 2022-11-16 10:41   ` Rahul Tanwar
  0 siblings, 0 replies; 15+ messages in thread
From: Rahul Tanwar @ 2022-11-16 10:28 UTC (permalink / raw)
  To: devicetree, robh, andriy.shevchenko, tglx, mingo, bp, dave.hansen, x86
  Cc: linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc, Rahul Tanwar

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 & hardcoded to legacy PIC mode. This is a bug for
platforms which are OF based but do not use 8259 compliant legacy
PIC interrupt controller. Such platforms can not even boot because
of this bug/hardcoding.

Fix this bug by adding support for configuration of init time
interrupt delivery mode for x86 OF based systems by introducing a
new optional boolean property 'intel,virtual-wire-mode' for
interrupt-controller node of local APIC. This property emulates
IMCRP Bit 7 of MP feature info byte 2 of MP floating pointer
structure [1].

Defaults to legacy PIC mode if absent. Configures it to virtual
wire compatibility mode if present.

[1] https://www.manualslib.com/manual/77733/Intel-Multiprocessor.html?page=40#manual

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(-)

diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 5cd51f25f446..2a8833f0f6ae 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,virtual-wire-mode")) {
+		printk(KERN_NOTICE "Virtual Wire compatibility mode.\n");
+		pic_mode = 0;
+	} else {
+		printk(KERN_NOTICE "IMCR and PIC compatibility mode.\n");
+		pic_mode = 1;
+	}
+
 	register_lapic_address(lapic_addr);
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 2/2] x86/of: Convert & update Intel's APIC related binding schemas
@ 2022-11-16 10:41   ` Rahul Tanwar
  0 siblings, 0 replies; 15+ messages in thread
From: Rahul Tanwar @ 2022-11-16 10:28 UTC (permalink / raw)
  To: devicetree, robh, andriy.shevchenko, tglx, mingo, bp, dave.hansen, x86
  Cc: linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc, Rahul Tanwar

Intel's APIC family of interrupt controllers support local APIC
(lapic) & I/O APIC (ioapic). Convert existing bindings for lapic
& ioapic from text to YAML schema. Separate lapic & ioapic schemas.

Also, update more info and newly introduced optional property for
lapic to choose legacy PIC or virtual wire compatibility interrupt
delivery mode.

Signed-off-by: Rahul Tanwar <rtanwar@maxlinear.com>
---
 .../intel,ce4100-ioapic.txt                   | 26 --------
 .../intel,ce4100-ioapic.yaml                  | 62 ++++++++++++++++++
 .../intel,ce4100-lapic.yaml                   | 63 +++++++++++++++++++
 3 files changed, 125 insertions(+), 26 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml

diff --git a/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.txt b/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.txt
deleted file mode 100644
index 7d19f494f19a..000000000000
--- a/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Interrupt chips
----------------
-
-* Intel I/O Advanced Programmable Interrupt Controller (IO APIC)
-
-  Required properties:
-  --------------------
-     compatible = "intel,ce4100-ioapic";
-     #interrupt-cells = <2>;
-
-  Device's interrupt property:
-
-     interrupts = <P S>;
-
-  The first number (P) represents the interrupt pin which is wired to the
-  IO APIC. The second number (S) represents the sense of interrupt which
-  should be configured and can be one of:
-    0 - Edge Rising
-    1 - Level Low
-    2 - Level High
-    3 - Edge Falling
-
-* Local APIC
-  Required property:
-
-     compatible = "intel,ce4100-lapic";
diff --git a/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml b/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml
new file mode 100644
index 000000000000..537bb69cf2d3
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/interrupt-controller/intel,ce4100-ioapic.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Intel I/O Advanced Programmable Interrupt Controller (I/O APIC)
+
+maintainers:
+  - Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+
+description: |
+  Intel's Advanced Programmable Interrupt Controller (APIC) is a
+  family of interrupt controllers. The APIC is a split
+  architecture design, with a local component (LAPIC) integrated
+  into the processor itself and an external I/O APIC. Local APIC
+  (lapic) receives interrupts from the processor's interrupt pins,
+  from internal sources and from an external I/O APIC (ioapic).
+  And it sends these to the processor core for handling.
+  See https://pdos.csail.mit.edu/6.828/2008/readings/ia32/IA32-3A.pdf
+  Chapter 8 for more details.
+
+  Many of the Intel's generic devices like hpet, ioapic, lapic have
+  the ce4100 name in their compatible property names because they
+  first appeared in CE4100 SoC. See bindings/x86/ce4100.txt for more
+  details on it.
+
+  This schema defines bindings for I/O APIC interrupt controller.
+  
+properties:
+  compatible:
+    - const: intel,ce4100-ioapic
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  '#interrupt-cells':
+    const: 2
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - '#interrupt-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    ioapic1: interrupt-controller@fec00000 {
+        compatible = "intel,ce4100-ioapic";
+        reg = <0xfec00000 0x1000>;
+        #interrupt-cells = <2>;
+        #address-cells = <0>;
+        interrupt-controller;
+    };
diff --git a/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml b/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml
new file mode 100644
index 000000000000..890e07351506
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/interrupt-controller/intel,ce4100-lapic.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Intel Local Advanced Programmable Interrupt Controller (LAPIC)
+
+maintainers:
+  - Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+
+description: |
+  Intel's Advanced Programmable Interrupt Controller (APIC) is a
+  family of interrupt controllers. The APIC is a split
+  architecture design, with a local component (LAPIC) integrated
+  into the processor itself and an external I/O APIC. Local APIC
+  (lapic) receives interrupts from the processor's interrupt pins,
+  from internal sources and from an external I/O APIC (ioapic).
+  And it sends these to the processor core for handling.
+  See https://pdos.csail.mit.edu/6.828/2008/readings/ia32/IA32-3A.pdf
+  Chapter 8 for more details.
+
+  Many of the Intel's generic devices like hpet, ioapic, lapic have
+  the ce4100 name in their compatible property names because they
+  first appeared in CE4100 SoC. See bindings/x86/ce4100.txt for more
+  details on it.
+
+  This schema defines bindings for local APIC interrupt controller.
+  
+properties:
+  compatible:
+    - const: intel,ce4100-lapic
+
+  reg:
+    maxItems: 1
+
+  intel,virtual-wire-mode:
+    description: Intel defines a few possible interrupt delivery
+      modes. With respect to boot/init time, mainly two interrupt
+      delivery modes are possible.
+      PIC Mode - Legacy external 8259 compliant PIC interrupt controller.
+      Virtual Wire Mode - use lapic as virtual wire interrupt delivery mode.
+      For ACPI or MPS spec compliant systems, it is figured out by some read
+      only bit field/s available in their respective defined data structures.
+      For OF based systems, it is by default set to PIC mode.
+      But if this optional boolean property is set, then the interrupt delivery
+      mode is configured to virtual wire compatibility mode.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    lapic0: interrupt-controller@fee00000 {
+        compatible = "intel,ce4100-lapic";
+        reg = <0xfee00000 0x1000>;
+        intel,virtual-wire-mode;
+    };
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 0/2]  x86/of: Fix a bug in x86 arch OF support
@ 2022-11-16 10:41 ` Rahul Tanwar
  0 siblings, 0 replies; 15+ messages in thread
From: Rahul Tanwar @ 2022-11-16 10:41 UTC (permalink / raw)
  To: bigeasy, devicetree, robh, andriy.shevchenko, tglx, mingo, bp,
	dave.hansen, x86
  Cc: linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc, Rahul Tanwar

[Resend] as i missed to include Sebastian who changes this patch
modifies.

+ devicetree@vger.kernel.org

Hi Sebastian,

All touched part in this patch series was added by you. Hoping for
concerns/comments or best case ACK, reviewed-by tag from you.
I have CCed all others who were involved with you when you added
this changes.

Hi devicetree@vger.kernel.org, Rob,

Since this appears to be entrirely in devicetree domain. Hoping
for feedback, concerns, mistakes or improvement feedbacks from
you.

Hi Andy,

Hoping for a reviewed-by tag from you once you think it is ready
to go. Thanks.


Hi Thomas, Ingo, Boris, Andy, Dave & all x86@kernel.org maintainers,

Resending below details hoping to figure out if the changes are
logically aligned with your understanding & that it will not break
any x86/arch concerns that you might have. Shooting on any mistakes
welcomed :-).


I sent this patch 3 times but for some reasons, never got any response or
attention from anybody so far. Hence, resending with a cover letter to
explain the rationale behind it in detail & to justify the need to add
this fix. Also, hoping to get some feedback in-case i am mistaken in my
understanding which might be the reason why i never got any response.

Background (baseline understanding - pls correct if mistaken anywhere):

References [1], [2] & [6]

For SMP systems, Intel defines three (logically four) interrupt modes
during boot/init time while BIOS/bootloader boots & switches to linux
kernel.

  1. PIC mode - Legacy 8259 PIC interrupt controller.
  2. Virtual wire mode via Local APIC - uses local APIC as virtual wire
  3. Virtual wire mode via I/O APIC - uses I/O APIC as virtual wire
  4. Symmetric I/O mode - final one used by linux for SMP systems. 

BIOS/bootloaders are supposed to boot in either #1 or #2 or #3 and then
switch to #4 in linux for SMP systems.

For our platform, we use #2.

Detection of which interrupt mode the system is booting in is made by using
below global variable in apic.c

int pic_mode __ro_after_init; 

Here pic_mode = 1 means #1 (PIC mode) above.
And pic_mode = 0 means #2 or #3 (basically virtual wire mode via apic).

And apic.c while doing setup_local_APIC() uses below code [3]:

        value = apic_read(APIC_LVT0) & APIC_LVT_MASKED;
        if (!cpu && (pic_mode || !value || skip_ioapic_setup)) {
                value = APIC_DM_EXTINT;
                apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n", cpu);
        } else {
                value = APIC_DM_EXTINT | APIC_LVT_MASKED;
                apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n", cpu);
        }
        apic_write(APIC_LVT0, value);

What i understand from above is that if at this point of time, as long as
it is cpu0 & pic_mode=1, it will set delivery mode to ExtINT (causes the
processor to respond to the interrupt as if the interrupt originated in an
externally connected (8259A-compatible) interrupt controller) and enables/
unmask the interrupts.

pic_mode is presently set/populated/initialized at only two places:
 1. In  mpparse.c [4]
 2. In devicetree.c [7]

For #1 MPPARSE Kconfig definition is as below:

	config X86_MPPARSE
        	bool "Enable MPS table" if ACPI
        	default y
        	depends on X86_LOCAL_APIC
        	help
          	For old smp systems that do not have proper acpi support. Newer systems
          	(esp with 64bit cpus) with acpi support, MADT and DSDT will override it

As seen above, if ACPI is not enabled, then mpparse by default is always
enabled. Presently, there is no way to disable MPPARSE (if ACPI is not
enabled). This to me appears to be another bug which needs fixing. As per
theory, MPPARSE was to support MPS spec [1] as a temporary solution to
support SMP systems until a final ACPI standard was added. But now if ACPI
is not enabled, it will rely on MPPARSE driver to read MP floating pointer
structure's IMCRP Bit 7 of MP feature info byte 2 [5] to figure out if it
supports PIC mode or virtual wire mode and initialize pic_mode variable
accordingly. If ACPI is enabled, the ACPI code overrides it by using the
MADT table spec'ed in ACPI spec [2]. 

For #2 devicetree.c presently hardcodes pic_mode = 1 (PIC Mode). There is
no support to configure virtual wire mode via devicetree path for OF based
systems.

Now we have a platform which is OF based & does not use legacy 8259 PIC
interrupt controller. Non ACPI compliant as well as non MPPARSE compliant.

For such platforms, it appears to me that hardcoding pic_mode = 1 (PIC Mode)
and giving no other choice to choose virtual wire mode is a bug for OF
based x86 platforms. 

Just like mpparse relies on IMCRP bit 7 of MP feature info byte2 [5] to
select pic_mode to PIC mode or virtual wire mode. arch/x86/kernel/devicetree.c
should also provide some similar configurability to choose interrupt
delivery mode & not hardcode it to PIC mode.

This patch is to fix above explained bug in x86/of support for interrupt
delivery mode configuration. Please let me know if you find any mistake
in above understanding or if you have a alternative better suggestion to
solve it or if you find anything odd here in our platform/system. TIA.

The patch is baselined on below git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core

[1] https://pdos.csail.mit.edu/6.828/2008/readings/ia32/MPspec.pdf
[2] https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf
[3] https://elixir.bootlin.com/linux/v6.1-rc5/source/arch/x86/kernel/apic/apic.c#L1691
[4] https://elixir.bootlin.com/linux/v6.1-rc5/source/arch/x86/kernel/mpparse.c#L517
[5] https://www.manualslib.com/manual/77733/Intel-Multiprocessor.html?page=40#manual
[6] https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html
[7] https://elixir.bootlin.com/linux/v6.1-rc5/source/arch/x86/kernel/devicetree.c#L170

v2:
- Address review concern from Andy - rename property name to make
  it a bit more positive & self explanatory.
- Found that the bindings document for these HW's (APIC) are a bit
  off/obsolete and still in text format. Created new YAML schemas
  one for each - lapic & ioapic. Updated these schemas with latest
  info and add in new optional property details in the updated
  schema for lapic. Delete/let go of the text binding doc.
- CC devicetree@vger.kernel.org as these changes appear to be
  mainly targeted for devicetree maintainers review & approval.
- Increase CCed list to include all possible people who touched
  and were involved this part of code/feature addition.

v1:
- Initial draft



Rahul Tanwar (2):
  x86/of: Add support for boot time interrupt delivery mode
    configuration
  x86/of: Convert & update Intel's APIC related binding schemas

 .../intel,ce4100-ioapic.txt                   | 26 --------
 .../intel,ce4100-ioapic.yaml                  | 62 ++++++++++++++++++
 .../intel,ce4100-lapic.yaml                   | 63 +++++++++++++++++++
 arch/x86/kernel/devicetree.c                  |  9 ++-
 4 files changed, 133 insertions(+), 27 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml

-- 
2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 1/2] x86/of: Add support for boot time interrupt delivery mode configuration
@ 2022-11-16 10:41   ` Rahul Tanwar
  0 siblings, 0 replies; 15+ messages in thread
From: Rahul Tanwar @ 2022-11-16 10:41 UTC (permalink / raw)
  To: bigeasy, devicetree, robh, andriy.shevchenko, tglx, mingo, bp,
	dave.hansen, x86
  Cc: linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc, Rahul Tanwar

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 & hardcoded to legacy PIC mode. This is a bug for
platforms which are OF based but do not use 8259 compliant legacy
PIC interrupt controller. Such platforms can not even boot because
of this bug/hardcoding.

Fix this bug by adding support for configuration of init time
interrupt delivery mode for x86 OF based systems by introducing a
new optional boolean property 'intel,virtual-wire-mode' for
interrupt-controller node of local APIC. This property emulates
IMCRP Bit 7 of MP feature info byte 2 of MP floating pointer
structure [1].

Defaults to legacy PIC mode if absent. Configures it to virtual
wire compatibility mode if present.

[1] https://www.manualslib.com/manual/77733/Intel-Multiprocessor.html?page=40#manual

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(-)

diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 5cd51f25f446..2a8833f0f6ae 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,virtual-wire-mode")) {
+		printk(KERN_NOTICE "Virtual Wire compatibility mode.\n");
+		pic_mode = 0;
+	} else {
+		printk(KERN_NOTICE "IMCR and PIC compatibility mode.\n");
+		pic_mode = 1;
+	}
+
 	register_lapic_address(lapic_addr);
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 2/2] x86/of: Convert & update Intel's APIC related binding schemas
@ 2022-11-16 10:41   ` Rahul Tanwar
  0 siblings, 0 replies; 15+ messages in thread
From: Rahul Tanwar @ 2022-11-16 10:41 UTC (permalink / raw)
  To: bigeasy, devicetree, robh, andriy.shevchenko, tglx, mingo, bp,
	dave.hansen, x86
  Cc: linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc, Rahul Tanwar

Intel's APIC family of interrupt controllers support local APIC
(lapic) & I/O APIC (ioapic). Convert existing bindings for lapic
& ioapic from text to YAML schema. Separate lapic & ioapic schemas.

Also, update more info and newly introduced optional property for
lapic to choose legacy PIC or virtual wire compatibility interrupt
delivery mode.

Signed-off-by: Rahul Tanwar <rtanwar@maxlinear.com>
---
 .../intel,ce4100-ioapic.txt                   | 26 --------
 .../intel,ce4100-ioapic.yaml                  | 62 ++++++++++++++++++
 .../intel,ce4100-lapic.yaml                   | 63 +++++++++++++++++++
 3 files changed, 125 insertions(+), 26 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml

diff --git a/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.txt b/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.txt
deleted file mode 100644
index 7d19f494f19a..000000000000
--- a/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Interrupt chips
----------------
-
-* Intel I/O Advanced Programmable Interrupt Controller (IO APIC)
-
-  Required properties:
-  --------------------
-     compatible = "intel,ce4100-ioapic";
-     #interrupt-cells = <2>;
-
-  Device's interrupt property:
-
-     interrupts = <P S>;
-
-  The first number (P) represents the interrupt pin which is wired to the
-  IO APIC. The second number (S) represents the sense of interrupt which
-  should be configured and can be one of:
-    0 - Edge Rising
-    1 - Level Low
-    2 - Level High
-    3 - Edge Falling
-
-* Local APIC
-  Required property:
-
-     compatible = "intel,ce4100-lapic";
diff --git a/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml b/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml
new file mode 100644
index 000000000000..537bb69cf2d3
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/interrupt-controller/intel,ce4100-ioapic.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Intel I/O Advanced Programmable Interrupt Controller (I/O APIC)
+
+maintainers:
+  - Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+
+description: |
+  Intel's Advanced Programmable Interrupt Controller (APIC) is a
+  family of interrupt controllers. The APIC is a split
+  architecture design, with a local component (LAPIC) integrated
+  into the processor itself and an external I/O APIC. Local APIC
+  (lapic) receives interrupts from the processor's interrupt pins,
+  from internal sources and from an external I/O APIC (ioapic).
+  And it sends these to the processor core for handling.
+  See https://pdos.csail.mit.edu/6.828/2008/readings/ia32/IA32-3A.pdf
+  Chapter 8 for more details.
+
+  Many of the Intel's generic devices like hpet, ioapic, lapic have
+  the ce4100 name in their compatible property names because they
+  first appeared in CE4100 SoC. See bindings/x86/ce4100.txt for more
+  details on it.
+
+  This schema defines bindings for I/O APIC interrupt controller.
+  
+properties:
+  compatible:
+    - const: intel,ce4100-ioapic
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  '#interrupt-cells':
+    const: 2
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - '#interrupt-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    ioapic1: interrupt-controller@fec00000 {
+        compatible = "intel,ce4100-ioapic";
+        reg = <0xfec00000 0x1000>;
+        #interrupt-cells = <2>;
+        #address-cells = <0>;
+        interrupt-controller;
+    };
diff --git a/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml b/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml
new file mode 100644
index 000000000000..890e07351506
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/interrupt-controller/intel,ce4100-lapic.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Intel Local Advanced Programmable Interrupt Controller (LAPIC)
+
+maintainers:
+  - Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+
+description: |
+  Intel's Advanced Programmable Interrupt Controller (APIC) is a
+  family of interrupt controllers. The APIC is a split
+  architecture design, with a local component (LAPIC) integrated
+  into the processor itself and an external I/O APIC. Local APIC
+  (lapic) receives interrupts from the processor's interrupt pins,
+  from internal sources and from an external I/O APIC (ioapic).
+  And it sends these to the processor core for handling.
+  See https://pdos.csail.mit.edu/6.828/2008/readings/ia32/IA32-3A.pdf
+  Chapter 8 for more details.
+
+  Many of the Intel's generic devices like hpet, ioapic, lapic have
+  the ce4100 name in their compatible property names because they
+  first appeared in CE4100 SoC. See bindings/x86/ce4100.txt for more
+  details on it.
+
+  This schema defines bindings for local APIC interrupt controller.
+  
+properties:
+  compatible:
+    - const: intel,ce4100-lapic
+
+  reg:
+    maxItems: 1
+
+  intel,virtual-wire-mode:
+    description: Intel defines a few possible interrupt delivery
+      modes. With respect to boot/init time, mainly two interrupt
+      delivery modes are possible.
+      PIC Mode - Legacy external 8259 compliant PIC interrupt controller.
+      Virtual Wire Mode - use lapic as virtual wire interrupt delivery mode.
+      For ACPI or MPS spec compliant systems, it is figured out by some read
+      only bit field/s available in their respective defined data structures.
+      For OF based systems, it is by default set to PIC mode.
+      But if this optional boolean property is set, then the interrupt delivery
+      mode is configured to virtual wire compatibility mode.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    lapic0: interrupt-controller@fee00000 {
+        compatible = "intel,ce4100-lapic";
+        reg = <0xfee00000 0x1000>;
+        intel,virtual-wire-mode;
+    };
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] x86/of: Convert & update Intel's APIC related binding schemas
  2022-11-16 10:41   ` Rahul Tanwar
  (?)
@ 2022-11-16 10:41   ` Andy Shevchenko
  2022-11-16 10:52     ` Rahul Tanwar
  -1 siblings, 1 reply; 15+ messages in thread
From: Andy Shevchenko @ 2022-11-16 10:41 UTC (permalink / raw)
  To: Rahul Tanwar
  Cc: devicetree, robh, tglx, mingo, bp, dave.hansen, x86,
	linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc

On Wed, Nov 16, 2022 at 06:28:21PM +0800, Rahul Tanwar wrote:
> Intel's APIC family of interrupt controllers support local APIC
> (lapic) & I/O APIC (ioapic). Convert existing bindings for lapic
> & ioapic from text to YAML schema. Separate lapic & ioapic schemas.
> 
> Also, update more info and newly introduced optional property for
> lapic to choose legacy PIC or virtual wire compatibility interrupt
> delivery mode.

Conversion should be split from a new property addition.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/2] x86/of: Add support for boot time interrupt delivery mode configuration
  2022-11-16 10:41   ` Rahul Tanwar
  (?)
@ 2022-11-16 10:42   ` Andy Shevchenko
  2022-11-16 11:25     ` Rahul Tanwar
  2022-11-16 11:27     ` Rahul Tanwar
  -1 siblings, 2 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-11-16 10:42 UTC (permalink / raw)
  To: Rahul Tanwar
  Cc: devicetree, robh, tglx, mingo, bp, dave.hansen, x86,
	linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc

On Wed, Nov 16, 2022 at 06:28:20PM +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 & hardcoded to legacy PIC mode. This is a bug for
> platforms which are OF based but do not use 8259 compliant legacy
> PIC interrupt controller. Such platforms can not even boot because
> of this bug/hardcoding.
> 
> Fix this bug by adding support for configuration of init time
> interrupt delivery mode for x86 OF based systems by introducing a
> new optional boolean property 'intel,virtual-wire-mode' for
> interrupt-controller node of local APIC. This property emulates
> IMCRP Bit 7 of MP feature info byte 2 of MP floating pointer
> structure [1].
> 
> Defaults to legacy PIC mode if absent. Configures it to virtual
> wire compatibility mode if present.

> [1] https://www.manualslib.com/manual/77733/Intel-Multiprocessor.html?page=40#manual

Link: ?

...

> +	if (of_property_read_bool(dn, "intel,virtual-wire-mode")) {

You need a separate patch to show this property being added (yes,
I have just commented on your patch 2).

> +		printk(KERN_NOTICE "Virtual Wire compatibility mode.\n");
> +		pic_mode = 0;
> +	} else {
> +		printk(KERN_NOTICE "IMCR and PIC compatibility mode.\n");
> +		pic_mode = 1;

Why not pr_notice()  in both cases?

> +	}

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] x86/of: Convert & update Intel's APIC related binding schemas
  2022-11-16 10:41   ` Andy Shevchenko
@ 2022-11-16 10:52     ` Rahul Tanwar
  2022-11-16 13:36       ` Andy Shevchenko
  0 siblings, 1 reply; 15+ messages in thread
From: Rahul Tanwar @ 2022-11-16 10:52 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: devicetree, robh, tglx, mingo, bp, dave.hansen, x86,
	linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc

On 16/11/2022 6:42 pm, Andy Shevchenko wrote:
> This email was sent from outside of MaxLinear.
> 
> 
> On Wed, Nov 16, 2022 at 06:28:21PM +0800, Rahul Tanwar wrote:
>> Intel's APIC family of interrupt controllers support local APIC
>> (lapic) & I/O APIC (ioapic). Convert existing bindings for lapic
>> & ioapic from text to YAML schema. Separate lapic & ioapic schemas.
>>
>> Also, update more info and newly introduced optional property for
>> lapic to choose legacy PIC or virtual wire compatibility interrupt
>> delivery mode.
> 
> Conversion should be split from a new property addition.
> 

Do you mean, i first update older text file with new property addition
and then later convert it into YAML i.e. for now i just update existing 
text file with new addition and later convert them to YAML schema ? Thanks.

Regards,
Rahul


> --
> With Best Regards,
> Andy Shevchenko
> 
> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/2] x86/of: Add support for boot time interrupt delivery mode configuration
  2022-11-16 10:42   ` Andy Shevchenko
@ 2022-11-16 11:25     ` Rahul Tanwar
  2022-11-16 13:34       ` Andy Shevchenko
  2022-11-16 11:27     ` Rahul Tanwar
  1 sibling, 1 reply; 15+ messages in thread
From: Rahul Tanwar @ 2022-11-16 11:25 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: devicetree, robh, tglx, mingo, bp, dave.hansen, x86,
	linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc

On 16/11/2022 6:42 pm, Andy Shevchenko wrote:
> This email was sent from outside of MaxLinear.
> 
> On Wed, Nov 16, 2022 at 06:28:20PM +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 & hardcoded to legacy PIC mode. This is a bug for
>  > platforms which are OF based but do not use 8259 compliant legacy
>  > PIC interrupt controller. Such platforms can not even boot because
>  > of this bug/hardcoding.
>  >
>  > Fix this bug by adding support for configuration of init time
>  > interrupt delivery mode for x86 OF based systems by introducing a
>  > new optional boolean property 'intel,virtual-wire-mode' for
>  > interrupt-controller node of local APIC. This property emulates
>  > IMCRP Bit 7 of MP feature info byte 2 of MP floating pointer
>  > structure [1].
>  >
>  > Defaults to legacy PIC mode if absent. Configures it to virtual
>  > wire compatibility mode if present.
> 
>  > [1] 
> https://www.manualslib.com/manual/77733/Intel-Multiprocessor.html?page=40#manual <https://www.manualslib.com/manual/77733/Intel-Multiprocessor.html?page=40#manual>
> 
> Link: ?


Rechecked. Link URL works for me. Am i missing any standard practice to 
add URL links in commit log ?



> 
> ...
> 
>  > + if (of_property_read_bool(dn, "intel,virtual-wire-mode")) {
> 
> You need a separate patch to show this property being added (yes,
> I have just commented on your patch 2).
> 
>  > + printk(KERN_NOTICE "Virtual Wire compatibility mode.\n");
>  > + pic_mode = 0;
>  > + } else {
>  > + printk(KERN_NOTICE "IMCR and PIC compatibility mode.\n");
>  > + pic_mode = 1;
> 
> Why not pr_notice() in both cases?

Reset of the file uses printk(KERN_xxx ""). In v1, i used pr_notice() 
but on reviewing again found it to be odd one out in the file. So 
switched to printk(KERN_xxx ""). I can revert back to using pr_notice() 
if you think that's a better fit. Thanks.

Regards,
Rahul

> 
>  > + }
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/2] x86/of: Add support for boot time interrupt delivery mode configuration
  2022-11-16 10:42   ` Andy Shevchenko
  2022-11-16 11:25     ` Rahul Tanwar
@ 2022-11-16 11:27     ` Rahul Tanwar
  1 sibling, 0 replies; 15+ messages in thread
From: Rahul Tanwar @ 2022-11-16 11:27 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: devicetree, robh, tglx, mingo, bp, dave.hansen, x86,
	linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc

On 16/11/2022 6:42 pm, Andy Shevchenko wrote:
> This email was sent from outside of MaxLinear.
> 
> On Wed, Nov 16, 2022 at 06:28:20PM +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 & hardcoded to legacy PIC mode. This is a bug for
>  > platforms which are OF based but do not use 8259 compliant legacy
>  > PIC interrupt controller. Such platforms can not even boot because
>  > of this bug/hardcoding.
>  >
>  > Fix this bug by adding support for configuration of init time
>  > interrupt delivery mode for x86 OF based systems by introducing a
>  > new optional boolean property 'intel,virtual-wire-mode' for
>  > interrupt-controller node of local APIC. This property emulates
>  > IMCRP Bit 7 of MP feature info byte 2 of MP floating pointer
>  > structure [1].
>  >
>  > Defaults to legacy PIC mode if absent. Configures it to virtual
>  > wire compatibility mode if present.
> 
>  > [1] 
> https://www.manualslib.com/manual/77733/Intel-Multiprocessor.html?page=40#manual <https://www.manualslib.com/manual/77733/Intel-Multiprocessor.html?page=40#manual>
> 
> Link: ?
> 
> ...
> 
>  > + if (of_property_read_bool(dn, "intel,virtual-wire-mode")) {
> 
> You need a separate patch to show this property being added (yes,
> I have just commented on your patch 2).
>

Well noted about it. Will update. Thanks.

Regards,
Rahul


>  > + printk(KERN_NOTICE "Virtual Wire compatibility mode.\n");
>  > + pic_mode = 0;
>  > + } else {
>  > + printk(KERN_NOTICE "IMCR and PIC compatibility mode.\n");
>  > + pic_mode = 1;
> 
> Why not pr_notice() in both cases?
> 
>  > + }
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 0/2]  x86/of: Fix a bug in x86 arch OF support
  2022-11-16 10:41 ` Rahul Tanwar
                   ` (2 preceding siblings ...)
  (?)
@ 2022-11-16 13:31 ` Andy Shevchenko
  -1 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-11-16 13:31 UTC (permalink / raw)
  To: Rahul Tanwar
  Cc: bigeasy, devicetree, robh, tglx, mingo, bp, dave.hansen, x86,
	linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc

On Wed, Nov 16, 2022 at 06:41:00PM +0800, Rahul Tanwar wrote:
> [Resend] as i missed to include Sebastian who changes this patch
> modifies.

Now they will not see the ongoing discussion. Better was to just Cc them and
give a link to lore.kernel.org for the thread.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/2] x86/of: Add support for boot time interrupt delivery mode configuration
  2022-11-16 11:25     ` Rahul Tanwar
@ 2022-11-16 13:34       ` Andy Shevchenko
  0 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-11-16 13:34 UTC (permalink / raw)
  To: Rahul Tanwar
  Cc: devicetree, robh, tglx, mingo, bp, dave.hansen, x86,
	linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc

On Wed, Nov 16, 2022 at 11:25:47AM +0000, Rahul Tanwar wrote:
> On 16/11/2022 6:42 pm, Andy Shevchenko wrote:
> > On Wed, Nov 16, 2022 at 06:28:20PM +0800, Rahul Tanwar wrote:

...

> > Why not pr_notice() in both cases?
> 
> Reset of the file uses printk(KERN_xxx ""). In v1, i used pr_notice() 
> but on reviewing again found it to be odd one out in the file. So 
> switched to printk(KERN_xxx ""). I can revert back to using pr_notice() 
> if you think that's a better fit. Thanks.

I don;t know why we should use antique style of printing APIs in new patches.
Even if the old code uses that, you can create a followup that can do two
things:
- uses pr_lvl() instead of printk(KERN_LVL)
- keeps string literals unbroken between the lines (if any
  of such breakage exists)

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] x86/of: Convert & update Intel's APIC related binding schemas
  2022-11-16 10:52     ` Rahul Tanwar
@ 2022-11-16 13:36       ` Andy Shevchenko
  0 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-11-16 13:36 UTC (permalink / raw)
  To: Rahul Tanwar
  Cc: devicetree, robh, tglx, mingo, bp, dave.hansen, x86,
	linux-kernel, hpa, alan, dirk.brandewie, grant.likely, sodaville,
	devicetree-discuss, linux-lgm-soc

On Wed, Nov 16, 2022 at 10:52:59AM +0000, Rahul Tanwar wrote:
> On 16/11/2022 6:42 pm, Andy Shevchenko wrote:
> > On Wed, Nov 16, 2022 at 06:28:21PM +0800, Rahul Tanwar wrote:
> >> Intel's APIC family of interrupt controllers support local APIC
> >> (lapic) & I/O APIC (ioapic). Convert existing bindings for lapic
> >> & ioapic from text to YAML schema. Separate lapic & ioapic schemas.
> >>
> >> Also, update more info and newly introduced optional property for
> >> lapic to choose legacy PIC or virtual wire compatibility interrupt
> >> delivery mode.
> > 
> > Conversion should be split from a new property addition.
> > 
> 
> Do you mean, i first update older text file with new property addition
> and then later convert it into YAML i.e. for now i just update existing 
> text file with new addition and later convert them to YAML schema ? Thanks.

Patch 1: Convert to YAML (no content changes except its format)
Patch 2: Introducing a new property
Patch 3: Updating code in x86

First two must be send to the DT people and have their Acks/Rb after all.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] x86/of: Convert & update Intel's APIC related binding schemas
  2022-11-16 10:41 ` Rahul Tanwar
                   ` (3 preceding siblings ...)
  (?)
@ 2022-11-16 15:29 ` Rob Herring
  -1 siblings, 0 replies; 15+ messages in thread
From: Rob Herring @ 2022-11-16 15:29 UTC (permalink / raw)
  To: Rahul Tanwar
  Cc: dave.hansen, hpa, dirk.brandewie, bp, tglx, devicetree, alan,
	devicetree-discuss, linux-lgm-soc, bigeasy, x86, mingo,
	sodaville, grant.likely, linux-kernel, andriy.shevchenko


On Wed, 16 Nov 2022 18:41:02 +0800, Rahul Tanwar wrote:
> Intel's APIC family of interrupt controllers support local APIC
> (lapic) & I/O APIC (ioapic). Convert existing bindings for lapic
> & ioapic from text to YAML schema. Separate lapic & ioapic schemas.
> 
> Also, update more info and newly introduced optional property for
> lapic to choose legacy PIC or virtual wire compatibility interrupt
> delivery mode.
> 
> Signed-off-by: Rahul Tanwar <rtanwar@maxlinear.com>
> ---
>  .../intel,ce4100-ioapic.txt                   | 26 --------
>  .../intel,ce4100-ioapic.yaml                  | 62 ++++++++++++++++++
>  .../intel,ce4100-lapic.yaml                   | 63 +++++++++++++++++++
>  3 files changed, 125 insertions(+), 26 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.txt
>  create mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml
>  create mode 100644 Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml: properties:compatible: [{'const': 'intel,ce4100-lapic'}] is not of type 'object', 'boolean'
	from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml: properties:compatible: [{'const': 'intel,ce4100-ioapic'}] is not of type 'object', 'boolean'
	from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.yaml: ignoring, error in schema: properties: compatible
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.yaml: ignoring, error in schema: properties: compatible
Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-lapic.example.dtb:0:0: /example-0/interrupt-controller@fee00000: failed to match any schema with compatible: ['intel,ce4100-lapic']
Documentation/devicetree/bindings/interrupt-controller/intel,ce4100-ioapic.example.dtb:0:0: /example-0/interrupt-controller@fec00000: failed to match any schema with compatible: ['intel,ce4100-ioapic']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-11-16 15:29 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 10:28 [PATCH v2 0/2] x86/of: Fix a bug in x86 arch OF support Rahul Tanwar
2022-11-16 10:41 ` Rahul Tanwar
2022-11-16 10:28 ` [PATCH v2 1/2] x86/of: Add support for boot time interrupt delivery mode configuration Rahul Tanwar
2022-11-16 10:41   ` Rahul Tanwar
2022-11-16 10:42   ` Andy Shevchenko
2022-11-16 11:25     ` Rahul Tanwar
2022-11-16 13:34       ` Andy Shevchenko
2022-11-16 11:27     ` Rahul Tanwar
2022-11-16 10:28 ` [PATCH v2 2/2] x86/of: Convert & update Intel's APIC related binding schemas Rahul Tanwar
2022-11-16 10:41   ` Rahul Tanwar
2022-11-16 10:41   ` Andy Shevchenko
2022-11-16 10:52     ` Rahul Tanwar
2022-11-16 13:36       ` Andy Shevchenko
2022-11-16 13:31 ` [PATCH v2 0/2] x86/of: Fix a bug in x86 arch OF support Andy Shevchenko
2022-11-16 15:29 ` [PATCH v2 2/2] x86/of: Convert & update Intel's APIC related binding schemas Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.