mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 07:35:31 +00:00
HV: handle adding ptdev entry failure cases
handle adding pass-through device entry failure cases, instead of calling ASSERT, to avoid hypervisor crash. Tracked-On: #1860 Signed-off-by: Minggui Cao <minggui.cao@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -160,19 +160,21 @@ static void ptdev_interrupt_handler(__unused uint32_t irq, void *data)
|
||||
}
|
||||
|
||||
/* active intr with irq registering */
|
||||
void
|
||||
ptdev_activate_entry(struct ptdev_remapping_info *entry, uint32_t phys_irq)
|
||||
int32_t ptdev_activate_entry(struct ptdev_remapping_info *entry, uint32_t phys_irq)
|
||||
{
|
||||
int32_t retval;
|
||||
|
||||
/* register and allocate host vector/irq */
|
||||
retval = request_irq(phys_irq, ptdev_interrupt_handler,
|
||||
(void *)entry, IRQF_PT);
|
||||
retval = request_irq(phys_irq, ptdev_interrupt_handler, (void *)entry, IRQF_PT);
|
||||
|
||||
ASSERT(retval >= 0, "dev register failed");
|
||||
entry->allocated_pirq = (uint32_t)retval;
|
||||
if (retval < 0) {
|
||||
pr_err("request irq failed, please check!, phys-irq=%d", phys_irq);
|
||||
} else {
|
||||
entry->allocated_pirq = (uint32_t)retval;
|
||||
atomic_set32(&entry->active, ACTIVE_FLAG);
|
||||
}
|
||||
|
||||
atomic_set32(&entry->active, ACTIVE_FLAG);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user