From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from DM1PR04CU001.outbound.protection.outlook.com (mail-centralusazon11010065.outbound.protection.outlook.com [52.101.61.65]) (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 EF0F437B027 for ; Wed, 8 Jul 2026 16:40:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.61.65 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783528811; cv=fail; b=uan/cLmwp0X30Tw8yk3i6jqjyGaOwJigR5DTuchi/QUbHhPOt0iToEU3ghAmiNRoisLjblgGSEzNNHnumLUT1l8V+shOOEnJ0y/Yp5HOKJyrPZqupUCHslXdMlTTJQTa5vC+BK38ztDtkVNSULgr6vLc0uqGOUEn8UuMj4sgzGs= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783528811; c=relaxed/simple; bh=qnu4t6MgGxX7NLLo1Ru5Nu15l2Oi47I2fXOq34C0VgQ=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=nbFKEKqv53QnqYwhdi3CJaJ0xMpS4ylLaC+7vOII7plANW+og1CcIu7MAJDcJiLkQTxctvS0SGBzkO2fAOKZltI56pRdaLr2zQH4BMlqGYvGIyDjleDw15rzXxIotgLQ7+V7Tr2jDhXDfFnn8XzPxT1amIeHxqR5JZDbxVVacNc= 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=Zs9ECW5I; arc=fail smtp.client-ip=52.101.61.65 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Zs9ECW5I" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HuobJjxoVNY7kZuci4Ydq8V6UA35zAhAJCqg1zU+DI67bDDt4KSgNLjWAJDEbEBpfFMj7vlj+eiHZs4vn7mkejlzLvDwgvXOgNskhiIIvFq+Af2/3PmmpKmQauzj8TZJMMH3aIPBVCO6gtGTUFcUqqSqgLboJlfZnlNeWmWZoRwNel+FMMflYUiaCVi5crQ7oIKWyu+uAbkosTqVJP46dv2U1Bszzo2GiqLxDl10WMj0NrVGqYQLr5CdekiYtHyn5KGTVbtl/PfQHX2JaILSX2dy7I6hROrJN1cCGd5RkbNDKiU6bR+2RupAZc7DtCOIgt5viuOatQKSLWh4Dn0eLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=JeWoinbeDXfBAFNHuyRfjJFo/VZYVjGd5gNJcLrMT24=; b=upuGsrsh2ukQ8hWONq7TRDJPF9Gq+Pk9PXwKPGSR7Lorp9sUtRzZOoq3+eOe4Em80XzisBlp4aYbq7MuAjN1y4QKP0chcofr2pyTiu9knZTLQCDE7dFmUWuJx4twUUWGGkkNA99G1FgvBnqiZn0oeX4Qik1tFRCAzzGDvUIFYT8QycY8kNqHEiVbERsHSacFV8gxCPSZ/EChlxtTxxadc8Ky9+lWUZ5/zl5nloSelZZBYUN8xayK2//VVSaiv76RWIYwQmyNrBhkVTmhZ+dFhjoI9TSClA7bM3MrVklJ7fMUJAC1kWytkJEGsV+8nDteydQZkx0WRIRuK1Z4E7smNg== 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=JeWoinbeDXfBAFNHuyRfjJFo/VZYVjGd5gNJcLrMT24=; b=Zs9ECW5IC5gubLZm2jy25HcHsJqfoWALKuqVuU9AM2BrNZttwgpyCypo9M580U/+1o61l+hqdCGkhh49VaW5aFtdKmQzHwH5DV6ZGqqb4asDE5qF0n1aWEt+WG78bPBu0yimll3i4U6w4FO2LnXKDLFUF+Q3HzHgVO6mrk28IlQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH8PR12MB6914.namprd12.prod.outlook.com (2603:10b6:510:1cb::21) by DM4PR12MB6565.namprd12.prod.outlook.com (2603:10b6:8:8c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.18; Wed, 8 Jul 2026 16:40:02 +0000 Received: from PH8PR12MB6914.namprd12.prod.outlook.com ([fe80::2893:177a:72b0:6000]) by PH8PR12MB6914.namprd12.prod.outlook.com ([fe80::2893:177a:72b0:6000%6]) with mapi id 15.21.0181.008; Wed, 8 Jul 2026 16:40:02 +0000 Message-ID: Date: Wed, 8 Jul 2026 11:39:59 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] drm/amd/amdgpu: add firmware file fallback for APU VBIOS discovery Content-Language: en-US To: Oz Tiram , amd-gfx@lists.freedesktop.org Cc: alexander.deucher@amd.com, christian.koenig@amd.com, airlied@gmail.com, simona@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <716a31c5-0484-4ef9-b49e-b71310f92d86@amd.com> <20260705100436.6877-1-oz@shift-computing.de> <42e07bbb-9384-4871-a345-e0fd6c00a772@shift-computing.de> <80f34509-9781-421e-b60f-1b8c772a01a9@shift-computing.de> <8dd56d76-e46d-43b6-831d-27e66fa2879a@amd.com> <0478bdcd-dc55-4eeb-b7a3-6c5e625ac5c1@amd.com> <6e2eaccf-823b-4db2-a4f3-451e5753af8d@shift-computing.de> From: Mario Limonciello In-Reply-To: <6e2eaccf-823b-4db2-a4f3-451e5753af8d@shift-computing.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: CH2PR19CA0030.namprd19.prod.outlook.com (2603:10b6:610:4d::40) To PH8PR12MB6914.namprd12.prod.outlook.com (2603:10b6:510:1cb::21) 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: PH8PR12MB6914:EE_|DM4PR12MB6565:EE_ X-MS-Office365-Filtering-Correlation-Id: 745c6c10-2a97-40d3-e232-08dedd0f8e6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|1800799024|376014|366016|56012099006|4143699003|22082099003|11063799006|18002099003|5023799004|6133799003; X-Microsoft-Antispam-Message-Info: HbBEZwWqP6fw7w1/QqfHndKwI1jsG7T6ttyh5atmZBBkgQMJEi367gBoi3AZO23LJer6Ugt4wUSP2K9OsuaSF7rzVioOSCqkEjmF+Wcufx0IUO8DOO3LHik4H51xIphCbuPAS3W/O3Vc8/FLg6W1tF6OKt855cgXy+uomgI3xQR4RmJ5icJOI5kpo/0zdvoK37V9EVqjtLjC0xcXL0BcLI/XYnMAATGzXW2G3Y90cV2fE39RJnoUNvj6kJ/i2uUM9BSm+WoG2BxkWxi9v8AFZ0pW4E8RZoC8x20DqUzrmIkNGAtaOPJ2Hx/+Ak8Coy79TfzvZLwrFFKGBZ+X6pfkGqO33lE6Tv7tsO2mO+o+4DbbbX4tP9tYQ3Y08Kw4nKsSlSh3kj7bX/G5ribatcCIhW3g3srJx6rq2omcLFdu8qbWqFBIMh7GQFS5BQctVcvmEyAI47e907JE4vPGwSXvbYeUK/azmtMi9lGgQNk98XSk5440J7IC1GGLnzK2hXC5ZHQ51tKCAHTJ8ADpKl3rNAhaWJbxL1L/z7GsEHR5eqbf7xfO343IsXU3/s43rYDwV/CIhncKqfD8KYg6NQx2YnqRr7oWEGozzpn3kAwfPiVs9cgG+iJz3D77jfKHmStzAUkkOHKTPjzqGt5RnQPeyLGTUKnYqlx91QdiLXdTiUA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB6914.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(376014)(366016)(56012099006)(4143699003)(22082099003)(11063799006)(18002099003)(5023799004)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WS8wMC9BL0w2dlh2UTFSRm9zTlZLYUhhb2pNTEhNOTZHWFhVYkh1NGF6dU82?= =?utf-8?B?aG5ZWUxJZXdhSm5GU2U5NUNYMVZ5clo5Qm1YdW1YNnNZTGtlOWYvSkxjQzZL?= =?utf-8?B?bW1waXZ6d0t2UnlGMEFSTUhVUVRkWG5YQzJxU3U1OFVlOWlWUllYQmx0WnQ0?= =?utf-8?B?WENHNUh2ZzAxYmUyL0J3MkxJYmJwekhkYnkzVFhJcTY3NTVYWW14N3NDZ0Uy?= =?utf-8?B?MVJnK1ZPV0cxTXQ2dlRtYUNyZ0htTVVtUmtGamNBOXd6VlY1VGVocno5Y1BQ?= =?utf-8?B?TTZKbzZSNTk5V1I3TFFvR0IvQUdvYVlIUjVlWW5lMjQzcFJ5bERWKyt5cUUy?= =?utf-8?B?bmg0S3NLL1VrZ3NVdW5aN0J5enk2bTR5WmJqVnZGbDcxYzFBa0ZGSkw5Z1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Z0dWFhTVQwZzlzLzIwNmdkcEdSQnBhWXBPKzRm?= =?utf-8?B?d2RaZGtCaEp2UkxsNHpRQ2JINUhBeUk3U0F1TVMvQ2F1WE9FdVZHajhiYW1R?= =?utf-8?B?MkxDREFJY1BGYk1sVFUvM2xveGs2R01hemhJVXhKaGEreGJnd1IxQT09?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 745c6c10-2a97-40d3-e232-08dedd0f8e6a X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB6914.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 16:40:01.9126 (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: 15JZdrNQEjbH5ZYcebasINPQ7t8I3ahcky/CJCxIVF+dOpXgFyyhHSE3Ih63xD082+Jdvn24F3b7HQgJy1XToQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6565 On 7/8/26 11:35, Oz Tiram wrote: > Hi Mario, > > The GPU is internal. It's an AMD RADEON PRO W7800 48GB. > The kernel is built from gentoo-sources-6.18.35. > > I will test the latest sys-kernel/vanilla-sources (7.1.3) and let you know. > > Best regards, Thanks. Can you please test 7.2-rc2? I'll clean up the workaround and propose it for review in parallel. > > Oz > > On 7/8/26 15:13, Mario Limonciello wrote: >> >> On 7/8/26 08:10, Oz Tiram wrote: >>> Hi Mario, >>> >>>  > If you drop that - does this notice still come up? >>> >>> No, the notice does not appear without pci=realloc,assign-busses. The >>> iGPU  stays at its POST bus (0x6A = 106), VFCT matches directly, and >>> it fetches the VBIOS without any mismatch. >>> >>> However, dropping the kernel argument is not an option on this machine: >>> without it the discrete GPU (0x7449) fails to probe entirely: >>> >>>    amdgpu 0000:03:00.0: amdgpu: Fatal error during GPU init >>>    amdgpu 0000:03:00.0: probe with driver amdgpu failed with error -12 >>> >>> The firmware BARs cannot be mapped without resource reallocation, so >>> pci=realloc,assign-busses is required for the dGPU, which in turn >>> reassigns >>> the iGPU to bus 0x0B and triggers the mismatch your patch resolves. >> >> Got it; thanks for clarifying.  I would like to dig a little bit >> futher into that though.  What kernel are you finding this behavior >> and can it still reproduce with 7.2-rc2 if it's older? There was a >> bunch of pci/realloc changes that happened in the last cycle that >> might have helped this. >> >> Also; is it an eGPU (external) or dGPU (internal)? >> >> If it's an dGPU IMO this is arguably a BIOS issue that not enough >> resources were applied in the first place. >> >> Thanks, >> >>> >>> >>> Thank you, >>> >>> Oz >>> >>> >>> On 7/8/26 14:55, Mario Limonciello wrote: >>>> Hi Oz, >>>> >>>> On 7/8/26 07:36, Oz Tiram wrote: >>>>> Hi Mario, >>>>> >>>>> Tested on a Morefine MNAS X1 AI Workstation (AMD Ryzen 7 Pro >>>>> 8845HS / Radeon 780M iGPU) with pci=realloc,assign-busses. >>>>> >>>>> The VFCT entry for the iGPU has PCIBus=106 (0x6A, recorded at POST) >>>>> while the >>>>> runtime bus is 11 (0x0B). Your patch fires exactly as expected: >>>>> >>>>>    amdgpu 0000:0b:00.0: amdgpu: VFCT bus number mismatch: table >>>>> 106 ! = runtime 11, >>>>>        matching by device identity (vendor 0x1002 device 0x1900) >>>>>    amdgpu 0000:0b:00.0: amdgpu: Fetched VBIOS from VFCT >>>>> >>>>> The iGPU initialises fully and drives the framebuffer. >>>>> >>>>> One minor nit: the dev_notice format string ends with \\n (two >>>>> characters) rather >>>>> than \n. The resulting kernel message has a literal "\n" at the >>>>> end. Same issue >>>>> exists in the nearby "too short #2" dev_info -- not introduced by >>>>> your patch, but >>>>> might be worth cleaning up. >>>>> >>>>> Tested-by: Oz Tiram >>>>> >>>> >>>> Thanks for confirming.  Before I split up this patch and post it in >>>> smaller logical pieces can you confirm my proposed root cause is >>>> right that this issue happens because "pci=realloc,assign-busses" >>>> was on your kernel command line? >>>> >>>> If you drop that - does this notice still come up? >>>> >>>> Thanks, >>>> >>>>> On 7/6/26 02:56, Mario Limonciello wrote: >>>>>> >>>>>> >>>>>> On 7/5/26 14:10, Oz Tiram wrote: >>>>>>> Hi Mario, >>>>>>> >>>>>>>    To make sure I understand correctly: are you suggesting that >>>>>>> the bus >>>>>>>    number in the VFCT was legitimate at BIOS POST time, and that >>>>>>>    pci=realloc,assign-busses is what changes it at runtime, >>>>>>> causing the >>>>>>>    mismatch? >>>>>> >>>>>> That's what it sounds like right now.  You can easily drop all the >>>>>> superfluous kernel command line optiosn and see. >>>>>> >>>>>>> >>>>>>>    I'm not familiar enough with the PCI subsystem to know the >>>>>>> right way to >>>>>>>    implement that — could you point me in the right direction? >>>>>> >>>>>> Well there's a variety of ways to do it.  But how about we start >>>>>> here - if we make that specific busnr match optional and instead >>>>>> make a VID/DID match. >>>>>> >>>>>> See if the attached patch helps. >>>>>> >>>>>>> >>>>>>>    Oz >>>>>>> >>>>>>> On 7/5/26 20:37, Mario Limonciello wrote: >>>>>>>> >>>>>>>> >>>>>>>> On 7/5/26 05:04, Oz Tiram wrote: >>>>>>>>> APUs (e.g. AMD Radeon 780M / HawkPoint, PCI 1002:1900) have no >>>>>>>>> dedicated VBIOS ROM chip.  amdgpu_get_bios_apu() attempts four >>>>>>>>> paths >>>>>>>>> before giving up: >>>>>>>>> >>>>>>>>>    1. ACPI VFCT table >>>>>>>>>    2. VRAM BAR read >>>>>>>>>    3. ROM BAR read >>>>>>>>>    4. platform BIOS >>>>>>>>> >>>>>>>>> On some systems all four fail.  The specific case motivating >>>>>>>>> this patch >>>>>>>>> is a hybrid graphics machine (dGPU + APU) where: >>>>>>>>> >>>>>>>>>    - The VFCT table contains the iGPU entry but with a stale >>>>>>>>> PCIBus value >>>>>>>>>      from BIOS POST time (0x6A).  When the kernel boots with >>>>>>>>>      pci=realloc,assign-busses, PCI bus numbers are reassigned >>>>>>>>> dynamically >>>>>>>>>      and the iGPU lands on bus 0x0B at runtime. >>>>>>>>> amdgpu_acpi_vfct_bios() >>>>>>>>>      matches entries by bus number, so the entry is never found. >>>>>>>>>    - The VRAM BAR is unmapped at probe time. >>>>>>>>>    - The ROM BAR is zero (PCI firmware did not assign it). >>>>>>>>>    - No platform BIOS mapping exists. >>>>>>>>> >>>>>>>>> The UEFI GOP driver initialises the iGPU successfully for early >>>>>>>>> display, >>>>>>>>> confirming the hardware is functional.  The VBIOS image data >>>>>>>>> embedded in >>>>>>>>> the VFCT is also valid; only the PCIBus metadata is wrong. >>>>>>>> >>>>>>>> So the BIOS on this machine is actually totally fine; it's just >>>>>>>> when the kernel is booted to reassign busses there is a problem? >>>>>>>> >>>>>>>> In that case; why not detect the kernel was booted this way and >>>>>>>> keep track of the original bus number when reassigned to avoid >>>>>>>> the issue? >>>>>>>> >>>>>>>>> The firmware >>>>>>>>> file can be extracted directly from the VFCT using dd: >>>>>>>>> >>>>>>>>>    dd if=/sys/firmware/acpi/tables/VFCT bs=1 skip=$((0x68)) >>>>>>>>> count=16896 \ >>>>>>>>>       of=/lib/firmware/amdgpu/1002_1900.bin >>>>>>>>> >>>>>>>>> (0x68 is the byte offset of the VBIOS image after the ACPI >>>>>>>>> table header >>>>>>>>> and VFCT_IMAGE_HEADER; the image length 16896 comes from the >>>>>>>>> ImageLength >>>>>>>>> field in VFCT_IMAGE_HEADER.) >>>>>>>>> >>>>>>>>> The driver then prints "Unable to locate a BIOS ROM" and >>>>>>>>> refuses to >>>>>>>>> bind, leaving the APU completely unusable under Linux. >>>>>>>>> >>>>>>>>> Add a fifth fallback: request a firmware file named >>>>>>>>> "amdgpu/_.bin" (e.g. "amdgpu/1002_1900.bin") via >>>>>>>>> request_firmware().  This allows a VBIOS image extracted as >>>>>>>>> above to be >>>>>>>>> placed in /lib/firmware/ and makes the binding succeed without >>>>>>>>> patching >>>>>>>>> ACPI tables or BIOS. >>>>>>>>> >>>>>>>>> The fallback is only reached if all existing paths have already >>>>>>>>> failed, >>>>>>>>> so there is no regression risk for boards where VFCT or ROM BAR >>>>>>>>> work. >>>>>>>> >>>>>>>> What happens if the VBIOS changes in another way one boot to >>>>>>>> another? You might have some other stateful information that >>>>>>>> isn't updated. >>>>>>>> >>>>>>>> The whole thing to me feels like a hack for a behavior we can >>>>>>>> control in the kernel when doing reassignments. >>>>>>>>> >>>>>>>>> Signed-off-by: Oz Tiram >>>>>>>>> --- >>>>>>>>> v2: Fix commit message: clarify that VFCT contains the iGPU >>>>>>>>> entry but >>>>>>>>>      with a stale PCIBus from BIOS POST that mismatches the >>>>>>>>> runtime bus >>>>>>>>>      number assigned by pci=realloc,assign-busses. Explain that >>>>>>>>> the VBIOS >>>>>>>>>      image data is valid and document the dd extraction command >>>>>>>>> and byte >>>>>>>>>      offsets.  Note that the UEFI GOP driver initialises the iGPU >>>>>>>>>      successfully, confirming the hardware is functional. >>>>>>>>> >>>>>>>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 23 +++++++++++++++ >>>>>>>>> ++ ++ ++++ >>>>>>>>>   1 file changed, 23 insertions(+) >>>>>>>>> >>>>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/ >>>>>>>>> drivers/ gpu/ drm/amd/amdgpu/amdgpu_bios.c >>>>>>>>> index aa039e148a5e..86064c753b09 100644 >>>>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c >>>>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c >>>>>>>>> @@ -26,6 +26,7 @@ >>>>>>>>>    *          Jerome Glisse >>>>>>>>>    */ >>>>>>>>>   +#include >>>>>>>>>   #include "amdgpu.h" >>>>>>>>>   #include "atom.h" >>>>>>>>>   @@ -457,6 +458,28 @@ static bool amdgpu_get_bios_apu(struct >>>>>>>>> amdgpu_device *adev) >>>>>>>>>           goto success; >>>>>>>>>       } >>>>>>>>>   +    { >>>>>>>>> +        const struct firmware *fw; >>>>>>>>> +        char fw_name[32]; >>>>>>>>> +        size_t fw_size; >>>>>>>>> + >>>>>>>>> +        snprintf(fw_name, sizeof(fw_name), "amdgpu/ >>>>>>>>> %04x_%04x.bin", >>>>>>>>> +             adev->pdev->vendor, adev->pdev->device); >>>>>>>>> +        if (request_firmware(&fw, fw_name, adev->dev) == 0) { >>>>>>>>> +            adev->bios = kmemdup(fw->data, fw->size, GFP_KERNEL); >>>>>>>>> +            fw_size = fw->size; >>>>>>>>> +            release_firmware(fw); >>>>>>>>> +            if (!adev->bios || !check_atom_bios(adev, fw_size)) { >>>>>>>>> +                amdgpu_bios_release(adev); >>>>>>>>> +            } else { >>>>>>>>> +                adev->bios_size = fw_size; >>>>>>>>> +                dev_info(adev->dev, "Fetched VBIOS from >>>>>>>>> firmware file %s\n", >>>>>>>>> +                     fw_name); >>>>>>>>> +                goto success; >>>>>>>>> +            } >>>>>>>>> +        } >>>>>>>>> +    } >>>>>>>>> + >>>>>>>>>       dev_err(adev->dev, "Unable to locate a BIOS ROM\n"); >>>>>>>>>       return false; >>>>>>>> >>>> >>