Commit:     40ee9e9f8d52d85f2446bbdda7823a3f1de62f3f
Parent:     8d7d86e9bd377e5779bf3c8da03b27d823c039b4
Author:     Jesse Barnes <[EMAIL PROTECTED]>
AuthorDate: Sat Mar 24 11:03:32 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Wed May 2 19:02:35 2007 -0700

    PCI: fix sysfs rom file creation for BIOS ROM shadows
    At one time, if a BIOS ROM shadow was detected for the boot video
    device (stored at offset 0xc0000), we'd set a special resource flag,
    IORESOURCE_ROM_SHADOW, so that the sysfs ROM file code could handle
    it properly.  That broke along the way somewhere though, so current
    kernels will be missing 'rom' files in sysfs if the video device
    doesn't have an explicit ROM BAR.
    This patch fixes the regression by moving the video fixup quirk to a
    little later in the boot cycle (to avoid having its work undone by
    PCI resource allocation) and checking in the PCI sysfs code whether
    a rom file should be created due to a shadow resource, which is also
    moved to a little later in the boot cycle so it will occur after the
    video fixup.  Tested and works on my i386 test box.
    Signed-off-by:  Jesse Barnes <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
 arch/i386/pci/fixup.c   |    2 +-
 drivers/pci/pci-sysfs.c |    5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c
index 8053b17..b62eafb 100644
--- a/arch/i386/pci/fixup.c
+++ b/arch/i386/pci/fixup.c
@@ -354,7 +354,7 @@ static void __devinit pci_fixup_video(struct pci_dev *pdev)
                printk(KERN_DEBUG "Boot video device is %s\n", pci_name(pdev));
  * Some Toshiba laptops need extra code to enable their TI TSB43AB22/A.
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index cd913a2..29676fe 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -620,7 +620,8 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev 
                goto err_bin_file;
        /* If the device has a ROM, try to expose it in sysfs. */
-       if (pci_resource_len(pdev, PCI_ROM_RESOURCE)) {
+       if (pci_resource_len(pdev, PCI_ROM_RESOURCE) ||
+           (pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW)) {
                rom_attr = kzalloc(sizeof(*rom_attr), GFP_ATOMIC);
                if (rom_attr) {
                        pdev->rom_attr = rom_attr;
@@ -695,4 +696,4 @@ static int __init pci_sysfs_init(void)
        return 0;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to