Re: [PATCH] add PCI ROMs to sysfs

From: Vojtech Pavlik (vojtech_at_suse.cz)
Date: 07/31/04

  • Next message: William Lee Irwin III: "Re: drm - first steps towards 64-bit correctness.."
    Date:	Sat, 31 Jul 2004 12:03:18 +0200
    To: Jon Smirl <jonsmirl@yahoo.com>
    
    

    On Fri, Jul 30, 2004 at 02:53:25PM -0700, Jon Smirl wrote:
    > Here's another grungy thing I needed to do to PCI. Multi-headed video
    > cards don't really implement independent PCI devices even though they
    > look like independent devices. I've heard that this behavior is needed
    > for MS Windows compatibility.
    >
    > I'm missing a PCI call to claim ownership for the secondary device
    > without also causing a second instance of my driver to be loaded.
    > Here's the code I'm using, what's the right way to do this?
    >
    > struct pci_dev *secondary;
    > /* check the next function on the same card */
    > secondary = pci_find_slot(dev->pdev->bus->number, dev->pdev->devfn +
    > 1);
    > if (secondary) {
    > /* check if class is secondary video */
    > if (secondary->class == 0x038000) {
    > DRM_DEBUG("registering secondary video head\n");
    > /* This code is need to bind the driver to the secondary device */
    > /* There is no direct pci call to do this, there should be one */
    > secondary->dev.driver = dev->pdev->dev.driver;
    > device_bind_driver(&secondary->dev);
    > /* dev->pdev->driver is not filled until after probe completes */
    > secondary->driver = to_pci_driver(dev->pdev->dev.driver);
    > pci_dev_get(secondary);
    > }
    > }

    You can do that, but where is the problem with your probe function being
    called twice - once for each of the devices? You should be able to sort
    out which one is which rather easily.

    -- 
    Vojtech Pavlik
    SuSE Labs, SuSE CR
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: William Lee Irwin III: "Re: drm - first steps towards 64-bit correctness.."

    Relevant Pages

    • Re: [PATCH] add PCI ROMs to sysfs
      ... Here's another grungy thing I needed to do to PCI. ... cards don't really implement independent PCI devices even though they ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: SATA SCSI device numbering - Im confuzed! - Help!
      ... That four sata ports can be several separate PCI devices and it all depends ... Ignoring ACPI timer override. ... Allocate Port Service ... nv_sata: Secondary device removed ...
      (Linux-Kernel)
    • Re: The ultimate TOE design
      ... > still does), Southbridge, DDR-SDRAM, ancilliary chips for doing MAC, PHY, ... > Jeff was implying using garden-variety processors which seem to have large ... power from PCI. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [bk pull] DRM tree - stop i830/i915 in kernel
      ... > It just disables to have both builtin, no both modular. ... PCI ID is me, and in X.org with the i915 it picks the i830 driver and it ... pam_smb / Linux DecStation / Linux VAX / ILUG person ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • RE: Help regarding PCI Express hot Plug functionality in kernel 2 .6.8
      ... Help regarding PCI Express hot Plug functionality in kernel 2 ... > Please help me in investigating linux kernel 2.6.8 fot its hotplugging ... > Is it support this and I not the what are the limitations and problems. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)