Re: [PATCH] quiet non-x86 option ROM warnings

From: Gabriel Paubert
Date: Fri Feb 18 2005 - 07:16:58 EST


On Thu, Feb 17, 2005 at 05:56:03PM -0500, Jon Smirl wrote:
> On Fri, 18 Feb 2005 09:45:50 +1100, Benjamin Herrenschmidt
> <benh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> > Can't the size be obtained like any other BAR ?
>
> yes, but cards that don't fully decode their ROM address space can
> waste memory in copy_rom. For example I have a card around here that
> reports a BAR address space of 128K and has a 2K ROM in it. You only
> want to copy the 2K, not the 128K.

Indeed, but they normally repeat by powers of 2, ignoring
high order address bits. Is it that hard to detect?

For example if it declares 128k, compare the two halves, reduce
to 64k if equal. Lather, rinse, repeat.

It's equivalent to reading the BAR declared size twice in
the worst case, so it's not that bad performance-wise.

That would only be in the case of an unknown signature
in the first bytes, otherwise the third byte gives you
the size IIUC.

Gabriel
-
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/