Re: [PATCH 1/2] vga: implements VGA arbitration on Linux

From: Benjamin Herrenschmidt
Date: Fri Jul 17 2009 - 01:13:29 EST


On Fri, 2009-07-17 at 15:00 +1000, Dave Airlie wrote:
>
> device doesn't decode VGA: normal io/mem locks always pass, legact
> io/mem locks always fail. don't touch main lock
>
> device decodes VGA: (acts like read/write lock)

Well, my initial idea was that even if you are marked as not decoding
legacy, you could still lock it.

The idea here is that if I'm going to just run a quick BIOS routine, ie
temporarily turn on legacy decoding and back off, I can just lock it, do
that, and unlock it.

No need to globally switch yourself to be a legacy decoder globally for
the arbiter (ie, you lock it so you can't lose it, and you'll have
re-disabled legacy decoding by the time you unlock, so there's no need
in getting notified of loss etc....

But you don't have to support that behaviour :-) I just thought it could
come handy.

> asks for normal mem/io locks: if no locks or only other normal locks
> are
> held by devices that decode VGA, then take main lock as a reader and
> enable decodes. If someone holds lock as a write block waiting for it.
>
> asks for VGA mem/io locks, if no locks are held, take main lock as a
> writer. If main lock has readers already, block waiting for a write
> lock
> on it.
>
> Does this sound sane?

Cursory glance it does.

Cheers,
Ben.

> Dave.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci"
> in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

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