Merge "msm: kgsl: Use non-atomic snapshot memory if it is unused"

This commit is contained in:
qctecmdr 2021-06-24 02:40:07 -07:00 • committed by Gerrit - the friendly Code Review server
commit fbb7d8a475

View file

@ -687,13 +687,18 @@ static void kgsl_device_snapshot_atomic(struct kgsl_device *device)
}
device->snapshot_memory_atomic.size = device->snapshot_memory.size;
device->snapshot_memory_atomic.ptr = devm_kzalloc(&device->pdev->dev,
device->snapshot_memory_atomic.size, GFP_ATOMIC);
if (!device->snapshot_faultcount) {
/* Use non-atomic snapshot memory if it is unused */
device->snapshot_memory_atomic.ptr = device->snapshot_memory.ptr;
} else {
device->snapshot_memory_atomic.ptr = devm_kzalloc(&device->pdev->dev,
device->snapshot_memory_atomic.size, GFP_ATOMIC);
if (!device->snapshot_memory_atomic.ptr) {
dev_err(device->dev,
"KGSL failed to allocate memory for atomic snapshot\n");
return;
if (!device->snapshot_memory_atomic.ptr) {
dev_err(device->dev,
"KGSL failed to allocate memory for atomic snapshot\n");
return;
}
}
/* Allocate memory for the snapshot instance */