From patchwork Fri Dec 3 17:27:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Zhu X-Patchwork-Id: 520508 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB2BFC433F5 for ; Fri, 3 Dec 2021 17:27:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239848AbhLCRbI (ORCPT ); Fri, 3 Dec 2021 12:31:08 -0500 Received: from mail-co1nam11on2050.outbound.protection.outlook.com ([40.107.220.50]:47201 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352986AbhLCRbI (ORCPT ); Fri, 3 Dec 2021 12:31:08 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ktIaUVab2pkpC/GeKDhPNsYXmSsLth2dIZyW135RIBpRV/oN/Q8bvbkoOtg1sgbP8Glh4MWHscLLE2WFzLxUsAheVXJIMU1mBhhCxILB7NnV2T8Z/tAeURsKY2BU4Cgx4v09m8aiGAZ7L3IIqbOUF2hdetfWXvLoGrhqcvuq/SGBvEQa2VfUfGpCbFV/31j90e0mIqmiwplmeKB7WUmgJhuZmJ0RYmqT1qIcF2Who69p6g34hautma90r/cUDlp8ZZX+22KYGHTqHj3RwJLexNVdp18+PCslRpTFQDIgLMagFhLfcxS6Cs4Ib88hrlv4Iz+PUsRdzIKYmsogDtvBxA== 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=AYirALc7U9JZHbayR9kkTOA/QJxN2gzhTpPmO4rIT5Y=; b=I9Z4hpHKMrQGgjlMV2xCWKezvRhrX3VO19Y11IEZ4u4P5VEpF77britB0Av8sQzUP2ZTyuVMAHJxkKZckqI387+6NMTq7V4bIvkWWVBRBQjJyqAb/xitKjwMPaHSIhVKT8QGq04cvY3uFPjugRUm1lGANUNXyNG4QYdJURYTJf0pT4AkuZXL85ZzrXQxlX06sAKI1kgK3/apQg/z3b637pzsE5r05Wdo/He/Ec0YO1DgtePPqJagQMoOMZgOC6ZlwEh3PZmN19Ce/2kJR/dD+h/KDK5iHoQWX18EHyEsZrPdgAf8KDdHl6HanAlVvMHS1VFUEKwv0A7JJuL8Bb2/Aw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=AYirALc7U9JZHbayR9kkTOA/QJxN2gzhTpPmO4rIT5Y=; b=5isyicp9M+Y3PJn+RVq2HYehuy5KZJckB0WNoWydOwkW1EJ7sT2AKiPDt5xBY2cCG0Ko5LNVfPnxmzHfIlWncQzDmSb8Eb3lVcKpkwTTaDGEX4BsD1dtk0F9Nm5cF2L7rq2CKtbYnoBiyjdEn/TTSE8hx21DHDtIWSA4V6pnPzk= Received: from DM5PR11CA0013.namprd11.prod.outlook.com (2603:10b6:3:115::23) by DM4PR12MB5183.namprd12.prod.outlook.com (2603:10b6:5:396::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Fri, 3 Dec 2021 17:27:42 +0000 Received: from DM6NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:3:115:cafe::b8) by DM5PR11CA0013.outlook.office365.com (2603:10b6:3:115::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.16 via Frontend Transport; Fri, 3 Dec 2021 17:27:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT033.mail.protection.outlook.com (10.13.172.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4755.13 via Frontend Transport; Fri, 3 Dec 2021 17:27:42 +0000 Received: from work_495456.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 3 Dec 2021 11:27:41 -0600 From: James Zhu To: CC: , , , Greg Kroah-Hartman Subject: [PATCH 2/5] drm/amdgpu: add amdgpu_amdkfd_resume_iommu Date: Fri, 3 Dec 2021 12:27:29 -0500 Message-ID: <1638552452-4198-3-git-send-email-James.Zhu@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1638552452-4198-1-git-send-email-James.Zhu@amd.com> References: <1638552452-4198-1-git-send-email-James.Zhu@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ece05475-a773-4072-0503-08d9b68236bb X-MS-TrafficTypeDiagnostic: DM4PR12MB5183: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:167; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dDUx3AfQSlzE2YQhhyEAbHZq7xJvi8g2+9GpMu5CInf5kTke2gZOBzcZKzLgxx+xwswCE2FSUcbDtTsYI6053cDRWW2Y1ami8vi8SnyxPiBtduv+ES5TXoTOG3vk8pNE+TxC3cC50kIXQovBwOrL+lZuZ2+XmovWezS5AQd7lNIKv0R3E55CEGWaU0JpOMhvRsOjjtPh+GTgew2fuEKr3lLBOTu+Bsk7qo9JCMe3PIEmpILG1xoqBGzC+ALNoEW4nA9ygl2Q00v8zwZbViYGcXTYDx/Kx//b6N5hkb6KGfkMnRjto0vRVKcNZllep4XwT0xmcDD9zhp+zO5SSmJQ6zr0Gh34dpRi4UXHGZ0y7d/bQA9UIEHSxlIu0bPcJP6b2gDN5hvA7G1xGW/CgM3yeYhhv0rDyFpb5vbIDZBVQZtgkO7XREdFPhn+A3aHTv2pz4N28nZMBXopFTbFAADp20ogM670knQmbHm/UhQtvgHbg1kWRCpHvp+y4X4uXvWFqXwYLUwy4diedqurMgTkitjrrEqK/vcGjYMVGvxNeuLlib5A83IL7HuFYgw8bNpozPp9Ik678/PfUF47ahrbywLHFCWbt6TwV8TWqVPLM18o8BTlUt36mixc4wHh82MjlYoeTnEVMQlF5JieOvGCpc/OjY7rmiGXshN8C+IWi9y/Qvw+hZelSQubLJD766MQZXpiSj9v7sy479oop61H7J7l0NmQj44Yz69jioWwPKuPy3Qfh3u/V10nKpp4WazNLE3nuhKkp7DjGj3bG+KvQEXJSti81/v7msZRtYs2WeSi9Fglz2jQLxfBY+zOseibQBRGLM1hnWU88JmlEE+XRYKjPXSTycsbIGoOJm3XDcb0rdn7papVhTkzThH6zZyw X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(40470700001)(6666004)(8676002)(47076005)(70206006)(83380400001)(2906002)(40460700001)(4326008)(426003)(82310400004)(36860700001)(186003)(336012)(70586007)(5660300002)(81166007)(6916009)(86362001)(26005)(54906003)(316002)(2616005)(16526019)(7696005)(8936002)(36756003)(356005)(966005)(508600001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2021 17:27:42.8772 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ece05475-a773-4072-0503-08d9b68236bb 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5183 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org commit 8066008482e533e91934bee49765bf8b4a7c40db upstream. Add amdgpu_amdkfd_resume_iommu for amdgpu. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=211277 Signed-off-by: James Zhu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 10 ++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index 0544460..ef83047 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c @@ -194,6 +194,16 @@ void amdgpu_amdkfd_suspend(struct amdgpu_device *adev, bool run_pm) kgd2kfd_suspend(adev->kfd.dev, run_pm); } +int amdgpu_amdkfd_resume_iommu(struct amdgpu_device *adev) +{ + int r = 0; + + if (adev->kfd.dev) + r = kgd2kfd_resume_iommu(adev->kfd.dev); + + return r; +} + int amdgpu_amdkfd_resume(struct amdgpu_device *adev, bool run_pm) { int r = 0; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h index 7f78bcf..896ae32 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h @@ -126,6 +126,7 @@ int amdgpu_amdkfd_init(void); void amdgpu_amdkfd_fini(void); void amdgpu_amdkfd_suspend(struct amdgpu_device *adev, bool run_pm); +int amdgpu_amdkfd_resume_iommu(struct amdgpu_device *adev); int amdgpu_amdkfd_resume(struct amdgpu_device *adev, bool run_pm); void amdgpu_amdkfd_interrupt(struct amdgpu_device *adev, const void *ih_ring_entry); From patchwork Fri Dec 3 17:27:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Zhu X-Patchwork-Id: 520507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 421EAC433F5 for ; Fri, 3 Dec 2021 17:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353294AbhLCRbL (ORCPT ); Fri, 3 Dec 2021 12:31:11 -0500 Received: from mail-mw2nam12on2080.outbound.protection.outlook.com ([40.107.244.80]:55136 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1353282AbhLCRbL (ORCPT ); Fri, 3 Dec 2021 12:31:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QbV1GvPI7fQfNCDmyx1SV0t82nZA3/VWAyo/EZ4/1OWljU6SCwJCGEc5PrMw+3wd6p+xpfBcv/hlnkiEPBNxJjQ4XoJNJdqKZRsmPcKDtJrv1Z29Ts7a5f7rb16EdM1jPrzUHTnCNX1xd4bYMpYkgNX0AfC5+mk46se18F4U7K2sVAiXpa4slLsEvlVzG/q5CbAFHyEvCw69jjy3RH1yHgO02vweY4FNyLUJY72m4VekyzK5H97CeD4sYd9FREHzI2mjFzcjRdIIEbnidytvZuWjJsq5q1W0bPCHx6DS/txT9e7ty1Tzno7ttWmrNWd0/xMyXJjdA2PwHBQ3dN3A0w== 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=mFulNL+gxKsn6QMU8HNS7jEB+amgVG7cdfIMT+xt4k8=; b=Rf7bNHDsxcIy1Dtciz6M35ok6NiI4QEgY/xHxr+qCznsHvNBTEj8ADoCkYpeP6UtdsrEqn1hpafrbueaMxR73T6hAYmjhaaYDW0Q2J15uVaUT9oHiFq6Q19mUEZZFeIKcZ1cuif3TVG7MWC9Dk57mKtVcb+jcyXv1PREAlYG11PZ6ZKDNsVkvo46kjwdNPJegU/CAhy6kz0VwZoIwl9LAoP24aKcQ2VmVbLn+YeTkXtbqgv1xFA1uQFcUfCRbzw2fd5/YxXllbczDieBlJu/CO4vMvLcIHe0QfYPpwaYnFV30o6s4AjI7Savob/dDRNCXuXmS486BU6TkTG6YRF8zA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=mFulNL+gxKsn6QMU8HNS7jEB+amgVG7cdfIMT+xt4k8=; b=o1gyvuU1yCK01Ww4syEfIjRYkWwyuvJz64k6JHJ54Lo1ylGq63a/lvXcF1SmMi7uwC/ZjahQGMhXJQfJ3TH0Cd8B1qEVF8jB9mUlwgdEY6cp1VGQXNdReScrypKxbvPXj2y+H/U2PJ/84/19Gn2Fdyj61mJst0C/qj0m22J5R+o= Received: from DM5PR11CA0004.namprd11.prod.outlook.com (2603:10b6:3:115::14) by BN9PR12MB5116.namprd12.prod.outlook.com (2603:10b6:408:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.22; Fri, 3 Dec 2021 17:27:45 +0000 Received: from DM6NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:3:115:cafe::d3) by DM5PR11CA0004.outlook.office365.com (2603:10b6:3:115::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Fri, 3 Dec 2021 17:27:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT033.mail.protection.outlook.com (10.13.172.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4755.13 via Frontend Transport; Fri, 3 Dec 2021 17:27:45 +0000 Received: from work_495456.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 3 Dec 2021 11:27:42 -0600 From: James Zhu To: CC: , , , Yifan Zhang , Sasha Levin Subject: [PATCH 4/5] drm/amdgpu: init iommu after amdkfd device init Date: Fri, 3 Dec 2021 12:27:31 -0500 Message-ID: <1638552452-4198-5-git-send-email-James.Zhu@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1638552452-4198-1-git-send-email-James.Zhu@amd.com> References: <1638552452-4198-1-git-send-email-James.Zhu@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ec22664-bb86-449b-3a3b-08d9b682383d X-MS-TrafficTypeDiagnostic: BN9PR12MB5116: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:177; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SECU9STrx9ecqEyjEx2lo843xrZABVJ1Bt4ffxbCDnpAkB6hKjMKJVm5gBzOevTOaoF3KPfHkT3acIFMO8q4JMEo0OzR65w6hpOyf2l3UAg27EbQ4WsWJIfIGyrL7vv/X3mKfuchlXibC2/HsJyQ/CRby9NwL/8bQfbU8jFDBBwhfxhgWe7acYuDDhQUc5FVwOZyvXnuRZdpJEw9rTsj513hGIh+RcBbP05hP1dUjIsbo6kNAUD5JxwuzfH0X4MGLNyYyU8SWb3DqWjDT3e+QcRtS5jnWe0nOuZUX8DO5QGyhcS0IT2Ud/tmS3BigQFgRTud1EoVpqRBAZTuF9ozV9AK14f7yQeE6tFj3YNSttUhlTvmj0SlX0HonyZCYn0iCUKqNBRBRb8UUr1sKcv/qhu9c/S2aD3TElSACADs+h/+anYy8HXOvfxXDdJgQ1JKrCRIiIdWzw9CvSzTyMoTuBOjrjeGGoxT+f9q3wh4bDicjf5LALrTbL7mBbIxjweMx4C3XGExK5FeCZ65rlwu+LZu51a7QT9QR2fYGtyc1x2lp7c3dbEzIQRL7ZzGuXDXMIG2ICC6oJqeTWvG6J3uCt0ey7LzSWGYsLKyDMkzk93M0MRcCEuY/amgArfpiF5TxxVaXdhm2SK19j9phUMelGUpVumvpTWLpD67oGKSGguY/twcCM9TKPyWdXu5B9bm8gNx9Aq6pdFs32tCY8QZ5BAzn3X6GNft4rYncm2xhzdKr5k89OhpMD9h2aMIxB9a/5LQ1m/XBqL1XQUrZu8kkdHjDrXrhXRyHavwHxK+1YQ= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(40470700001)(8676002)(36756003)(54906003)(6666004)(82310400004)(336012)(316002)(36860700001)(86362001)(2906002)(2616005)(426003)(508600001)(70586007)(5660300002)(7696005)(83380400001)(6916009)(186003)(81166007)(16526019)(70206006)(356005)(40460700001)(47076005)(8936002)(26005)(4326008)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2021 17:27:45.4082 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ec22664-bb86-449b-3a3b-08d9b682383d 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5116 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yifan Zhang [ Upstream commit 714d9e4574d54596973ee3b0624ee4a16264d700 ] This patch is to fix clinfo failure in Raven/Picasso: Number of platforms: 1 Platform Profile: FULL_PROFILE Platform Version: OpenCL 2.2 AMD-APP (3364.0) Platform Name: AMD Accelerated Parallel Processing Platform Vendor: Advanced Micro Devices, Inc. Platform Extensions: cl_khr_icd cl_amd_event_callback Platform Name: AMD Accelerated Parallel Processing Number of devices: 0 Signed-off-by: Yifan Zhang Reviewed-by: James Zhu Tested-by: James Zhu Acked-by: Felix Kuehling Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 2947bde..488e574 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2220,10 +2220,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) if (r) goto init_failed; - r = amdgpu_amdkfd_resume_iommu(adev); - if (r) - goto init_failed; - r = amdgpu_device_ip_hw_init_phase1(adev); if (r) goto init_failed; @@ -2259,6 +2255,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) amdgpu_xgmi_add_device(adev); amdgpu_amdkfd_device_init(adev); + r = amdgpu_amdkfd_resume_iommu(adev); + if (r) + goto init_failed; + amdgpu_fru_get_product_info(adev); init_failed: From patchwork Fri Dec 3 17:27:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Zhu X-Patchwork-Id: 520506 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CF5CC433EF for ; Fri, 3 Dec 2021 17:27:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353312AbhLCRbN (ORCPT ); Fri, 3 Dec 2021 12:31:13 -0500 Received: from mail-bn8nam11on2068.outbound.protection.outlook.com ([40.107.236.68]:7092 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S245736AbhLCRbN (ORCPT ); Fri, 3 Dec 2021 12:31:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nhcOk8A4rT3VKeeK/x1AV0l7NfeZwFDVbJCM1w0pxP1RSeQl/SsFWRJM4if9bvsVwjnt4q9p0KrSPfHk7FKOQbhY1ljEBrN5uDFyLknRE7yLiDQPwGYBQaWAIWUrr1N2m3Ld3c0/WzhYKE6KrjxI93258m7YUrlAcxPcrR4FIh+kDZWswhauyrn+2Dk5g1wlM9loHzW297fQ2KJREu5mgKCSf5BVSZM/ZDvxIfsIs5CjILYktAvEaYKkn+bvu405nFMeGgHzpgtLWtuIOXd4FZYX0yDy2yCNZbO3Nn/3JIGzfjRupv/+pUqitv+U9LbhE2zy7fPZJq/h5hxY/12NPA== 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=7dNUWoclLZKSQ6yyYYvVu/EfTEg2Q7q1RAPDJZ/+Cds=; b=QcoqtqhJx1xYVE+Kl7qb/mH4EGXxa5zrmaUneIfsKSFN7B9w65PBDWi57Z1R+eVnGWsaqF8uahY9RSrChCzixIilWlOixymCkIU2PvthN62pgCWGoqV/yx8XUBnoz+2BeHSA5ZFfuRiytSnVjZzxlswt1V4qHIwUTvlHMKm1NnUFldC2pQNIhTgq0WMDaKQNs/+FVVVsAZUt49YeGQdNSuquh0kzNqthkJoDJ3fCTxE/FuDrmpFIwivnhTqmiCqv3gCWtrleJYYzTjLtY6V9GlSiMUYUMEqy6Bu5NSelI5j1Hd+7+UpHG4ipCRNOQWDUXYWizL96mmVDK6ZMbQ2wUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=7dNUWoclLZKSQ6yyYYvVu/EfTEg2Q7q1RAPDJZ/+Cds=; b=PT6j2HYUuguTzeURfw39VNVcHzbLogUV4hUp5OGmOb/8JMBym3qb7fDSVZdgh3LcdMBD8V3iwsKNzIsNwJMoo0zHKcG63HRpKcSRVM7EzrECOHv07lnHWBTiCznlSYxCDxES1c9LQ2hgA1KonKIjFXvu+BdNCM9BRkVRXTM+RlI= Received: from DM5PR11CA0010.namprd11.prod.outlook.com (2603:10b6:3:115::20) by BY5PR12MB4901.namprd12.prod.outlook.com (2603:10b6:a03:1c5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Fri, 3 Dec 2021 17:27:46 +0000 Received: from DM6NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:3:115:cafe::50) by DM5PR11CA0010.outlook.office365.com (2603:10b6:3:115::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Fri, 3 Dec 2021 17:27:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT033.mail.protection.outlook.com (10.13.172.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4755.13 via Frontend Transport; Fri, 3 Dec 2021 17:27:45 +0000 Received: from work_495456.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 3 Dec 2021 11:27:42 -0600 From: James Zhu To: CC: , , , Yifan Zhang , Greg Kroah-Hartman Subject: [PATCH 5/5] drm/amdkfd: fix boot failure when iommu is disabled in Picasso. Date: Fri, 3 Dec 2021 12:27:32 -0500 Message-ID: <1638552452-4198-6-git-send-email-James.Zhu@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1638552452-4198-1-git-send-email-James.Zhu@amd.com> References: <1638552452-4198-1-git-send-email-James.Zhu@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ad9e4ad-e887-40ea-bf57-08d9b6823884 X-MS-TrafficTypeDiagnostic: BY5PR12MB4901: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:302; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zztUfnSr5Jm2W17yirPwXb9gaLdzZFNUq1BpeKU8yEcn1z/SAzy+LjrGM4Azrbs8FNhBa0/piOn9TitAkxVcFIfbp+zwD5T3O/D5P/j9ihofiD42xR95ftECHKgsCCAd06LELo1UV5Cj5GYLc+e5zsV0RzfoGOWFREAYYkgLsnr/Pl9h0Q+v7e2fSgceWZXUIdMcy2vdPiR0BPT0Zh77ra4Ux2fpM0sb9e6qkzjcYpa8kUE/SOerrw1gxHeiccMyd/bUTJ44r85aEcYz0DgOxIoFxqHhn5TTln5+ZsTjaIxyyEdVyRSUwzcKNBy3J7DoSfye02iBdsDr8Tvs6dVFIGFuKYTYge2o4mcG9VPtOQM+GesX/H65xeDu4qP9UdXLTli0ZeLBLgsO0pAebtybNZOJGI1xqvLOZW5yfIW8yfMb8PboAKI4E7E79X3Je+nB3glF/SWv85nZey4FF5gos+aGgo3WR8z8JQ5fSM6yksz0d4iYBnrDs2miXoqHzb0cw/2MacuK+W/6lsItFREwk7I/9xnaInc31w9APdKKGd9oG56Gk+pj1BnBbdSJoFKa2YHwkIt/4fjbpCOpYwJFZPX0NVfTk3lksHIBSpmRxDdYqatNIOd1AHg4ewXf/8f6LAyMaE8SFMiQumLophw9VhC7McwMNQhS2JtK0z2q42tb0EwnjmeElPuxU6UXbMDC2GZpqq+T8avY9xJ1ST00IrIoeGMA/765GJ7j5s9/93bYgSMyS0BIsSIpOqQ8arKuwL+06bl+4xKWsgIKsf+NFQs5DgIVHn8Vv7Dx8rmsQgQ= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(40470700001)(2906002)(2616005)(426003)(336012)(8676002)(6666004)(40460700001)(8936002)(36860700001)(36756003)(5660300002)(26005)(81166007)(54906003)(508600001)(356005)(186003)(47076005)(70206006)(6916009)(7696005)(82310400004)(4326008)(83380400001)(86362001)(70586007)(316002)(16526019)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2021 17:27:45.8769 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ad9e4ad-e887-40ea-bf57-08d9b6823884 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4901 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yifan Zhang commit afd18180c07026f94a80ff024acef5f4159084a4 upstream. When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2 init will fail. But this failure should not block amdgpu driver init. Reported-by: youling Tested-by: youling Signed-off-by: Yifan Zhang Reviewed-by: James Zhu Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 488e574..f262c4e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2255,10 +2255,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) amdgpu_xgmi_add_device(adev); amdgpu_amdkfd_device_init(adev); - r = amdgpu_amdkfd_resume_iommu(adev); - if (r) - goto init_failed; - amdgpu_fru_get_product_info(adev); init_failed: diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index 1204dae..b35f0af 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c @@ -751,6 +751,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, kfd_cwsr_init(kfd); + if (kgd2kfd_resume_iommu(kfd)) + goto device_iommu_error; + if (kfd_resume(kfd)) goto kfd_resume_error;