Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752233AbcDZGNx (ORCPT ); Tue, 26 Apr 2016 02:13:53 -0400 Received: from mail-bl2on0076.outbound.protection.outlook.com ([65.55.169.76]:12854 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751146AbcDZGNv (ORCPT ); Tue, 26 Apr 2016 02:13:51 -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: Tue, 26 Apr 2016 07:58:45 +0200 From: Jan Glauber To: Wolfram Sang CC: , , David Daney Subject: Re: [PATCH v7 03/15] i2c: octeon: Remove I2C_FUNC_SMBUS_QUICK support Message-ID: <20160426055845.GB5758@hardcore> References: <1461594824-7215-1-git-send-email-jglauber@cavium.com> <1461594824-7215-4-git-send-email-jglauber@cavium.com> <20160425221621.GI1550@katana> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160425221621.GI1550@katana> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [46.223.168.231] X-ClientProxiedBy: DB5PR01CA0035.eurprd01.prod.exchangelabs.com (10.162.149.173) To SN2PR07MB2589.namprd07.prod.outlook.com (10.167.15.19) X-MS-Office365-Filtering-Correlation-Id: 8ff516a1-5762-4f52-8065-08d36d97db2e X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2589;2:AsC9YK0oTv3SrKrPwTlnaWceOGgm1Z2WcNjuJQFma5z9h9beQWQQhsXCTVvMDdVwjQabrABdcRGxBbIWwR7W5ZxY+1Lx7VpJLyI0l5gZqf9Un1JliyHwQSg0XrDXuy7WI5nTv8rL7cEnOLquwax9ou2qYWRLcV75kXluBVdnQhojc7OWyaUF+ujQXkKQWtqa;3:xh5hq0bSX7/RiPNsLNRAJwvGT11qbs63hgVzRm1yWsokZa9YmAkZkykxwNAUhJb9UMNuR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jmdDQSPlBjUC8yAvat8O7FFjqqXLoJAYSrC0thhREcbyDDqUcjpeRZMyHpab+CwROUowzQJ1kv1jiwPfEZp6l/OKHCC1rvgNolHItdevcZD6e0P7nk6rpa3i2h3HkMbUBVzQDgM6MWA5x5/RLuOA9LoUpgyZsTvg9EYdkTYPLOqQD2AsHET0i/SsknqQRqvkngD5Ds8PtqAoif5PIIEKygFkcpb344Qu+6OwGdH5JntO3dNJ1phipIYlULBwBSVp1vZfzk6iH4+PWaq09ajhGB4QoBXp61xQ1bo9RpkkpqIEtqLju+EuYmYEHaUg1L2FQTAuExWI1Ltxh9CoJJXAKw1U/VP40mlu6TnIppUQ7sHOHRnGd7Jqbvvcy56QCJ60xMlVihw1Nua/+MxaZTSLZSXuCWaNeJyw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521072)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:SN2PR07MB2589;BCL:0;PCL:0;RULEID:;SRVR:SN2PR07MB2589; X-Microsoft-Exchange-Diagnostics: 1;SN2PR07MB2589;4:NHqCemUI8fqkXPGGEqincDSD8LuxU/hg+2oJ/3tg2QEyolo/zfDIKYwPToKhQ8RPD8+AsWNr4yZfLfIN4qdolefSpgrPrO2dABXIvtO15gHWowPUBwKFTuTU/kDqX/PBrtho/Y03mPoFHPqpHB9mOTLyoXlu6Dqes8lL4gzJYLLhR9lvyFAyxAqaKC+jBg96Pwqj0FnVdgz6QycT2Z2rG2Xc1zh54onw+Jy/vz0NxUse0HGHl4uD2McVeNAkAN7HCV007VoIClFh2AEMn+Z9u6GSsPhyzTMCc+on0bkRRROkwNYw3nY5+aRGMeB7hfwt6vTHMB6NqZtgLyAZu0FGR32TLQBsaxzTUUzIwgbyscaQzOKpHGVvfMY2aKfSiGi3HwoLpg/ySxhwrCBerLaa0Q== X-Forefront-PRVS: 0924C6A0D5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(24454002)(76176999)(50986999)(4326007)(54356999)(97756001)(81166005)(5004730100002)(50466002)(92566002)(4001350100001)(189998001)(110136002)(107886002)(46406003)(33656002)(42186005)(9686002)(5008740100001)(86362001)(83506001)(1076002)(1096002)(19580395003)(6116002)(23726003)(33716001)(586003)(2906002)(19580405001)(3846002)(47776003)(66066001)(77096005)(2950100001)(15760500001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR07MB2589;H:hardcore;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN2PR07MB2589;23:VBl74CIHxIyas0jHkzwpOww7inM/HTadyH3XFksXG?= =?us-ascii?Q?+V6bISLFYwyM0pxkbjuKB/qKs1hQDdmu7hidwOuel+Ar2KVyUR+hYJuHu1Vx?= =?us-ascii?Q?3yBMW//4pkBn04dqL1FzstikrGwloeshU/XsX/tGcfiV8cR7Za/ij0qTkwzg?= =?us-ascii?Q?fmcxky1dzJCBJghzFJRs/OR3JIlavLcmO//FeI50y2l6C6/D0IH5Lx8VLakQ?= =?us-ascii?Q?1reMO9Sm6fy88oSgxeS/LKVL/vySq9zUqqvnrXUQ2MVxkciX49EUlZw+wQ9r?= =?us-ascii?Q?h8INB3wjdvs66B89JBN9ZCdsc5WXBuy4p/7uBHtWE5jd7Ko44Z0t9J8ZJ0s8?= =?us-ascii?Q?cpYeHx79sQurJYNqtyt/N62nvNgDLxTNsCU8pV99fwnO/UBirhyoKL8LqJfx?= =?us-ascii?Q?HTZ7YIEVOOHec9sKNnKF+oUDhQowUHwg4DtgIps6qD2cfSA3Ry9DNfX7eeD6?= =?us-ascii?Q?+GRCxOqfPh8ocX9bQjhpq7CeG2xL5T9+jOgp35ZOW6PFWCPm/sodBlF4UBLB?= =?us-ascii?Q?xtDJxDHb2kgDJHDRPTrP0YZiPwNjm+k5eTSgRk0NsjjFGtL6m7V8ftAV2rff?= =?us-ascii?Q?4T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F2CrcLHBgaExTPjZ+Kx5NIeQ37DjieF+4lk= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2016 05:58:56.0368 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2589 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2444 Lines: 67 On Tue, Apr 26, 2016 at 12:16:22AM +0200, Wolfram Sang wrote: > On Mon, Apr 25, 2016 at 04:33:32PM +0200, Jan Glauber wrote: > > SMBUS QUICK never worked for the read case, because EINVAL was returned > > for a zero length message. The hardware does not support SMBUS QUICK > > messages so disable the support and remove the zero length check. > > > > Signed-off-by: Jan Glauber > > I see better now and I think we need to drop this patch. It looks like > the driver supports only SMBUS_QUICK_WRITE which can be used for > scanning devices. The driver probably works with 'i2cdetect -q'. This > will regress if I apply the patch. > > It seems it can't do SMBUS_QUICK_READ thus the extra check in the code. > > I2C_FUNC_SMBUS_QUICK should have been split up in READ and WRITE to > support this scenario. > > Are my assumptions correct? Yes, I thought briefly about splitting SMBUS_QUICK into read-write variants too. To me the question is if this feature is still used on modern devices or if this is more a relict of the past. I don't know enough about SMBUS to answer that. Also, the ThunderX documentation does not mention that it is supported. The read case would be forbidden by the documentation (that was probably the reason for adding the read EINVAL). The write case is kind of a grey area, it might or might not work. I'll see what i2cdetect does. Thanks, Jan > > > --- > > drivers/i2c/busses/i2c-octeon.c | 5 +---- > > 1 file changed, 1 insertion(+), 4 deletions(-) > > > > diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c > > index 0f536a1..ad563cf 100644 > > --- a/drivers/i2c/busses/i2c-octeon.c > > +++ b/drivers/i2c/busses/i2c-octeon.c > > @@ -459,9 +459,6 @@ static int octeon_i2c_read(struct octeon_i2c *i2c, int target, > > int i, result, length = *rlength; > > bool final_read = false; > > > > - if (length < 1) > > - return -EINVAL; > > - > > octeon_i2c_data_write(i2c, (target << 1) | 1); > > octeon_i2c_ctl_write(i2c, TWSI_CTL_ENAB); > > > > @@ -597,7 +594,7 @@ static struct i2c_bus_recovery_info octeon_i2c_recovery_info = { > > > > static u32 octeon_i2c_functionality(struct i2c_adapter *adap) > > { > > - return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | > > + return I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK) | > > I2C_FUNC_SMBUS_READ_BLOCK_DATA | I2C_SMBUS_BLOCK_PROC_CALL; > > } > > > > -- > > 1.9.1 > >