Matthew Garrett ([personal profile] mjg59) wrote2013-08-10 00:23
Entry tags:

When to add a platform-specific quirk to a Linux driver

If you're tempted to add a platform-specific quirk to a Linux driver, pause and do the following:

  1. Check whether the platform works correctly with the generic Windows driver for the hardware in question. If it requires a platform-specific driver rather than the generic one, adding a quirk is probably ok.
  2. If the generic Windows driver works, check whether there's any evidence of platform-specific code in the Windows driver. This will typically be in the .inf file, but occasionally you'll want to run strings against the Windows driver and see whether any functions or strings match the platform in question. If there's evidence of special-casing in the generic Windows driver, adding a quirk is probably ok
  3. If the generic Windows driver works and doesn't appear to have any platform-specific special casing, don't add a quirk. You'll plausibly fix the machine you care about, but you won't fix any others that have the same behaviour. Even worse, if someone does eventually fix the problem properly, there's a risk that your special-casing will now break your system.

The moral to this story is: if you think adding a quirk is the right solution, you're almost certainly wrong.

(Anonymous) 2013-08-10 05:26 (UTC)(link)
0.5) If your quirk works on all platforms, not just your own, that's not a quirk, that's a bugfix; apply it universally. I've seen way too many vendor hacks that should have gone upstream, either in their original form (sans conditional for that vendor) or in some other form that would fix all instances of the driver across the board.

if you want to run Linux, install Windows first

[identity profile] pavelmachek.livejournal.com 2013-08-10 09:59 (UTC)(link)
Then discuss with your lawyer if this is enough of reverse-engineering to be against the EULA, and what other effects EULA you just agreed to may have.
fluffymormegil: @ (Default)

Re: if you want to run Linux, install Windows first

[personal profile] fluffymormegil 2013-08-11 12:07 (UTC)(link)
And whether your jurisdiction allows "no reverse engineering" clauses to be enforced in the first place.

If you want to add a platform-specific quirk to a linux driver, make sure it's supported by Windows

(Anonymous) 2013-08-10 17:09 (UTC)(link)
d'oh.

Re: If you want to add a platform-specific quirk to a linux driver, make sure it's supported by Wind

(Anonymous) 2013-08-11 14:28 (UTC)(link)
Anything that doesn't make sense on x86. Various SOCs, for example.

How can this be legally done while accepting both copyright and contract law?

(Anonymous) 2013-08-12 11:40 (UTC)(link)
At least I find the terms of use for Windows unacceptable, and thus can not enter the contract Microsoft present to be able to legally use Windows. How are those of use that find terms for example prohibiting reverse engineering to follow your advice? I am aware of the alternative to ignore the terms and just press 'accept' on anything presented, but that seem to me to be the same as ignoring both copyright and contract law, which I also find unacceptable.

Re: How can this be legally done while accepting both copyright and contract law?

(Anonymous) 2013-08-15 10:59 (UTC)(link)
I'd say it'd be a bit of a stretch to declare what's described here as "reverse engineering". Not implausible, but a stretch

Sad state of affairs

(Anonymous) 2013-08-15 10:58 (UTC)(link)
It's a bit of a sad state of affairs when its 2013 and our primary source for "how do i figure out this thing that's going on that doesn't make any sense" is still "how does windows / the windows drivers" handle it.

Re: Sad state of affairs

(Anonymous) 2013-08-15 13:38 (UTC)(link)
You're certainly dead right, but when the hardware vendors are writing drivers for MS-Windows and nothing else - not even useable documentation - that's the state of affairs we end up with.