Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751952AbcKTFxD (ORCPT ); Sun, 20 Nov 2016 00:53:03 -0500 Received: from mail-db5eur01on0046.outbound.protection.outlook.com ([104.47.2.46]:16608 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750728AbcKTFxB (ORCPT ); Sun, 20 Nov 2016 00:53:01 -0500 From: Vadim Pasternak To: Wolfram Sang CC: "wsa@the-dreams.de" , "linux-i2c@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jiri@resnulli.us" , Michael Shych Subject: RE: [patch v8 1/1] i2c: add master driver for mellanox systems Thread-Topic: [patch v8 1/1] i2c: add master driver for mellanox systems Thread-Index: AQHSQWAQrGMtvj7Pp0+i/bgUDg5qPqDgzloAgACFXLA= Date: Sun, 20 Nov 2016 05:52:56 +0000 Message-ID: References: <1479455458-157627-1-git-send-email-vadimp@mellanox.com> <20161119210444.GB2856@katana> In-Reply-To: <20161119210444.GB2856@katana> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=vadimp@mellanox.com; x-originating-ip: [193.47.165.251] x-microsoft-exchange-diagnostics: 1;AM3PR05MB1268;7:JF44KcCPuiSBOpVJa3SPOF9+BczlAhtBTyeiDcnGvJE7JyTF1YVb7VueWXpg9Uy6kdnQ7EZKJvJelsw0S2EsHwZ2SfDrxeoe+qcp5d2tvVJjracNhMEyiiSAngm+wu9a2Z+lnIltnm/DMDClETB+nq5N+xV34uQEjDIPEASH61TxnnCgT0u9F4QHIAVJzxsl4IUIYHbIiFXlyrzWfA+23rykcrCHv4t6plsKcaaskthT7nRmxOIDVe8/raiNdKo9Z3cRMU/WUiuGdRYY0dNmN2H67IObNHOXPRixWTU86Nd3SGMoyf6wnUPbdZlgLoAIXJ3Iak7a5qlgKInkQjWRY2t+U/mDTb65EUVdhA0hSvw= x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(7916002)(199003)(189002)(377454003)(13464003)(7736002)(229853002)(86362001)(97736004)(6506003)(68736007)(2900100001)(8676002)(38730400001)(9686002)(74316002)(87936001)(76576001)(92566002)(6116002)(105586002)(106356001)(33656002)(7846002)(551934003)(8936002)(305945005)(81156014)(7696004)(3660700001)(66066001)(107886002)(81166006)(6916009)(106116001)(2906002)(4001430100002)(50986999)(2950100002)(101416001)(76176999)(102836003)(54356999)(5660300001)(3280700002)(189998001)(110136003)(122556002)(77096005)(4326007)(3846002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR05MB1268;H:AM5PR0501MB2097.eurprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-ms-office365-filtering-correlation-id: 4a918bad-795b-42da-5490-08d411097a22 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:AM3PR05MB1268; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040307)(6060326)(6045199)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(6061324)(6072148);SRVR:AM3PR05MB1268;BCL:0;PCL:0;RULEID:;SRVR:AM3PR05MB1268; x-forefront-prvs: 0132C558ED spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Nov 2016 05:52:56.4908 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR05MB1268 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uAK5rCtM026815 Content-Length: 1961 Lines: 59 Hi Wolfram, > -----Original Message----- > From: Wolfram Sang [mailto:wsa-dev@sang-engineering.com] > Sent: Saturday, November 19, 2016 11:05 PM > To: Vadim Pasternak > Cc: wsa@the-dreams.de; linux-i2c@vger.kernel.org; linux- > kernel@vger.kernel.org; jiri@resnulli.us; Michael Shych > > Subject: Re: [patch v8 1/1] i2c: add master driver for mellanox systems > > Hi, > > looks mostly good. I just found this comment which needs clarification: > > > + /* > > + * All upper layers currently are never use transfer with more than > > + * 2 messages. > > Have you really checked ALL of the upper layers? And even if so, there is the dev- > interface to userspace which allows for arbitrary I2C transfers using I2C_RDWR. > We are using the next drivers on our switches: max11603, lm75, pmbus, mlxsw_minimal (last one is new, I wrote it to support Mellanox ASIC and it's has 32 byte limitation for I2C transaction chunk) and at24. I am planning to add some code in the next patch, for handling bufferization for message length greater then data buffer. Allowed by HW. Possibly I should add validation for "num" parameter at the beginning of mlxcpld_i2c_xfer? > > Actually, it's also not so relevant in Mellanox systems > > + * because of HW limitation. > > What kind of HW limitation do you mean here? Can Mellanox send more than > two messages? > > > Max size of transfer is o more than 20B > > "is o more"? Typo? Typo. Max size of transfer is not more than 32 bytes. > > > + * in current x86 LPCI2C bridge. > > What does that mean in result? In case more than 32 bytes of data length will be set in transaction, such message will fail length validation. The 32 is HW limitation - 32 registers of DATAx. In new version of LPCI2C logic, there is 64 registers, which can be used for data, and I am going to support it in next patch for this driver. > > Regards, > > Wolfram Thanks, Vadim.