mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
After unloading the NVDLA driver and then reloading the NVDLA, the kernel is crashing. The host1x-nvhost driver is missing a call to class_destroy() in nvhost_client_device_release() which gets called when removing the DLA driver and this is preventing the DLA driver from creating the class again when reloading. The crash then occurs because when the driver is reloaded, creating the class for the DLA driver fails and then the host1x-nvhost driver incorrectly calls device_destroy() even though the device has not been created yet. Fix this by ensuring the class_destroy() is called by nvhost_client_device_release() and in the necessary error paths and then remove the call to device_destroy(). Finally, replace request_irq() with devm_request_irq() to ensure that the interrupts are also released as necessary on removal. Bug 3641820 Change-Id: Ia328bf63d528e8c31bff1d7b3ac0d5dddc22f1f5 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2710546 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit