From patchwork Wed Sep 2 01:06:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luben Tuikov X-Patchwork-Id: 11749633 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CE3413B1 for ; Wed, 2 Sep 2020 01:07:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B09F2068F for ; Wed, 2 Sep 2020 01:07:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="3e5ekS89" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B09F2068F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 134296E2D8; Wed, 2 Sep 2020 01:07:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2051.outbound.protection.outlook.com [40.107.236.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 462CF6E137; Wed, 2 Sep 2020 01:07:26 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kB9Vi3bMLw0xk6Rrpthz5M/8t4hqFyJZM5YBVMYdElVleC7Y9VwhZVXb0aF5kw9JOkV+SbdOBadRibW28yibczrW1Vy/yGwwL3zEh65iQodN62Ai0AiCLXPNVBHsgtzyLnCpEwb5//9Kk3z4HfXFaqUwAqHqhWzeJGBxl1M3Oe2gehs+JwfTFXxjBHy97GHbQBxX/oZtQ0Rvsn5HwhERt6WPw9f6Hxgm9yL//rI2GuMJp98eNNI/5xaUnj3XgHwiMu75Esn2DhVTCR85Bmpj7lhVfefomX/1q7l6AidP3So47Sh26elrUgu57Q23Mnj+Imq3OGUdGSqpkkZ6l5hOUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k3x+jrburrUAFAECICalsVafk3pNpqHovAC/1JekOKs=; b=XP5MuVG1bE9491/oaQF7h1zj67L8nCwVTS7URVKC44XyPcUxM1Ktn2iO8sjrJ5HIvWAdxfeAVZ2PPbFgof3uOMGKww0mZpsJreVAaa/49IdJrUH1YU6UqDo5fYoFZV9helw0aDtomTv5FtcQ2X2RnDr6XBFJUJ30z/rX6ATItgeCm1QR1XwUfa8KTSIGSUq5/SZHQn3qS2yPztpWXKXZ6B0pyCxuYi8XwfDPyX8cTOwiuFaxzeFrPjY9EHAdzDt06VjJMKno9ZVlRGdCPHwi4pE/oZBcVz5VRd3ldkNJB2d5h1dnPF4aUf8t3vSxWVKS4kaIW0MNEISRuMPjAR0Q4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k3x+jrburrUAFAECICalsVafk3pNpqHovAC/1JekOKs=; b=3e5ekS89mkaJQw6Kv3yvoVPakRA3utm67OAlX7NBmx2pMo6Htw3V5WS098SleUXv+SLRBJnclZ8Kbpje0AfXfm5mJjdInqu7Eoi3VUYDG92W+d/hCn6pQl5xgsWSHcf6TUz4rNBeuTHQaI7Dfaxn7wAdzeZuzN20g3wAWAJ/Vt0= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB3962.namprd12.prod.outlook.com (2603:10b6:5:1ce::21) by DM6PR12MB4058.namprd12.prod.outlook.com (2603:10b6:5:21d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.23; Wed, 2 Sep 2020 01:07:17 +0000 Received: from DM6PR12MB3962.namprd12.prod.outlook.com ([fe80::3452:6d8f:e0ef:b45e]) by DM6PR12MB3962.namprd12.prod.outlook.com ([fe80::3452:6d8f:e0ef:b45e%6]) with mapi id 15.20.3326.025; Wed, 2 Sep 2020 01:07:17 +0000 From: Luben Tuikov To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm: No warn for drivers who provide release Date: Tue, 1 Sep 2020 21:06:43 -0400 Message-Id: <20200902010645.26943-2-luben.tuikov@amd.com> X-Mailer: git-send-email 2.28.0.394.ge197136389 In-Reply-To: <20200902010645.26943-1-luben.tuikov@amd.com> References: <20200902010645.26943-1-luben.tuikov@amd.com> X-ClientProxiedBy: YTXPR0101CA0012.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00::25) To DM6PR12MB3962.namprd12.prod.outlook.com (2603:10b6:5:1ce::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by YTXPR0101CA0012.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15 via Frontend Transport; Wed, 2 Sep 2020 01:07:16 +0000 X-Mailer: git-send-email 2.28.0.394.ge197136389 X-Originating-IP: [165.204.55.250] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 51fa65ae-9cdb-4084-d806-08d84edc88c4 X-MS-TrafficTypeDiagnostic: DM6PR12MB4058: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v1lBrXH1/fyJ5M8dR3fvvD3MSC3RJb/WjekMKWErxFbRWb8dQ4biO9Xl1I3YuLdo6rUbXhhRnYbxUle6O65JPTvB7X2hgflRuSivuTmYbF++s4nUx6xUA8qrWgc0PnFpombbP4eov2/0LSSbElq+M33j3peotSzIbJRKETN0mwV1DEs/OSZ62eMn3ZGAre8dbQcbf+TSfTEE92cFZvHuOsSUa0uLnl9jeWhEsBvlpUZmgTqy8FNMDZNa3ncYsPsq0r1N9UpAhHgM4yz7w2g4RkumNIdPPyT2yl1yaRv+m2mTULTSHKAoBjH3OptHM5G2gQfOmUgjtsi/LNqjF+QGrw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3962.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(39860400002)(136003)(366004)(396003)(2616005)(8936002)(52116002)(44832011)(316002)(83380400001)(956004)(66556008)(4326008)(66946007)(36756003)(66476007)(16576012)(8676002)(54906003)(478600001)(6666004)(6486002)(1076003)(86362001)(5660300002)(26005)(2906002)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: n8AQS3X7YcXs2KHE6hdXnHogEwltrIMk5+0MIvqpT+xsYG0xabyU9zm7l22ouaRbhH3mNFG5y68I9shzDVApnl/yTFWBZ0N4OAgcx/z3uQm0NdZwLBS6070UhCYrajE7WIqePZW+i3LaGlpltEb8s9pxQkl8BbgfRFrwv5f3aHfGyr2czkzI0gmL8ZL1azaERsI86G/n6ElotMFa853WMWK2HtztPHs3XR70RKtfUjMdItHtZy6+YuGtbRUUQQRnLpRUnRz8rxr+nEAPJQ4cRibx2lhd73JjqeNCVk3p+n5zAzscfJQQnRO8dVxFmozSZVl/NpIj1XD8xIwH6LszQE8kazs0Ze435LS1D993VAjT8tQlLP3FIhDp4nGLYz3+M7T8svURbjKHH4HK/UkUytKPYoGg6hchQyzTNtzBnmGapMKpkRJ70BYbiQWVinakzWotf2U2f5Uc3pSccQNQaH41LA+TLCOvCNPP8RUqZT20nGMyzzw5tmQULPf98louAcibqLa24cUbkpyTZGVHWdj21juw7HZuOyg8kYBBc5yaY+taXOczq6Lar4nXrXfyEpWINiwfIVJifjB/ahf0dUwGKyvzUJ/xelaG/ckLnc2NPtnEjWkxVwIdywgFNIyRVpyBxsA2BAUjfbWyGce84w== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51fa65ae-9cdb-4084-d806-08d84edc88c4 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3962.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2020 01:07:17.1906 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EEWXOvUoVOSg9Qot0Htsj2P9iPdwpoJYwRTJHPhc4j3KRKwXP4EGJu2C4gERKhsQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4058 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Deucher , Luben Tuikov , Xinhui.Pan@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Drivers usually allocate their container struct at PCI probe time, then call drm_dev_init(), which initializes the contained DRM dev kref to 1. A DRM driver may provide their own kref release method, which frees the container object, the container of the DRM device, on the last "put" which usually comes after the PCI device has been freed with PCI and with DRM. If a driver has provided their own "release" method in the drm_driver structure, then do not check "managed.final_kfree", and thus do not splat a WARN_ON in the kernel log when a driver which implements "release" is loaded. This patch adds this one-line check. Signed-off-by: Luben Tuikov --- drivers/gpu/drm/drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 13068fdf4331..952455dedb8c 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -935,7 +935,8 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) if (!driver->load) drm_mode_config_validate(dev); - WARN_ON(!dev->managed.final_kfree); + if (!driver->release) + WARN_ON(!dev->managed.final_kfree); if (drm_dev_needs_global_mutex(dev)) mutex_lock(&drm_global_mutex); From patchwork Wed Sep 2 01:06:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luben Tuikov X-Patchwork-Id: 11749627 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 95D7713B1 for ; Wed, 2 Sep 2020 01:07:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 73B1B2068F for ; Wed, 2 Sep 2020 01:07:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="dBfiZePA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73B1B2068F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0CCEA6E03C; Wed, 2 Sep 2020 01:07:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2086.outbound.protection.outlook.com [40.107.223.86]) by gabe.freedesktop.org (Postfix) with ESMTPS id 06ADB6E03C; Wed, 2 Sep 2020 01:07:22 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mpixOT+/ixf1zJZcs88n8WKeuiGv4+liJxdr5ft0LUJnZOXY03V0KZ86F9CUry+/eAO2AVU9AiYTzTuPcD0TiMq53niKfQZ3Ekh2PVtfQEv+d8BG3Avs65ut9FNZMsvSxMlSrn2nTAWvj01rnOjZM3LoDti6wmQoIv6VaaPB6/7M7tIVhme3w17lzygY998rqqXpxf74AhFnnfwhS0xqPCetFyIviIVOIG1Hu18i2Gg+oXMA943Iv3jY0oUGK6HLDil1JgnY1ODjSaXCHZAdOFbwTtK59AlMyOmQOA8Z9Sd+TK9rRg7V6IMFBR/TnTxHJo4xXHntPOeFLNMmjdOBNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rr8Tq41MtpHbOQGTsUwfW1+cjCVdL3PnRV4UpgmKw3U=; b=TT5lDhDSthMIEb/AhoAR3DnNmvC9G1aUyYlReIJ1OYf4rRnon2I2ha10oj1wvBZKsM4XuZ+bAOC3TigijZgVt8sAFu1Z2OlBC/MfW7DExFJTskjG6S0gELsU8+YMyT9K08U7SA2dZvbiFP3CukLydPFk2geZPxUKqQbJD/TJgARsFElQue/dtRAIbzybc3JUUbygBG5It3/s53jxkm78VSnbCpYcQ8xgzkLJ4qDm9gJZUP+a2bfofWfNWSsk4ciB6+s2+ccqhSpqj0tNZkOUdpJQu37NcIN/E54Psgd4GRQk8138IyNB3E9tx1C1kQBxbHe7gQFOBsEfnTDEMN/R4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rr8Tq41MtpHbOQGTsUwfW1+cjCVdL3PnRV4UpgmKw3U=; b=dBfiZePAJz93WbcGNkbmhzw9WpR3MA+QFc5IeOQ5+lFCxN+Av34YspkCRAmLQT8wUu1Y1iDanaJ9fVgqmFpr1vwmnxr6ySFmQGA7Nn+lphJeUEs23lk+zmasmAwnslKFo518/N8eYclHBqPTNfzvT6m5N18S39c7GWm0VkJiN4A= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB3962.namprd12.prod.outlook.com (2603:10b6:5:1ce::21) by DM6PR12MB4516.namprd12.prod.outlook.com (2603:10b6:5:2ac::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.23; Wed, 2 Sep 2020 01:07:17 +0000 Received: from DM6PR12MB3962.namprd12.prod.outlook.com ([fe80::3452:6d8f:e0ef:b45e]) by DM6PR12MB3962.namprd12.prod.outlook.com ([fe80::3452:6d8f:e0ef:b45e%6]) with mapi id 15.20.3326.025; Wed, 2 Sep 2020 01:07:17 +0000 From: Luben Tuikov To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/amdgpu: Remove drmm final free Date: Tue, 1 Sep 2020 21:06:44 -0400 Message-Id: <20200902010645.26943-3-luben.tuikov@amd.com> X-Mailer: git-send-email 2.28.0.394.ge197136389 In-Reply-To: <20200902010645.26943-1-luben.tuikov@amd.com> References: <20200902010645.26943-1-luben.tuikov@amd.com> X-ClientProxiedBy: YTXPR0101CA0012.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00::25) To DM6PR12MB3962.namprd12.prod.outlook.com (2603:10b6:5:1ce::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by YTXPR0101CA0012.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15 via Frontend Transport; Wed, 2 Sep 2020 01:07:17 +0000 X-Mailer: git-send-email 2.28.0.394.ge197136389 X-Originating-IP: [165.204.55.250] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ae83c2ff-6f72-4730-d073-08d84edc8939 X-MS-TrafficTypeDiagnostic: DM6PR12MB4516: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OdXigMJO8qGxFZUSKtfcST4LIc7XO71LxlBLYGxUiwvMfHNw7ZOcwn9q0oN/LeZ1UdT5NWJt+6jDFLreQsYZkIZV5Dcfv7sq+zlMsVc/nfLpYATlIoqPSs9dHrABwhO2X2JQtfdid2hl451vP2unruGMg/7zMHd21h1dJPH9gYGPsYMioULDPe3AhND8A8rCyG23n73B9zV+pVQuMvStrEroTc4sm8kbDVJ2ifoJgIYC3vN/dIk0VQvGsc1Evy8p+BJiRTWqhlEUj8Nm/MtsDVTx4TVlgr/lzjNoYDFoXdi6UzJmYdZMLxvCJ0M37136LKBKuGTRQp8oWlK6o8WOKA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3962.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(8676002)(956004)(5660300002)(8936002)(44832011)(26005)(66946007)(66556008)(66476007)(478600001)(4326008)(54906003)(6666004)(86362001)(186003)(1076003)(4744005)(6486002)(2616005)(316002)(83380400001)(16576012)(2906002)(52116002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 0+n7B+zyMNBFXwT8xB0xJd7T1ZDTxEuzv39hPM/uQxxjSOTjYgsKK6p4c+PHKd79Mkg04awS5W16iYBw828f+hWret/3I+9CAiVGvu7cl5gjUlMzwRo588R7iAcdB3VfnuVdVQ0PPNcfoho6AuUtEi1pJ0LDLAuprHIG4tsyuBJ6wvUv4FCmHz6Z88eWUD3uvRpm2ZvFz8jSYZWfZYRE0DNYpP3R9VK3JT7ZGwjUWygD7VBOWhYcqSjjxZZNwCGUeuPtcQ9XwL9Tr/fM9mIzbZ2toXziQg9a6QZ/57uz0P0F8GiePMU/qhdtV/UyTsJ10FpEyW7IbCQIrB8ZakG0LVYAmrud218MnsLimPyU/SZoCdHfMa7xBpqPKnXfG9bWsLMlCPslyefyId/CVIgl8NSbPiFglGLDuf+TcJR76S5mvdvuh4TGQrHLsUkp92Lm35fnomx5hUeqO+UYTJ3G3md5V+WBaXZ2psrHN4+TP5+x9RBkaAWRo6qQLYB/ofuroC83FBetuAXtlJvrNa/r1E6Qz5jLWWo5KjVOvjoc27dykDWtMNTdWuJa2Tx6bvx6OpvrbXTvjddVikzeB2yTreBLl4tgOUTBzeANMtoYiVunVQGYhXYO1f/32jJJ+VgyKi7OKKP+m0cylvdfaAqRMQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae83c2ff-6f72-4730-d073-08d84edc8939 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3962.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2020 01:07:17.7353 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: seoi1zaFrjGf7spLnBJm1WQbW7m9jleZN18Rnl6LmD1kbrzhXtPxRHkdyvv1E51h X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4516 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Deucher , Luben Tuikov , Xinhui.Pan@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The amdgpu driver implements its own DRM driver release function which naturally frees the container struct amdgpu_device of the DRM device, on a "final" kref-put, i.e. when the kref transitions from non-zero to 0. Signed-off-by: Luben Tuikov --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 459cf13e76fe..17d49f1d86e7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -1153,8 +1153,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, if (ret) goto err_free; - drmm_add_final_kfree(ddev, ddev); - if (!supports_atomic) ddev->driver_features &= ~DRIVER_ATOMIC; From patchwork Wed Sep 2 01:06:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luben Tuikov X-Patchwork-Id: 11749629 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A702109B for ; Wed, 2 Sep 2020 01:07:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78A732068F for ; Wed, 2 Sep 2020 01:07:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="WJm3xhs+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78A732068F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 604496E10D; Wed, 2 Sep 2020 01:07:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2086.outbound.protection.outlook.com [40.107.223.86]) by gabe.freedesktop.org (Postfix) with ESMTPS id 214386E0AD; Wed, 2 Sep 2020 01:07:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ERO5RsX+/QfGKe7saY8eg8/hNBEHEpAUu7PshV0k8CXmFFP266hQ1mXbGTVGJ/V8N5pbhhJ71EALR2zUa4EEM/lOmOXtpUjx/6tO5dHwGNoFwjKoEFQqZ8H0YYOdh0J0+gWvgz9Zu0Yp+3/s2zVkT83o4bstsHrsTO5HLcioBEgQu6n6Mu3BsZpS5tlBkklJuRLwR9ACl0O7aVkvGkIXxYA+WxlnAWQu3vhr8Y3YuCDUIQpBssGAw6Hu86fnKWEM2BgP+pQwWj/FKf9WhJ4Yw/r/keCTOjHRbORPkDXYoU0UJL1DNntYKd9xFoGU8PO+mqZk4zqwU8POxaHLvCLzLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=elBg6O1w+7/6bWiCI8OivqU0ZC/YbvuFcpF1p967eY4=; b=K+cObI4AWHWI9WfmkePv7abLLkthiHcIOlB2R7/vs2CjX1xqYMYCTFj7z/QAJxD+h3JXdDTqaztQndRnix2aeytAxbAyDeLUBd3cieGdtiBIBUAgVPGEBLIgSBbK8q1z38PadKLNAEQA5K5tVF8jN+U7kbOWThWwiP0eLAnIzDL9dhWPQVAPXplFyhvERp3STXI4ih5xyh4bWGwPOxd9AyJa/a1tvz3tSSsK0k53Qxb2fChzDs3hwilCw4Cqf6q8E12/xSO4+0zB+hQaF1OxmDdFBWNK4ogc80yfQbJl4bp8yFM3U0hoftEhZ1FXIKHnJruBUM5OLyzlARSxGavLjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=elBg6O1w+7/6bWiCI8OivqU0ZC/YbvuFcpF1p967eY4=; b=WJm3xhs+k4NJyZfn0s6zwrBW5Zw5UR7YE11cRXRYDxDwHjKrHh3sLYhukt9Ouz3TBjRVFmMcuINmbIoFqPAc64RQMAqnz6bHLJWOIicaVoYwHbat7h9WGE9LqCty2atc02Q4y/WjYnr1ZkHz1myyD8dFkm/rosaei2Y9bqWU0uM= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB3962.namprd12.prod.outlook.com (2603:10b6:5:1ce::21) by DM6PR12MB4516.namprd12.prod.outlook.com (2603:10b6:5:2ac::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.23; Wed, 2 Sep 2020 01:07:18 +0000 Received: from DM6PR12MB3962.namprd12.prod.outlook.com ([fe80::3452:6d8f:e0ef:b45e]) by DM6PR12MB3962.namprd12.prod.outlook.com ([fe80::3452:6d8f:e0ef:b45e%6]) with mapi id 15.20.3326.025; Wed, 2 Sep 2020 01:07:18 +0000 From: Luben Tuikov To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm/amdgpu: Remove superfluous NULL check Date: Tue, 1 Sep 2020 21:06:45 -0400 Message-Id: <20200902010645.26943-4-luben.tuikov@amd.com> X-Mailer: git-send-email 2.28.0.394.ge197136389 In-Reply-To: <20200902010645.26943-1-luben.tuikov@amd.com> References: <20200902010645.26943-1-luben.tuikov@amd.com> X-ClientProxiedBy: YTXPR0101CA0012.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00::25) To DM6PR12MB3962.namprd12.prod.outlook.com (2603:10b6:5:1ce::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by YTXPR0101CA0012.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15 via Frontend Transport; Wed, 2 Sep 2020 01:07:17 +0000 X-Mailer: git-send-email 2.28.0.394.ge197136389 X-Originating-IP: [165.204.55.250] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 493a3213-5e0f-4a79-48b5-08d84edc8990 X-MS-TrafficTypeDiagnostic: DM6PR12MB4516: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:635; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gtJMWRulJZBptWk0niwawMoJ6iIkQfnhciW2LIEH9aPsMFYsmVGa0cIxeuGgr+TZk/jh1zY9OL3J2kq1dSbmjZOS0QiwjneLbCzSwokh6hQoAZS/7GnQ+fgck3wqUjxMD/XHVdpow/xx6eGxHQm5IciKa3zA9AoDVBs/ocJML9XkYlz5FMfivHyuPSIP2o+B2HKII4K8nbfGSjhzf2xPz1yiYdf2/Df5xdEKWQ8J5SItkTvqxhYHe/vdgd+VA/PRWVQxHIbzIVcgn+kQ2M8iXQAR9dFChdZf/MWUBiuugL5Ak68lUImiyzG2pjo9QROKz8LS8YizaQTtZDS6q9EiDg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3962.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(8676002)(956004)(5660300002)(8936002)(44832011)(26005)(66946007)(66556008)(66476007)(478600001)(4326008)(54906003)(6666004)(86362001)(186003)(1076003)(4744005)(6486002)(2616005)(316002)(83380400001)(16576012)(2906002)(52116002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Q3253gqJ+CHW+2ziKWwCKi41eqY2UtgKgGXfgdIFtYFjbLAS26S1dMCAff9/jASQxw3TmzffS9NCHJzEj7DZ2+SqWMDRDTerCNHOJHql7utxZjUvriYQEyDMT/T7mpGgKOpFe+ffh1eMAKM1Ts5v5XwCxm/RFxpKMkf5adnwgzbvHRyOG/j69kXmBzq71o2fWiXgXHabjlYpPHXbgkB1jdVqy0L/juvQWbiUXP895XtOKdI58CmCwP5lxTIRYt8vIeqwJw9hjkEwxrfMSe1qdC+ejPWUGlZKRIjviot+mFb3b7nJ7NIbtxv/ARCOxkFixck25T3dcp4Wvt3CizdGGVSWE68LURYQ/6dfIOPPfFbT7Qb7tLkR7sjLCjUPA7qrrmxPwTkjCl6IgSnKjDBBpaFHH4zcdnU7wY5I44tkaPU6E/Asvjf3dLOJyZvmZDJm3Fu6CN2a9EG+iia99HyVjhVtesRlKPsoh4YzGQBxqcrTHRmjFpg2wa7i6/TNVKZe/xv5BAk4u5MocRHN9YZZmV3cxCCYGFaqAyjNOsNDge4lr5e38Wl9Is+BbDvkT09ZEp5+VB0FEXRSVX0IyvnsKQGVM1NhZotJLYcc40RfHo1VPM1XbNAQ2WfyRBvvcDqnUoQych7Nfgps5I2/6zCfSQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 493a3213-5e0f-4a79-48b5-08d84edc8990 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3962.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2020 01:07:18.2680 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: R05ubYIFy7A2vvuiGSxFjo204AUkgEKqM2NW4q3Lm4fmjdeS01M4R0mncJArJ7r9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4516 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Deucher , Luben Tuikov , Xinhui.Pan@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The DRM device is a static member of the amdgpu device structure and as such always exists, so long as the PCI and thus the amdgpu device exist. Signed-off-by: Luben Tuikov Acked-by: Daniel Vetter --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index c4900471beb0..6dcc256b9ebc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3471,9 +3471,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) struct drm_connector_list_iter iter; int r; - if (!dev) - return -ENODEV; - adev = drm_to_adev(dev); if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)