[coreboot] Intel: How to share `tsc_freq.c` to select `UDELAY_TSC`

ron minnich rminnich at gmail.com
Wed May 8 18:02:11 CEST 2013


It's nice to merge code where possible, but it's been shown to be a
mistake in the past to be overzealous in merging code. Sometimes, the
merged code turns into an ugly mess of if's and special cases; see
some parts of Linux drm to see just how complex this can get. And, in
the worst case, as people extend the merged code for newer cases, they
break older cases. You've really got to be careful.

Sometimes, code is duplicated because either it has to be tweaked or
people want to make sure it remains unchanged for a given part, or the
part is sensitive to order of operations. There are timing or other
issues that make code delicate. In the worst case (this has happened)
code is changed for a common case and it works in the initial tests,
and fails later, or fails later on one platform for one special case
in which it used to work. That's always fun.

We've already seen with Paul's first plan how easy it would be to
break a bunch of platforms with a well-intentioned code merge. This
kind of mistake has happened before.

Just merging code is not necessarily virtuous. Given that the
platforms work, and most of them are obsolete, it's hard to see the
virtue in this change. It adds the risk of failure for what seems an
academic gain in cleanliness.

ron



More information about the coreboot mailing list