Re: Please revert: PCI: fix IDE legacy mode resources

Alan Cox
2007-12-09T13:43:52Z

> The code now replaces the content of the resource structures with the
> hard-decoded legacy addresses for any IDE controller in legacy mode,
> just losing whatever was there (the real BAR value).

This is correct behaviour. It checks the port is in legacy mode. If the
port is in legacy mode the BAR value is undefined and in some cases
completely random.

> has, I don't know for sure), we have a quirk that puts those controller
> back into native mode. But so far, those quirks didn't change the
> resources as they were supposed to contain the proper BAR values that
> would, from then, be used.

Then your quirk is faulty (for the general case). The BAR values are
undefined at that point, they may not even be writable.

> I suspect any platform with such a quirk to turn IDE controllers into
> native mode will now -also- need to put back the BAR values in the
> struct resource, and do so -before- the platform fixup happens, that is
> from a header quirk.

Improbable unless its willing to rely on entirely undefined behaviour.

If you kick the device out of legacy mode (itself very very board
dependant) then you must find a suitable new resource allocation for the
controller.

Alan