[U-Boot] [PATCH v2 1/2] x86: Wrap calls to 8259 with CONFIG_I8259_PIC

mask_irq(), unmask_irq() and specific_eoi() are provided by the i8259 PIC driver and should be wrapped with CONFIG_I8259_PIC.
Signed-off-by: Bin Meng bmeng.cn@gmail.com Tested-by: Hannes Schmelzer oe5hpm@oevsv.at
---
Changes in v2: - use if() instead of #if
arch/x86/lib/interrupts.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/arch/x86/lib/interrupts.c b/arch/x86/lib/interrupts.c index 297067d..39f8dea 100644 --- a/arch/x86/lib/interrupts.c +++ b/arch/x86/lib/interrupts.c @@ -64,7 +64,8 @@ void irq_install_handler(int irq, interrupt_handler_t *handler, void *arg) irq_handlers[irq].arg = arg; irq_handlers[irq].count = 0;
- unmask_irq(irq); + if (CONFIG_IS_ENABLED(I8259_PIC)) + unmask_irq(irq);
if (status) enable_interrupts(); @@ -83,7 +84,8 @@ void irq_free_handler(int irq)
status = disable_interrupts();
- mask_irq(irq); + if (CONFIG_IS_ENABLED(I8259_PIC)) + mask_irq(irq);
irq_handlers[irq].handler = NULL; irq_handlers[irq].arg = NULL; @@ -104,14 +106,16 @@ void do_irq(int hw_irq) }
if (irq_handlers[irq].handler) { - mask_irq(irq); + if (CONFIG_IS_ENABLED(I8259_PIC)) + mask_irq(irq);
irq_handlers[irq].handler(irq_handlers[irq].arg); irq_handlers[irq].count++;
- unmask_irq(irq); - specific_eoi(irq); - + if (CONFIG_IS_ENABLED(I8259_PIC)) { + unmask_irq(irq); + specific_eoi(irq); + } } else { if ((irq & 7) != 7) { spurious_irq_cnt++;

At present the Kconfig options (CONFIG_I8259_PIC and CONFIG_APIC) do not include a prompt message, which makes it impossible to be disabled from a board defconfig file.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
---
Changes in v2: None
arch/x86/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8fc9187..e052093 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -729,7 +729,7 @@ config PCIE_ECAM_SIZE maximum number of PCI buses as defined by the PCI specification.
config I8259_PIC - bool + bool "Enable Intel 8259 compatible interrupt controller" default y help Intel 8259 ISA compatible chipset incorporates two 8259 (master and @@ -737,7 +737,7 @@ config I8259_PIC the interrupt correctly.
config APIC - bool + bool "Enable Intel Advanced Programmable Interrupt Controller" default y help The (A)dvanced (P)rogrammable (I)nterrupt (C)ontroller is responsible

On Thu, 29 Nov 2018 at 20:52, Bin Meng bmeng.cn@gmail.com wrote:
At present the Kconfig options (CONFIG_I8259_PIC and CONFIG_APIC) do not include a prompt message, which makes it impossible to be disabled from a board defconfig file.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
Changes in v2: None
arch/x86/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Wed, Dec 5, 2018 at 10:01 PM Simon Glass sjg@chromium.org wrote:
On Thu, 29 Nov 2018 at 20:52, Bin Meng bmeng.cn@gmail.com wrote:
At present the Kconfig options (CONFIG_I8259_PIC and CONFIG_APIC) do not include a prompt message, which makes it impossible to be disabled from a board defconfig file.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
Changes in v2: None
arch/x86/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
applied to u-boot-x86, thanks!

On Thu, 29 Nov 2018 at 20:52, Bin Meng bmeng.cn@gmail.com wrote:
mask_irq(), unmask_irq() and specific_eoi() are provided by the i8259 PIC driver and should be wrapped with CONFIG_I8259_PIC.
Signed-off-by: Bin Meng bmeng.cn@gmail.com Tested-by: Hannes Schmelzer oe5hpm@oevsv.at
Changes in v2:
- use if() instead of #if
arch/x86/lib/interrupts.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Wed, Dec 5, 2018 at 10:01 PM Simon Glass sjg@chromium.org wrote:
On Thu, 29 Nov 2018 at 20:52, Bin Meng bmeng.cn@gmail.com wrote:
mask_irq(), unmask_irq() and specific_eoi() are provided by the i8259 PIC driver and should be wrapped with CONFIG_I8259_PIC.
Signed-off-by: Bin Meng bmeng.cn@gmail.com Tested-by: Hannes Schmelzer oe5hpm@oevsv.at
Changes in v2:
- use if() instead of #if
arch/x86/lib/interrupts.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
applied to u-boot-x86, thanks!
participants (2)
-
Bin Meng
-
Simon Glass