[lkml]   [2004]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] add PCI ROMs to sysfs
    --- Jesse Barnes <> 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
    > 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) {
    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

    Do you Yahoo!?
    New and Improved Yahoo! Mail - 100MB free storage!
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:04    [W:0.018 / U:2.588 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site