On 07/29/2013 07:30 AM, Guennadi Liakhovetski wrote: > On Mon, 29 Jul 2013, Pawel Moll wrote: > >> On Mon, 2013-07-29 at 13:05 +0100, Guennadi Liakhovetski wrote: >>> No, that's exactly the problem. We absolutely do not want to write >>> compatible="vendor,soc-v1"; in a .dts file for SoC v2 just because we >>> currently think, that we don't have to distinguish between those SoC >>> versions in this specific driver. I think we all know it quite well, that >>> there are (practically) always differences - sometimes documented, >>> sometimes undocumented. And if you later find out, that you do have to >>> differentiate in the driver - it's too late. Even if we disregard the >>> argument of ugliness of having to set compatibility with soc-v1, soc-v2, >>> soc-v3 in different DT nodes on an SoC v4. >> >> First of all I think your example calls for more than one compatible >> string - if it seems that soc,v2 is almost like soc,v1, make it >> compatible = "soc-v2", "soc-v1" and don't touch the driver (as in: keep >> it compatible with "soc-v1" only). Then, when the realisation comes, you >> can simply add the "soc-v2" of_device_id with .data pointing at new >> features. > > Yes, this is also a possibility, but it seems only a little bit better. > Why should a DT node on SoC vN have a compatible string with SoC vK for > some random for an abstract user absolutely unrelated SoC version?... Precisely because the HW /is/ compatible. If the HW interface (registers) in two chips A and B is such that a driver for chip A can be expected to run unmodified on chip B too (albeit perhaps without yet supporting any new features, or perhaps not running at full performance etc.), then chip B /is/ compatible with chip A, and it makes sense to mark it so in DT. That way, an old kernel which had support for chip A can run on chip B. A newer kernel might come along later with explicit support for chip B, and hence run faster and/or expose new features, but the driver for chip A can still work on chip B. > And > that vK would be different for different devices... So on SoC v5 MMC can > be compatible with with v1, sound with v2, camera with v3... Don't you > think it would look like a mess? I don't consider that a mess, no. It's nice evolutionary HW design:-) -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html