Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5213289rwr; Mon, 24 Apr 2023 00:07:47 -0700 (PDT) X-Google-Smtp-Source: AKy350ZDdTTMD0HpshH1KnkSvtEoYUNyMT1MVOPbfs7lQWjVt6sNY72v0zoGFKRVDaQSosuqzx+u X-Received: by 2002:a17:90b:3110:b0:246:fd44:eb6f with SMTP id gc16-20020a17090b311000b00246fd44eb6fmr12871724pjb.39.1682320066931; Mon, 24 Apr 2023 00:07:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682320066; cv=pass; d=google.com; s=arc-20160816; b=itL8ZsneJUe8cXfF1rueeakuYuybg7vedhGlgB3XeHcE6JhLP2gQ7W+YPqANOakaWX PgESxFNxCWjG9q62iuHRVHtY8PGMUvEBwrwXXC7Yc2VqZ+8frNdWLBOegB4K7OJpMWpX KWS0yS13yzUdn+DJsryq8aTUUGdqRZL4YON0WWgYz0MbI4t6Bw3XdCwQwHWdbDNQqfuv bXVe/+UFY0LMjUj+k1UiJ67CRM/S//a1UxsNiCsPTxyBgQpa9Y9D7mwUHXvVzVncP+IK /TVG54spoxNFGK+6ai0eUq4Dy+XZxbjPAnE76ZN9ZeUYAy8DJJUitLLYNhX90jjietiv 0KlA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=TpNBGrdokkydCBIl1gK/7Hn2VBcUenGXRQfpcjoEyUg=; b=0y63403rXByyjdCx3RMfN/oZXesdp0DrY9AMSJwzdiSuIWRf5neaqIEvsSSulNXxyu JSIyd9NXKPxwa1NaswgDRfF70mssB8RrOstSIOlMLXAV2ah4UjGbB3hVuagwU12S6Wiy 7nHDm02mnzKqR/Golp2Q+qb01pjfUgGidUNhDyTESwz5s66JDFa4347JgAACja3Po69D a7TU1W3IckQBnA/sf8C8ID/mUuL3pyfUzlooRx6Aao77XtWfrR5u7YoJmq1wQXnZ8ubz JFgPBWMsl6cFaDfX1oWZN1QPhJdyJMAJgTk/9SXYGWbtZfE7RqPOF91fENpt+lQWuILb u4aw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=TywVTUX9; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nh17-20020a17090b365100b002475951186asi13195731pjb.131.2023.04.24.00.07.32; Mon, 24 Apr 2023 00:07:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=TywVTUX9; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231259AbjDXHHP (ORCPT + 99 others); Mon, 24 Apr 2023 03:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230415AbjDXHHM (ORCPT ); Mon, 24 Apr 2023 03:07:12 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2078.outbound.protection.outlook.com [40.107.220.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EC6F11A; Mon, 24 Apr 2023 00:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MXRaI2kCUbWYbEdG7xflMGzxdCsqje7m5bvEevUtSn+13SiaaLhgZYTf1fsC7Aq+3ZyiaRfKmr0wUjPepcB1nr8YSf7WepWH1VI9Tqh02xR3FrfsQbkR43UvDNo/s/zOMGqC9RQ93IncYYxAPgbD9IkVYzFoiwAGKe9ZZ0TAH6ZO64AJgRZP0TKEUl1zk4jROZoDHHspyWYOjOXKF9e7eqrmKZZwViWEPJFlrrTC+EDXFKhDiVOLfHRabjHkGfzCp1cb7fOUXuFfrAo8dnld7MFQTvzfK+Z9iahmtiIc2U4U0//ehUjXnGu1ZkgKGP0fAnmoKproh30WXpog9jD/Aw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TpNBGrdokkydCBIl1gK/7Hn2VBcUenGXRQfpcjoEyUg=; b=QoTWGgIsRmUkYKxAVliQBltlnOLHUO6fHEhNrPWBjUq7gOcKGH3pOS7ait/udsj+9BOz82mrAUMwkm3ipw2+1JTdeYLJMWmCkNRbTob983hoo+hAwbLMmttl2VuxrD1m26yjqO06v1oq/U2xFYvCzrTUexSSqlmNjUBlG6P7oOin2wk5J+7mwTv7uDbxG0DGNwxhZxS7betcx9ZFOxdaKvD/iJPYOjcutm/ipIsTBYjMqfTdxplFpdSaHRJDnoeivWoA1j5Y9vfki2QNGHXMpwMVxPVH43XTWe5rDcBjUgAjYM2Ut2EttQalpEfaXeXXj2NV0B8wvhI1ai/h9wgaeg== 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=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TpNBGrdokkydCBIl1gK/7Hn2VBcUenGXRQfpcjoEyUg=; b=TywVTUX967UYpQxRzPf2yATHZ+xlSlxN8IhgIkk7lVJfJLV8ubYGObM+buMP4KUxwbUs0yyfmZdC1L547WAyu/OXlk4dO4ZqLDLTw9RfUS7sY7RY/Y4cG2+YgCpcDmN2y+H7mhV7zAK/Bxx5sgUbGPowsRa+vOa2Y/rKbw9/Jpc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) by SN7PR12MB6744.namprd12.prod.outlook.com (2603:10b6:806:26c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.32; Mon, 24 Apr 2023 07:07:09 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::d2f8:7388:39c1:bbed]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::d2f8:7388:39c1:bbed%3]) with mapi id 15.20.6319.033; Mon, 24 Apr 2023 07:07:09 +0000 Message-ID: Date: Mon, 24 Apr 2023 09:07:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] drm:amd:amdgpu: Fix missing bo unlock in failure path Content-Language: en-US To: Sukrut Bellary , daniel@ffwll.ch, airlied@gmail.com, sumit.semwal@linaro.org, Hawking.Zhang@amd.com, Julia.Lawall@inria.fr, dri-devel@lists.freedesktop.org Cc: alexander.deucher@amd.com, Xinhui.Pan@amd.com, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org References: <20230424055910.15683-1-sukrut.bellary@linux.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <20230424055910.15683-1-sukrut.bellary@linux.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM4PR0101CA0050.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::18) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8PR12MB3587:EE_|SN7PR12MB6744:EE_ X-MS-Office365-Filtering-Correlation-Id: 806e4d98-779d-499d-32a7-08db4492850a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hq3pI5sBYDmWj+UqNl7Td2VaPGmoyf79SSZN4lqkLnyvBbz9w/F4/wVb3HDy5cMbEMUBrWA5P6plIGWwKPycqJIIxYnjhP0Q3GLBrQYxQ9Fgm3UWf5GovAHoUcNnmqK/WiZQfLiZAOYx8oTwZDVSHD/vFIdyy3cWrRNTMzBE8ic6PWyN+EcRvW0kMv89iOL0JYwoPoWEPN+dteeqSwQjJ64Sk/Rld87pLyOWVRbezFya9P33HAX6ra+aZRHtoE7VRSSrpNu13Oat4Z2TO+J947iQdZeZq2fGrqQkEU+vaUYMgDaqaN0B17xxZTLmutia4s6Wfgmy3sjRv+tZ2L1WumFr/IoIbne1Y55mKlKr/OJORsnqraVfFu2MJR1DvoiBJPLDaaeKbPu+EKfenA7Dt0mK5slM3qQVQS3j+uU2VxjxuQtEnK8cIm7+txJWacno5jfsB/he/2fRRWJUhLc0BXQtwhIUwU6XRYReXenk1Llo5OYLv47UmPZrd48krXCROyKpms26H5wOrG1+eNkSP3utNZfK9vyb69n6cq+2cy47aTwEQmqyrayT3W2N74CQLDy+qPqTWThVdK/0b2J+w2JF7AyI/9PIz3aCOXg7Y/P+CHlcWR9RLRPw22N7bGOgYUH8OYsKy3J3UdYsxZhsrw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR12MB3587.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(366004)(346002)(376002)(136003)(451199021)(36756003)(8676002)(8936002)(478600001)(66476007)(66556008)(4326008)(66946007)(7416002)(316002)(41300700001)(2906002)(38100700002)(5660300002)(2616005)(86362001)(186003)(26005)(6506007)(6512007)(31686004)(31696002)(6486002)(6666004)(83380400001)(66574015)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eXRqdElrUk5aYmJzRk55d3BVM1NmclRGNVdXeDdxRmZIUS9ZSHI1SndLU1hM?= =?utf-8?B?bjdTcG1PUVAvTG5pQkFzZ0NzM1RzaTRsUnNXejc5SFl6R21CZEFkdUE3UkJK?= =?utf-8?B?TWN3N2UybXZQQ3VRZVB4bmZKbjZWalcvK1pTWnVXQjdjZ0RJb1ZtQ3NYdUVU?= =?utf-8?B?c3FOR1lLY29JV3RFMm1KbEUvNXpXUWhpUno1aXpnL1VrQTAxYlZFVC9ZSzFk?= =?utf-8?B?NVE5WFIrTk9yYi82Y3ZUQm9MaUExOXEvSEpHdVN5U2c0VHNicExHQUVxd1VB?= =?utf-8?B?TnJiZU9uYm9DZURmMy9XSDRHMnZ4Qm0xYXUxbHhURkVpOHdjdmtiWGdVSW9z?= =?utf-8?B?RjNJSmRUOU9BeHRndzhVWktyUmtGZlY4NDNxWkl6MnFQaW1PZE5tVm1QdHV1?= =?utf-8?B?RXY3OCsyb01UZ2t2OUlWcGcvdUZJdFJ5M0JXOTZYY1R3a0lZbCttK1paeHlY?= =?utf-8?B?cW5ScEt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VI?= =?utf-8?B?b2tDTERwcExzVFZJeVlOdWdSQk5CUzFuWGFtVW53TEt5bE9zWUZFYkNyQll0?= =?utf-8?B?N2doeFQxLzBkdnpsNnN4aXJUYisvMjNyak5rbi9lcmozU0tHdjdqellPSUp6?= =?utf-8?B?bFVYNnNsNDJ5YTV2Mkx1QlA5R0VQci81K09DeE5NZkN0UHRhbWF5aDhWVVlX?= =?utf-8?B?eURWR2NCS2FYQlI0OFZqZFVWc1dMQTFVQWI3SU9FanNYNWsvNTh6UGFiZTdw?= =?utf-8?B?cVlMc3dhV0NkaEl0OFpKYy90RmxLanVTU0FuTzE1UmtBclFYcVpYdG9xWTBa?= =?utf-8?B?M1gvYlZLejdlOTU4UzdpT3BSZHhrVE0yNTlMYnkxaWZoV09idk5hNXBXakND?= =?utf-8?B?bW13YWViR0orVTNyUjBnY0NKa1hubmhKTkcwaWNMaHJ1czJJYWo1QkxPNjV3?= =?utf-8?B?RlU5MlJaSVpRTVMvSzMzWmc3WkZXZGN2a0JiRGpiTFBvZ1BXcGYxaXlYYVVw?= =?utf-8?B?SXhnc1dhS3VNQ0taN0lySUo2eFptdzBYR09IbTg3VS93KzEzek5NOHA5cFlS?= =?utf-8?B?eUdETS9rOFcvaWZqd0tIYUJtRFdRS1dkNmdUTGRxa2MxcFh6NnR0SDFNNW1s?= =?utf-8?B?RFE5Wk9BcXdxaVFERnRnVVhOSzZ0UGZiYnF1WnduUlUycm9USC9UMkhvbEdp?= =?utf-8?B?bnZsMStCZER2Y0FqeHJ2alE1KzY1WDRySkplQ0U5NVZpUjN4eXBCRzZnLzIz?= =?utf-8?Q?8khU=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 806e4d98-779d-499d-32a7-08db4492850a X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2023 07:07:09.3232 (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: u+K+nGjJfTgreM46x1b+QQdAKiQ+mQa5rg32FAu6JqyVnR60J/MRCv7IMUmqXoCf X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6744 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 24.04.23 um 07:59 schrieb Sukrut Bellary: > smatch warning - inconsistent handling of buffer object reserve > and unreserve. > > Signed-off-by: Sukrut Bellary For now that patch is Reviewed-by: Christian König . But for the record mapping/unmapping the MQD like this is a very bad idea in the first place. We could need to shuffle memory around for that during resume and that is not something we really want to do. Christian. > --- > drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c > index 278416acf060..5de44d7e92de 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c > @@ -4686,8 +4686,10 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev) > return r; > > r = amdgpu_bo_kmap(ring->mqd_obj, &ring->mqd_ptr); > - if (unlikely(r != 0)) > + if (unlikely(r != 0)) { > + amdgpu_bo_unreserve(ring->mqd_obj); > return r; > + } > > gfx_v8_0_kiq_init_queue(ring); > amdgpu_bo_kunmap(ring->mqd_obj);