From patchwork Mon Oct 15 13:46:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Li X-Patchwork-Id: 10641877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F343615E2 for ; Mon, 15 Oct 2018 13:46:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD84829AD7 for ; Mon, 15 Oct 2018 13:46:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE61529C7D; Mon, 15 Oct 2018 13:46:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4EB7329ADD for ; Mon, 15 Oct 2018 13:46:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 22D94893EC; Mon, 15 Oct 2018 13:46:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on060e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::60e]) by gabe.freedesktop.org (Postfix) with ESMTPS id EB98D893EC; Mon, 15 Oct 2018 13:46:45 +0000 (UTC) Received: from DM3PR12CA0083.namprd12.prod.outlook.com (2603:10b6:0:57::27) by CY1PR12MB0425.namprd12.prod.outlook.com (2a01:111:e400:5192::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.22; Mon, 15 Oct 2018 13:46:43 +0000 Received: from BY2NAM03FT054.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::203) by DM3PR12CA0083.outlook.office365.com (2603:10b6:0:57::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.21 via Frontend Transport; Mon, 15 Oct 2018 13:46:43 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by BY2NAM03FT054.mail.protection.outlook.com (10.152.85.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1250.12 via Frontend Transport; Mon, 15 Oct 2018 13:46:42 +0000 Received: from leodev.amd.com (10.180.168.240) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Mon, 15 Oct 2018 08:46:41 -0500 From: To: Subject: [PATCH v2] drm: Get ref on CRTC commit object when waiting for flip_done Date: Mon, 15 Oct 2018 09:46:40 -0400 Message-ID: <1539611200-6184-1-git-send-email-sunpeng.li@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539380010-9221-1-git-send-email-sunpeng.li@amd.com> References: <1539380010-9221-1-git-send-email-sunpeng.li@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(396003)(136003)(376002)(346002)(2980300002)(428003)(189003)(199004)(50466002)(104016004)(476003)(86362001)(478600001)(48376002)(86152003)(47776003)(72206003)(126002)(68736007)(76176011)(81156014)(2351001)(81166006)(11346002)(53416004)(8936002)(97736004)(106466001)(5660300001)(446003)(105586002)(2906002)(2616005)(2876002)(45080400002)(4326008)(486006)(53936002)(51416003)(7696005)(305945005)(8676002)(186003)(16586007)(54906003)(6916009)(316002)(426003)(50226002)(77096007)(14444005)(356004)(36756003)(336012)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0425; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT054; 1:RZSNonGYZw454hI07wQAHH68kHr0qYKMerU0zQgSN9g+hoVSWOr94ElI+IHSfneRLS4meZFKwKLKyPc2QtNJVmCO2An5NjDzHgW33YQ8eTgNaJAtDrmyGnHO4nGcFc1Y X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da43e575-4320-4da4-193a-08d632a4a441 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:CY1PR12MB0425; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0425; 3:krB+9DP47gbh2zmlZZPFE392+4LYwAOJIjEaHCf3EZkj5c2z31MxTmWP0GjrYBhny3qZnVReI3Piu7+0SKHxcM36A8qE7dHdMo7KGOPRqDb3uipO17hPpxuUqJ5DHbO4aFAQabiaNyOxzO8hLJ5P+K9WWHd4WCpmkZTZtqdeqM/TNYD1TEqHF9dmzfAX0KwUfnksFl4Bnmq3lb/xBXZYJJEREdpzQI/NkBP931iIdAhe8TAJN9C/iy1/HEkMNPxmPtYao43+GLP0eE3mvad0vSQnnj2zZFu22WSD1olY6o6wa88KR5ma6PuJ+x4yfq+3PjlGjXB5eIYS+f1CM/wuGbSuYT99/JTcZbk16BnM47E=; 25:BEBjhNcZsv6kKLmfpjpK2tZ9TzQuxT/2Vj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B1UptElddORuNTacUe+AEbYpcSbaastZCEt5HqI3ZAkjVmrUix7/9Oq2nBTMeBuTiBvfiD5jPM/kVU7N X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93003095)(6055026)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991067); SRVR:CY1PR12MB0425; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0425; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0425; 4:8u4pnTQpiSDfqu7zcnjRXOwG9GQ4rOI924/xS6uveliTAJ5H8PDKlxf0UdtfBD2JhJYyXTZ1QZV37UAAKDeRnKh1hXqH8Bz79s1vZIAiwYbEeGSsB8RykqrRgjx1s1n7FMp0voXfbVM6Q50VKklSXka82qFV/LjiNOaeS+fIrH6aPtb5aga5NWzPw9M1j84I+NX8kbaS/8cJI/1k0f9A5uEDl9ohnWFf7TsWDGfOcc71fuTZ8mQri8LKhe9eQ/L+UataaHqnbFBveiJJhWhiiQpxhGP1/1i1BnHRGtdTOZG9uLpKTDUPR7BHatJRjNIh X-Forefront-PRVS: 0826B2F01B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR12MB0425; 23:45hLlmeObh2fqJG5j5gk5QKZXLxDg1+VhrudQyQbh?= +0li9UO6W4Nqnjh77Q0TBVYbXe30y+adFRQ7XVzDg409NYeA97MQsx+UWYHttPX6WBfjXaM/97egSRtg9wDWOLo/1HlLOspSLm//uq4CTjD1bT+pfLEJVht76xdVvVsR+fCPyqPGSjDUm0n8eRZMQp9vXTK2A3NuoX+bUaoKllJxJ2XL+D5+09sPs980IdVcoFY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7d1tBdbsFBM9es497zzYq6iPGx0dYSUNoY/EvgXS5t94W/EEaE9L3dgiSYx9MiaCx/NR3tEYZBTKPkevBmr0KNQ+ABBxHXeC3ZDqLwBxvPPH2LliF3HXrMB9OpCyS8vkL/MosMAg4TcTvZ0/tXDuQV1s4GGbEo16GRlsgO7OlFwD2Ibjz0tvpKvPdSil1t SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0425; 20:NGYXkoEwHkLCopDxDlrLvS7AsDW6AO+ev/Nva3cnXDc5u80BgPCu+Bq1I8uRmfuONJzzgIZ09Ya3luSKSHeyfSa8mF0agNqcBxeznux7HPUmU0Weo/4ovJmpj23+ZkFhV3lpEDS/0mtW5o3ky3MLiYbZskBavnsi+l6xsLxyxXK5BG7LzUt34Fey0NRMjYqqSkB3/EddtJSbLvlNrWk75iGUs7NkV/M8FfQwMyb96OOyk35baR3vZkDzJitc9lEa X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2018 13:46:42.9383 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da43e575-4320-4da4-193a-08d632a4a441 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0425 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , amd-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Li This fixes a general protection fault, caused by accessing the contents of a flip_done completion object that has already been freed. It occurs due to the preemption of a non-blocking commit worker thread W by another commit thread X. X continues to clear its atomic state at the end, destroying the CRTC commit object that W still needs. Switching back to W and accessing the commit objects then leads to bad results. Worker W becomes preemptable when waiting for flip_done to complete. At this point, a frequently occurring commit thread X can take over. Here's an example where W is a worker thread that flips on both CRTCs, and X does a legacy cursor update on both CRTCs: ... 1. W does flip work 2. W runs commit_hw_done() 3. W waits for flip_done on CRTC 1 4. > flip_done for CRTC 1 completes 5. W finishes waiting for CRTC 1 6. W waits for flip_done on CRTC 2 7. > Preempted by X 8. > flip_done for CRTC 2 completes 9. X atomic_check: hw_done and flip_done are complete on all CRTCs 10. X updates cursor on both CRTCs 11. X destroys atomic state 12. X done 13. > Switch back to W 14. W waits for flip_done on CRTC 2 15. W raises general protection fault The error looks like so: general protection fault: 0000 [#1] PREEMPT SMP PTI **snip** Call Trace: lock_acquire+0xa2/0x1b0 _raw_spin_lock_irq+0x39/0x70 wait_for_completion_timeout+0x31/0x130 drm_atomic_helper_wait_for_flip_done+0x64/0x90 [drm_kms_helper] amdgpu_dm_atomic_commit_tail+0xcae/0xdd0 [amdgpu] commit_tail+0x3d/0x70 [drm_kms_helper] process_one_work+0x212/0x650 worker_thread+0x49/0x420 kthread+0xfb/0x130 ret_from_fork+0x3a/0x50 Modules linked in: x86_pkg_temp_thermal amdgpu(O) chash(O) gpu_sched(O) drm_kms_helper(O) syscopyarea sysfillrect sysimgblt fb_sys_fops ttm(O) drm(O) Note that i915 has this issue masked, since hw_done is signaled after waiting for flip_done. Doing so will block the cursor update from happening until hw_done is signaled, preventing the cursor commit from destroying the state. v2: The reference on the commit object needs to be obtained before hw_done() is signaled, since that's the point where another commit is allowed to modify the state. Assuming that the new_crtc_state->commit object still exists within flip_done() is incorrect. Fix by getting a reference in setup_commit(), and releasing it during default_clear(). Signed-off-by: Leo Li Reviewed-by: Daniel Vetter --- Sending again, this time to the correct mailing list :) Leo drivers/gpu/drm/drm_atomic.c | 5 +++++ drivers/gpu/drm/drm_atomic_helper.c | 12 ++++++++---- include/drm/drm_atomic.h | 11 +++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 3eb061e..12ae917 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -174,6 +174,11 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state) state->crtcs[i].state = NULL; state->crtcs[i].old_state = NULL; state->crtcs[i].new_state = NULL; + + if (state->crtcs[i].commit) { + drm_crtc_commit_put(state->crtcs[i].commit); + state->crtcs[i].commit = NULL; + } } for (i = 0; i < config->num_total_plane; i++) { diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 80be74d..1bb4c31 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1408,15 +1408,16 @@ EXPORT_SYMBOL(drm_atomic_helper_wait_for_vblanks); void drm_atomic_helper_wait_for_flip_done(struct drm_device *dev, struct drm_atomic_state *old_state) { - struct drm_crtc_state *new_crtc_state; struct drm_crtc *crtc; int i; - for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { - struct drm_crtc_commit *commit = new_crtc_state->commit; + for (i = 0; i < dev->mode_config.num_crtc; i++) { + struct drm_crtc_commit *commit = old_state->crtcs[i].commit; int ret; - if (!commit) + crtc = old_state->crtcs[i].ptr; + + if (!crtc || !commit) continue; ret = wait_for_completion_timeout(&commit->flip_done, 10 * HZ); @@ -1934,6 +1935,9 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, drm_crtc_commit_get(commit); commit->abort_completion = true; + + state->crtcs[i].commit = commit; + drm_crtc_commit_get(commit); } for_each_oldnew_connector_in_state(state, conn, old_conn_state, new_conn_state, i) { diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index da9d95a..1e71315 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -153,6 +153,17 @@ struct __drm_planes_state { struct __drm_crtcs_state { struct drm_crtc *ptr; struct drm_crtc_state *state, *old_state, *new_state; + + /** + * @commit: + * + * A reference to the CRTC commit object that is kept for use by + * drm_atomic_helper_wait_for_flip_done() after + * drm_atomic_helper_commit_hw_done() is called. This ensures that a + * concurrent commit won't free a commit object that is still in use. + */ + struct drm_crtc_commit *commit; + s32 __user *out_fence_ptr; u64 last_vblank_count; };