All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Hans de Goede <hansg@kernel.org>
Cc: David Airlie <airlied@linux.ie>, Andi Kleen <ak@linux.intel.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/3] agp/amd64: Remove support for probing unlisted PCI devices
Date: Mon, 7 Jul 2025 20:00:41 +0200	[thread overview]
Message-ID: <aGwLSeX3gZmjJ48_@wunner.de> (raw)
In-Reply-To: <20250707173710.313701-4-hansg@kernel.org>

On Mon, Jul 07, 2025 at 07:37:10PM +0200, Hans de Goede wrote:
> AMD64 boards with AGP support are so old that the agp_amd64_pci_table
> should be complete and there is no need to probe unlisted PCI devices,
> so lets completely remove support for probing unlisted PCI devices.
[...]
> --- a/drivers/char/agp/amd64-agp.c
> +++ b/drivers/char/agp/amd64-agp.c
> @@ -734,47 +733,10 @@ static struct pci_driver agp_amd64_pci_driver = {
>  /* Not static due to IOMMU code calling it early. */
>  int __init agp_amd64_init(void)
>  {
> -	struct pci_dev *pdev = NULL;
> -	int err = 0;
> -
>  	if (agp_off)
>  		return -EINVAL;
>  
> -	err = pci_register_driver(&agp_amd64_pci_driver);
> -	if (err < 0)
> -		return err;
> -
> -	if (agp_bridges_found == 0) {
> -		if (!agp_try_unsupported && !agp_try_unsupported_boot) {
> -			printk(KERN_INFO PFX "No supported AGP bridge found.\n");
> -#ifdef MODULE
> -			printk(KERN_INFO PFX "You can try agp_try_unsupported=1\n");
> -#else
> -			printk(KERN_INFO PFX "You can boot with agp=try_unsupported\n");
> -#endif
> -			pci_unregister_driver(&agp_amd64_pci_driver);
> -			return -ENODEV;
> -		}
> -
> -		/* First check that we have at least one AMD64 NB */
> -		if (!amd_nb_num()) {
> -			pci_unregister_driver(&agp_amd64_pci_driver);
> -			return -ENODEV;
> -		}

Here the PCI driver used to be unregistered if no AGP bridges were found
and successfully probed...

> -
> -		/* Look for any AGP bridge */
> -		for_each_pci_dev(pdev)
> -			if (pci_find_capability(pdev, PCI_CAP_ID_AGP))
> -				pci_add_dynid(&agp_amd64_pci_driver,
> -					      pdev->vendor, pdev->device,
> -					      pdev->subsystem_vendor,
> -					      pdev->subsystem_device, 0, 0, 0);
> -		if (agp_bridges_found == 0) {
> -			pci_unregister_driver(&agp_amd64_pci_driver);
> -			err = -ENODEV;
> -		}
> -	}
> -	return err;
> +	return pci_register_driver(&agp_amd64_pci_driver);
>  }

... and now the PCI driver will be kept around.  Is that intentional?

Keeping the PCI driver around only makes sense if an AGP bridge is
later on hot-plugged.  I guess that never happens with AGP bridges,
at least it's not supported by this driver so far.

Thanks,

Lukas

  reply	other threads:[~2025-07-07 18:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-07 17:37 [PATCH 0/3] agp/amd64: Remove support for probing unlisted PCI devices Hans de Goede
2025-07-07 17:37 ` [PATCH 1/3] agp/amd64: Check AGP Capability before binding to unsupported devices Hans de Goede
2025-07-07 17:37 ` [PATCH 2/3] agp/amd64: Change agp_try_unsupported default to 0 Hans de Goede
2025-07-07 17:37 ` [PATCH 3/3] agp/amd64: Remove support for probing unlisted PCI devices Hans de Goede
2025-07-07 18:00   ` Lukas Wunner [this message]
2025-07-07 18:12 ` [PATCH 0/3] " Andi Kleen

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=aGwLSeX3gZmjJ48_@wunner.de \
    --to=lukas@wunner.de \
    --cc=airlied@linux.ie \
    --cc=ak@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hansg@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.