From 4db95aa21ae4d2b0fc50c8e538e692bca8fd8c4c Mon Sep 17 00:00:00 2001 From: Prakruthi Deepak Heragu Date: Tue, 22 Aug 2023 17:15:50 -0700 Subject: [PATCH] ANDROID: virt: gunyah: Do not allocate irq for GH_RM_RESOURCE_NO_VIRQ Resource manager can now return GH_RM_RESOURCE_NO_VIRQ (-1) instead of 0 as the value to mean "there's no vIRQ for this resource". Bug: 297100131 Change-Id: I93c4f41b881bfc9e094fa6115df7ba6fcdaa7e6e Signed-off-by: Elliot Berman Signed-off-by: Prakruthi Deepak Heragu --- drivers/virt/gunyah/rsc_mgr.c | 2 +- include/linux/gunyah_rsc_mgr.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/virt/gunyah/rsc_mgr.c b/drivers/virt/gunyah/rsc_mgr.c index ab29e7687e3b..dd6fe39f652d 100644 --- a/drivers/virt/gunyah/rsc_mgr.c +++ b/drivers/virt/gunyah/rsc_mgr.c @@ -300,7 +300,7 @@ struct gh_resource *gh_rm_alloc_resource(struct gh_rm *rm, struct gh_rm_hyp_reso ghrsc->capid = le64_to_cpu(hyp_resource->cap_id); ghrsc->irq = IRQ_NOTCONNECTED; ghrsc->rm_label = le32_to_cpu(hyp_resource->resource_label); - if (hyp_resource->virq) { + if (hyp_resource->virq && hyp_resource->virq != GH_RM_RESOURCE_NO_VIRQ) { struct gh_irq_chip_data irq_data = { .gh_virq = le32_to_cpu(hyp_resource->virq), }; diff --git a/include/linux/gunyah_rsc_mgr.h b/include/linux/gunyah_rsc_mgr.h index bc55be6d8d33..0d9ec6d5162d 100644 --- a/include/linux/gunyah_rsc_mgr.h +++ b/include/linux/gunyah_rsc_mgr.h @@ -139,6 +139,7 @@ struct gh_rm_hyp_resource { __le32 resource_label; __le64 cap_id; __le32 virq_handle; +#define GH_RM_RESOURCE_NO_VIRQ 0xFFFFFFFF __le32 virq; __le64 base; __le64 size;