@@ -60,35 +60,30 @@ static int32_t request_notification_irq(irq_action_t func, void *data)
60
60
int32_t retval ;
61
61
62
62
if (notification_irq != IRQ_INVALID ) {
63
- pr_info ("%s, Notification vector already allocated on this CPU" ,
64
- __func__ );
65
- return - EBUSY ;
66
- }
67
-
68
- /* all cpu register the same notification vector */
69
- retval = request_irq (NOTIFY_IRQ , func , data , IRQF_NONE );
70
- if (retval < 0 ) {
71
- pr_err ("Failed to add notify isr" );
72
- return - ENODEV ;
63
+ pr_info ("%s, Notification vector already allocated on this CPU" , __func__ );
64
+ retval = - EBUSY ;
65
+ } else {
66
+ /* all cpu register the same notification vector */
67
+ retval = request_irq (NOTIFY_IRQ , func , data , IRQF_NONE );
68
+ if (retval < 0 ) {
69
+ pr_err ("Failed to add notify isr" );
70
+ retval = - ENODEV ;
71
+ } else {
72
+ notification_irq = (uint32_t )retval ;
73
+ }
73
74
}
74
75
75
- notification_irq = (uint32_t )retval ;
76
-
77
- return 0 ;
76
+ return retval ;
78
77
}
79
78
79
+ /*
80
+ * @pre be called only by BSP initialization process
81
+ */
80
82
void setup_notification (void )
81
83
{
82
- uint16_t cpu = get_cpu_id ();
83
-
84
- if (cpu > 0U ) {
85
- return ;
86
- }
87
-
88
84
/* support IPI notification, VM0 will register all CPU */
89
85
if (request_notification_irq (kick_notification , NULL ) < 0 ) {
90
86
pr_err ("Failed to setup notification" );
91
- return ;
92
87
}
93
88
94
89
dev_dbg (ACRN_DBG_PTIRQ , "NOTIFY: irq[%d] setup vector %x" ,
0 commit comments