Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2607069imj; Mon, 11 Feb 2019 05:50:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IYzStq8ZJUxFzc+oRYf5h+Fpg/Ewbd/Tr7zF0fj6dhwgVSCeL+IakjPsBfouvLk/yxcyNVQ X-Received: by 2002:a63:e615:: with SMTP id g21mr34123673pgh.290.1549893010522; Mon, 11 Feb 2019 05:50:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549893010; cv=none; d=google.com; s=arc-20160816; b=IsRJzaJ0zeflFETCd2YIr1EpPnM02GxnDFbBsPxawLEOoS8V0koBsFRBhTJNe7HvRz 2eT4KWnLjV5ls2B6RHE0NtKCzVDYJWOPiBgdrn4WYgNv55lJbnDVuJAZb7t00yC0vbeT KCCI/lgQ0Z3/l4rCkjxBf0IBOa+M8XT4v0s4pey6UNlIaSSiONBAvDkBoqsN5UwBhBqS eS4sSDA2q48dHeCiAdmvvfqDlqP0PxvwbdvICPWIS1k4tW7pDmtD16m0spDJqeIdD9WD 1Rjw27DV+ZatdZ06xOLfV5Y7AywPhJrYHbxlUXk8owpGvgeTGYZOP3bah4HZStPncAUp t3JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:reply-to:to:from :dkim-signature; bh=CBjC8rkjWTBH/UQvY4t/FG2ykzOKkflnI1WmfhEBrqE=; b=vVcKXL86QfCkOpO/j9cI89LE1n6GO23kkRuzRhheI+C5A9awIUM4EHsmLGAp/fCMeI PYChw6Ih/eTw/Lr+pieqGmf79GRRwzOba6Z9CEDAgTnMkvznP1YUwWfaseqIvDo59gRA hyhbPmRwlrxmscFF8Bj8PgBTN2tt1Db66zwkX6IMyRySptPQe+8vFfPf6K6RvcedTBHG QYLdviPgpC6GpweVlDys5N0GuEIrjCsIix3wAuc3BB2eFfHCslbIEyms3ZTg6v72ULuY ptIiXzqdcIT1nkbD3IHTkvoYngsS6zpRrxAO3InC8gNptWAf0zukI+lpisho4JCs4Q9D 1baA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cern.onmicrosoft.com header.s=selector1-cern-ch header.b=h4qOSIzZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b21si10115497pls.31.2019.02.11.05.49.54; Mon, 11 Feb 2019 05:50:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cern.onmicrosoft.com header.s=selector1-cern-ch header.b=h4qOSIzZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728307AbfBKNsH (ORCPT + 99 others); Mon, 11 Feb 2019 08:48:07 -0500 Received: from mail-eopbgr40086.outbound.protection.outlook.com ([40.107.4.86]:6272 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727223AbfBKNsG (ORCPT ); Mon, 11 Feb 2019 08:48:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cern.onmicrosoft.com; s=selector1-cern-ch; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CBjC8rkjWTBH/UQvY4t/FG2ykzOKkflnI1WmfhEBrqE=; b=h4qOSIzZhTVdFQEqkqxnygO1w/C0u2Hx5P8xYtGUMuitmm34MXNv99ib4h/ez1iIY/LM/1y3JCtOm4MCErH/sASCkRi6ySMJQmO2uOWLffHrb4PcwO0Et+0zV7TYvC7Fj2xULW1Be5n/TaQN4c/DSnyeijU11h0ggq2LwTZtJ80= Received: from AM5PR0602CA0007.eurprd06.prod.outlook.com (2603:10a6:203:a3::17) by HE1PR0601MB2153.eurprd06.prod.outlook.com (2603:10a6:3:29::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.17; Mon, 11 Feb 2019 13:48:02 +0000 Received: from HE1EUR02FT060.eop-EUR02.prod.protection.outlook.com (2a01:111:f400:7e05::207) by AM5PR0602CA0007.outlook.office365.com (2603:10a6:203:a3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1601.17 via Frontend Transport; Mon, 11 Feb 2019 13:48:02 +0000 Authentication-Results: spf=pass (sender IP is 188.184.36.50) smtp.mailfrom=cern.ch; the-dreams.de; dkim=none (message not signed) header.d=none;the-dreams.de; dmarc=bestguesspass action=none header.from=cern.ch; Received-SPF: Pass (protection.outlook.com: domain of cern.ch designates 188.184.36.50 as permitted sender) receiver=protection.outlook.com; client-ip=188.184.36.50; helo=cernmxgwlb4.cern.ch; Received: from cernmxgwlb4.cern.ch (188.184.36.50) by HE1EUR02FT060.mail.protection.outlook.com (10.152.11.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1580.10 via Frontend Transport; Mon, 11 Feb 2019 13:48:02 +0000 Received: from cernfe02.cern.ch (188.184.36.47) by cernmxgwlb4.cern.ch (188.184.36.50) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 11 Feb 2019 14:47:47 +0100 Received: from pcbe13614.localnet (2001:1458:202:121::100:40) by smtp.cern.ch (2001:1458:201:66::100:14) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 11 Feb 2019 14:47:46 +0100 From: Federico Vaga To: Wolfram Sang Reply-To: CC: Peter Korsgaard , Andrew Lunn , , Subject: Re: [PATCH v4 3/5] i2c:ocores: add polling interface Date: Mon, 11 Feb 2019 14:47:47 +0100 Message-ID: <2252068.1XvXk90vR3@pcbe13614> In-Reply-To: <20190211102526.3y46r43usznu4jgp@ninjato> References: <20190211083122.32485-1-federico.vaga@cern.ch> <20190211083122.32485-4-federico.vaga@cern.ch> <20190211102526.3y46r43usznu4jgp@ninjato> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Originating-IP: [2001:1458:202:121::100:40] X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:188.184.36.50;IPV:NLI;CTRY:CH;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(376002)(136003)(39860400002)(346002)(2980300002)(199004)(189003)(8676002)(9576002)(7636002)(33716001)(33896004)(8936002)(47776003)(305945005)(46406003)(246002)(230700001)(76176011)(6916009)(7736002)(74482002)(316002)(106002)(786003)(106466001)(54906003)(2906002)(4326008)(9686003)(186003)(43066004)(3450700001)(446003)(50466002)(97756001)(11346002)(426003)(44832011)(478600001)(86362001)(126002)(476003)(16526019)(23726003)(6246003)(336012)(6116002)(26005)(229853002)(14444005)(53546011)(356004)(486006)(39026011);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0601MB2153;H:cernmxgwlb4.cern.ch;FPR:;SPF:Pass;LANG:en;PTR:cernmx11.cern.ch;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4b9ce413-ffe8-499d-2814-08d690278aa4 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600110)(711020)(4605077)(4608076)(4709027)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:HE1PR0601MB2153; X-MS-TrafficTypeDiagnostic: HE1PR0601MB2153: X-Microsoft-Exchange-Diagnostics: 1;HE1PR0601MB2153;20:j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C4a+4jJsS4ffCBRwd2PRQCBTlxx/MzuvWALiAQE04Z6hnvHCJDGLIfTVlKhDbN3Ef1xBD5VHiaNblwzOowmV/H2HzrruUPqinpxiwSWvk5MEp4uz/b2BBrRgEdVbNlw103cYuI2fTT1SlG8vXb3lpiKWaCr2M9+v1KeP8rgdvVTbfPVYOUwPkHfxptPZemrm708RjNjnYgdeVejvqtUmQ==;5:DtjKyH+YGVvZPvKaeVKtGh62AdqjWTrruowE5fCX81fHPOvZ1IukmpLeY7zYVkXmcbaMUKjeZeN7IAusC614rq650XTnPbWnUaZz8lJLsvjnYONmtsVVJlnIxNmBzlI518zu/wxTzDjbQc6512PTMpG7pZUVHhv4Ns1aH6QjZv2eT5+yHBEd/PnKmZt5UINh2XcdHimbTCkSOzU+awfdvA==;7:v5mItvXCPNEQaKPHgTCg34UUhN8SPC3dl4qbslIab4SEKsP2R/R83k1mdzJxPXzkNnms+2iNyczaD+ffVdqyCzwU6GYwsfl855p6HbS+fXh23Hg1NmvUQQv6Jr5j5hyWL0x5EGyPa1k0Io277ZyLWw== X-OriginatorOrg: cern.ch X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2019 13:48:02.0539 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b9ce413-ffe8-499d-2814-08d690278aa4 X-MS-Exchange-CrossTenant-Id: c80d3499-4a40-4a8c-986e-abce017d6b19 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c80d3499-4a40-4a8c-986e-abce017d6b19;Ip=[188.184.36.50];Helo=[cernmxgwlb4.cern.ch] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0601MB2153 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, February 11, 2019 11:25:26 AM CET Wolfram Sang wrote: > On Mon, Feb 11, 2019 at 09:31:20AM +0100, Federico Vaga wrote: > > This driver assumes that an interrupt line is always available for > > the I2C master. This is not always the case and this patch adds support > > for a polling version. > > > > Report from Andrew Lunn: > > I did some timing tests for this. On my box, we request a udelay of > > 80uS. The kernel actually delays for about 79uS. We then spin in > > ocores_wait() for an additional 10-11uS, which is 3 to 4 iterations. > > > > There are actually 9 bits on the wire, not 8, since there is an > > ACK/NACK bit after the actual data transfer. So i changed the delay to > > (9 * 1000) / i2c->bus_clock_khz. That resulted in ocores_wait() mostly > > not looping at all. But for reading an 4K AT24 EEPROM, it increased > > the read time by 10ms, from 424ms to 434ms. So we should probably keep > > with 8. > > > > Signed-off-by: Federico Vaga > > Tested-by: Andrew Lunn > > Fixed these checkpatch warnings: > > WARNING: 'transfered' may be misspelled - perhaps 'transferred'? > #111: FILE: drivers/i2c/busses/i2c-ocores.c:306: > + * We wait for the data to be transfered (8bit), > > CHECK: Please don't use multiple blank lines > #129: FILE: drivers/i2c/busses/i2c-ocores.c:324: > + > + > > WARNING: 'transfered' may be misspelled - perhaps 'transferred'? > #154: FILE: drivers/i2c/busses/i2c-ocores.c:349: > + break; /* all messages have been transfered */ > > and applied to for-next, thanks! I will resend this patch as v5 to add the fix suggested by Peter Rosin