Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754025AbbDUHY5 (ORCPT ); Tue, 21 Apr 2015 03:24:57 -0400 Received: from mail.fireflyinternet.com ([87.106.93.118]:57315 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751538AbbDUHYz (ORCPT ); Tue, 21 Apr 2015 03:24:55 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Date: Tue, 21 Apr 2015 08:24:45 +0100 From: Chris Wilson To: Dmitry Torokhov Cc: David Airlie , Daniel Vetter , Jani Nikula , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Linus Torvalds , Olof Johansson , Nick Dyer , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/i915: cope with large i2c transfers Message-ID: <20150421072445.GA18051@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Dmitry Torokhov , David Airlie , Daniel Vetter , Jani Nikula , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Linus Torvalds , Olof Johansson , Nick Dyer , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20150420221116.GA1261@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150420221116.GA1261@dtor-ws> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1565 Lines: 35 On Mon, Apr 20, 2015 at 03:11:16PM -0700, Dmitry Torokhov wrote: > The hardware is limited to 2^9 - 1 (511) bytes transfers, and current > driver has no protections in case users attempt to do larger transfers. > The code will just stomp over status register and mayhem ensues. Interesting. The spec says supports "0 to 256 byte" transfers in the introduction, but the register just says bits 16:24 are a byte counter without the extra limitation. I suspect the introductory blurb is inaccurate and it is implementated as a simple counter as demonstrated here. We should get that clarified in the specs just in case it was once limited to 256 bytes. > Let's split larger transfers into digestable chunks. Doing this allows > Atmel MXT driver on Pixel 1 function properly (it hasn't since commit > 9d8dc3e529a19e427fd379118acd132520935c5d "Input: atmel_mxt_ts - > implement T44 message handling" which tries to consume multiple > touchscreen/touchpad reports in a single transaction). > > Signed-off-by: Dmitry Torokhov The code looks good and I've only whitespace and variable scoping gripes, so Reviewed-by: Chris Wilson Though I am tempted to say we should impose the 256 byte limit for stable@ -Chris -- Chris Wilson, Intel Open Source Technology Centre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/