Re: [PATCH] add PCI ROMs to sysfs

From: Jon Smirl (jonsmirl_at_yahoo.com)
Date: 07/31/04

  • Next message: Rik van Riel: "[PATCH] token based thrashing control"
    Date:	Fri, 30 Jul 2004 15:15:28 -0700 (PDT)
    To: Jesse Barnes <jbarnes@engr.sgi.com>, Greg KH <greg@kroah.com>
    
    

    --- Jesse Barnes <jbarnes@engr.sgi.com> wrote:
    > Jon, am I missing something or is it possible for us to cache the ROM
    > in userspace when it receives the hotplug event? I saw your DRM
    code,
    > and for the case of ROMs at a nonstandard address, we can fixup the
    > address for pci_dev->resource[PCI_ROM_RESOURCE] in pci-quirks,
    > can't we?

    When I was done with the ROM I did this:
    if (r->parent) {
            release_resource(r);
            r->flags &= ~PCI_ROM_ADDRESS_ENABLE;
            r->end -= r->start;
            r->start = 0;
    }
    /* This will disable and set address to unassigned */
    pci_write_config_dword(dev->pdev, PCI_ROM_ADDRESS, 0);
            
    Then when I accessed them I did this:

    /* assign the ROM an address if it doesn't have one */
    if (r->parent == NULL)
            pci_assign_resource(dev->pdev, PCI_ROM_RESOURCE);

    I believe I needed to do this because Xfree was enabling the ROMs
    without telling the kernel. This caused the kernel resource struct to
    get out of sync with the actual state of the ROM.

    If you set pci_dev->resource[PCI_ROM_RESOURCE] to C000:0 won't this
    mess up pci_assign_resource()/release_resource()?

    I wrote this code a while ago so I'm forgetting exactly why I did
    things. There is a variation on this code in drivers/video/aty/radeon_base.c

    =====
    Jon Smirl
    jonsmirl@yahoo.com

            
                    
    __________________________________
    Do you Yahoo!?
    New and Improved Yahoo! Mail - 100MB free storage!
    http://promotions.yahoo.com/new_mail
    -
    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: Rik van Riel: "[PATCH] token based thrashing control"

    Relevant Pages

    • Re: [PATCH] add PCI ROMs to sysfs
      ... I have one card that maps a 40KB ROM with a ... the ROM attribute off. ... Do you Yahoo!? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Standard driver call to enable/disable PCI ROM
      ... I needed to enable a PCI ROM and read a few things ... Do you Yahoo!? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [Dri-devel] Re: [Linux-fbdev-devel] DRM and pci_driver conversion
      ... hardware that uses the same address decoder for ROM and RAM and you can't use ... > Real Good Reason why you want to leave it disabled 99% of the time. ... Do you Yahoo!? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] add PCI ROMs to sysfs
      ... The static resource was from an old version that I ... There's not much sense to the ROM accessing code ... Do you Yahoo!? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • RE: [PATCH] add PCI ROMs to sysfs
      ... My concern about relying on bios to set initial address for ROM ... it is a bug in the radeon hardware. ... Do you Yahoo!? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)