ia64: replace setup_irq() by request_irq()

request_irq() is preferred over setup_irq(). Invocations of setup_irq()
occur after memory allocators are ready.

Per tglx[1], setup_irq() existed in olden days when allocators were not
ready by the time early interrupts were initialized.

Hence replace setup_irq() by request_irq().

Changing 'ia64_native_register_percpu_irq' decleration to include
'irq_handler_t' as an argument type in arch/ia64/include/asm/hw_irq.h
was causing build error - 'unknown type name 'irq_handler_t''

This was due to below header file sequence,
+ include/interrupt.h
 + include/hardirq.h
  + asm/hardirq.h
   + include/irq.h
    + asm/hw_irq.h
       [ 'ia64_native_register_percpu_irq' declared w/ 'irq_handler_t']
 [ 'irq_handler_t' typedef'ed here in 'include/interrupt.h']

'register_percpu_irq' defined to 'ia64_native_register_percpu_irq' is
the one invoked by the caller, not the latter directly. This was done
to support paravirtualization which was removed around 4 years back.
And 'register_percpu_irq' is invoked only inside 'arch/ia64/kernel'.

So 'register_percpu_irq' define to 'ia64_native_register_percpu_irq' is
removed, instead 'ia64_native_register_percpu_irq' is renamed to
'register_precpu_irq()' & it is directly invoked. Also,
'register_precpu_irq()' is declared in a new header file 'irq.h' inside
'arch/ia64/kernel/', this header file is included by C files invoking
'register_percpu_irq()'.

[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos

Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:
afzal mohammed
2020-03-08 17:33:49 +05:30
committed by Tony Luck
parent 98d54f81e3
commit 90341cd8e0
6 changed files with 39 additions and 80 deletions

View File

@@ -104,6 +104,7 @@
#include "mca_drv.h"
#include "entry.h"
#include "irq.h"
#if defined(IA64_MCA_DEBUG_INFO)
# define IA64_MCA_DEBUG(fmt...) printk(fmt)
@@ -1766,36 +1767,6 @@ ia64_mca_disable_cpe_polling(char *str)
__setup("disable_cpe_poll", ia64_mca_disable_cpe_polling);
static struct irqaction cmci_irqaction = {
.handler = ia64_mca_cmc_int_handler,
.name = "cmc_hndlr"
};
static struct irqaction cmcp_irqaction = {
.handler = ia64_mca_cmc_int_caller,
.name = "cmc_poll"
};
static struct irqaction mca_rdzv_irqaction = {
.handler = ia64_mca_rendez_int_handler,
.name = "mca_rdzv"
};
static struct irqaction mca_wkup_irqaction = {
.handler = ia64_mca_wakeup_int_handler,
.name = "mca_wkup"
};
static struct irqaction mca_cpe_irqaction = {
.handler = ia64_mca_cpe_int_handler,
.name = "cpe_hndlr"
};
static struct irqaction mca_cpep_irqaction = {
.handler = ia64_mca_cpe_int_caller,
.name = "cpe_poll"
};
/* Minimal format of the MCA/INIT stacks. The pseudo processes that run on
* these stacks can never sleep, they cannot return from the kernel to user
* space, they do not appear in a normal ps listing. So there is no need to
@@ -2056,18 +2027,23 @@ void __init ia64_mca_irq_init(void)
* Configure the CMCI/P vector and handler. Interrupts for CMC are
* per-processor, so AP CMC interrupts are setup in smp_callin() (smpboot.c).
*/
register_percpu_irq(IA64_CMC_VECTOR, &cmci_irqaction);
register_percpu_irq(IA64_CMCP_VECTOR, &cmcp_irqaction);
register_percpu_irq(IA64_CMC_VECTOR, ia64_mca_cmc_int_handler, 0,
"cmc_hndlr");
register_percpu_irq(IA64_CMCP_VECTOR, ia64_mca_cmc_int_caller, 0,
"cmc_poll");
ia64_mca_cmc_vector_setup(); /* Setup vector on BSP */
/* Setup the MCA rendezvous interrupt vector */
register_percpu_irq(IA64_MCA_RENDEZ_VECTOR, &mca_rdzv_irqaction);
register_percpu_irq(IA64_MCA_RENDEZ_VECTOR, ia64_mca_rendez_int_handler,
0, "mca_rdzv");
/* Setup the MCA wakeup interrupt vector */
register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);
register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, ia64_mca_wakeup_int_handler,
0, "mca_wkup");
/* Setup the CPEI/P handler */
register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);
register_percpu_irq(IA64_CPEP_VECTOR, ia64_mca_cpe_int_caller, 0,
"cpe_poll");
}
/*
@@ -2108,7 +2084,9 @@ ia64_mca_late_init(void)
if (irq > 0) {
cpe_poll_enabled = 0;
irq_set_status_flags(irq, IRQ_PER_CPU);
setup_irq(irq, &mca_cpe_irqaction);
if (request_irq(irq, ia64_mca_cpe_int_handler,
0, "cpe_hndlr", NULL))
pr_err("Failed to register cpe_hndlr interrupt\n");
ia64_cpe_irq = irq;
ia64_mca_register_cpev(cpe_vector);
IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n",