Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2323494lqt; Mon, 22 Apr 2024 07:48:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXh1gvlHY1xf5ZCcp6aOeF8fQ3MRsRMgBtI5oqS3iEphxdAi+grXwKtk0bSt/5x7giwRDEUTiuI9F3/6iSPqGMbfpGWI3vDRZDrJcEhcw== X-Google-Smtp-Source: AGHT+IFnWOS3m+FsjvIT46nRQDhYqafMYuj2m/5LDiouNAjd42kzYMWdFcVTgLhGLLh6BoSImg7n X-Received: by 2002:a17:902:c40c:b0:1e4:2b90:7282 with SMTP id k12-20020a170902c40c00b001e42b907282mr14589823plk.14.1713797290163; Mon, 22 Apr 2024 07:48:10 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k15-20020a170902ce0f00b001e47fa9ae58si8187092plg.651.2024.04.22.07.48.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 07:48:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153578-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=EmU2IE11; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-153578-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153578-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9DBB02841B8 for ; Mon, 22 Apr 2024 14:47:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4535F152186; Mon, 22 Apr 2024 14:47:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="EmU2IE11" Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2055.outbound.protection.outlook.com [40.107.93.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DD5F15217C for ; Mon, 22 Apr 2024 14:47:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.55 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713797271; cv=fail; b=VF2gMZrdxeQY7jBdp5A/9Q781HCsqAd26sdtJXJYqwm0s7uuByI3on8QdrN+/iaSJWJE0aMWzB0wJ4sf41Q1k+/GnQDsTRqU+oKqlPZ3OsabZQf1KmfkUJq/YF8RzvfBZBzcz6Vqhb4MW0ks1rIz3LtsAfm40s/DgvBjrUTLsUQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713797271; c=relaxed/simple; bh=PqWbK0yuBJgcrB78fyntY94VNx8G2MfBsTJgzdPbCH0=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=XgcaNmXIqiMrGkWUnQlaHhsyurcXcvaT6jhsHEAvUb2zVQ0MD/v6Cq6/V+3v//ZVkattSE2Nt0ubX/moOwdC/d0tzsBZIILltNM3Frq5rDjapXIT3+3klzsd868XFhMrCLWnIDPJdZtmSlgpO/67QNQHV1+hE0anC68irCLDazE= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=EmU2IE11; arc=fail smtp.client-ip=40.107.93.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZtF6WOX9fcfvpLO62WgFlfNa4Es3nKcRIBov5N3mlZ41pDwPbJI5hXV2x3CgE+om4ZxBG2XJ7FtV/Qx9anG+McfPjISEPvUKAgJwAYV3UFG7kkY/0lA8iTW4bvrmK194baQR6ElrJyoB7fn4jh1eApS5MuCd5XeHbUWO2/7PkjTcMoYIKTEuDuuBQqXLeY5NTpCzl+X/gBDtfmFTlyymagViNAgVgp9tJEgYFORAAbmApNwhWr5wSYFpC2w9SYPPRkJywT0hKvuFEa04KiFQNJTfir/jvkoSLyKb6lJovPuVwhjzQspGedXfiYq2CVFye5NDMlez614X7//COVoOXQ== 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=Zrzmz1EIVLPWs8tzLs6uTH4t8nqT6MPTTStUQzxSZiM=; b=fYNPq2qyRE/n6/qul7nvc3CjPxIGNmNW6+Vcm5DHp0vDkT0+4I8QRkQoq0BGXjUrVZ6NEl1Vh/s/1+3U7wABxYjeZeMiOT2hwOQGVZZwFYFuVS7s6eAib1nsyrYN5koQWgNdDQ2bSA04eZIVtnG+AC8jxZUPqDpA940Cllh+Vw4F7wrHVJerG4NvzM7Yqr2aCmhQ2/0FwgFi+SEXLJOqbHZ69VlcBmp/9DuIVBucl+2qc/dL4fMQWX9ZYJDK8LsHtsNTtOS2vhHXnSD9Rh0sGwl0bWiDz2YK9H7q+gGYkuL+XtrxDZrGc5yQ96A3LO/x7CimEcOUHI7Z+ck9QNgByw== 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=Zrzmz1EIVLPWs8tzLs6uTH4t8nqT6MPTTStUQzxSZiM=; b=EmU2IE11wFQ8EEorqtIlmQaclerA308Q6rRXNBG8OegZpI1GX+QLdqwRwMD3v6LRRU3g+a0RgPMt5njmfcNNVtMYNmjvB+yG90P/gi9vsZJ5zHkYXECrvJLOtQ+xc4MlV2FGHIpqQwFwtZo5Gp1PeCTB/urM3rfQHTy3QOpnNCc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) by SA1PR12MB7269.namprd12.prod.outlook.com (2603:10b6:806:2be::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.42; Mon, 22 Apr 2024 14:47:46 +0000 Received: from PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::f2b6:1034:76e8:f15a]) by PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::f2b6:1034:76e8:f15a%6]) with mapi id 15.20.7472.044; Mon, 22 Apr 2024 14:47:46 +0000 Message-ID: Date: Mon, 22 Apr 2024 16:47:36 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/amdgpu: Fixup bad vram size on gmc v6 and v7 To: Alex Deucher Cc: Qiang Ma , alexander.deucher@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, srinivasan.shanmugam@amd.com, Arunpravin.PaneerSelvam@amd.com, le.ma@amd.com, Felix.Kuehling@amd.com, mukul.joshi@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20240422052608.5297-1-maqianga@uniontech.com> <68f02c5c-5591-4d6f-9926-b0fc6f9f6287@amd.com> Content-Language: en-US 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: FR5P281CA0009.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f2::8) To PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB5685:EE_|SA1PR12MB7269:EE_ X-MS-Office365-Filtering-Correlation-Id: e6f0f2fd-2aea-47a4-f1ba-08dc62db2c34 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ZmJKNTl4T1o5YW5scUErOTlTczVnMmNOOGZ2K1k1ejJiem9pRmVTYVppR0hp?= =?utf-8?B?Tjd6UmlJTGxIL2k1dHM4bkhLejZNcjV3N1IrVWRod3VMSmo4Z3EvM3ZvUTFQ?= =?utf-8?B?Y2RVa3lQV05GeG83RzhndmJ4elZqbXZSVDh1b3BVVXphb0trcTBRNXVYK05a?= =?utf-8?B?N0FlYnhnUkJ5WWlETFJMZEVFejNsMDljRE8zcXA3UXdwR3VBaEVWMEEvckh0?= =?utf-8?B?MEoreHZ6eXZrMGZWQjVud1BXRXhUNld5NnFrWW1wYkNQdUxRTGlTT2NSdU04?= =?utf-8?B?d1R2UVIyM2U5bXpEU1NoL3pTcWdJbnNRVi9NanEyNHk2V09KUC95SmxFcER3?= =?utf-8?B?U0JGOGRpU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5SbzhkanMwaXVoSkF2OUp2T3VLc05lK1JFOU1XOHdPTXZ5eFRHTEsy?= =?utf-8?B?R1RXNjR3bGR3WE4wZC9ZVkJRVTNXQmxRbXAyVEltVjlvelJvaXE1dU5mV0Ft?= =?utf-8?B?TDVUZEdtN1JvYXppTzBGdk5sMkdqK2p1cVFxMS9IaFNhcjBlTFdWMllubTVv?= =?utf-8?B?NlZmSE9KM3p4LzZMdTJDcm52Qk43c0JmZ0c0TjI1Wm5RYlF4aGpwK0dhVUdN?= =?utf-8?B?MDRRUFJSRCsrckxVdjlYS2pQNXVKenZSdnk0eWRjWHRzUDVwQzBWUnpmRGZr?= =?utf-8?B?d2tFdkhwL1BaQjR6ODNnUXBXSzJHdXg0T09tZGtTRkRLZzdIYUxFNElSbGZv?= =?utf-8?B?bUJrVWxEYlJiYXFEN0lDU1ZvTUpQTmVmb0k3UktoVnlkMG1ZVWsvY0FTZDFu?= =?utf-8?B?MTUrOWlOOEVnaFBlUE9vSUdTVHFaVUpMK1JXeUxBbFIzTzlIeDhGdUZ3PT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB5685.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SkVyZE5iN2ZRTHFobnV1dmM4c3hEK1ZTNVkzUktBOEhwRFVGM3Jxc1ZPdTgr?= =?utf-8?B?MmZ3aGxFMmZWckRFemZya08xM3FNdjdwYWQzWnI2Wmh6aFd3VEFXUW1UVjBQ?= =?utf-8?B?R09SL1FDOTVaWUVSMUdkQ0sxUGZsZDYxaXg1NnRYQ2E1RWRuUHp5VWJWc3BQ?= =?utf-8?B?ZWpLVVR6ZEhmRTJ5aVJNc2UzUlpiKzdJU01mMUNLazVwZWZrQ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WEMva1o1bDlXaCtlU1dsaTZTVzZVd3pqdnRh?= =?utf-8?B?RUpGTUpvWUNud2MyaHl6TVQ2UkQySGlHNzFsR2tJbTRiTHpDZXMzWFFwQ1lX?= =?utf-8?Q?0SAaHHp+GLyJayjWXYjz0vgew?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6f0f2fd-2aea-47a4-f1ba-08dc62db2c34 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5685.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2024 14:47:46.1634 (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: cH9dNdeiMAq2Ndyg1Im77U1/ZEvkI4XeK8i1w7nlvw9DONrl2832QrrYe/npoMqf X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7269 Am 22.04.24 um 16:40 schrieb Alex Deucher: > On Mon, Apr 22, 2024 at 9:00 AM Christian König > wrote: >> Am 22.04.24 um 14:33 schrieb Qiang Ma: >>> On Mon, 22 Apr 2024 11:40:26 +0200 >>> Christian König wrote: >>> >>>> Am 22.04.24 um 07:26 schrieb Qiang Ma: >>>>> Some boards(like Oland PRO: 0x1002:0x6613) seem to have >>>>> garbage in the upper 16 bits of the vram size register, >>>>> kern log as follows: >>>>> >>>>> [ 6.000000] [drm] Detected VRAM RAM=2256537600M, BAR=256M >>>>> [ 6.007812] [drm] RAM width 64bits GDDR5 >>>>> [ 6.031250] [drm] amdgpu: 2256537600M of VRAM memory ready >>>>> >>>>> This is obviously not true, check for this and clamp the size >>>>> properly. Fixes boards reporting bogus amounts of vram, >>>>> kern log as follows: >>>>> >>>>> [ 2.789062] [drm] Probable bad vram size: 0x86800800 >>>>> [ 2.789062] [drm] Detected VRAM RAM=2048M, BAR=256M >>>>> [ 2.789062] [drm] RAM width 64bits GDDR5 >>>>> [ 2.789062] [drm] amdgpu: 2048M of VRAM memory ready >>>> Well we had patches like this one here before and so far we always >>>> rejected them. >>>> >>>> When the mmCONFIG_MEMSIZE register isn't properly initialized then >>>> there is something wrong with your hardware. >>>> >>>> Working around that in the software driver is not going to fly. >>>> >>>> Regards, >>>> Christian. >>>> >>> Hi Christian: >>> I see that two patches for this issue have been merged, and the >>> patches are as follows: >>> >>> 11544d77e397 drm/amdgpu: fixup bad vram size on gmc v8 >>> 0ca223b029a2 drm/radeon: fixup bad vram size on SI >> Mhm, I remember that we discussed reverting those but it looks like that >> never happened. I need to ask around internally. >> >> Question is do you see any other problems with the board? E.g. incorrect >> connector or harvesting configuration? > I'll need to dig up the past discussion again, but IIRC, the issue was > only seen on some non-x86 platforms. Maybe something specific to MMIO > on those? I honestly doesn't remember it either, but in general it's the job of the VBIOS to init this register. So if we see the upper bits mangled the VBIOS hasn't done that correctly and it's quite likely that this is only the tip of the iceberg of problems. Christian. > > Alex > > >> Regards, >> Christian. >> >>> Qiang Ma >>> >>>>> Signed-off-by: Qiang Ma >>>>> --- >>>>> drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 11 +++++++++-- >>>>> drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 13 ++++++++++--- >>>>> 2 files changed, 19 insertions(+), 5 deletions(-) >>>>> >>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c >>>>> b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c index >>>>> 23b478639921..3703695f7789 100644 --- >>>>> a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +++ >>>>> b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c @@ -309,8 +309,15 @@ static >>>>> int gmc_v6_0_mc_init(struct amdgpu_device *adev) } >>>>> adev->gmc.vram_width = numchan * chansize; >>>>> /* size in MB on si */ >>>>> - adev->gmc.mc_vram_size = RREG32(mmCONFIG_MEMSIZE) * >>>>> 1024ULL * 1024ULL; >>>>> - adev->gmc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * >>>>> 1024ULL * 1024ULL; >>>>> + tmp = RREG32(mmCONFIG_MEMSIZE); >>>>> + /* some boards may have garbage in the upper 16 bits */ >>>>> + if (tmp & 0xffff0000) { >>>>> + DRM_INFO("Probable bad vram size: 0x%08x\n", tmp); >>>>> + if (tmp & 0xffff) >>>>> + tmp &= 0xffff; >>>>> + } >>>>> + adev->gmc.mc_vram_size = tmp * 1024ULL * 1024ULL; >>>>> + adev->gmc.real_vram_size = adev->gmc.mc_vram_size; >>>>> >>>>> if (!(adev->flags & AMD_IS_APU)) { >>>>> r = amdgpu_device_resize_fb_bar(adev); >>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c >>>>> b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c index >>>>> 3da7b6a2b00d..1df1fc578ff6 100644 --- >>>>> a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +++ >>>>> b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c @@ -316,10 +316,10 @@ >>>>> static void gmc_v7_0_mc_program(struct amdgpu_device *adev) static >>>>> int gmc_v7_0_mc_init(struct amdgpu_device *adev) { >>>>> int r; >>>>> + u32 tmp; >>>>> >>>>> adev->gmc.vram_width = >>>>> amdgpu_atombios_get_vram_width(adev); if (!adev->gmc.vram_width) { >>>>> - u32 tmp; >>>>> int chansize, numchan; >>>>> >>>>> /* Get VRAM informations */ >>>>> @@ -363,8 +363,15 @@ static int gmc_v7_0_mc_init(struct >>>>> amdgpu_device *adev) adev->gmc.vram_width = numchan * chansize; >>>>> } >>>>> /* size in MB on si */ >>>>> - adev->gmc.mc_vram_size = RREG32(mmCONFIG_MEMSIZE) * >>>>> 1024ULL * 1024ULL; >>>>> - adev->gmc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * >>>>> 1024ULL * 1024ULL; >>>>> + tmp = RREG32(mmCONFIG_MEMSIZE); >>>>> + /* some boards may have garbage in the upper 16 bits */ >>>>> + if (tmp & 0xffff0000) { >>>>> + DRM_INFO("Probable bad vram size: 0x%08x\n", tmp); >>>>> + if (tmp & 0xffff) >>>>> + tmp &= 0xffff; >>>>> + } >>>>> + adev->gmc.mc_vram_size = tmp * 1024ULL * 1024ULL; >>>>> + adev->gmc.real_vram_size = adev->gmc.mc_vram_size; >>>>> >>>>> if (!(adev->flags & AMD_IS_APU)) { >>>>> r = amdgpu_device_resize_fb_bar(adev);