From 80e82cf4fb9eada4155cf1ad5270662313bc436e Mon Sep 17 00:00:00 2001 From: Kamal Agrawal Date: Mon, 20 Sep 2021 14:56:01 +0530 Subject: [PATCH] msm: kgsl: Avoid parsing IBs during atomic snapshot During IB parse, vmalloc is called which can sleep and should not be called from atomic context. Since IBs are not dumped during atomic snapshot, there is no need to parse it. Change-Id: I116d095958d99a8caeafb24dc45684ead01c961d Signed-off-by: Kamal Agrawal --- drivers/gpu/msm/adreno_hwsched.c | 8 ++++++++ drivers/gpu/msm/adreno_snapshot.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/gpu/msm/adreno_hwsched.c b/drivers/gpu/msm/adreno_hwsched.c index b860dc3b5e26..6eb466919833 100644 --- a/drivers/gpu/msm/adreno_hwsched.c +++ b/drivers/gpu/msm/adreno_hwsched.c @@ -1424,6 +1424,14 @@ void adreno_hwsched_parse_fault_cmdobj(struct adreno_device *adreno_dev, struct adreno_hwsched *hwsched = to_hwsched(adreno_dev); struct cmd_list_obj *obj, *tmp; + /* + * During IB parse, vmalloc is called which can sleep and + * should not be called from atomic context. Since IBs are not + * dumped during atomic snapshot, there is no need to parse it. + */ + if (adreno_dev->dev.snapshot_atomic) + return; + list_for_each_entry_safe(obj, tmp, &hwsched->cmd_list, node) { struct kgsl_drawobj_cmd *cmdobj = obj->cmdobj; diff --git a/drivers/gpu/msm/adreno_snapshot.c b/drivers/gpu/msm/adreno_snapshot.c index 2da41adafdf7..fe018fda26cf 100644 --- a/drivers/gpu/msm/adreno_snapshot.c +++ b/drivers/gpu/msm/adreno_snapshot.c @@ -272,6 +272,14 @@ static void snapshot_rb_ibs(struct kgsl_device *device, int index, i; int parse_ibs = 0, ib_parse_start; + /* + * During IB parse, vmalloc is called which can sleep and + * should not be called from atomic context. Since IBs are not + * dumped during atomic snapshot, there is no need to parse it. + */ + if (device->snapshot_atomic) + return; + /* * Figure out the window of ringbuffer data to dump. First we need to * find where the last processed IB ws submitted. Start walking back