[Intel-gfx] [PATCH v5] vga_switcheroo: Add helper for deferred probing

Lukas Wunner lukas at wunner.de
Tue May 31 10:54:33 UTC 2016


On Mon, May 23, 2016 at 09:23:14AM +0200, Daniel Vetter wrote:
> On Sat, May 21, 2016 at 03:59:16PM +0100, Lukas Wunner wrote:
[snip]
> >  /**
> > + * vga_switcheroo_client_probe_defer() - whether to defer probing a given client
> > + * @pdev: client pci device
> > + *
> > + * Determine whether any prerequisites are not fulfilled to probe a given
> > + * client. Drivers shall invoke this early on in their ->probe callback
> > + * and return %-EPROBE_DEFER if it evaluates to %true. Thou shalt not
> > + * register the client ere thou hast called this.
> 
> I still think we should just smash this into the relevant _register
> functions(), for safety. But I forgot the actual result of the previous
> discussion ...

I've amended the commit message in v6 to summarize the result of the
previous discussion, which was:

    One might be tempted to check deferred probing conditions in
    vga_switcheroo_register_client(), but this is usually called fairly late
    during driver load. The GPU is fully brought up and ready for switching
    at that point. On boot the ->probe hook is potentially called dozens of
    times until it finally succeeds, and each time we'd repeat bringup and
    teardown of the GPU, lengthening boot time considerably and cluttering
    logfiles. A separate helper is therefore needed which can be called
    right at the beginning of the ->probe hook.

Thanks,

Lukas


More information about the Intel-gfx mailing list