On Fri, Jul 03, 2020 at 04:13:41PM +0200, Paul Cercueil wrote:
The function mipi_dbi_spi1_transfer() will transfer its payload as 9-bit data, the 9th (MSB) bit being the data/command bit. In order to do that, it unpacks the 8-bit values into 16-bit values, then sets the 9th bit if the byte corresponds to data, clears it otherwise. The 7 MSB are padding. The array of now 16-bit values is then passed to the SPI core for transfer.
This function was broken since its introduction, as the length of the SPI transfer was set to the payload size before its conversion, but the payload doubled in size due to the 8-bit -> 16-bit conversion.
Fixes: 02dd95fe3169 ("drm/tinydrm: Add MIPI DBI support") Cc: stable@vger.kernel.org # 4.10
"dim fixes 02dd95fe3169" provides the following output: Fixes: 02dd95fe3169 ("drm/tinydrm: Add MIPI DBI support") Cc: Noralf Trønnes noralf@tronnes.org Cc: Thierry Reding treding@nvidia.com Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard mripard@kernel.org Cc: Thomas Zimmermann tzimmermann@suse.de Cc: "Noralf Trønnes" noralf@tronnes.org Cc: Sam Ravnborg sam@ravnborg.org Cc: David Lechner david@lechnology.com Cc: Hans de Goede hdegoede@redhat.com Cc: Eric Anholt eric@anholt.net Cc: dri-devel@lists.freedesktop.org Cc: stable@vger.kernel.org # v4.11+
I assume the "Cc: stable@vger.kernel.org # 4.11+" is more correct?
Sam
Signed-off-by: Paul Cercueil paul@crapouillou.net
drivers/gpu/drm/drm_mipi_dbi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index bb27c82757f1..bf7888ad9ad4 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -923,7 +923,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *dbi, int dc, } }
tr.len = chunk;
len -= chunk;tr.len = chunk * 2;
ret = spi_sync(spi, &m); -- 2.27.0