From patchwork Tue Sep 13 14:48:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 12974930 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 4064AC54EE9 for ; Tue, 13 Sep 2022 15:56:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236205AbiIMP4R (ORCPT ); Tue, 13 Sep 2022 11:56:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234249AbiIMPzr (ORCPT ); Tue, 13 Sep 2022 11:55:47 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20600.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::600]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1586C8F94E for ; Tue, 13 Sep 2022 07:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=URs9lQHM7t140BAbTmQZNtda9eqwGEHQOeJWqGahJZEG9YVwzoRs/NeJmb0L7F2uWeEyNVAvrUa+GUMlVaXHVB9qQc1Kx5YyAnAgRp0GVIKlNMss0hLspl6FYkxkrKN94/9ZJ0TJpi1McSkENELrcRVrvPV8lRQ+BrjkHVcuMGPV58FlxVz7QGaoig0uFp0cLlJL2kA22rs9VdVudGr/BIlMW9I6nZxm3Uu7H+3iGnB9JGbMkid2zEstb9JdvVjUPL3Sj0yfQfXmOfIIKxH6c1uBqqwpCCYyQvzLpM3PZtecjyBdLog2MMKYe565HD2He5QI851cknVijqTtsj55yQ== 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=caHXh5ebz8/bO+pvzbOAcLayiN7VPGsV298vKkwXYq8=; b=I6ihOC62pd/e8A9xOuq4OVSw35LnDcSpR2IVr6tGbGTr0OrTee/6PvXxgqV/4sQePUcwnWe7g+JLNSxw2WvREp1cf2oko1x5t6WnUxsEizljrxu176883zB/inf10RKRSyh/j/UOlBfUp3wlOAyTUNvXL/lScKO724va1NvpL/KxtcsZ7crBRLufKvgPwlS0OvWcqRWhh2PVBSLmi8BbH4nHn+wjs7MfwH1ynqCD7+4ytwTIyFvvxBwcA7MAGiyZs6L3ojq6WC1MWko0FFAt5WO2SHTTgjho0dB06OPwvFq0n0nNjyB4SUFoNn1TfQ9MoNfkpCmrPGrCG5bfunONhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.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=caHXh5ebz8/bO+pvzbOAcLayiN7VPGsV298vKkwXYq8=; b=B10u2HHyRt1z/MtDkY0sT7bG/GuDbbj1Xgh9E+CUjYv1VbZ8DBf6kXSWoPxbuH6OhcjiKIXwmmqEOIodm/YwgVDKQrTx8FrZpGSQ+gc5t52H0zAF3fNLnGg4UN3GW2RDALguPp0irDC+L2J3zNX5WAyj+ouSNQ3lz2mW9Qz6XXk= Received: from CY5PR17CA0032.namprd17.prod.outlook.com (2603:10b6:930:12::28) by DM6PR12MB4450.namprd12.prod.outlook.com (2603:10b6:5:28e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Tue, 13 Sep 2022 14:48:47 +0000 Received: from CY4PEPF0000B8EC.namprd05.prod.outlook.com (2603:10b6:930:12:cafe::5f) by CY5PR17CA0032.outlook.office365.com (2603:10b6:930:12::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22 via Frontend Transport; Tue, 13 Sep 2022 14:48:47 +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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000B8EC.mail.protection.outlook.com (10.167.241.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.12 via Frontend Transport; Tue, 13 Sep 2022 14:48:47 +0000 Received: from tr4.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.28; Tue, 13 Sep 2022 09:48:45 -0500 From: Alex Deucher To: , CC: , , , , , , , , Alex Deucher Subject: [PATCH 1/3] drm/amdgpu: move nbio ih_doorbell_range() into ih code for vega Date: Tue, 13 Sep 2022 10:48:30 -0400 Message-ID: <20220913144832.2784012-2-alexander.deucher@amd.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220913144832.2784012-1-alexander.deucher@amd.com> References: <20220913144832.2784012-1-alexander.deucher@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-TrafficTypeDiagnostic: CY4PEPF0000B8EC:EE_|DM6PR12MB4450:EE_ X-MS-Office365-Filtering-Correlation-Id: 059a3f69-1dc1-4165-7b69-08da95971041 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: il172b3+KZg+SJI5PEqDAiulW4za58+XwwkdPsHtQ4P4VUabOk4f8sEUluwfUT2TmCTx48p2x6wuXNiObtzCdHeXTbbuaJzJFG7tymYkOiYpCW4qFOEOtD69sXd7E5Zuvs8dpkQtDLW3z/JKV9NSFBS5ih/rsuzypVueNwLDzaJmzs3jX1dQa9iyxSpCpzM6vND05ckqf247l6xenMg9mTeWCN/v8D7M488vqx/uDkOqvU/IoLW4R1plnyU8byZgsgXxgZO5+lU87aKfr4461wO9SpxU+QaQ3QZgxDEmYiC7ozG/S9Am6dvfjfnqYD6CwxNRTGDvbRwdWLiCLBKqf2rSuOmacIF76GVN2fwkhuD8pm/owd2lp7WXfSd9ouSLtt4YAVxSUBHI6+KscHZJ/M92zfBlIh85U7JCuVlMN84o/V3FiIigTO1hHc22aqPM14cWNQjy9tulHL8JMBML5c8DCgpwRXrXCzHa8bFRhWp8++91eMieIhyOcSxQ4PoYWaVK93u6yN+JlrTPPBCYjvB/fH3q5JaIWpWkDeEq/JMpA6KWptF5FjwVkxJjuzbquDq2sag1/BF7fJMWVVfh3yImco5bLVFgH92Is5F9dG7VN9FDCJpiplv8tdENS7xbFDPxfg2FA++bV6rLOyXCM5D9S2fEY6yKaYketGvby0fcA/2ItBwEhlJY2hSUul4wBiAbnfLrT/E7JUXaPy6SOS4Y/M3OFt7FlfSnTRluSJCh2phmWG0Xt4N+BYRookoOWQw6KaUD/8FpxUp5GCXykUhr8Uv9Q4OooZ/99lWpTIn1EoelVm/tGrsJ5TlHGXKl3Q2+4hMUzpL+Ullzu05i3A== 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:(13230022)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199015)(46966006)(40470700004)(36840700001)(356005)(1076003)(186003)(26005)(83380400001)(6666004)(16526019)(336012)(8936002)(426003)(36860700001)(41300700001)(81166007)(86362001)(966005)(478600001)(40460700003)(8676002)(7696005)(2906002)(2616005)(36756003)(47076005)(5660300002)(54906003)(110136005)(7416002)(316002)(82740400003)(4326008)(70586007)(82310400005)(70206006)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 14:48:47.0423 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 059a3f69-1dc1-4165-7b69-08da95971041 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: CY4PEPF0000B8EC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4450 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This mirrors what we do for other asics and this way we are sure the ih doorbell range is properly initialized. There is a comment about the way doorbells on gfx9 work that requires that they are initialized for other IPs before GFX is initialized. In this case IH is initialized before GFX, so there should be no issue. This fixes the Unsupported Request error reported through AER during driver load. The error happens as a write happens to the remap offset before real remapping is done. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216373 The error was unnoticed before and got visible because of the commit referenced below. This doesn't fix anything in the commit below, rather fixes the issue in amdgpu exposed by the commit. The reference is only to associate this commit with below one so that both go together. Fixes: 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc15.c | 3 --- drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index 5188da87428d..e6a4002fa67d 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15.c +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c @@ -1224,9 +1224,6 @@ static void soc15_doorbell_range_init(struct amdgpu_device *adev) ring->use_doorbell, ring->doorbell_index, adev->doorbell_index.sdma_doorbell_range); } - - adev->nbio.funcs->ih_doorbell_range(adev, adev->irq.ih.use_doorbell, - adev->irq.ih.doorbell_index); } } diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c index 03b7066471f9..1e83db0c5438 100644 --- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c +++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c @@ -289,6 +289,10 @@ static int vega10_ih_irq_init(struct amdgpu_device *adev) } } + if (!amdgpu_sriov_vf(adev)) + adev->nbio.funcs->ih_doorbell_range(adev, adev->irq.ih.use_doorbell, + adev->irq.ih.doorbell_index); + pci_set_master(adev->pdev); /* enable interrupts */ diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c index 2022ffbb8dba..59dfca093155 100644 --- a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c +++ b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c @@ -340,6 +340,10 @@ static int vega20_ih_irq_init(struct amdgpu_device *adev) } } + if (!amdgpu_sriov_vf(adev)) + adev->nbio.funcs->ih_doorbell_range(adev, adev->irq.ih.use_doorbell, + adev->irq.ih.doorbell_index); + pci_set_master(adev->pdev); /* enable interrupts */ From patchwork Tue Sep 13 14:48:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 12974931 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 B90D4C54EE9 for ; Tue, 13 Sep 2022 15:56:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233110AbiIMP4V (ORCPT ); Tue, 13 Sep 2022 11:56:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232885AbiIMPzv (ORCPT ); Tue, 13 Sep 2022 11:55:51 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2061f.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8d::61f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57F8972B51 for ; Tue, 13 Sep 2022 07:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YAYdKfGBAyoWFSii1pPgfVceDu1y8FTO+6yf8UCtXz9hepZNFbIhVdOyEPWIGJaDmZEJ/4en9E9txmjNbhJsscwgMRDsC9MHuUpDa4qs397++t0d5hePR0NGaK5ulCBrW/qaQXYzbZ7iyMLCn63pdsI6VE7xjk39B/91jFfefjItWbrkt/AdCnq/HSdIp/OT15BCV5whXRazEGCoFi3m+HmeNZYSD2I4+ajrR4RXjzRhRrbPtranxQHKwTdavteRf8KihA5y7ExDMbyd6GdLJUaNWSWb5VYgT4SoiJy9+0cuDrM/hnqpPoHIwhjVO5DT8pc6QGenXa6Ysblo8fu1/g== 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=e/rNLgZyzZ6VUodTt4yEHs9rX6Uw0ih3HvVKXJasi7g=; b=Fd7BlPPtDuZ6i6mGra88zaOEq65866iCI/3wjGB0QnqaYMFpLR+PN77rWHgUod4aH92kSwDxTvb1DK7wCRka1WIxbVmAvaOWfKY64ZkyQ+bvXLTlkb8LY9n5HLAjujEE6tu0KL+DFsX5a1sJzS5K6CQFrQHbPTQoImauuREE1QThEunEWkCGkDuk1MI5G0k8syCfpDod3equ+I/boC3vBM4H4jdgh4a69cmj7OvrGGwGS+FbrR1KnxK300VCZXqO847vjnwOlUPIUlsy0aopx94Tz2ybI6zlgml8qQAKoV8Tc97tnHL4ld8yi+WJvnXnu3q9/bCnbVJbJ9F25vd+sQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.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=e/rNLgZyzZ6VUodTt4yEHs9rX6Uw0ih3HvVKXJasi7g=; b=o06aqg1BRQqzEgKGgyH7zDlJgBtiICwmV90/ymWRuzULVdmzFTIO5Zj2J26Rg8sJGnCX/Gf3DbzLEtEi7tH1K0bhOaV3durUmQ68sO2P1A1VElQLiuFBP2wKgq9cV0sB4a4tiXzL0XWwDFzma99+OnoEErfSw5ICiEfI9vLJ4vM= Received: from DS7PR05CA0102.namprd05.prod.outlook.com (2603:10b6:8:56::22) by IA1PR12MB6386.namprd12.prod.outlook.com (2603:10b6:208:38a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.16; Tue, 13 Sep 2022 14:48:48 +0000 Received: from CY4PEPF0000B8EF.namprd05.prod.outlook.com (2603:10b6:8:56:cafe::3b) by DS7PR05CA0102.outlook.office365.com (2603:10b6:8:56::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.5 via Frontend Transport; Tue, 13 Sep 2022 14:48:48 +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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000B8EF.mail.protection.outlook.com (10.167.241.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.9 via Frontend Transport; Tue, 13 Sep 2022 14:48:48 +0000 Received: from tr4.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.28; Tue, 13 Sep 2022 09:48:46 -0500 From: Alex Deucher To: , CC: , , , , , , , , Alex Deucher Subject: [PATCH 2/3] drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega Date: Tue, 13 Sep 2022 10:48:31 -0400 Message-ID: <20220913144832.2784012-3-alexander.deucher@amd.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220913144832.2784012-1-alexander.deucher@amd.com> References: <20220913144832.2784012-1-alexander.deucher@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-TrafficTypeDiagnostic: CY4PEPF0000B8EF:EE_|IA1PR12MB6386:EE_ X-MS-Office365-Filtering-Correlation-Id: 6257bc7d-d2b1-4202-21be-08da959710f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vGXlls4iG597JmDlzljDK2pdisgVD9fPt1tPcCvGr1+Vtn8ErA05KGDz5kMyroQfbqXXqoyJZRNh2fYrMHTT2226izMmrwu/PYfm5vxH5R5JAzy0W6EnxwSQcjpLLkGpOInf32G2lYM2V46TClA4wWecap7E75At9Sfiox7lniUYyYnXlPJukBoYMkfrpv2EbkAHOA9VhdL7PmaTCa5jHe6eiEL3SL5xFf6fagURgLR6Y5kzMq6OFPvPonie8gMEdDzVsJrhbMGqErqk3np4tVd5q6xNNdckhC6Uv1O/wGa7GKxYxnG1B7tXHGUnwoLzccbkjC89N40JzBpbw1+OLSKfjqKow5Ek4ZT3XQTWkffOdGPAY0R/qkM4p5jtvQXjZWyGXMqqWUbimqBwHXjxKgormiQlzvw+Sa2cZ5bnCV0R0mrpYArxNXHFxvHUwFlwZ/ijAxBCLiFAfFswFS0nXBYpgEgqVXXfYq+l9wL/46Wcjqz7lgmQBbgo+yR6ud6mZX2nP8Oi12oQPTWR4+Xix5bJWVNbKXKQ4cOGl2naWzOYg9BpnnS90p/OJRp+GGsWhPgZ4BkPCNMKYnH5iPuDgGYj2d0ORdYOng8jr4GBX2QTLDgVq85Knx4ST5+ls5Sk5OfIxgv1bS6QUEPIbjvsvRy0oBYqOLj0bietya7tHelO7vPRVTW0B6JQ/wkx/mWUGINk7lrymdwtdvOpq4yV8tpfDEZvUKDyCNAW43pHIruLlxm02GY3AaN0Pfz/aQYKDXH6VZDalBVMjmL9gRuyQRptDwp+Q6MP5lR7EC0rqWAXhYz5qDjXyM0nP+mzB3cV6BdQD9nKWT4Bd/i3zsOG3w== 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:(13230022)(4636009)(346002)(376002)(396003)(39860400002)(136003)(451199015)(46966006)(40470700004)(36840700001)(82310400005)(7696005)(16526019)(83380400001)(82740400003)(5660300002)(316002)(7416002)(47076005)(26005)(426003)(4326008)(356005)(81166007)(36756003)(966005)(70586007)(8676002)(70206006)(86362001)(41300700001)(110136005)(2906002)(1076003)(6666004)(40460700003)(36860700001)(336012)(478600001)(40480700001)(2616005)(186003)(54906003)(8936002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 14:48:48.2156 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6257bc7d-d2b1-4202-21be-08da959710f2 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: CY4PEPF0000B8EF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6386 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This mirrors what we do for other asics and this way we are sure the sdma doorbell range is properly initialized. There is a comment about the way doorbells on gfx9 work that requires that they are initialized for other IPs before GFX is initialized. However, the statement says that it applies to multimedia as well, but the VCN code currently initializes doorbells after GFX and there are no known issues there. In my testing at least I don't see any problems on SDMA. This fixes the Unsupported Request error reported through AER during driver load. The error happens as a write happens to the remap offset before real remapping is done. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216373 The error was unnoticed before and got visible because of the commit referenced below. This doesn't fix anything in the commit below, rather fixes the issue in amdgpu exposed by the commit. The reference is only to associate this commit with below one so that both go together. Fixes: 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 5 +++++ drivers/gpu/drm/amd/amdgpu/soc15.c | 22 ---------------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c index 0cf9d3b486b2..7fe8bf3417db 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c @@ -1504,6 +1504,11 @@ static int sdma_v4_0_start(struct amdgpu_device *adev) WREG32_SDMA(i, mmSDMA0_CNTL, temp); if (!amdgpu_sriov_vf(adev)) { + ring = &adev->sdma.instance[i].ring; + adev->nbio.funcs->sdma_doorbell_range(adev, i, + ring->use_doorbell, ring->doorbell_index, + adev->doorbell_index.sdma_doorbell_range); + /* unhalt engine */ temp = RREG32_SDMA(i, mmSDMA0_F32_CNTL); temp = REG_SET_FIELD(temp, SDMA0_F32_CNTL, HALT, 0); diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index e6a4002fa67d..d9914052d20d 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15.c +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c @@ -1211,22 +1211,6 @@ static int soc15_common_sw_fini(void *handle) return 0; } -static void soc15_doorbell_range_init(struct amdgpu_device *adev) -{ - int i; - struct amdgpu_ring *ring; - - /* sdma/ih doorbell range are programed by hypervisor */ - if (!amdgpu_sriov_vf(adev)) { - for (i = 0; i < adev->sdma.num_instances; i++) { - ring = &adev->sdma.instance[i].ring; - adev->nbio.funcs->sdma_doorbell_range(adev, i, - ring->use_doorbell, ring->doorbell_index, - adev->doorbell_index.sdma_doorbell_range); - } - } -} - static int soc15_common_hw_init(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; @@ -1246,12 +1230,6 @@ static int soc15_common_hw_init(void *handle) /* enable the doorbell aperture */ soc15_enable_doorbell_aperture(adev, true); - /* HW doorbell routing policy: doorbell writing not - * in SDMA/IH/MM/ACV range will be routed to CP. So - * we need to init SDMA/IH/MM/ACV doorbell range prior - * to CP ip block init and ring test. - */ - soc15_doorbell_range_init(adev); return 0; } From patchwork Tue Sep 13 14:48:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 12974933 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 03BDFC6FA82 for ; Tue, 13 Sep 2022 15:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236243AbiIMP4a (ORCPT ); Tue, 13 Sep 2022 11:56:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236710AbiIMP4C (ORCPT ); Tue, 13 Sep 2022 11:56:02 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20606.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::606]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFED38F97B for ; Tue, 13 Sep 2022 07:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VYW5dOSV2YJ/bEycTkgehVKuVbH6csf1NfO5pjEbfEPfQujgjC955rWRN8naR7Mk19TVlO4mSoRm2errgQVqqnUzitTcxwTQRPapFBVjP/+7tX0U7mI45dukAa7do1BmDrB86bgq7MUB5FNXxcrwg/zbhRTioCBpZpGObckI6FHkGYfyM9JVxURqADAebsfkVYPXZjSFiIRaRms0B8bZdNLVGGdzNbup1Ct/lGpy7da9bK5P2GCTCEOd+7lTY+zAohXGPeuhBcN7ddnnWqMXot6SV/+kyLxMtRY/4YVO1j2fYz2LX9oK/6piF9br/s6Vywj/1MNhGhxPp6swhoFUqA== 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=LMvJ0cK1RtZ4HhvKKjbtYOgW4IAD+9M5R56NNR8pkoU=; b=IPtVNTjA7dMEDLljx5sgPP0MYJngVrm7mgO18oGjQ4f4JWkOaMrYdbMhYfVfHxz5b722czhY5A47jUElc9qkO9NNRXBs9LlviVPIiwdsDIiTNpnxM66hCU2Hvu7AsSiPAQ5pR3+XCfCr1BlV+5wxqVFuuSEHNaXtDkmmaCkwEnDbTAii1AmGV5O8w5hoDdH0CL/sQP8rMfwe8PW4pOUT9L/S3PlRWqBt4wiiV5CK0Dx4s58O3SWC5iSuFBwCiatPnjdMOJbJKDoa/sbybnd2VxgAa6JbmsekGZgBv4SJdwuzcfU+FRQRsccOY4h3zZyMtAMno4VosmwL6kUjzIBr5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.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=LMvJ0cK1RtZ4HhvKKjbtYOgW4IAD+9M5R56NNR8pkoU=; b=CV6INuQN8jBAEXQKlU6PgB3pLmto6HGnY4RPbF32fhV+yiMYdcBbkR2QSoFHfn333aDTlVC21stedL5ACZPt1HXE49LaM7D3FXFklPBF5nR0gVj1t7Odf94TKEs7lY6b9tGNMIgtQSf42D+xC5D3vG3u5RchtAAUX3qwR++QMa0= Received: from DS7PR05CA0098.namprd05.prod.outlook.com (2603:10b6:8:56::8) by DS7PR12MB6288.namprd12.prod.outlook.com (2603:10b6:8:93::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.19; Tue, 13 Sep 2022 14:48:49 +0000 Received: from CY4PEPF0000B8EF.namprd05.prod.outlook.com (2603:10b6:8:56:cafe::9c) by DS7PR05CA0098.outlook.office365.com (2603:10b6:8:56::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.5 via Frontend Transport; Tue, 13 Sep 2022 14:48:49 +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; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000B8EF.mail.protection.outlook.com (10.167.241.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.9 via Frontend Transport; Tue, 13 Sep 2022 14:48:48 +0000 Received: from tr4.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.28; Tue, 13 Sep 2022 09:48:47 -0500 From: Alex Deucher To: , CC: , , , , , , , , Alex Deucher Subject: [PATCH 3/3] drm/amdgpu: make sure to init common IP before gmc Date: Tue, 13 Sep 2022 10:48:32 -0400 Message-ID: <20220913144832.2784012-4-alexander.deucher@amd.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220913144832.2784012-1-alexander.deucher@amd.com> References: <20220913144832.2784012-1-alexander.deucher@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-TrafficTypeDiagnostic: CY4PEPF0000B8EF:EE_|DS7PR12MB6288:EE_ X-MS-Office365-Filtering-Correlation-Id: 19cb231a-9c84-4845-cef0-08da9597115f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /muC4vf1lma2wu4hSTmKqdlCRdiUTwKxkiGbYiNHyDXjvtKRVhidamxH+X8lj5XrJtsP4sheF4RNccDqWdYokb4YbrzHaJdj510SbhaYCMxr4S5oSRSq5te4AFghyz15eoD8ChJtVYczgswmFC2U+oVp1CGpgHRke+hoafcQztb9QduPncV3G7GdbvNqlGVs0gNXYl0DA7SgEPrdbqfIa8Fqn+TzyEw5NPhZP6ZxjVekFeurvkWqCuUsqMy1HwKKDnDxhFjMVP3ROPW84JsnnxFqxzjK1rJAp/t9Q7Z/Ee1dRFSFsspFM/s4+cYyWTO2dD1I5T9IeMdsc0Q1X+cCGh+25+S3q/879IuMTFs6XzRtD1uH+vLYG3zEVQ6fZJd+q0UeM9ahFAYWEpl5Amz2/Y6Q+UqGihaxSZZZ/r1EHNFyA0Z+lAykDsMRDA23+ZMU8WPgqWiXqd3dStUbUYd0p+I8CZ8zXnRE0IGAjoWDqkOuafyIe/06EuQ+KL1TZ9va5AHboLslksIA3N1j6QiYmhOmFgdbTmOVbHUH1nKHKa75hNorDGDo6aB8w3qS//go7CUZskkNCFkD1UWLPREt5SH6MXZ/c90jSE/0Y+cSY11QgcPfJvJ9lu5peOlAcmwuVQ/TOhfS5ELvmxSm4Ulax31HZwKUX+W9JxreyNsD5h0EM12z2lzOndFhNOi7soerGEALek15x9CLSeJfPQ5iKFC979+Wigspj5fSZtWfUckfYAghUJnqhzCa+G/iEuLBwMdeN2YgZCQMZPC1Oa1ZgcwW4LDxmn00k1mZ87hlnzy1o9ESNQ0MsVR06+C4dqVgNazgyTGxRyJrs2eBjMRoHQ== 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:(13230022)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199015)(40470700004)(46966006)(36840700001)(356005)(8936002)(47076005)(70206006)(8676002)(2906002)(2616005)(86362001)(4326008)(478600001)(82310400005)(186003)(36756003)(41300700001)(26005)(16526019)(966005)(40460700003)(7696005)(36860700001)(336012)(81166007)(110136005)(1076003)(40480700001)(82740400003)(54906003)(316002)(7416002)(6666004)(5660300002)(426003)(83380400001)(70586007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 14:48:48.9345 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19cb231a-9c84-4845-cef0-08da9597115f 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: CY4PEPF0000B8EF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6288 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Move common IP init before GMC init so that HDP gets remapped before GMC init which uses it. This fixes the Unsupported Request error reported through AER during driver load. The error happens as a write happens to the remap offset before real remapping is done. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216373 The error was unnoticed before and got visible because of the commit referenced below. This doesn't fix anything in the commit below, rather fixes the issue in amdgpu exposed by the commit. The reference is only to associate this commit with below one so that both go together. Fixes: 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 899564ea8b4b..4da85ce9e3b1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2375,8 +2375,16 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) } adev->ip_blocks[i].status.sw = true; - /* need to do gmc hw init early so we can allocate gpu mem */ - if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) { + if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_COMMON) { + /* need to do common hw init early so everything is set up for gmc */ + r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev); + if (r) { + DRM_ERROR("hw_init %d failed %d\n", i, r); + goto init_failed; + } + adev->ip_blocks[i].status.hw = true; + } else if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) { + /* need to do gmc hw init early so we can allocate gpu mem */ /* Try to reserve bad pages early */ if (amdgpu_sriov_vf(adev)) amdgpu_virt_exchange_data(adev); @@ -3062,8 +3070,8 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev) int i, r; static enum amd_ip_block_type ip_order[] = { - AMD_IP_BLOCK_TYPE_GMC, AMD_IP_BLOCK_TYPE_COMMON, + AMD_IP_BLOCK_TYPE_GMC, AMD_IP_BLOCK_TYPE_PSP, AMD_IP_BLOCK_TYPE_IH, };