[lkml]   [2005]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    SubjectRe: Ignore disabled ROM resources at setup

    On Tue, 30 Aug 2005, Benjamin Herrenschmidt wrote:
    > I was just testing a slightly different one that appear to fix the
    > problem :
    > + rom_addr = region.start | (res->flags & PCI_REGION_FLAG_MASK);

    I worry about this one. It's not really correct. The low en bits are
    "reserved", and while I don't know whether writing zero is always correct,
    I do know that just writing the low 4 bits with the old value is a bit
    strange. And the flags don't save the other bits.

    So I'd prefer either my previous diff, or one that just re-reads the bits
    entirely, something like the appended..

    What does the PCI spec say about the reserved bits? Do we have to save


    diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
    --- a/drivers/pci/rom.c
    +++ b/drivers/pci/rom.c
    @@ -24,9 +24,16 @@
    static void pci_enable_rom(struct pci_dev *pdev)
    u32 rom_addr;
    + struct resource *res = pdev->resource + PCI_ROM_RESOURCE;
    + struct pci_bus_region region;

    + if (!res->flags)
    + return;
    + pcibios_resource_to_bus(pdev, &region, res);
    pci_read_config_dword(pdev, pdev->rom_base_reg, &rom_addr);
    - rom_addr |= PCI_ROM_ADDRESS_ENABLE;
    + rom_addr &= ~PCI_ROM_ADDRESS_MASK;
    + rom_addr |= region.start | PCI_ROM_ADDRESS_ENABLE;
    pci_write_config_dword(pdev, pdev->rom_base_reg, rom_addr);

    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: 2009-11-18 23:46    [W:0.025 / U:68.980 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site