From patchwork Fri Nov 11 08:57:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Glauber X-Patchwork-Id: 81798 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1167620qge; Fri, 11 Nov 2016 01:13:05 -0800 (PST) X-Received: by 10.99.216.21 with SMTP id b21mr43520798pgh.159.1478855585495; Fri, 11 Nov 2016 01:13:05 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o79si9276196pfa.97.2016.11.11.01.13.05; Fri, 11 Nov 2016 01:13:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@CAVIUMNETWORKS.onmicrosoft.com; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965894AbcKKJND (ORCPT + 1 other); Fri, 11 Nov 2016 04:13:03 -0500 Received: from mail-cys01nam02on0063.outbound.protection.outlook.com ([104.47.37.63]:27233 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965735AbcKKJM6 (ORCPT ); Fri, 11 Nov 2016 04:12:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cAHAABA5pr2Alq8Aco8FhmT5dUnOs8nETlQPJVcXfE8=; b=ZebFWQExLbI556ivkm7Vld213mhxcpeFDKICk5YoKui6M6s0MOLdMDVAjXONO/Hgh30r4QhJ+egcaCbT47dcBNpVoLErdn/EWy/y8Nlg/fkMT41wH9pG5fowl3GgoFyiF4n8Qa5Xt6hXOeP1E6j/6csefQZ4bmuKQBxCVfQSGeA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jan.Glauber@cavium.com; Received: from hardcore (46.223.65.110) by CO2PR07MB2582.namprd07.prod.outlook.com (10.166.201.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.649.16; Fri, 11 Nov 2016 08:57:20 +0000 Date: Fri, 11 Nov 2016 09:57:07 +0100 From: Jan Glauber To: Paul Burton CC: , , David Daney , Peter Swain , Wolfram Sang , "Steven J. Hill" Subject: Re: [PATCH 2/2] i2c: octeon: Fix waiting for operation completion Message-ID: <20161111085707.GC16907@hardcore> References: <20161107200921.30284-1-paul.burton@imgtec.com> <20161107200921.30284-2-paul.burton@imgtec.com> <20161109134103.GC2960@hardcore> <1595446.2T31j1Ekg5@np-p-burton> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1595446.2T31j1Ekg5@np-p-burton> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [46.223.65.110] X-ClientProxiedBy: AM3PR04CA0109.eurprd04.prod.outlook.com (10.163.180.163) To CO2PR07MB2582.namprd07.prod.outlook.com (10.166.201.21) X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2582; 2:AVlzDxJU6g+bPCu+Ds5mSQ7SsJsKTaHVIYb9OzebYEybJ+tIcqfsMb66w/1Hw7XBVDwOn0YbmrtSuOg5U59onZa+nDbYmIpGYcMZztg7ksGPcbPtiRzYwZXuSTdFqyLltFQ/pCrvIz0iAa2GEtfZYZUYniT0o9DqElbPL4ruy20=; 3:nG0OQfwYi6oWUArUPHKFD7f4bOoim4Af8TT2rsrEau6DmvfbS/dmfHHVldRCdVG2aYCcMTnSeZio0GUp7fqXn5Z7/oqdZDbbKbnXHIRCU+VXDzI43QcKUSnfr/d0RTSfu2bUc+VvsR90vo2gKyN1LCLOzzHl5XfThHIaWXpqSp4=; 25:8e+wWqef0X1aacWgNEEhfo1s4rrdL4UYDmNkLXORNE6y5ItHaGGh1ounuKgs1BAt3NH/bB1wdFdLHEmJLdwaLU2LisNMrZiUwqGzomSHywKHOXMKya4wJLy9qVonCii+R6xzusWwyYV6b5BtdeJoZHVYHYEq28eADtO7skm4wcNVf5F5rtO0dQ+zntx0cc/FoSWODHLOnG8/P913kQuYnjbhNu675eNk9UyyMzM+OaKKbfO7ZWY4qE2zzh5EoRYqCL8sVRByUM1QqYw0wVyxXCMkgD1ocsozzmcKLjTVfWuyIfR3vhCe6x34kcH4VHvr8EdoXU6NcmuHCNo3urdVvz199bYPj54dWBWRP2z2FIIbIK7ky3yDUQB4Z6OMWCqvS9Yr12FOKzZuj77/Kl+hG74jNUO5nVUXWOIyGOOH9URIK7qTG/aSs17v03H+M9j+iGvDm7kRhDtx3VvSNs9F1CY0z0nFFH2nqnFHYFK4nXE= X-MS-Office365-Filtering-Correlation-Id: d958b986-f8c8-4cbc-fbeb-08d40a10bff0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CO2PR07MB2582; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2582; 31:i2F3/ysm3B5C/bzP+198HFgtvbZjh2/1rHsjlnO8jDrZ0TGvV3I0EuLkhGn1OkWrY7C0GxX8dH/SIUUS8UJxn71TGZ70UDvz5EgAY0DwoQS6Qz04Qkzlv4Sjt/DFYvcWkHLbVzZXixN1It7kzDFNYlC5SovodAJrzl+DLXJMUPgPSvDDxMVUoq2RF6QEH6hVBWb+fVYfGJuiKbD4dmGcp2bbTdS/NyyoYVD74EDgToBlILa8NnCZ/xLua7v8foX/klKtQ9yxUPdS7c2q5Xhda9io2KRET1s3eNxPviMZVuQjagBNVLwvVrONHH18cH8W; 20:tt/NiYQit42IR36wvgV+dbOLfHrhqRTi2GrhDjfN7k8a8DoGMVaaSjdBMdAeB87Su66p738JbWlGWvyO94buPBFuQVzEAWJB+h2poyKCFI2A3PHUAILyGEI5GcgLCn3pzl40h+XgwXEtzTs3bWydwzUtpnvOXKdYghVZxSjDs4eRJDKE8YSL9dnbBTPKqw0M/ZoCDR4ai86IluL4XpJKGGtxmLp+9da1a/CrjuX+e1tR+yjaPamhQQQFLZu+tNjzJ4eKY2sAhALCdb4XhL9Z79L/6xhe4lHarHG2Fhr6joE1Lszh44zZZ0iswMYNeGVr8BSZXlfnGcWlHwKjyzY0NIpiGpUIyfY0L35SygllbWlgmWW0s6F1WR1GyqG7RX7yyqVSyNHAjuL3/KMY2Vf/UtOAoNbLAcrJpUGIsCCV3hwlXGUaL3c+8a+O9Xq4ltJaxaGj18a0nQuxvA6kCGgAnVlVkaiuZvIjIf+oCHGBp9DPxAIybgt6bSFeIIdXkgmYHRE+x/bS/eE6DtI6NWJtsK1owzwhX3E7OOw6yejM0CfdGBnDda8GNkvrl5cD4ziK/PyDwQY3tCSqoEqmWoI+hffH0s4zFa3dno0hHF5rJXY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:CO2PR07MB2582; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB2582; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2582; 4:l2zVkuHtoFQYYIhDwqhXR1+eQ03WXWWPKyx/4ICouLMcZ4r4V8OEudoJ3tC23RViBDUEzaj3evf/HOizNJ+Kn/fPJRdJO0YrPuqjFTugL03f+IywjS56NEeA1AB5J+EYMASiqHObXVQ1qj1qkWHQbwCnTDmgHIt0rWuQmk9neCTkA/CAiDuhekasjTDVQ/f8Z7FUe2gPlziJs1xntDJWQIUWZShIA2PU/AF4+vE74VP+PRimWKlhebvLs12FUTW5HFdCF74WXJOocaJA+UyNypFkdqPPKK5avKP4lM9vGJcu0iePTf9UbozXk2zene5m/zDsupgYyulriEBdCSmSqIpHnFhxFW3vbzWrTNIQJKzXA4aJzO8jz+T3IdlGj4ZantRtJfVm0x5gzUhoIkiQe2y+WBXahkZO18W9H+UcxVA= X-Forefront-PRVS: 012349AD1C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(189002)(83506001)(189998001)(4326007)(68736007)(97736004)(33716001)(5000100001)(84326002)(4001350100001)(107886002)(66066001)(9686002)(5890100001)(2906002)(5660300001)(305945005)(229853002)(42882006)(512954002)(42186005)(568964002)(6116002)(2476003)(3846002)(92566002)(6916009)(33656002)(81166006)(110136003)(93886004)(2950100002)(81156014)(4810100001)(260700001)(586003)(6666003)(7736002)(7846002)(101416001)(54356999)(50986999)(76176999)(4610100001)(106356001)(1076002)(4001430100002)(8676002)(77096005)(105586002)(18370500001)(2700100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2582; H:hardcore; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR07MB2582; 23:C9SR1k1w5PhQjMFPdvZU8zQA7U0yJ60awSOJLijal?= =?us-ascii?Q?V9kq5P3v3fWNc6b6xI/zyzLTas/s80dYdbXBNxbjTkrqXonFKjISmv+uMcUb?= =?us-ascii?Q?TaNaiGx3suhlOJ559/zuqOnEjlbjTgvfYh+SLom0+fAd1O+gNOGSHBrcAkhm?= =?us-ascii?Q?wvcQ4cZFpkpxtSN4FsZI3Ksgj/1znDic42R+qaM35KiiNCCP7gNXmvDUIgKg?= =?us-ascii?Q?iSRIP/HPD6URBQsu4iaCT7uFyEVHGZY3SBfmTQaHYjBfMQe9/6NT1ksW6IkV?= =?us-ascii?Q?Ld/BRYZLFymH5kUAY0m6X4/4aj1LxTKEgakft1e+yquqJntHPXXtUlDDH2pQ?= =?us-ascii?Q?TRagljqiV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K9Vv/PDnEvawGiquHDJReCckaEUo6SIksp5+IeXz/tStcTe/+BJZo6558Vd+gVFWH4/BNCzBGDMqBdqX7o43Pmr+1GLwiq+cYE0S+0nglPtChHbjtp0I2h61er0fl3+b/+YC1YY1asOrctzvUoTIroZ08PplpMhhwaFAlh9C8E= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2016 08:57:20.3913 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2582 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org > As you can see octeon_i2c_driver_init never returns. Are you able to test on > one of your MIPS-based systems? > > Thanks, > Paul Hi Paul, we can reproduce the problem on our side, but I don't have direct access to a MIPS system so I'm still just guessing what happens. If you want you can try the attached patches. I'm trying to get rid of the polling around the interrupt altogether. It works fine on Thunderx, sometimes I run into an interrupt timeout after a lost-arbitration but recovery/retry is able to clean that up. Please also revert 70121f7 as before. The last patch adds some debugging output to see if we run into timeouts or recovery. thanks, Jan >From 45eae05b8d793f5652f77ab1d5faa62c30927a10 Mon Sep 17 00:00:00 2001 From: Jan Glauber Date: Fri, 11 Nov 2016 09:40:15 +0100 Subject: [PATCH 3/3] i2c: octeon: thunderx: Debug prints for timeout and recovery Signed-off-by: Jan Glauber --- drivers/i2c/busses/i2c-octeon-core.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c index 1d8775799..a2a92b6 100644 --- a/drivers/i2c/busses/i2c-octeon-core.c +++ b/drivers/i2c/busses/i2c-octeon-core.c @@ -72,9 +72,10 @@ static int octeon_i2c_wait(struct octeon_i2c *i2c) return 0; } - if (!time_left) + if (!time_left) { + pr_err("%s: timed out\n", __func__); return -ETIMEDOUT; - + } return 0; } @@ -169,8 +170,10 @@ static int octeon_i2c_hlc_wait(struct octeon_i2c *i2c) return 0; } - if (!time_left) + if (!time_left) { + pr_err("%s: timed out\n", __func__); return -ETIMEDOUT; + } return 0; } @@ -280,6 +283,7 @@ static int octeon_i2c_start(struct octeon_i2c *i2c) error: /* START failed, try to recover */ + pr_err("%s: try to recover from status: %d\n", __func__, stat); ret = octeon_i2c_recovery(i2c); return (ret) ? ret : -EAGAIN; } -- 1.9.1