bus: mhi: host: Move IRQ allocation to controller registration phase
authorQiang Yu <quic_qianyu@quicinc.com>
Thu, 23 Jun 2022 02:43:03 +0000 (10:43 +0800)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Fri, 24 Jun 2022 07:24:19 +0000 (12:54 +0530)
commit1227d2a20cd7319fb45c62fab4b252600e0308bf
tree8b120a7133d92c026ef975c64fb715ff13151f09
parentb7ce716254315dffcfce60e149ddd022c8a60345
bus: mhi: host: Move IRQ allocation to controller registration phase

During runtime, the MHI endpoint may be powered up/down several times.
So instead of allocating and destroying the IRQs all the time, let's just
enable/disable IRQs during power up/down.

The IRQs will be allocated during mhi_register_controller() and freed
during mhi_unregister_controller(). This works well for things like PCI
hotplug also as once the PCI device gets removed, the controller will
get unregistered. And once it comes back, it will get registered back
and even if the IRQ configuration changes (MSI), that will get accounted.

Signed-off-by: Qiang Yu <quic_qianyu@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/1655952183-66792-1-git-send-email-quic_qianyu@quicinc.com
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/bus/mhi/host/init.c
drivers/bus/mhi/host/pm.c