Received: by 10.223.176.46 with SMTP id f43csp4713545wra; Tue, 23 Jan 2018 13:29:26 -0800 (PST) X-Google-Smtp-Source: AH8x226q8rrKYfKzxG2NPUJ3MxDx3V1rQKrXIm4nEblL9jXhQ2C1ccbWdDONL88oA0BAM/zmkFcW X-Received: by 10.107.180.70 with SMTP id d67mr5948250iof.73.1516742966011; Tue, 23 Jan 2018 13:29:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516742965; cv=none; d=google.com; s=arc-20160816; b=uXSsxqg3IpIaCYDczM1Dz+Acy8EwfjI1csPhNoB537ZmA3vzDk3Lj5nCO1UwO14R3K zRritzxcPuZkF6VLsMGUBW649hfVIy/mu9/Exquu1SPBtftoRQCXJqLYLxV4rCj6evvP depsxOd5bDYjSmVOdRMRDAwere0+xqrlU5NA7odLTvNdjzbFWmQ7Li55gMdTD02U2uSk 1zl3pV9uzq3HDjiRwiZqYzhOPsjDLvs2E7JQghBdK2fv4XfBZ9px50Kg3c+gvbUdyJWz qwEEPSQG8yaVwo5Bb0mCyUavoBQ0EnhgRWfJ0vQUFA42p/CHy6DgaWm+ZiQ5IywVpGrM yzeA== 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=LLDfl4171JoFv1se2Dho+PLKa7MLlV/G+vzktrj4cmQ=; b=yoEJ3ZAlqBO7TguB17ELcHK8wOxjbeVQWu6YeLSMhU3cbkEGnbHYz9kDnK8IN5DWyB KXy+ssGXuxeL6uWV8pdkU87RBj7VSJsIUSYX1yEpGzFciuNtyoP4yGq9thyUvvx/EI0t QscxIQLWyIedy2E4Pau359KlKG0qwGiwrl1W0jsgBtnj37oYutbot06am04+KhdTAGVB rJVL6h8aGRZfRxvxMRvMHqoib84hAi8KETR88ju1ZR069B++oXnnsJPFWl8oJb+64arY wFbibRYGumYqcb7hF87GqFiMrlsrPcZYgh8nUEAsPcFpflvmq8gLI6urNE9d4rCteVRs kjCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IkKgLVNG; 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 p4si9075868iod.57.2018.01.23.13.28.59; Tue, 23 Jan 2018 13:29:25 -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=IkKgLVNG; 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 S932065AbeAWV2Z (ORCPT + 99 others); Tue, 23 Jan 2018 16:28:25 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:43177 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752455AbeAWV2Y (ORCPT ); Tue, 23 Jan 2018 16:28:24 -0500 Received: by mail-io0-f195.google.com with SMTP id 72so2503576iom.10 for ; Tue, 23 Jan 2018 13:28:23 -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=LLDfl4171JoFv1se2Dho+PLKa7MLlV/G+vzktrj4cmQ=; b=IkKgLVNGCXC5UC3xuA7Bdb1rJfstGx2rhnclEEYt3WvATcOFs3INQ1sKYTEJLwt8sk ibVucxLdA/9zFN61wakZUoC4P7sOlwUW2iSMXSEJBKeatNwKUyDu5hFVjJF21j4GjUv+ OwU7yIyomvyH4yDBdWEzIPA+odRKs81+eN2Lo= 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=LLDfl4171JoFv1se2Dho+PLKa7MLlV/G+vzktrj4cmQ=; b=Kk+a9lzuZR35tXaAFEdE6gcHhJOeTJ+Bcc5CmtJyqY38jQTfWKZCYA9YofBUOcGOxD tE5/vghPT41KtJVM0hVrLDfZu+diURhDbz47KnHjW/YXaLl0PUMEZd8jwgW9jqoYRhtx E3+ccwvPr4imAT4cDRuq3fI+F2Uunho02SLwrGfCRaYV9tO55456rSGPTwYkLmu7PQzG 2pBDwNpXgZGda5C9b678m7NxFLMxx56pV45U44BTUSzFIiGizlYnPDYqQjjLGiPhQt3s RYmYg8xtMlZb6GUfAyhwltHjjwtkO3BLdpAFqT+BNDoNbhiU9HfemH5F+3kD5vwlEw/t a+7g== X-Gm-Message-State: AKwxyteWlsut+m3diVy5lAsGM7xud/11cg+kQvxPRAEzG/l9p2P/KGlH FTQgevhuvsIO/RFnkoN9qpoy2t7+hl8= X-Received: by 10.107.28.201 with SMTP id c192mr5509440ioc.26.1516742903525; Tue, 23 Jan 2018 13:28:23 -0800 (PST) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com. [209.85.223.176]) by smtp.gmail.com with ESMTPSA id f16sm10001165iob.75.2018.01.23.13.28.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jan 2018 13:28:22 -0800 (PST) Received: by mail-io0-f176.google.com with SMTP id f34so2497632ioi.13 for ; Tue, 23 Jan 2018 13:28:21 -0800 (PST) X-Received: by 10.107.26.202 with SMTP id a193mr5783257ioa.19.1516742901069; Tue, 23 Jan 2018 13:28:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.203.194 with HTTP; Tue, 23 Jan 2018 13:28:20 -0800 (PST) In-Reply-To: <20180123142618.28384-3-philippe.cornu@st.com> References: <20180123142618.28384-1-philippe.cornu@st.com> <20180123142618.28384-3-philippe.cornu@st.com> From: Brian Norris Date: Tue, 23 Jan 2018 13:28:20 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 2/2] drm/bridge/synopsys: dsi: Add a warning msg on dsi read operations 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, I see you sent this out already today, while I only just responded (late) to your questions about it... oh well :) On Tue, Jan 23, 2018 at 6:26 AM, Philippe Cornu wrote: > The DCS/GENERIC DSI read feature is not yet implemented so it > is important to warn the host_transfer() caller in case of > read operation requests. > > Signed-off-by: Philippe Cornu > --- > drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > index 096cf5e5bb30..e46ddff8601c 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > @@ -417,7 +417,14 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, > if (ret) > return ret; > > - nb_bytes = packet.size; > + if (msg->rx_buf && msg->rx_len > 0) { It feels like you should do this check *before* you start writing anything. It's possible to have a combination TX/RX command, and it would be counterintuitive to only do half the operation then return with an argument error. > + /* TODO dw drv improvements: implement read feature */ > + dev_warn(dsi->dev, "read operations not yet implemented\n"); > + return -EPERM; I'm not sure -EPERM is right. Feels like -EINVAL, -ENOSYS, or -EOPNOTSUPP. I think -ENOSYS actually has been abused somewhat, so maybe one of the other two. > + Spurious blank line? > + } else { > + nb_bytes = packet.size; > + } You don't actually need to put this sort of thing in the 'else' case. The other branch is an error-handling case, which definitely 'return's early, and it's pretty standard coding style to avoid indenting the "good" path like this. Brian > > return nb_bytes; > } > -- > 2.15.1 >