Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4103610rwb; Mon, 21 Nov 2022 03:53:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf77CfOIxbctTQx0zt8tVMwFmy2DSgSvUSC/VVjFP7ivRAIxnYO3P/l+22bhiXvnRWCVN9Cm X-Received: by 2002:a17:907:8d02:b0:7ad:f43a:cb07 with SMTP id tc2-20020a1709078d0200b007adf43acb07mr2947550ejc.562.1669031583075; Mon, 21 Nov 2022 03:53:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669031583; cv=pass; d=google.com; s=arc-20160816; b=Fjd3JhvZhE0+qqOvyTF0nr4Zyc8Gfkm5RqAViHQvfFPvdmseGBEdoM0KmqhbbROl3b u8QT5RGiEzTeDNhOAZjd1IW8pfzlY1HN5CVnDFYFiMDyjU73QsEnUM7oLiQFLAcD0i1G OCLa1LdwfEgruIy8JyNl0XYWHV3NWWFVNPwUgmT8Cb2K7GBcKNdNph+7OpeUrZm+sVdD cKW7HVZv2IDie77c87UVvDRs47RrQFJnO4EEWtIxnlk5D7iTPQ7TLrHzmDT08D8Phdk5 8geUotQtVgCdbZXcVjNZcmbrq6NmYIjnCOaQcMQsS0lO4amtQjx625jdkgcp6BFmurTe 5rjQ== 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=4OhYESem0zy1fPSEHzSf/MD1Jlfbs2fUilziKTwR3I4=; b=nLR8+AghJRuH3J9uWraaaivi/F8O69Xnknn9J9wT/eWVkUFEZGBC5pqqbJxLOl+qCl Jkvf2LXacZre0r3I0VZU6aWjTjY4Oypq9AmM1jCwUFqVUhn+xXJ3ClD4HV0PKj/ogGtV rV7Q0wqIZd9wnL/6m+bWiyYArKpzIk7MgWUTxPmvThm3OAOicp57h2Z8kXTos5itJhUl 7EFDsrKUifjJ2OVPOQl7LB/o31exM+UekdizWYnPRdflbSGaeFalIaFhQ/2s2DOhQobN LDJXhUXkA4H6iiFHWcynnWIGl1ZzzXTrNfUmzwBqeRWO+PnNeQA+5Sec4h8o9KYwQVyL 7a4w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=THgk+Ob2; 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 jt24-20020a170906dfd800b007317274bb0dsi7371936ejc.979.2022.11.21.03.52.39; Mon, 21 Nov 2022 03:53:03 -0800 (PST) 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=THgk+Ob2; 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 S230408AbiKULM4 (ORCPT + 92 others); Mon, 21 Nov 2022 06:12:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231245AbiKULMJ (ORCPT ); Mon, 21 Nov 2022 06:12:09 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2045.outbound.protection.outlook.com [40.107.244.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A79F0BA58F; Mon, 21 Nov 2022 03:08:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oPB4BfoKnZS/lmzll43namEWjcY2NvRaqkl/8QhSDAQ6F1rpLrx/xymE/r9lv6WKWlGdieXrFyVO8LfMHV7bYlu06fhCy7722CF9fRjeCvdA3gW/aK07dr1yJboH2+mEVFnR4AgZAFWjg/MNtjQ+8t9H/TzOBl69TAVd8zSxJAL2aLU1Fka75FeaWbnLkh80NAuSAM+KR+/+LsJD40fLio6mrtW0wkeUI6tSrrnle+tvI0MJZlbSQ2eQdSeiqMIPzXi6lgSD43a4+cEUEq79a9rWNjjinzxEve2g2DUqmlz7mODHOeG0xcsRIT8AxvDIbrtdDbYHCc53XDqTTEyJ3A== 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=4OhYESem0zy1fPSEHzSf/MD1Jlfbs2fUilziKTwR3I4=; b=k3sOYwdn60pTy8IH1/VDIEp7r42Nvd2UDtRywB+exWZXf43yjjz6l+L+HWm2gznA6qk96TYNqZQJ9G//FmvitpuILx5SNUOcRzbZTAN/gQDiWzuIRv88jpcQ10G3kB4SuxIfo57TzkMJ8fzS2degeiI6tMkedtHpFca57zUKgdAc3XEeD8dLMJiUA8l++DOAeBFxtD/3XJ5pOe4b5Qjp+QGP06WpAyYumkyq50QTpRujKsbU6ENNWrFFtH2rJg9WY6MaPyBu1Ry6vj6BFMgjHsWGE8zxFHYhf9AOE0GOJFjhiqUovunZgLkjNRygZOuBd6+WQZnIHfIVMg3lXMxNnA== 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=4OhYESem0zy1fPSEHzSf/MD1Jlfbs2fUilziKTwR3I4=; b=THgk+Ob2di2+EYg2yopzBkgUbB9HvMaYZjehbN740/DW/ahwRO6H+fs6iIJRjPzz4QGbP0IFqSD0pXH9eExemueqVWf4w7PJnP5WGYn3qdPJm7+XG0Qs5n8dQvdrFylY3bRaHTPAiMb1KtqNVCzEmV5DuEqhb6u7N07zDcjdTaE= 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 SJ2PR12MB8033.namprd12.prod.outlook.com (2603:10b6:a03:4c7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15; Mon, 21 Nov 2022 11:07:46 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::7d43:3f30:4caf:7421]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::7d43:3f30:4caf:7421%7]) with mapi id 15.20.5834.009; Mon, 21 Nov 2022 11:07:46 +0000 Message-ID: <0916abd9-265d-e4ed-819b-9dfa05e8d746@amd.com> Date: Mon, 21 Nov 2022 12:07:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH AUTOSEL 6.0 38/44] drm/amdgpu: Unlock bo_list_mutex after error handling Content-Language: en-US To: =?UTF-8?Q?Michel_D=c3=a4nzer?= , Sasha Levin , linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Philip Yang , Xinhui.Pan@amd.com, amd-gfx@lists.freedesktop.org, luben.tuikov@amd.com, dri-devel@lists.freedesktop.org, daniel@ffwll.ch, Alex Deucher , airlied@gmail.com References: <20221119021124.1773699-1-sashal@kernel.org> <20221119021124.1773699-38-sashal@kernel.org> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR2P281CA0043.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:92::16) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8PR12MB3587:EE_|SJ2PR12MB8033:EE_ X-MS-Office365-Filtering-Correlation-Id: cbea118f-285d-42bc-bf7d-08dacbb09e8a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 575/dNStLYR/0Dr5CvQwqt+h8aifRgZJLItLLDGxeW7aaeEXwB3DVWITPT7Hcry4cH0n7fykoIC0Ps0Rnfjzo+DS+MTYqCUzHYbcSXppk7J/t0NWEAX5HQqGW8ALRD7R6002GNAVJNZhFGGLHXS6PcWWfbNEEKTrAWrlsjchax7bzFHDcP8W9x9oxtAMGErgXtT8CDpKaQYh4e1+2jH/HRhpbVLnKrE4pMUarkWZGeTvbdYZOzXcsIQzh5GOf6w9zfpQ+poaW+/W1MwGIVx3TgWXa1fhTGYy5x2wXEL1NhfIIUF517IRQvRYet8s6CThzeVwH8lYxz1xlv+kIUVY+4O+OGsO9bhUVoaUs/5VWrWn77phGQo7u57uqDcBjefjrLYDROKfl7CGZ/uLY9zo/S1rb9n3xWLYctZTCfitiv+07I/JSRtKupML5+Zg7cwBHEz5Ucc0PDvZD4jufaQaK36C0XqfMK1ilVbMviU7xSkjX0/DEswNqcg0OZeN15YhCZWBxZAd+M6sM2j7YinUvWb5b7DonLAcnccHcz7jN3k101xmwx95r/WND2kqRHVqbnJntvb0qAg7TuZJPK9FgSpamo0ia6u5U1G135voBjzDzPcBQlsSndPeFdRcqpzUN0IihPuPDT3Yv/XrXErVqNFyBVvPwIhszOJyba3Qb+K8SwepWy28h/rxO5u6nxGYfK8eWF8QHA2K926ZOwOX9xeVsIGo6eFc3VE9dV0Okck= 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:(13230022)(4636009)(396003)(136003)(366004)(39860400002)(346002)(376002)(451199015)(53546011)(26005)(6486002)(6666004)(478600001)(4326008)(8676002)(6506007)(66946007)(66476007)(66556008)(110136005)(41300700001)(316002)(38100700002)(6512007)(66574015)(54906003)(186003)(2616005)(83380400001)(8936002)(2906002)(5660300002)(31686004)(36756003)(31696002)(86362001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ai9wa3VlVGZJL2IrbGZadkhHYlh4N3FYOS9sdnZsRnN5WnpkWjg5czF6YnRV?= =?utf-8?B?bVFKNHBoMXl6VFBHQ1pWTzhvTXFncVp5RXQxU3JHajRJN1doSjZzTlhwcVRT?= =?utf-8?B?WDM0bm5JMFBZeU9La25ZaGZaZTllWkRlL1ZzRXJzZVdkRWpwZUVESU5yT1A2?= =?utf-8?B?bWkyYmpQRURGLzNUUkVYWnhVYWRLYStpdVJ0MWZieUU3b0Q5OEppY3VsT1ZG?= =?utf-8?B?RlV3eGJGano1ZHBZY0pJL1FSMjhDUlkzc2V4dzlnaTZtSFZnaE5XOFZzWDFJ?= =?utf-8?B?cHhHTVo3blBCNXR5UXZ4MjdmOHJsQmtqV09udjBLS3FKM3BSbWZmZGN0L2ZG?= =?utf-8?B?VVd6UTZrVUw2MXhHWE16SDQyUm5Ubn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MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2022 11:07:46.3578 (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: Rp5YvrSKlzYCCgOnRcW/dIsFYjRVP9fdRyA2YZpKa+VnqxuUvrlaS34a3DHZE2/C X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8033 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 21.11.22 um 10:57 schrieb Michel Dänzer: > On 11/19/22 03:11, Sasha Levin wrote: >> From: Philip Yang >> >> [ Upstream commit 64f65135c41a75f933d3bca236417ad8e9eb75de ] >> >> Get below kernel WARNING backtrace when pressing ctrl-C to kill kfdtest >> application. >> >> If amdgpu_cs_parser_bos returns error after taking bo_list_mutex, as >> caller amdgpu_cs_ioctl will not unlock bo_list_mutex, this generates the >> kernel WARNING. >> >> Add unlock bo_list_mutex after amdgpu_cs_parser_bos error handling to >> cleanup bo_list userptr bo. >> >> WARNING: kfdtest/2930 still has locks held! >> 1 lock held by kfdtest/2930: >> (&list->bo_list_mutex){+.+.}-{3:3}, at: amdgpu_cs_ioctl+0xce5/0x1f10 [amdgpu] >> stack backtrace: >> dump_stack_lvl+0x44/0x57 >> get_signal+0x79f/0xd00 >> arch_do_signal_or_restart+0x36/0x7b0 >> exit_to_user_mode_prepare+0xfd/0x1b0 >> syscall_exit_to_user_mode+0x19/0x40 >> do_syscall_64+0x40/0x80 >> >> Signed-off-by: Philip Yang >> Reviewed-by: Christian König >> Signed-off-by: Alex Deucher >> Signed-off-by: Sasha Levin >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c >> index b7bae833c804..9d59f83c8faa 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c >> @@ -655,6 +655,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, >> } >> mutex_unlock(&p->bo_list->bo_list_mutex); >> } >> + mutex_unlock(&p->bo_list->bo_list_mutex); >> return r; >> } >> > Looks doubtful that this is a correct backport — there's an identical mutex_unlock call just above. Oh, yes good point. This patch doesn't needs to be backported at all because it just fixes a problem introduced in the same cycle: commit 4953b6b22ab9d7f64706631a027b1ed1130ce4c8 Author: Christian König Date:   Tue Sep 13 09:52:13 2022 +0200     drm/amdgpu: cleanup error handling in amdgpu_cs_parser_bos     Return early on success and so remove all those "if (r)" in the error     path.     Signed-off-by: Christian König     Reviewed-by: Alex Deucher     Signed-off-by: Alex Deucher Regards, Christian.