Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754007AbdLUXIG (ORCPT ); Thu, 21 Dec 2017 18:08:06 -0500 Received: from mail-eopbgr40099.outbound.protection.outlook.com ([40.107.4.99]:37728 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751094AbdLUXIC (ORCPT ); Thu, 21 Dec 2017 18:08:02 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Subject: Re: [PATCH v2 1/5] dt-bindings: at24: consistently document the compatible property To: Javier Martinez Canillas Cc: Bartosz Golaszewski , Andy Shevchenko , Rob Herring , Mark Rutland , David Lechner , Divagar Mohandass , Linux I2C , devicetree@vger.kernel.org, Linux Kernel References: <20171221134842.31287-1-brgl@bgdev.pl> <20171221134842.31287-2-brgl@bgdev.pl> <0c2455ae-2f68-5342-14c6-14706d6f0e66@axentia.se> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: Date: Fri, 22 Dec 2017 00:07:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [85.226.244.23] X-ClientProxiedBy: HE1PR0901CA0055.eurprd09.prod.outlook.com (2603:10a6:3:45::23) To DB6PR0202MB2551.eurprd02.prod.outlook.com (2603:10a6:4:1b::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ca1fddb-a8c9-4f1d-363e-08d548c7ade1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4603075)(4627115)(201702281549075)(5600026)(4604075)(2017052603307)(7153060);SRVR:DB6PR0202MB2551; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0202MB2551;3:w3pjdGtz9xHv8Id7ERqU4lOvZ1N+utZGSEGf4UXs1/uDk4dTvPlcD/l05SWL8pE40v1U2408fSXufVGSIKVPyDWwSRTWCpnx6KXENr7FBSQWFWnt+dvwNvKZH04GnE0+op+hBn6HK+jC0SvuDqz/m8UJgfQPQcuvw/18yCZzAOFCGf4bbYIUhLdhpFGXxBe/puGd0dGj8EpH+IvLTAZcsm2ZImiAqdukcuLtQPYYAf+bIzN6/BE7Jd3BYhTNAW8L;25:C1PGgixR1golTJArfO4mq1amkSCe2mhUVMj+CfZ0MIhGFiD9gF0WKRrgcIgHMCoyeFM8wnr/b7weGesmnPjcACK2NWaftM3UvS9Y0wq++FhiDGKGoUpPURGTMcVqrXkOTzv9MswhJqK+/UUSQpJ9YBSvH8X0C1UGL3VGOtf11sO7Y1ryD4caBrjXztuQDBkCu8IlOeDRPlmPaIsM99x517YksZqQpCuqsL85yLdpJGCaR/IE2UjIf4vWZZQZIe13TQPVJG2Dr4K0cFgbFMDbRm6Xx3HyxpqcdQ8pV4h/X10OMxRRJqvpQNPwztVZE5qNKETwpG7CjFN9J2MVqG1q6GC/KI10t1w0REazGxrjaNc=;31:nsRjDjiDi6pKiiI+MopMurn4lXW29cUbANjEymZEkj3k18CS7MIaa/+IMtECjwXXShKdxO8lCZ//qA590drncvrBhmk71UanWmJvBuGZEpJoZchSknm+dZFERdQfegIqFE20OxsZ7ijuqqv6YenlDf08e3wrmQR3ZAIKTAEB2QnRgvzTwdVBwqHiHalBneBygyjBDh0zw3hTtybo1y2MwQs5b5WzRHpuS1tloBU31bE= X-MS-TrafficTypeDiagnostic: DB6PR0202MB2551: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(6041268)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(2016111802025)(20161123564045)(20161123558120)(20161123562045)(6072148)(6043046)(201708071742011);SRVR:DB6PR0202MB2551;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DB6PR0202MB2551; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0202MB2551;4:etKA5aSQ6ffvrmaHI7bo1s+Urgr9je3fOZ8Ey2ZTvcPiL+qsvJHdDH5BsnTMPrhcrdKBcIBLk9u0QnVIdcAuKp9qLW0imDvrntm15j6iEDIOvC6Q3y84UCxCAd23ZXM/WmqI3lI5F8SY8OPGXW+RWkZdEgnxjkfAPCpIyigEj/U9emO+xWKXlg2uSWT5V6Q86iIcrFj4KdMe3ghvtinHyr500tRD6z+kkmxiOCkcGEZm/ys7qENGVZYTj7OXxtaAPycAPSwQ+QumA2ftOBg4yg== X-Forefront-PRVS: 0528942FD8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(39830400003)(39380400002)(376002)(366004)(396003)(346002)(51444003)(189003)(199004)(377424004)(24454002)(65956001)(66066001)(65806001)(4001150100001)(47776003)(58126008)(74482002)(966005)(97736004)(93886005)(105586002)(39060400002)(7416002)(6486002)(316002)(16576012)(77096006)(106356001)(305945005)(7736002)(478600001)(86362001)(83506002)(52116002)(76176011)(2486003)(23676004)(2906002)(36916002)(31696002)(52146003)(8936002)(6116002)(68736007)(3846002)(230700001)(36756003)(31686004)(53936002)(54906003)(59450400001)(2950100002)(3260700006)(81166006)(81156014)(16526018)(229853002)(6246003)(5660300001)(4326008)(6666003)(65826007)(117156002)(6306002)(64126003)(6916009)(25786009)(8676002)(386003)(53546011)(50466002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DB6PR0202MB2551;H:[192.168.13.3];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjZQUjAyMDJNQjI1NTE7MjM6YlU0L2JZQkE1Rk5xZVN5MWdjV3k5cnpL?= =?utf-8?B?MUdTU051L1FQazRNT3Q3UGVNcmdUOC9EMFpXM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24:nFwuVCxOrJRYmFPSZzVLEoCvuefRt636/T4QlmTZk+tzto9nk/RwkXH22uzGbMty/idBzuN+nUKmCrQVmXO/cj4/vi2dERXRXWgsdgBvStA=;7:oyUIPoUPZTmu7qyAZV7mD0zwTMflfbsd9Sv/C7z3UvCzIUyWXLwmrSkin/6Ww2iTI4Eh5SAhnSlWivQY+hx89KiKNoT/IobS270AZ2lbQzBDwg/g6J/eWxcrDYfI/8D9ws8ah4VenyPzrOcK25HsQKzmNFiPNURD+s4p2gnUZwd0DobMHuZhNIAITgUcx5M13SGVanN0nwSO764XjZWH7BWpMDo1tnPJa63j9YNedKWKRmokfdUE+E0ahu1ssWU2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2017 23:07:58.7421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ca1fddb-a8c9-4f1d-363e-08d548c7ade1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0202MB2551 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4623 Lines: 105 On 2017-12-21 21:27, Javier Martinez Canillas wrote: > Hello Peter, > > On Thu, Dec 21, 2017 at 5:20 PM, Peter Rosin wrote: >> On 2017-12-21 14:48, Bartosz Golaszewski wrote: >>> Current description of the compatible property for at24 is quite vague. >>> >>> Specify an exact list of accepted compatibles and document the - now >>> deprecated - strings which were previously used in device tree files. >> >> Why is it suddenly deprecated to correctly specify what hardware you >> have, e.g. "nxp,24c32". In this case the manufacturer is nxp, damnit. > > Sorry but I disagree. > > When you specify a compatible string, you are not specifying a > particular hardware but a device programming model. That's not what it says in https://elinux.org/Device_Tree_Usage in the "Understanding the compatible Property" section. I quote: compatible is a list of strings. The first string in the list specifies the exact device that the node represents in the form ",". The following strings represent other devices that the device is compatible with. Pretty clearly talks about devices and not programming models. But maybe I shouldn't trust that reference? What should I be reading instead? > It's very common to use a compatible string that doesn't match exactly > the specific hardware used. That's why it's called _compatible_ BTW. That's not how I read the above. > For example when a DTS define a UART node with an ns16550 compatible, > they don't really mean that have a UART IC manufactured by National > Semiconductor. That just tells me that most people are a little bit lazy and ready to cut a corner or two when they can get away with it. Or that there is some form of misunderstanding at work... >> Sure, it happens to be compatible with "atmel,24c32", but that is >> supposed to be written with a fallback as >> >> "nxp,24c32", "atmel,24c32" > > This isn't a requirement really, systems integrators are free to use > more than one tuple in the compatible string if > they want the DTB to be future proof, just in case there's a need for > a more specific driver or if the programming model happened to not be > the same at the end. This is usually done for the boards compatible > string as an example, even when there isn't a struct machine_desc for > the specific board compatible and only for the SoC family. > > So it's OK if you want to define the compatible as "nxp,24c32", > "atmel,24c32", but that's a general OF concept and not something > related to the at24 eeprom driver so I'm not sure if it should be > mentioned in the at24 DT binding doc. One problem is that if "nxp,24c32" (or "nxp,24c02" as in the example below) is not a valid compatible, the tooling will be correct to complain about it. Currently, it is just a checkpatch deficiency that it complains like this: $ scripts/checkpatch.pl -f arch/arm/boot/dts/at91-tse850-3.dts WARNING: DT compatible string "nxp,24c02" appears un-documented -- check ./Documentation/devicetree/bindings/ #249: FILE: arch/arm/boot/dts/at91-tse850-3.dts:249: + compatible = "nxp,24c02", "atmel,24c02"; >> if I understand correctly. So, why is that deprecated in this case? >> >> What if (a few years down the line) it is discovered that some weird >> quirk is needed that is only appropriate for nxp chips? >> >> nxp is of course just an example, pick any manufacturer of eeproms >> (supposedly) compatible with the atmel interface. >> > > That's indeed a possibility and the reason why most DT nodes have a > more specific before the generic one matched by > drivers. I really doubt that in the future it will be found that a > more specific compatible string is needed for one manufacturer in this > case, specially since the driver didn't even care about the > manufacturers until recently. I'm not talking about the driver. But if what you say is true, that change would have broken a number of existing DTBs. Is that really the case? > So I think that makes no sense for a driver to support all possible > manufacturers as possible compatible strings if all the devices have > the same exact programming model. That's what the fallback is for. With that in place the driver can start to care when there is a need but until then it can work just as it always has. Without knowing the specific device, the driver has less chance to adapt when the unexpected is discovered. But again, I'm not really discussing driver details, I'm complaining about the proposed changes to the bindings. I simply don't see how they make sense. Cheers, Peter