Re: [PATCH 1/4] pci: Update pci_set_vga_state to call arch functions

Andrew Morton
2010-01-26T00:18:43Z

On Mon, 25 Jan 2010 16:09:52 -0800
Mike Travis <travis@sgi.com> wrote:

> >
> > Still, a neater solution might be
> >
> > int arch_pci_set_vga_state(...) __weak
> > {
> > return 0;
> > }
> >
> > and then resolve it at linkage time?
> >
> >
>
> Wouldn't the linked in stronger function then need to surround
> the UV register updating with "if (uv_system)"?

If the file which implements arch_pci_set_vga_state() is present in
vmlinux on non-uv systems then yes.

Presumably that file is arch/x86/kernel/apic/x2apic_uv_x.c, although
that might later become a problem if other sub-architectures a) want to
get at this hook and b) can be linked into vmlinux along with
arch/x86/kernel/apic/x2apic_uv_x.o. But such a kernel wouldn't
actually link, so we'll need to address it at that stage.

If this is a UV-specific hack which other architectures and
sub-architectures are unlikely to need (seems that way?) then I'd be
going for something whcih is simple and minimal.