Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4041236pxf; Tue, 16 Mar 2021 04:26:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzD8/qmQMBVHrxyeNR83rrre951b+QAkOV+rAUmuBUNRdka4gjZNrkhAHwIXEY33KFjiXqL X-Received: by 2002:a17:906:a44f:: with SMTP id cb15mr28586261ejb.420.1615893983088; Tue, 16 Mar 2021 04:26:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1615893983; cv=pass; d=google.com; s=arc-20160816; b=H3LRDpyQm9El39GMo/6eyLEkJU1qYO6NZweuiylxDZFobzU6K674ik1qLmEKbqMAuA DwDnmEW6S22qh55pNHhlmg3LS4WPB+51jwH8ISCWldzo3XTX399OpJ7tHhMAJ9+a4m1Q vaysFzel3iqZ6fmhN4NdQ8VmyYyGIUBCKX8y5xqh5hkoubNhkJRmz5SxFjKkGwUbSTAg Co7xydc/SIfzWRg5M9XqAXhAUnv6lyLLCL/1B7rxStrrhXSfvL54Ba/plvjAwr6a9qWD 5ey+Pcal38nqHBeCKlaSGQgLeP3cKVLRRt0N+UNPgq2lFkhW0Ja+hJiPoNTef1ezv4e1 B+lw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date; bh=Tyl2hoYLel169cE/+mDQDd0Lt5fJA9qZWU4FnGNXbJI=; b=Eqe1Db7dLYNTqxcfwVcaqiXJPihEpHG7EeHW1tDWNrw1YEXKjn2Mh2v3ts4Vm5HmLq /aVySoxkX/08IkdCNAck6Q0TG0R4LWIpIHKTINvD/uiKNKcC9abJNEZx3QSAkh2wLUrW bSi5u/AwCmYbrlgQSPkJXwYnBWBpb6uBS9k/qHDhgiCKshsJblEuLXyAlp6ghUbEtCN5 dhpFk+cbmk9A8DVahrTCkMcfrgV26SCh3MlYfPUVhvI5/TBYMZvYkmldskmWVxHANfzk jULHXpY5N70GJeTOVfOJlJfoxS5SOvGMhjeFLWGSYJZ6xMloR+sAtBwdzYdn278pxTha PQNw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=outlook.com.au Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ge14si12060047ejb.716.2021.03.16.04.26.00; Tue, 16 Mar 2021 04:26:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=outlook.com.au Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229713AbhCPDBs (ORCPT + 99 others); Mon, 15 Mar 2021 23:01:48 -0400 Received: from mail-oln040092254088.outbound.protection.outlook.com ([40.92.254.88]:2368 "EHLO APC01-PU1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230087AbhCPDBg (ORCPT ); Mon, 15 Mar 2021 23:01:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GaWWHHZDywqdhdKudIMFB9Di59+jpAorJYvwFOfh3MfY9STascKn/Z8Fwt3MKxPM7SpUc/1Hd8I03OMPi7TnVN7X/+C2/lFvcS85XW/cTFIj0DwB1snu99YXChjR3h0KGQwlyPA/bh0jZiGlX4+v6rDidYLisySNOIeQ3+PRXF51jLh3OuOpF0DIg5RtKXODm6QyDMOK3Dr/YvmKIky8TC9xGMhrlpx5kAOyLN4nG9/koGMrCtkQ+s+BqvIjarKUWPD6Y9yFQygzx4lormPelzNzpDCZddUX3izBAKWI1tDi0JjAJlup3OGaylxq4mOmcUJn8MYMpdaZfFMPIZqQDQ== 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=Tyl2hoYLel169cE/+mDQDd0Lt5fJA9qZWU4FnGNXbJI=; b=dTmjfzJHZa/dJL81Iw1Rj2Qi/Vy5VN978P+bRDG/fcIa/51cjhnKsga2xhwsc/tsbPrtW0NsdSmi265Ok7GO7mlWNPKcaQ8WF6ZVZW2L2QnME74gc+1SHqDg7rWZgrxMcZvNdDfjapqmSqegluXSmlT9KQ7dGNsagsYTpdgqtpw4TiFJLv4y2QXHky1oy2bSlTj5dj0Pb2MwVKPEd0XYwIkJDyvoJ3LtfmS6KzRC4/SRtx39c8NXVQi8Y6y93AMfJpDdD5Xyv+jI6GLtN4JnWyhqnk0Aif1Jju47dKUlalBG/Gg0+CZR+TZRdBj6wfH9oe0Yvc6HUsVCw81ddvC4kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from PU1APC01FT112.eop-APC01.prod.protection.outlook.com (2a01:111:e400:7ebe::48) by PU1APC01HT107.eop-APC01.prod.protection.outlook.com (2a01:111:e400:7ebe::294) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Tue, 16 Mar 2021 03:01:31 +0000 Received: from PSXP216MB0438.KORP216.PROD.OUTLOOK.COM (2a01:111:e400:7ebe::4f) by PU1APC01FT112.mail.protection.outlook.com (2a01:111:e400:7ebe::234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31 via Frontend Transport; Tue, 16 Mar 2021 03:01:31 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A71994C38A722B276A6B0B8151E5A819E574EF0A32B29142B8B4D00A3D82D83C;UpperCasedChecksum:E54319A6D39A535BD78296725950F8AC6D09223ED29BCB43D242B4A308D4BBEB;SizeAsReceived:7862;Count:46 Received: from PSXP216MB0438.KORP216.PROD.OUTLOOK.COM ([fe80::415f:2d37:68bd:23eb]) by PSXP216MB0438.KORP216.PROD.OUTLOOK.COM ([fe80::415f:2d37:68bd:23eb%10]) with mapi id 15.20.3933.032; Tue, 16 Mar 2021 03:01:31 +0000 Date: Tue, 16 Mar 2021 11:01:23 +0800 From: Nicholas Johnson To: Alex Deucher Cc: LKML , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , amd-gfx list Subject: Re: [PATCH 1/1] amdgpu: use MMIO to init atombios if device is Thunderbolt / USB4 attached Message-ID: References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TMN: [r9NpVUoPQFThsq+AuTNDAXK0OZRmt7olp+BGynrQ3uFCKDPdYNfh2/P2oG1kuMHj] X-ClientProxiedBy: ME2PR01CA0097.ausprd01.prod.outlook.com (2603:10c6:201:2c::13) To PSXP216MB0438.KORP216.PROD.OUTLOOK.COM (2603:1096:300:d::20) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from nicholas-dell-linux (2001:4479:c200:d00:bf6a:7b68:e41d:33a3) by ME2PR01CA0097.ausprd01.prod.outlook.com (2603:10c6:201:2c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31 via Frontend Transport; Tue, 16 Mar 2021 03:01:29 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: cc5dffa9-f035-455d-caa7-08d8e827cc66 X-MS-TrafficTypeDiagnostic: PU1APC01HT107: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u47nhmnikYiAwuQ2lgOV2/7biV6MObewTFipuxQCp6BHyz1/UDz2QlQnYNUBVIYAvE0ZX2e3U1YF02IuFpymNTS30RYCrOzs1SUKbfNyF6Z0NoLFO2T1u7tiPglCve2nzrhC2OjTfdqfrLyCas4ejudOr8yt6pe+CMkh3WMW/Vq1NMLD7tpRqwU1GVMVab2gIB74OQTxFqyQK2gcLZN1CeniTyj905DuNCtqUyV+gK+/FzWLqsuNc1UHYhWFK8UhHyOEv4A1T2atiTMQb13TihbBTs67xTpjHdsk+OMgplTWtzUi2ZSDILnSzd1Lj39hA/eWAGRFy6RzKsiETjX4unr5XGgE8+DgoUq3jdEvv4JCP7yKM0mGMnKR6h3KJvmQfgoyF9tClgKlFTYowYqoZWCcL0/cxH+CvEVmSDPvpwY= X-MS-Exchange-AntiSpam-MessageData: AfF/7hTzchJA5XiyLc1IhaaxmnrL9it/Bcdu+g9wC++YHlaiBPcNrQ8qqFvGpj8j7le+z0XKMY3o5e4dFMiduM1dmS8640KzShsHoKaUwvirVlQvZ2idFbfd94uLz4vif4D8cmD1AEN/etm2nUfhkttQgfiPTFNx9ZkcHb6O7PkWmYlz0IrWRaH9PAkD6fyKpLd8wSp3oDQJ3VNkDT7c2A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc5dffa9-f035-455d-caa7-08d8e827cc66 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2021 03:01:31.4437 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: PU1APC01FT112.eop-APC01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU1APC01HT107 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 15, 2021 at 11:05:21AM -0400, Alex Deucher wrote: > On Mon, Mar 15, 2021 at 4:04 AM Nicholas Johnson > wrote: > > > > When using some Thunderbolt hosts using BIOS-assisted PCI enumeration > > with IO BAR assigned, we get an atombios timeout, such as: > > > > [drm:atom_op_jump [amdgpu]] *ERROR* atombios stuck in loop for more than 20secs aborting > > [drm:amdgpu_atom_execute_table_locked [amdgpu]] *ERROR* atombios stuck executing B456 (len 304, WS 4, PS 0) @ 0xB51B > > [drm:amdgpu_atom_execute_table_locked [amdgpu]] *ERROR* atombios stuck executing B104 (len 183, WS 0, PS 8) @ 0xB17E > > amdgpu 0000:08:00.0: amdgpu: gpu post error! > > amdgpu 0000:08:00.0: amdgpu: Fatal error during GPU init > > amdgpu: probe of 0000:08:00.0 failed with error -22 > > > > A workaround is to use MMIO to access ATOMBIOS when device is > > Thunderbolt / USB4 attached. > > Missing your signed-off-by. Also, we can just remove the legacy IO > callbacks altogether. They are leftover from radeon and not required > at all on amdgpu. Sorry, it's been a while; I forgot "-s". And I like your patch much better. I look forward to the day when all new PCIe devices only have 64-bit MMIO_PREF BARs. Thanks for looking at this! If you are still doing work on surprise removal / driver unloading for Thunderbolt, then I am happy to do testing for you. Removal of DRM devices in Linux is the main sore point for me, and I would love to see it through. Regards, Nicholas Johnson > > Alex > > > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c > > index 86add0f4e..5d16ec10d 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c > > @@ -1999,11 +1999,15 @@ int amdgpu_atombios_init(struct amdgpu_device *adev) > > atom_card_info->reg_read = cail_reg_read; > > atom_card_info->reg_write = cail_reg_write; > > /* needed for iio ops */ > > - if (adev->rio_mem) { > > + if (adev->rio_mem && !pci_is_thunderbolt_attached(adev->pdev)) { > > atom_card_info->ioreg_read = cail_ioreg_read; > > atom_card_info->ioreg_write = cail_ioreg_write; > > } else { > > - DRM_DEBUG("PCI I/O BAR is not found. Using MMIO to access ATOM BIOS\n"); > > + if (pci_is_thunderbolt_attached(adev->pdev)) > > + DRM_DEBUG("Device is attached via Thunderbolt / USB4. Using MMIO to access ATOM BIOS\n"); > > + else > > + DRM_DEBUG("PCI I/O BAR is not found. Using MMIO to access ATOM BIOS\n"); > > + > > atom_card_info->ioreg_read = cail_reg_read; > > atom_card_info->ioreg_write = cail_reg_write; > > } > > -- > > 2.30.2 > > > > _______________________________________________ > > amd-gfx mailing list > > amd-gfx@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx