Re: [PATCH] add PCI ROMs to sysfs
From: Martin Mares
Date: Sat Aug 14 2004 - 04:51:50 EST
> I removed the call to pci_assign_resource(). The sysfs attribute code
> builds the attributes before the pci subsystem is fully initialized.
> specifically before arch pcibios_init() has been called. If
> pci_assign_resource() is called for the ROM before pcibios_init() the
> kernel's resource maps have not been built yet. This will result in the
> ROM being assigned a location on top of the framebuffer; as soon as it
> is enabled the system will lock. Right now the code relies on the BIOS
> getting the ROM address set up right. If we can figure out how to
> initialize the sysfs attributes after pcibios_init() then I can put the
> assign call back.
If I understand correctly, you don't need that. Just don't map the ROM
before somebody explicitly requests it -- be it either some driver
or sysfs. In both cases, the PCI subsystem is already initialized.
> I think the decoder sharing problem is being blown out of proportion
> there are very few boards with this problem.
Yes, but it's no excuse for writing code which triggers these problems
if there is an easy way how to do that more safely.
> Also, one card I have has a 256MB PCI window over a 48KB ROM. If I use
> the window size instead of true size for a copy I would waste a lot of
BTW, if the card doesn't share decoders, is there any need to create
a copy of the ROM? If not, no memory gets wasted.
Have a nice fortnight
Martin `MJ' Mares <mj@xxxxxx> http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
How an engineer writes a program: Start by debugging an empty file...
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/