From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfram Sang Subject: Re: [PATCH] i2c: axxia: Add I2C driver for AXM55xx Date: Mon, 22 Sep 2014 13:04:55 +0200 Message-ID: <20140922110455.GA1463@katana> References: <1408967482-17723-1-git-send-email-anders.berg@avagotech.com> <20140920121242.GA3833@katana> <20140922095939.GB1406@katana> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YiEDa0DAkWCtVeE4" Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Anders Berg Cc: devicetree , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > >> >> + if (msg->len =3D=3D 0 || msg->len > 255) > >> >> + return -EINVAL; > >> > > >> > Ouch, really? Maybe we should warn the user here. > >> > >> Yeah, the transfer length register limits the length to 255. I'll add > >> a warning here. > > > > Please also add this information to the Kconfig description and > > somewhere at the top of the source file. This is an important flaw which > > people should easily find out about. > > >=20 > You are referring to the "len <=3D 255" restriction being the flaw here, > right? I'll add a note to Kconfig and the driver about that. Yes, I meant that. I just remembered we should do something else: Remove I2C_FUNC_I2C (because it cannot do endless transfers) from functionality and simply use I2C_FUNC_SMBUS_I2C_BLOCK which does I2C like transfers with the SMBus Limit of 32 bytes. It seems PMBus allows for 255 byte which this HW could support, yet I don't recall we have support for that size currently. > The other part of the condition (msg->len =3D=3D 0) should actually go > away. The controller can do zero-length-data transfers. I'll fix that > for next round. Great! --YiEDa0DAkWCtVeE4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUIAJXAAoJEBQN5MwUoCm2ot4P/idz7ZXL1HjoDH8KMlAruwpZ 2fBWLCGGBhf4hJJsykZcXdkdFWcgolHPfc8XPy9vn+FpseCPwZgkJl8h228lZi16 hRyNEF6wP1KsWbGMbRXkb6oqpx/mcNSp/C8JkbNtQ9PkFGJxuET3OIjxLb6KyYvD +vpLBa33D+fiP2UCF6Far2yu2LMYQsn9Cd5ClJYrCqv3xXfrHuTSwrtW4Dm1WnCz ObYYCO2T37sYPI/iSgmST1sukkwdgHBAUgwOD0s8F3U9A72TbnrQ1vBycRa43dIJ W7j+IwzzZZ+kFdpusrXaiJTyYzQKINAjOswv3neZyLkc6da/Nwl9oCQ1KZYMp6J1 RRpAkQaOMZ0INHCpA4+Mn2ruaxpry5YLsQC0yk5t/p1W4yIqgZl3bBRtK9rh1eym wtr4nNivyPXgB0rO8qMRlmOXTaRHA8txyDcxT6CdUE+uUIgpabyrUCENSM3PW50b H/LxPbDY1bzs4WQoQGtdAoEzBvImIEANc4mdYT9tLD/mrZNunS4nwZ0gjcc1ka0D FP6cTYMNQgOjvh6IRNdWdWkofFsQOYYu4d0UNnXeTVQPCtdwoyZ9ySwk3VXBk35f OzwkSzvumUDNEx3u5YeezzDeVy8jUPpl2hQQhjZlojBFvhukTMtfPoV7e2Vja50d QKSGgarrn94AaCQxB0dj =/9Zg -----END PGP SIGNATURE----- --YiEDa0DAkWCtVeE4--