Received: by 10.223.176.46 with SMTP id f43csp4721535wra; Tue, 23 Jan 2018 13:39:12 -0800 (PST) X-Google-Smtp-Source: AH8x226QWw1Iv76qW6ujeEeLbdRZyCrNr/ESQL90Ved4LcdL+fy6b6zKsYwhr2EAhz3zmi8Y7sHS X-Received: by 10.36.57.5 with SMTP id l5mr5419295ita.97.1516743551967; Tue, 23 Jan 2018 13:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516743551; cv=none; d=google.com; s=arc-20160816; b=Aorvgf3knsqmMvCNDxfBTwFmM4nkiyzX9vuutQFl13nyRhw9+ba40aJhe8FfBHC5q+ PQaiqwqO5jvwn+yvppqM23BJfKAR0dY0kJk98MWs6U//6dFmWlaG4FpeDBVoHCrPBLqW EWdnXDUUTq/sD12d3GZKSu8vYQrGP5v1PzEFpCoVzQGzzmEM7zp6fP8vZ1WFOz936IX+ iaFCtWw0Iyy0aWZN2Dh0IS2dLxbW+3cs/le9CWry2AwDt1DYhbapQXct1jHOnWx5Uybq 65KuXNhzrxyk6N/+FVEsDEfCrygDW7rH3h3QgvSVP9jHJYbtD93Se5yDLbTSbD33kcqK QepA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=bWa1vLeillHB9jEvdpAVtsaKptZYYs+Zep5vHievDmg=; b=h9mMN99NFeIQt1VQQgtvZ0w1popHNe4OJeuon7plv3/6Ytmf4FIYuazL9qNPrUmszj dfLqueVja5oEufphuIP3eqCRyEOjboPfMKXU3bLdneS8XxcnNrume9kK290nhfBGC/Vj Zzo3CaywAczE/IBwQ6j0VeJyMLlbzNN925gADqoPOtEcB/t5Rml5QGIFfHK+PriKpVG/ vdgMP+Q6W1iNT0pmAxDZYafBs5ihdA15Lzli+NgAHhqPOrS3+a+PDtghKB4ju1YgVC9G cUyLCNc6Oe2/o2EzfI6aLj1ft540D10X4VemMQdw/Rul/ER1EIOsFCsFB2vj1oagsAWc WM3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nX7PYqmC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8si9347500ita.37.2018.01.23.13.38.55; Tue, 23 Jan 2018 13:39:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nX7PYqmC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932132AbeAWVi3 (ORCPT + 99 others); Tue, 23 Jan 2018 16:38:29 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:45639 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752591AbeAWVi2 (ORCPT ); Tue, 23 Jan 2018 16:38:28 -0500 Received: by mail-it0-f67.google.com with SMTP id x42so2734533ita.4 for ; Tue, 23 Jan 2018 13:38:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bWa1vLeillHB9jEvdpAVtsaKptZYYs+Zep5vHievDmg=; b=nX7PYqmCpxADrGXTrFM5W9hS5aC/J+QVNXtPmJw7SmOXd/jvaEQHFhbB2yPmDG6ZFJ NJvYMjiNl8Y+sEfjQbc4R8K550OLzBQjnLPLOglWDCh55Q3PdCnXZg797XznrsPh6d23 E7wnpSjEP0sn6weUv85nhx4uPDL4e8Q5LSc9M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bWa1vLeillHB9jEvdpAVtsaKptZYYs+Zep5vHievDmg=; b=jp7UVKiv8fpR3F/AGaI8JPwyiMfhO9CRXpFQuxEyci+W1+TFkoxEnCvG+VqBuEkmrq XUGhMXDx7fUTG6RHIEc3dmbRKKGKkO8JHbzt6YkObp6OhqAL/gMLNbLymJAc1aaHAO4t sSY4C091xdFq/9QT0CXMwlU5QQq91+GCHOu7jH8Byf349SkMT/giVmH8LCclLGDBTh8s bDnCocFEyKhw3m85zKl7Q1Q+/cFtd/4yJn6xmjyspZ2rVPn6LCGphizEr5zAtMWsbt8N Wa9E2iYJuWxS4oP4YRrUQ/S8oBuzgP0yy8vMeFXefhX0SA/EjdXV0KWED9z6W+K/xWsz MhXA== X-Gm-Message-State: AKwxytdZh49jc16YIcbA+Mn71lJndrxOEjYdHeKpCBBP1rivf4YYQQE8 6/XO5xTGfQYlmd/dbtfWhmXSYTxBns4= X-Received: by 10.36.29.81 with SMTP id 78mr5735523itj.53.1516743507876; Tue, 23 Jan 2018 13:38:27 -0800 (PST) Received: from mail-io0-f171.google.com (mail-io0-f171.google.com. [209.85.223.171]) by smtp.gmail.com with ESMTPSA id v198sm5831536ita.3.2018.01.23.13.38.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jan 2018 13:38:27 -0800 (PST) Received: by mail-io0-f171.google.com with SMTP id c17so2552549iod.1 for ; Tue, 23 Jan 2018 13:38:26 -0800 (PST) X-Received: by 10.107.170.148 with SMTP id g20mr5688435ioj.206.1516743506215; Tue, 23 Jan 2018 13:38:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.203.194 with HTTP; Tue, 23 Jan 2018 13:38:25 -0800 (PST) In-Reply-To: <20180123142618.28384-2-philippe.cornu@st.com> References: <20180123142618.28384-1-philippe.cornu@st.com> <20180123142618.28384-2-philippe.cornu@st.com> From: Brian Norris Date: Tue, 23 Jan 2018 13:38:25 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 1/2] drm/bridge/synopsys: dsi: Fix dsi_host_transfer() return value To: Philippe Cornu Cc: Archit Taneja , Andrzej Hajda , Laurent Pinchart , David Airlie , Benjamin Gaignard , Bhumika Goyal , dri-devel@lists.freedesktop.org, Linux Kernel , Sandy Huang , Heiko Stubner , linux-arm-kernel@lists.infradead.org, "open list:ARM/Rockchip SoC..." , Yannick Fertre , Vincent Abriou , Alexandre Torgue , Maxime Coquelin , Ludovic Barre , Mickael Reulier Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Philippe, On Tue, Jan 23, 2018 at 6:26 AM, Philippe Cornu wrote: > The dw_mipi_dsi_host_transfer() must return the number of > bytes transmitted/received on success instead of 0. I'm a little confused. As of the latest drm-misc-next I'm looking at, this still has conflicting documentation. For ->transfer(): On success it shall return the number of bytes * transmitted for write packets or the number of bytes received for read * packets. While mipi_dsi_generic_read() says: * Return: The number of bytes successfully read or a negative error code on * failure. But it just returns the value that ->transfer() returns. So I'm not sure whether the documentation is still wrong, or if the implementation is. Anyway, I guess maybe that isn't super-critical to *this* patch, since we don't have RX support yet... > Note: nb_bytes is introduced in this patch as it will be > re-used with the future dcs/generic dsi read feature. It feels like you could just wait to add that when you need it? It really feels trivial and useless right now :) Brian > > Signed-off-by: Philippe Cornu > --- > drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > index f458798af788..096cf5e5bb30 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > @@ -403,7 +403,7 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, > { > struct dw_mipi_dsi *dsi = host_to_dsi(host); > struct mipi_dsi_packet packet; > - int ret; > + int ret, nb_bytes; > > ret = mipi_dsi_create_packet(&packet, msg); > if (ret) { > @@ -413,7 +413,13 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, > > dw_mipi_message_config(dsi, msg); > > - return dw_mipi_dsi_write(dsi, &packet); > + ret = dw_mipi_dsi_write(dsi, &packet); > + if (ret) > + return ret; > + > + nb_bytes = packet.size; > + > + return nb_bytes; > } > > static const struct mipi_dsi_host_ops dw_mipi_dsi_host_ops = { > -- > 2.15.1 >