From baa9f3ee725f76f0b6fbb5f853d914b9dc17ae16 Mon Sep 17 00:00:00 2001 From: Cho KyongHo Date: Wed, 17 Jan 2018 13:48:12 +0900 Subject: [PATCH] g2d: fix BUG() when logging events The following message caused by smp_processor_id() when it is not called in atomic context to keep the consistency of the processor id during the task related to the processor id is completed. <3>[ 66.158972] [7:composer@2.1-se: 1919] BUG: using smp_processor_id() in preemptible [00000000] code: composer@2.1-se/1919 <4>[ 66.158989] [7:composer@2.1-se: 1919] caller is debug_smp_processor_id+0x1c/0x24 <4>[ 66.158999] [7:composer@2.1-se: 1919] CPU: 7 PID: 1919 Comm: composer@2.1-se Tainted: G S 4.14.13-g7ad8263aec9d #83 <4>[ 66.159006] [7:composer@2.1-se: 1919] Hardware name: Samsung UNIVERSAL9810 board based on EXYNOS9810 (DT) <4>[ 66.159012] [7:composer@2.1-se: 1919] Call trace: <4>[ 66.159024] [7:composer@2.1-se: 1919] [] dump_backtrace+0x0/0x418 <4>[ 66.159032] [7:composer@2.1-se: 1919] [] show_stack+0x14/0x1c <4>[ 66.159042] [7:composer@2.1-se: 1919] [] dump_stack+0x88/0xac <4>[ 66.159049] [7:composer@2.1-se: 1919] [] check_preemption_disabled+0xd0/0xf4 <4>[ 66.159055] [7:composer@2.1-se: 1919] [] debug_smp_processor_id+0x1c/0x24 <4>[ 66.159065] [7:composer@2.1-se: 1919] [] g2d_stamp_task+0xa0/0x104 <4>[ 66.159071] [7:composer@2.1-se: 1919] [] g2d_ioctl+0x374/0x424 <4>[ 66.159080] [7:composer@2.1-se: 1919] [] vfs_ioctl+0x20/0x38 <4>[ 66.159086] [7:composer@2.1-se: 1919] [] do_vfs_ioctl+0x9c0/0xa6c <4>[ 66.159093] [7:composer@2.1-se: 1919] [] SyS_ioctl+0x60/0x88 Even though g2d driver does not need the consistency because it just uses it for logging the current CPU, it is required to kill the unnecessary messages. Change-Id: Ie6be45bc1457cb8936c388f80bc9b837fb4d2afa Signed-off-by: Cho KyongHo --- drivers/gpu/exynos/g2d/g2d_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/exynos/g2d/g2d_debug.c b/drivers/gpu/exynos/g2d/g2d_debug.c index 6f7bcd2776dc..9f662e49d677 100644 --- a/drivers/gpu/exynos/g2d/g2d_debug.c +++ b/drivers/gpu/exynos/g2d/g2d_debug.c @@ -223,7 +223,7 @@ void g2d_stamp_task(struct g2d_task *task, u32 val, s32 info) stamp->time = ktime_get(); stamp->val = val; - stamp->cpu = smp_processor_id(); + stamp->cpu = raw_smp_processor_id(); stamp->info = info; if (task && (stamp->val == G2D_STAMP_STATE_DONE)) { -- 2.20.1