mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: "Bjorn Helgaas" <helgaas@kernel.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>
Cc: Oz Tiram <oz@shift-computing.de>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	Reza Nikzad Chaleshori <rezanikzadch@gmail.com>
Subject: Re: [PATCH v3 2/3] drm/amdgpu: Match VFCT using initial PCI bus number
Date: Mon, 26 Oct 2026 10:51:11 -0500	[thread overview]
Message-ID: <16303023-2c73-4296-aa12-5f04b34e5610@amd.com> (raw)
In-Reply-To: <20261026-vfct-regression-v3-2-fe9586ed6978@amd.com>



On 10/26/26 10:48, Mario Limonciello wrote:
> VFCT records the PCI bus number from BIOS POST. The current bus number
> can change after PCI core renumbers the bus, while accepting a mismatch
> based only on device identity can select the wrong VFCT image when
> matching devices are present. Compare against the bus number captured
> from the firmware bus assignment before bridge renumbering.
> 
> Reported-by: Reza Nikzad Chaleshori <rezanikzadch@gmail.com>
> Closes: https://lore.kernel.org/amd-gfx/20261014080523.186533-1-rezanikzadch@gmail.com/
> Fixes: 11c141672045f ("drm/amdgpu: Fix VFCT bus number matching with soft filter")
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

Accidentally lost Alex's tag when I rebased.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 17 +++--------------
>   1 file changed, 3 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> index 08ed1eb695586..051be1905e296 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> @@ -386,10 +386,8 @@ static bool amdgpu_read_disabled_bios(struct amdgpu_device *adev)
>    * VFCT entries contain the PCI bus number as recorded during BIOS POST.
>    * On systems where the kernel renumbers PCI buses (e.g. pci=realloc or
>    * resource conflicts), the runtime bus number may differ from the POST
> - * value.  Match by device identity (vendor + device + function) and use
> - * the bus number as a preference: exact bus match is preferred, but when
> - * the bus numbers disagree we accept the entry if the device identity
> - * matches.
> + * value.  Match using the bus number captured when the device was
> + * discovered, before any bus renumbering.
>    *
>    * Returns: 0 on match, -ENODEV on no match
>    */
> @@ -405,16 +403,7 @@ static int amdgpu_acpi_vfct_match(struct amdgpu_device *adev,
>   	    vhdr->PCIFunction != PCI_FUNC(adev->pdev->devfn))
>   		return -ENODEV;
>   
> -	/* Exact bus number match - preferred */
> -	if (vhdr->PCIBus == adev->pdev->bus->number)
> -		return 0;
> -
> -	/* Bus mismatch but device identity matches (PCI renumbering case) */
> -	dev_notice(adev->dev,
> -		   "VFCT bus number mismatch: table %u != runtime %u, matching by device identity (vendor 0x%04x device 0x%04x)\n",
> -		   vhdr->PCIBus, adev->pdev->bus->number,
> -		   adev->pdev->vendor, adev->pdev->device);
> -	return 0;
> +	return vhdr->PCIBus == adev->pdev->bus->number_initial ? 0 : -ENODEV;
>   }
>   
>   static bool amdgpu_acpi_vfct_bios(struct amdgpu_device *adev)
> 


  reply	other threads:[~2026-10-26 15:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 15:48 [PATCH v3 0/3] Fix amdgpu detection of pci=realloc Mario Limonciello
2026-10-26 15:48 ` [PATCH v3 1/3] PCI: Preserve the initial bus number in pci_bus Mario Limonciello
2026-10-27  4:41   ` Lazar, Lijo
2026-10-26 15:48 ` [PATCH v3 2/3] drm/amdgpu: Match VFCT using initial PCI bus number Mario Limonciello
2026-10-26 15:51   ` Mario Limonciello [this message]
2026-10-26 15:48 ` [PATCH v3 3/3] drm/radeon: " Mario Limonciello
2026-10-26 15:51   ` Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16303023-2c73-4296-aa12-5f04b34e5610@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=oz@shift-computing.de \
    --cc=rezanikzadch@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®