diff --git a/msm/sde/sde_vm_primary.c b/msm/sde/sde_vm_primary.c index 85917d407a..54fafeb77d 100644 --- a/msm/sde/sde_vm_primary.c +++ b/msm/sde/sde_vm_primary.c @@ -25,7 +25,8 @@ static bool sde_vm_owns_hw(struct sde_kms *sde_kms) return (owns_irq & owns_mem_io); } -void sde_vm_irq_release_notification_handler(void *req, enum hh_irq_label label) +void sde_vm_irq_release_notification_handler(void *req, + unsigned long notif_type, enum hh_irq_label label) { struct sde_vm_primary *sde_vm; int rc = 0; @@ -169,7 +170,7 @@ static int _sde_vm_lend_irq(struct sde_vm *vm, struct msm_io_res *io_res) for (i = 0; i < irq_desc->n_irq; i++) { struct sde_vm_irq_entry *entry = &irq_desc->irq_entries[i]; - rc = hh_irq_lend(entry->label, HH_TRUSTED_VM, entry->irq, + rc = hh_irq_lend_v2(entry->label, HH_TRUSTED_VM, entry->irq, sde_vm_irq_release_notification_handler, sde_vm); if (rc) { @@ -179,6 +180,14 @@ static int _sde_vm_lend_irq(struct sde_vm *vm, struct msm_io_res *io_res) return rc; } + rc = hh_irq_lend_notify(entry->label); + if (rc) { + SDE_ERROR("irq lend notify failed, label: %d, rc=%d\n", + entry->label, rc); + hh_irq_reclaim(entry->label); + return rc; + } + SDE_INFO("vm lend suceeded for IRQ label: %d\n", entry->label); } diff --git a/msm/sde/sde_vm_trusted.c b/msm/sde/sde_vm_trusted.c index dfde63b4aa..a19dda502d 100644 --- a/msm/sde/sde_vm_trusted.c +++ b/msm/sde/sde_vm_trusted.c @@ -61,7 +61,8 @@ static int __irq_cmp(const void *a, const void *b) return (l->label - r->label); } -void sde_vm_irq_lend_notification_handler(void *req, enum hh_irq_label label) +void sde_vm_irq_lend_notification_handler(void *req, unsigned long notif_type, + enum hh_irq_label label) { struct sde_vm_trusted *sde_vm; struct sde_kms *sde_kms; @@ -217,6 +218,14 @@ static int _sde_vm_release_irq(struct sde_vm *vm) return rc; } + rc = hh_irq_release_notify(entry->label); + if (rc) { + SDE_ERROR( + "irq release notify failed,label: %d rc: %d\n", + entry->label, rc); + return rc; + } + atomic_dec(&sde_vm->base.n_irq_lent); } @@ -387,7 +396,7 @@ int sde_vm_trusted_init(struct sde_kms *kms) } sde_vm->base.mem_notification_cookie = cookie; - rc = hh_irq_wait_for_lend(HH_IRQ_LABEL_SDE, HH_PRIMARY_VM, + rc = hh_irq_wait_for_lend_v2(HH_IRQ_LABEL_SDE, HH_PRIMARY_VM, sde_vm_irq_lend_notification_handler, (void *)sde_vm); if (rc) {