Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753010AbcCaKNj (ORCPT ); Thu, 31 Mar 2016 06:13:39 -0400 Received: from mail-bn1on0065.outbound.protection.outlook.com ([157.56.110.65]:38336 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751243AbcCaKNh (ORCPT ); Thu, 31 Mar 2016 06:13:37 -0400 Authentication-Results: the-dreams.de; dkim=none (message not signed) header.d=none;the-dreams.de; dmarc=none action=none header.from=caviumnetworks.com; Date: Thu, 31 Mar 2016 12:13:19 +0200 From: Jan Glauber To: Wolfram Sang CC: , , David Daney Subject: Re: [PATCH v4 03/14] i2c-octeon: Change adapter timeout and retry default values Message-ID: <20160331101319.GA31112@hardcore> References: <20160323195517.GE19849@katana> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160323195517.GE19849@katana> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [88.66.101.161] X-ClientProxiedBy: AMSPR04CA0040.eurprd04.prod.outlook.com (10.242.87.158) To BLUPR0701MB754.namprd07.prod.outlook.com (10.141.252.20) X-MS-Office365-Filtering-Correlation-Id: 985c2b0c-0ece-42b0-82c4-08d3594d1e4e X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB754;2:ZUm4zSYvNoXckwIunrHlXIria61b6q56Yem21Vcla4okx9AWoE6xe1wXx69USRoAdc9i7K7bTLHHENmPVeDpmEuguhuH2+KP6LltBKrGm0HaaJBXGjqPy5/MTwRaUzxY5gQT4OQ60hWgyLG3GY+pIFVO3dhSjd56cxobTFK4KRfY7KAIueWoFQFGfZf2sEgQ;3:vInS7IqZa351SvGLVpwc15GuKE9nFp0dG8HWHlyfIRMRXIwXQ3/DtactmfxgUQ//McQ/6PZ6sMTjhMuHrAQQK47POYV9CwxoC/Cyvb4YQ1OGFm/13UA0I3wfSnFE9V9r X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB754; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB754;25:zEd8TgS6Ddyc63DBR533+Z4PvgfMyjHxBMrpw93R96quXabj0oCdxEJ4sc6kfnOUFemZ0ktrCbrnUqILxUZ50dVNVRxOXRvKY+dgXNa523A6hTprW9Jh/QOZFXx88XtKSsKnq9uBH/NzxaYscbCK7ROOEJF4R6Q+3s3+XJKt44raxt33JJHQKZf647mMtQXI4jYekvy6yeC4Y9/mza2Bum0FQtPfddylvQoNVjj4j8OJrbj1quKYfoBTXh82RnvdeBIjP9qFlBu0AqBg0/bD+MDtVN00ygK3IajIgNwzFd9pI50Oyh94mNTN/lQdfmxI/VVghfeSRcXkqxKN8/OJt1mdePg3faNv7UUasTO7kMnQZTGNo8J+ZihCm9gutOEtnAn0xkv2j+knOUCOtuUgczZdaL6AnijH3hD5+kUgpl9F+1LNdQqAtE5QtLc2+j3MGa2ETr9yJH/ZzO9X/RWktbVOFgkmCOgM5KVux6AhDqC/0ejt4CY3EcV1wbR+bYhBxQmYwwaJXZIKuEfrUku/ksjPpKYKQ1M1r0ljvF/CnpBIVkwaunLrJpOJyGdAoesGERYoP/nfmDArOaehMuaDBir8vZ3LWQkrUVweFU2vWNXwpgT/67THanHPDH2MyoFuEej4TelBzxvozFqLcTkS7A== X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB754;20:UQewAs0TGkyZuukbSurfl1eQZVBBDJ4eDnoMHNVjWLpMpw6+CwU2Ht/99pOffhnAMq6LSizbc5znTkhFclXcgE/MYX8fWAjgZTDTAvr4XSwwEvE6mcctfo5qvO569sfi8Z4JKxiHIZhoomGjULj0U/HbQxf57haPTJeQcDnBqhN0npLMHY2t9CNQR/8F0+zIGbhAabQ3GsZ/i8sr4hoaUDdHFSPe6ky18Rz1lNLZN3w/kNbTMCCE90LpRPrNUGH5LqENYVbjvADIPF31X/jFk2ECoKIQ4IPDuwu22PMggOTuLrnONzjBEBaQjbRDBnRu85ma6KFLP5lg+yMbdmM9ymi+nFcPtVTc0Ig+1qlWFi7U9VQrJzkJ2vcivZzAht5foP4FAHtb00BYo0CNQXH34+OKdB5d09D9UwWm3p92JcBN1FD7qL6Y87R6z2R+itLfopou6Eqb7m1dxthf16UeQ0v4nrN3glpG74/Q058S+zVgbZmYpsomf8rq0rz2iJiH7lrkVp+bONuYPWbHujqrW3FhmpgASO197aPN/VsgBKV17GVk+7g568clvMOmYRrF610vVDIFeD5gtXq60ZrAe3QdkJtloImndW5/a0nS8JE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:BLUPR0701MB754;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB754; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB754;4:DA3aGwn5X2AxPpDRBKKnoI08I28XNr6ceQ4teiG57eTGl+VDWcdLJqTYaAL73tJZ9h4VdtYbcgUdF759QKpbgZyQkiVylHizjR9QTKdVuTj/NTVDwMhQPXUYkrrA1HhK5exxw41qfc697AF1yuQljE276yXuYmECgzNFLhD3JKKCJ6i99V5yyqoBPO9tjUzPYW6K6W8sPs4W+qzaj8+mbwjE3nXIh0VhqJgOrmNix39VLANmqI9LZAm5zcxkntlD9O4xEfxxXtyfTYwjXvnsiLVDp13p7V64vUOu0pQ/1by6z1yufLE8qL0hQ+RrZJBTs+GnLlRjrorh0bncfgK6T3dFz8vPfx9c5ik5ddYfCm1+7D5Ik/xUwpcxG2yNTzMu X-Forefront-PRVS: 0898A6E028 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(164054003)(24454002)(50986999)(4001430100002)(81166005)(97756001)(86362001)(54356999)(42186005)(5004730100002)(50466002)(76176999)(2950100001)(586003)(3846002)(33656002)(33716001)(6116002)(5008740100001)(2906002)(1096002)(4326007)(23726003)(1076002)(47776003)(77096005)(83506001)(46406003)(189998001)(92566002)(19580405001)(19580395003)(110136002)(4001350100001)(66066001)(107886002);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB754;H:hardcore;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0701MB754;23:ReAlCJgf6hjf/QaIxCidb8hTkBYGus6wIrRHik4V?= =?us-ascii?Q?IepEGk2mXiSG9dzvBnx9G56teml2d5QF2rxex8nuAgCzh5fEsss6qDoFTxMW?= =?us-ascii?Q?IADH9dquLRdO9oYBRKuSBMEiT7dGasD90RP/6rPc4cqI42p2PuxdYpKb7se8?= =?us-ascii?Q?NcofwHrUE5amueWAJhhBsx0MZp0Iy5BQ80irasW/OFbS9Gpr6bqwXXk+mMCN?= =?us-ascii?Q?Q37qeQwj3hgKbbfvIObHdPEbBwYxfWS0fbf6LVkS6vGF9uLag2e57GjR0FfQ?= =?us-ascii?Q?FudQkFEWDNfUQ0YQ47+otmrC0WrgeJYJIyrPbVUweppCiIm/axTD+nNfSbO5?= =?us-ascii?Q?5LBSftoOR1Wel+RmHFlyBw1ZzY970U/vW2kNgY0Z4omXeLFtrRrPzHADASoi?= =?us-ascii?Q?1z5jFiy8OMNWlKHzH2RzEkhgzm+nZ83M3o7T86ZQeuxDGEdo9m0mR6cT371F?= =?us-ascii?Q?Qk2AE+Mdubw4XDS8IuYARjV3JETqi8GFVvXm0UVk8mQD7YKSr0WV6WeKp0EL?= =?us-ascii?Q?9B52Txj63q9Lj4MNatN3jfP+Jl66H1dDin56W9Cam3w8HmbHco0uTxeDRnvm?= =?us-ascii?Q?nw1SrwC+vXPWX1NU9wjg3AsTLKFqONLpFdNuO+PPQM1ta+s5L2wyLEi7oXJ1?= =?us-ascii?Q?YIbu9Tya3WhouCbf9v2U7LxJ5tuQzPfH92XI5iALieE/5hgllrfAI6qj7241?= =?us-ascii?Q?tNyf9vUiJ8sTJu3s17NgZlr22irVKOMkDdclF/rGtsYJZFKVDzMch76UnkPh?= =?us-ascii?Q?eu6LR783jgL03MdZn5tuzC4abFHI+g8NoBBrR486merDrNj3/i6n0LFDPa6e?= =?us-ascii?Q?DE+gWQJXfjNH0du1BAGty3vy8BZoTTv0sTBHqOS90JbwTBB1benP2um/Qnjc?= =?us-ascii?Q?kiW0g6eUMpF3Un43fxUvfCurtkVk6vvGwmEid+9SSxuVc8KzOEEjAxNe8f7A?= =?us-ascii?Q?hjpm2lv1ydIGHmaEY3JqaAdCTinIKvjcsIKnePCeRJ5hZW42WJrhFgt1Z2NJ?= =?us-ascii?Q?qvfX0YvYwBMjqSlHhL4y1Y3HOyI8QljvQtsprO0D4OUnBQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB754;5:lbmJlqxHU9yue1vSKrTfHFaUa0XLEs0Jc0lWDoiQCFrlwx9TkFls6r8xb6MJtG/nv5u/ekjbz72wUn5T4tkejCmUN5QjVqlQxMmYw9NT1rlzZRvLwfzBWA8n8CcZmXbKO/BIhVWTsvjLMFfMmyPWOQ==;24:drZhTMctv3KPG4d9WCIrdRWzwVkpeTefb7ULoyD4lVaIVzpZunU4UCgyceP0f90ESAW30q/cFkSnc4SFOlFLDJM7w6RXuVAbDN6ocfeth1M= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2016 10:13:33.6124 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB754 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2019 Lines: 62 On Wed, Mar 23, 2016 at 08:55:18PM +0100, Wolfram Sang wrote: > On Fri, Mar 18, 2016 at 09:46:28AM +0100, Jan Glauber wrote: > > Convert the adapter timeout to 2 ms instead of a fixed number of > > jiffies and set retries to 10. > > You describe what you change, but not why this is needed. Why 10 > retries? And shouldn't that be 20ms seeing the HZ/50 ? The timeout value is not changed, i2c-octeon is bound to Octeon SOC which has CONFIG_HZ=100. I would prefer to use an absolute value for a timeout that should not change with the value of CONFIG_HZ. For the retries, I'll change it to 5 which is what many i2c drivers use. I thought the reason to use a non-zero value for retries might be obvious, like "retry in case of a failed operation" ?! With the updated driver I do not see retry attempts, but it might not hurt the robustness of the driver to benefit from i2c core retry logic, or am I missing something? > Also, please use "i2c: octeon: " as prefix in the subject. OK. Thanks, Jan > Thanks, > > Wolfram > > > > > Signed-off-by: Jan Glauber > > --- > > drivers/i2c/busses/i2c-octeon.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c > > index 9240037..e616e4c 100644 > > --- a/drivers/i2c/busses/i2c-octeon.c > > +++ b/drivers/i2c/busses/i2c-octeon.c > > @@ -414,7 +414,6 @@ static struct i2c_adapter octeon_i2c_ops = { > > .owner = THIS_MODULE, > > .name = "OCTEON adapter", > > .algo = &octeon_i2c_algo, > > - .timeout = HZ / 50, > > }; > > > > /* calculate and set clock divisors */ > > @@ -541,6 +540,8 @@ static int octeon_i2c_probe(struct platform_device *pdev) > > octeon_i2c_set_clock(i2c); > > > > i2c->adap = octeon_i2c_ops; > > + i2c->adap.timeout = msecs_to_jiffies(2); > > + i2c->adap.retries = 10; > > i2c->adap.dev.parent = &pdev->dev; > > i2c->adap.dev.of_node = node; > > i2c_set_adapdata(&i2c->adap, i2c); > > -- > > 1.9.1 > >