mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
msm: kgsl: Cleanup correctly when platform probe fails
When kgsl_device_platform_probe fails with EPROBE_DEFER, do proper cleanup to avoid issues in next probe call. Change-Id: Icd998b1299a64d53458bcd452f754903710c4ca0 Signed-off-by: Druva Kumar Charipalli <quic_dcharipa@quicinc.com> Signed-off-by: Pankaj Gupta <quic_gpankaj@quicinc.com>
This commit is contained in:
parent
1414389bb2
commit
6186cb14cc
3 changed files with 12 additions and 9 deletions
|
|
@ -1585,6 +1585,7 @@ err:
|
|||
if (of_find_matching_node(dev->of_node, adreno_gmu_match))
|
||||
component_unbind_all(dev, NULL);
|
||||
|
||||
idr_destroy(&device->context_idr);
|
||||
kgsl_bus_close(device);
|
||||
|
||||
return status;
|
||||
|
|
|
|||
|
|
@ -4293,6 +4293,9 @@ static void _unregister_device(struct kgsl_device *device)
|
|||
{
|
||||
int minor;
|
||||
|
||||
if (device->gpu_sysfs_kobj.state_initialized)
|
||||
kobject_del(&device->gpu_sysfs_kobj);
|
||||
|
||||
mutex_lock(&kgsl_driver.devlock);
|
||||
for (minor = 0; minor < ARRAY_SIZE(kgsl_driver.devp); minor++) {
|
||||
if (device == kgsl_driver.devp[minor]) {
|
||||
|
|
@ -4484,12 +4487,6 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
|
|||
device->pwrctrl.interrupt_num = status;
|
||||
disable_irq(device->pwrctrl.interrupt_num);
|
||||
|
||||
rwlock_init(&device->context_lock);
|
||||
spin_lock_init(&device->submit_lock);
|
||||
|
||||
idr_init(&device->timelines);
|
||||
spin_lock_init(&device->timelines_lock);
|
||||
|
||||
device->events_wq = alloc_workqueue("kgsl-events",
|
||||
WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS | WQ_HIGHPRI, 0);
|
||||
|
||||
|
|
@ -4504,6 +4501,12 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
|
|||
if (status != 0)
|
||||
goto error_pwrctrl_close;
|
||||
|
||||
rwlock_init(&device->context_lock);
|
||||
spin_lock_init(&device->submit_lock);
|
||||
|
||||
idr_init(&device->timelines);
|
||||
spin_lock_init(&device->timelines_lock);
|
||||
|
||||
kgsl_device_debugfs_init(device);
|
||||
|
||||
dma_set_coherent_mask(&pdev->dev, KGSL_DMA_BIT_MASK);
|
||||
|
|
@ -4537,9 +4540,6 @@ void kgsl_device_platform_remove(struct kgsl_device *device)
|
|||
|
||||
kgsl_device_snapshot_close(device);
|
||||
|
||||
if (device->gpu_sysfs_kobj.state_initialized)
|
||||
kobject_del(&device->gpu_sysfs_kobj);
|
||||
|
||||
idr_destroy(&device->context_idr);
|
||||
idr_destroy(&device->timelines);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/interconnect.h>
|
||||
|
|
@ -224,6 +225,7 @@ void kgsl_bus_close(struct kgsl_device *device)
|
|||
kfree(device->pwrctrl.ddr_table);
|
||||
device->pwrctrl.ddr_table = NULL;
|
||||
icc_put(device->pwrctrl.icc_path);
|
||||
device->pwrctrl.icc_path = NULL;
|
||||
if (device->pwrctrl.ddr_qos_devfreq)
|
||||
put_device(&device->pwrctrl.ddr_qos_devfreq->dev);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue