From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751333AbdAMRRU convert rfc822-to-8bit (ORCPT ); Fri, 13 Jan 2017 12:17:20 -0500 Received: from mx12-14.smtp.antispamcloud.com ([46.165.232.184]:49966 "EHLO mx12-14.smtp.antispamcloud.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750980AbdAMRRR (ORCPT ); Fri, 13 Jan 2017 12:17:17 -0500 X-Greylist: delayed 5410 seconds by postgrey-1.27 at vger.kernel.org; Fri, 13 Jan 2017 12:17:16 EST Subject: Re: [PATCH] i2c: i2c-cadence: Don't register the adapter until it's ready To: Wolfram Sang References: <1483613240-32501-1-git-send-email-mike.looijmans@topic.nl> <428e8fc8-8b23-8e2c-763e-d977aaa98691@mleia.com> <469bf72b-70e6-24d2-99b1-79b6f0a635bb@topic.nl> <20170113083727.GB1446@katana> CC: Vladimir Zapolskiy , , , , , From: Mike Looijmans Organization: TOPIC Message-ID: <5d1b0fda-38e7-c4bd-46de-318507525c8b@topic.nl> Date: Fri, 13 Jan 2017 15:52:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170113083727.GB1446@katana> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8BIT X-Originating-IP: [192.168.80.121] X-EXCLAIMER-MD-CONFIG: 9833cda7-5b21-4d34-9a38-8d025ddc3664 X-EXCLAIMER-MD-BIFURCATION-INSTANCE: 0 X-Originating-IP: 37.74.225.130 X-SpamExperts-Domain: topic.nl X-SpamExperts-Username: 37.74.225.128/28 Authentication-Results: antispamcloud.com; auth=pass smtp.auth=37.74.225.128/28@topic.nl X-SpamExperts-Outgoing-Class: unsure X-SpamExperts-Outgoing-Evidence: Combined (0.12) X-Filter-ID: s0sct1PQhAABKnZB5plbIbbvfIHzQjPVmPLZeVYSu3xU9luQrU+8/8qthi+0Jd/W/95+6ZE6dI+d FNTaLLKrTD4PkK8WOoKuw32u9iEtZmisSr42qUwvK7U11fJ5smF5bE7GwnNXTE7JFCR1ojdwNCBO OUc+gq1Po8DC8lZ2cjs/uPC/uEiAchXm34kS+xZtaTWQmy1NM1RJKPT15KdXPmbjO41FyBEqIaDu dcVplPGNaieKxw/vh63RdlaW2Zj1hcQD6Dxo9kokFZNwiacNPxeTCKssqlJePCDBHWfCYUvWOATT vnG+QUCcfrSs6FZc7tZ3vKwSN7Mv0HNteAusUZ8BuYwGqmI8Tx/Ism0pnCcmlWACu0WC7nIKSPYV aBAAdpU0oUDqng6Dyy2mQeofiehJwuEK4iHDDzaNRtqez9l1el35jO+WJBgrWGjAavfuifnL+9wg oTj4ygNPw1XfN1IUJ2+rCMPpQhII5VkEVC//8GRISD+lYCwA5l6/Q4nfg8y63jKKBrO1BroJmvb9 eUfeSxHoryR0VpaMOdjZtRaRVYKU9W9tbmVXJBqdHHDml2fQHaY9hVoT9jGvxqBU4l5OTHLiyLVU tMfloK+xuF/fUy6xfZdyLRnwP1q5wC1e/tSnyqajZaK8dQ0opDJmurxCh4uqVodKdv1rgD9r0i/+ 38todEowB4JSAx5W7x0M2YI5PogHEGUWoL6eStEYApwKXoD4iJBsNfB/QPOzo3NC59y3EFXUwBcT DQ0nlghOTckC4oN5XN7BzTWQhrf/sy9AfdNBz1OTDTU4CjMBd8C3wL2Y4F0412ezGCyTUPan0Cab 0FVwhy8h2/CP66Liqw/CNZP28pmmK2KOECt9TJ5qnQPIZBBVCHCFXpzqEvf4YCTwuapYHJC4Tg2A sI28ylHHWzuqn5izqlNvHr1+risRQas0Y+9lR0Wzsy3xsZoKSXx3vgAfKR5D1F4EknF00cK4j7yB fShK9r7fGinDXHaEQ1zg63VRC9n5o9IubHRCajhI/osHQYQOY9tKQuYhVxJiclR+pVyfMOyA/7zg bL4= X-Report-Abuse-To: spam@quarantine2.antispamcloud.com X-Recommended-Action: accept Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13-01-17 09:37, Wolfram Sang wrote: > >> I would argue that the "info" message means "the I2C adapter is ready for >> transaction now, and we'll start initializing devices on the bus". That is >> the case before it calls i2c_add_adapter(). > > I know what you mean, but i2c_add_adapter does more, and it can fail > because the adapter is *not* ready to transfer. Seeing the success > message before is also confusing. > >> When i2c_add_adapter() runs, it will start probing devices on the bus. This >> yields very confusing output, as it will output things in a reversed order: >> >> - device X on I2C bus >> - device Y on I2C bus >> - cdns-i2c ff030000.i2c: 100 kHz mmio ff030000 irq 197 > > I agree. That being said, somewhen I started working on moving such > messages into the core to save string space and have consistent output. > Then, we can print at the proper time. > > So, until then, we should be consistent with the other driver, I'd say. Makes sense. I'll create a v2 patch to just move the i2c_add_adapter to after writing the configuration registers, and leave the dmesg output as is. Thanks for reviewing, Mike. Kind regards, Mike Looijmans System Expert TOPIC Products Materiaalweg 4, NL-5681 RJ Best Postbus 440, NL-5680 AK Best Telefoon: +31 (0) 499 33 69 79 E-mail: mike.looijmans@topicproducts.com Website: www.topicproducts.com Please consider the environment before printing this e-mail