From patchwork Thu Oct 25 10:21:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10655689 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 00A57109C for ; Thu, 25 Oct 2018 10:21:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D85492B4B1 for ; Thu, 25 Oct 2018 10:21:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D643C2B0BB; Thu, 25 Oct 2018 10:21:25 +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=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 4FD442B4D3 for ; Thu, 25 Oct 2018 10:21:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B31F6E3D5; Thu, 25 Oct 2018 10:21:24 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700051.outbound.protection.outlook.com [40.107.70.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 328106E3D1; Thu, 25 Oct 2018 10:21:15 +0000 (UTC) Received: from SN1PR12CA0063.namprd12.prod.outlook.com (2603:10b6:802:20::34) by BLUPR12MB0610.namprd12.prod.outlook.com (2a01:111:e400:594e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.29; Thu, 25 Oct 2018 10:21:12 +0000 Received: from DM3NAM03FT042.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::203) by SN1PR12CA0063.outlook.office365.com (2603:10b6:802:20::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1273.21 via Frontend Transport; Thu, 25 Oct 2018 10:21:12 +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 DM3NAM03FT042.mail.protection.outlook.com (10.152.83.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1273.13 via Frontend Transport; Thu, 25 Oct 2018 10:21:12 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Thu, 25 Oct 2018 05:21:09 -0500 From: Chunming Zhou To: Date: Thu, 25 Oct 2018 18:21:05 +0800 Message-ID: <20181025102105.15412-1-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 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)(346002)(136003)(396003)(376002)(39860400002)(2980300002)(428003)(199004)(189003)(2870700001)(68736007)(66574009)(7696005)(6916009)(54906003)(23676004)(356004)(6666004)(81166006)(81156014)(8676002)(478600001)(104016004)(316002)(50226002)(8936002)(97736004)(53936002)(36756003)(5820100001)(47776003)(72206003)(105586002)(4326008)(5660300001)(53416004)(50466002)(106466001)(2351001)(6346003)(476003)(186003)(126002)(26005)(2616005)(77096007)(336012)(14444005)(1076002)(2906002)(426003)(305945005)(1857600001)(486006)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0610; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT042; 1:BBsRfzxFNOySsccdkZKZCS3LEeSZxXnJc53hk6SZiOmkKUhLgP/zG5Qhu5gxf5QlKZckBMvwNzyCNbeY9NHcAla1J/0gwXh5nhl40wIRyC4hnyaS5YHsrMiyxn1T90Nr X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 252c9aab-c87f-4f5b-da0f-08d63a6396a0 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:BLUPR12MB0610; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0610; 3:Yy5I0oYuH55OMsB4AMe4RbIdv8DfRsxMYy+yBa2iKC/7zJOrF+HZfbNWCo4RmCz2UQ4oPioPxEyX6J6mcCHtwXToQZjx1UBFisu77gtOehTc4AgmeYus/yB2jvp6Y5+G4zSAn5hpCGmEW2a3FJo/VIIMEHi2J6BOwFJWjbxzx/yywQq5GKH0WGtqvG1DhkG91uNOG8dHORKnpLoZueodijsGXWStMx3AWBBasmg0Jibtoj5n3T298D0ZSkCYEZ7oTKid+c6B92h87rObGodKbbtHpe9RW3whboP0jAg4vSJS4pKwt7NSjR7GrdvIEbrmsa2lfp65DtMA9AmdcW6D2XSn544Vr/+BpTPPhQ2PmZk=; 25:sR9cj/M+8k2GNz6m1XZCq+leD3UzRQlfdygYtndmXfKSAfQlK/N242dd5wBXiMgsU4ZFsAXtLRaECKpjjjY6dBktqQAH2tJA5pH7Ze2JSmeF8tbgkJpa7Xov1awuaXQ589svsxC5FKhEXJEIFLlke2s7wbcHxt5jW9m/QAXhcX5DBImxBqWdjHn/Hza1Rbp8HOM3HpEInXJBoWMbwhS9RRdvd5gHqv8VZqB7x/Vlv9StxmyUHtnmheoeRrZG7Nq8pskSCWC4EBjo80wxX4MzOdBUAtCA2wXvm3kbw0zd2aLuVCb1qaCPRUE8aXgw+BEVcLG1HhimznRW+XM2HfG/AnScGgweed8MVxIbHDoalc4= X-MS-TrafficTypeDiagnostic: BLUPR12MB0610: X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0610; 31:acjXzXZ06NgqKT7S8FoCl0qcIq8gnCvCPMuFvfZduczqM1Y7zAULLXhYkqcTL+wXCvDG5JmatiHHdrqkpAlSlmSGlWen19LHo4pKyftiZe8n0FEByTnEu5b/WnqiiVlzy5uEoXODN96ZZjol+j+YxLbiQSFI38wLdiGCKl5pvh1P7Wo+84A8mM+dU3+QVXeXMpxDRDTgJp040dZhk1gqeDRuGbBeT0hkFLeL7FoYOHw=; 20:q0QtNmC2RZjUsLS5xRDWkmP8Xuw+306ropUgGMLfcBjr0w83a51WtqQtz/6NPytOr2JwahB2y+pb3bEXp/aFz3bDdYLICmwDnAluNxWiV0Ya61IFgVn/c4hJWt3scxl5SDDseTWIScX2B8X2bR+NLcZO07R1LF5A+lGaSSLSMnn/FFK+4BOnwl1918D4JKzk7Blevp+2Z8DUdBeHBQnAP4ieTRnjevgKOJM9Qn1ktsTIMuHE/6/jCkANHMPpZxbgzOxp+r9G7R8MnHzoT/QyywY7Kf7syiDo956myrqwv1y+A3l0HQXKNJu+gBlBoIPNLEjiEIe01Uae1lWaLbqPy6/shDPNwOJcrkV39Fr2tv4OkArRdAGfNBX1XA0StCVV4LeKt4C2bjlxYPAlzKDZ5EHpgCET1bCGXQ7c9+MNImPGUqCAt5rp0m5Oa+83g6YRKj/Byd4IzDpe22ZzEuohYv/bSKDu4XfccjvqVhHscpls8vdNa+9I4o2ct5Kdtd5Q X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193)(767451399110)(228905959029699)(217544274631240)(8415204561270); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93003095)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:BLUPR12MB0610; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0610; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0610; 4:71ZXX62kKJC3AtWAC3oLRjoUeTLlT4yjNrbBkv/3IwlJNFrNmexxjRhptHTU3qAsgqwHgbBWxCCR2SGGS9TugWVrCBEVPEW2CEbCJBAiZOxBoSxTr0qeCy2NYP4V8pdYENrhwYikwFDy7KBoY5pc+o4wUpfXk41k3gXXtX6ZUGi2fO/uYtCGBHA78dnrsdAPdDu/LCPsLyWVJque5TRztn+vwzzCOOYuW2FR92KNdzcCDvqR3R9janBFvNrBSwjvR78gNHCGfmblY0HPcP21rZOTaOTwz92Ah2jhdqGOsHMwfuFQyKuIwC9josjN1/m9cGFEx64Dy2abncJU3POYfgL32j6Mxk7fbBLRr4HfCNjtXDiqBHGoAV8NyQIyTJgHasKNn3coZxuix8U0NIVT6La33o/UqWKx+twH+RBH0hojR5i5Bed9RwAAkBRigi4x X-Forefront-PRVS: 083691450C X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBLUPR12MB0610=3B23=3Ahz4oqQ2?= =?utf-8?q?IS9IkRnG5UAKD+T1QuzxTTGWf/2Zp4Y7xvjPA7wxAE0Bu7oR3ZK5CY/dHFBgXwxRb?= =?utf-8?q?U52llx9iYMABUj+l82QBPKedwRynYZIj1gz/maZLOI6Oc4o+zZo/7ZGwMnSw3m+Jm?= =?utf-8?q?WF7QuCSMSIO9qIQRg0Pp60i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WSgGpRF9NJoRBd4I5TF7HF7PQ3/Sc8nMBVWQXG3XVIY6Wg8uHnrtNeOSiYOQxWaOixw=; 5:ed3dWb2QtgBUgwpECSSF4wnaHMopjfUR4T9nDknbESGlftCSY4Q0xCCwHOo/rFjt2qfu0WRmUGaJAR9psgUBjy02YVWuazBVDbeEO3l1vZH8yL2y9pokyxt0bm1bRrUh2nbl2CfkII5rKk97WpAhES7Kh+9HYFioduKEJmNvbmQ=; 7:1XWyaZJA7CcLcgB/Cj6zahC2rdjDc8ILZ9OJD2NMb8rcVGETEJ1GvuIRy/Zq4+4s2hQx9wMO0u5r8yZ9Uoh3gsgGBr7IKkoYTUuDCLz94Sb1AIbbvs0je4xujAg6yzwzIkCd7Vfq5n86GazZq5B4XcDEnJwFqXxSnzlAAIxqPc+dZmWEVIEZIrRYlVRPFJerrX3zklnp+7yuhuCv1X84Jz9GYWs+24x5f+52QsSVpdf4H7lr9frS6hBtxdC1cptm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0610; 20:UsbnVXD3QSARV3NC58tkK1MiM3qGD03swIBnsa3xifwy5YRSPv+RP1iHwI/nC4VyaAc30Ut7me05HAY3JNHEsvV7iffx98GMmEmxHcqLtgM1FNTuVCNGksNl3fQQxx71jgCaFGaOfxqGZsZAWEh5l++QbZMRATDLOID75vCzdh3jffOfZOfqaRVd2hTRnL2nzN5vCz80cDhHx+W9afdlI4MrcTej8D/42R24p/tPZv/zcpdDnjB6CjqCXiEvfsYX X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2018 10:21:12.0301 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 252c9aab-c87f-4f5b-da0f-08d63a6396a0 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: BLUPR12MB0610 Subject: [Intel-gfx] [PATCH] drm: fix call_kern.cocci warnings v3 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Christian_K=C3=B6nig?= , Chunming Zhou , intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP drivers/gpu/drm/drm_syncobj.c:202:4-14: ERROR: function drm_syncobj_find_signal_pt_for_point called on line 390 inside lock on line 389 but uses GFP_KERNEL Find functions that refer to GFP_KERNEL but are called with locks held. Generated by: scripts/coccinelle/locks/call_kern.cocci v2: syncobj->timeline still needs protect. v3: use a global signaled fence instead of re-allocation. Signed-off-by: Chunming Zhou Cc: Maarten Lankhorst Cc: intel-gfx@lists.freedesktop.org Cc: Christian König --- drivers/gpu/drm/drm_drv.c | 2 ++ drivers/gpu/drm/drm_syncobj.c | 52 +++++++++++++++++++++-------------- include/drm/drm_syncobj.h | 1 + 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 36e8e9cbec52..0a6f1023d6c3 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "drm_crtc_internal.h" #include "drm_legacy.h" @@ -1003,6 +1004,7 @@ static int __init drm_core_init(void) if (ret < 0) goto error; + drm_syncobj_stub_fence_init(); drm_core_init_complete = true; DRM_DEBUG("Initialized\n"); diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index b7eaa603f368..6b3f5a06e4d3 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -80,6 +80,27 @@ struct drm_syncobj_signal_pt { struct list_head list; }; +static struct drm_syncobj_stub_fence stub_signaled_fence; +static void global_stub_fence_release(struct dma_fence *fence) +{ + /* it is impossible to come here */ + BUG(); +} +static const struct dma_fence_ops global_stub_fence_ops = { + .get_driver_name = drm_syncobj_stub_fence_get_name, + .get_timeline_name = drm_syncobj_stub_fence_get_name, + .release = global_stub_fence_release, +}; + +void drm_syncobj_stub_fence_init(void) +{ + spin_lock_init(&stub_signaled_fence.lock); + dma_fence_init(&stub_signaled_fence.base, + &global_stub_fence_ops, + &stub_signaled_fence.lock, + 0, 0); + dma_fence_signal(&stub_signaled_fence.base); +} /** * drm_syncobj_find - lookup and reference a sync object. * @file_private: drm file private pointer @@ -111,24 +132,14 @@ static struct dma_fence uint64_t point) { struct drm_syncobj_signal_pt *signal_pt; + struct dma_fence *f = NULL; + spin_lock(&syncobj->pt_lock); if ((syncobj->type == DRM_SYNCOBJ_TYPE_TIMELINE) && (point <= syncobj->timeline)) { - struct drm_syncobj_stub_fence *fence = - kzalloc(sizeof(struct drm_syncobj_stub_fence), - GFP_KERNEL); - - if (!fence) - return NULL; - spin_lock_init(&fence->lock); - dma_fence_init(&fence->base, - &drm_syncobj_stub_fence_ops, - &fence->lock, - syncobj->timeline_context, - point); - - dma_fence_signal(&fence->base); - return &fence->base; + dma_fence_get(&stub_signaled_fence.base); + spin_unlock(&syncobj->pt_lock); + return &stub_signaled_fence.base; } list_for_each_entry(signal_pt, &syncobj->signal_pt_list, list) { @@ -137,9 +148,12 @@ static struct dma_fence if ((syncobj->type == DRM_SYNCOBJ_TYPE_BINARY) && (point != signal_pt->value)) continue; - return dma_fence_get(&signal_pt->fence_array->base); + f = dma_fence_get(&signal_pt->fence_array->base); + break; } - return NULL; + spin_unlock(&syncobj->pt_lock); + + return f; } static void drm_syncobj_add_callback_locked(struct drm_syncobj *syncobj, @@ -166,9 +180,7 @@ static void drm_syncobj_fence_get_or_add_callback(struct drm_syncobj *syncobj, } mutex_lock(&syncobj->cb_mutex); - spin_lock(&syncobj->pt_lock); *fence = drm_syncobj_find_signal_pt_for_point(syncobj, pt_value); - spin_unlock(&syncobj->pt_lock); if (!*fence) drm_syncobj_add_callback_locked(syncobj, cb, func); mutex_unlock(&syncobj->cb_mutex); @@ -379,11 +391,9 @@ drm_syncobj_point_get(struct drm_syncobj *syncobj, u64 point, u64 flags, if (ret < 0) return ret; } - spin_lock(&syncobj->pt_lock); *fence = drm_syncobj_find_signal_pt_for_point(syncobj, point); if (!*fence) ret = -EINVAL; - spin_unlock(&syncobj->pt_lock); return ret; } diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h index 29244cbcd05e..63cfd1540241 100644 --- a/include/drm/drm_syncobj.h +++ b/include/drm/drm_syncobj.h @@ -148,4 +148,5 @@ int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd); int drm_syncobj_search_fence(struct drm_syncobj *syncobj, u64 point, u64 flags, struct dma_fence **fence); +void drm_syncobj_stub_fence_init(void); #endif