Received: by 10.223.176.46 with SMTP id f43csp1079595wra; Wed, 24 Jan 2018 10:15:33 -0800 (PST) X-Google-Smtp-Source: AH8x224pTWxNRco6S+e8ilNmIhDX0+fH3K2bs7JwOXIsp/Nk4KgHOBDHx6rjrtOR8ckTJhu+HAkV X-Received: by 2002:a17:902:8d85:: with SMTP id v5-v6mr8813270plo.37.1516817733022; Wed, 24 Jan 2018 10:15:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516817732; cv=none; d=google.com; s=arc-20160816; b=Ycn3ygkKBJJ8r2cZ5U/dNN+xOwz5ejZoVHLfBoI+WgritcAXcAdwLKvb5Ez+vAWdyf FDvoalmrCNQ46VV51g72gM6BDmsVUW5dOXuEnsiXnrwRzcxWCYPN1cCnYf6WyHkB318/ LhmhTqJtbhlshXEzPA3ZOCPhbLMfWCzTi6USMSdLpaV9GfOnH+YKQHs7cG+xn6FvlnOh SiYhUaKATa0GlGnY2L6imH3Wdc/nSRUo6X7qy1rQXknvBIuHIy3GqG4j/7o8yzkkQ1qf 8Q82RC1hbj3iCk5TyanJ5+TXLDajtWgfQwE6kYol86qdwy2ou/Tkx8yqd+pzTyniN9t/ mArA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=WQWVRpwaMY52u1tqv43bOhqms2TNJoRPn7sg0+mgaQQ=; b=UmvByI7IZRv+So1P66Eb+bWO4sADJ9ov4uBp+K6m77GRQ3baYM0uJw2ULB7GT6inV/ 1GeugIqaktc3eYwjqiO6hgJYeW3GoaVKUaL5I1YF0h+oqkwir5NZL7vhHSZYJQpmKdX4 6+jyX/nO/RAtYKKY/NyYOK3JfBah7B1p8x6lJdlZvD/u2YhH0/S5gifZ6ANPTdoWqk2z n7cwCN5O+Plks0v3IvQoG6HBqY/QPTgnYoc8v7YO0WnPrkDGymwCCq2u/atTYFYLebN8 z8Q7AP+aCMR3trY6+K3NHqcVJwhnPgD6ZjGLY4yBl5mI7iEsAzdMVKQ82TAgb7mGMkTP 39FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JGvoyFTP; 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 e39-v6si541377plg.100.2018.01.24.10.15.18; Wed, 24 Jan 2018 10:15:32 -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=JGvoyFTP; 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 S965012AbeAXSOy (ORCPT + 99 others); Wed, 24 Jan 2018 13:14:54 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:40438 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964953AbeAXSOw (ORCPT ); Wed, 24 Jan 2018 13:14:52 -0500 Received: by mail-pf0-f194.google.com with SMTP id i66so3713264pfd.7 for ; Wed, 24 Jan 2018 10:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=WQWVRpwaMY52u1tqv43bOhqms2TNJoRPn7sg0+mgaQQ=; b=JGvoyFTPaMCX9vr4oSVxfRa1eagB2LjlL7Srlof+hvF/d1yEAG3HQyPVTqHG5IaWD8 fB4XLahz5pW8ZiC0ZpKSQWvK+rgGglMfw+OpUg4peNUgJUVHodEtFa28NBiA+upXp48D FvT3ishesDIdBBsbSC084B3Sn4UdTQIPGW82w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=WQWVRpwaMY52u1tqv43bOhqms2TNJoRPn7sg0+mgaQQ=; b=V4nDQhPsMDRmkO/s/cK9MK/3QHga5caCQf2ZOmD6j5YN0B0uJ6JXa3I5DfX7Rto0oc Dbddr1/0/8YssmzpvAYp8spqXJbU/Ii8x2Mqx+yqlCTYyzTF9b8eDmjvfR5Qt6xzNyVc L2UAHjRFKlGMMu4DBGDzUGDJlQLcUiTSMwhSuo8wiba3Dy1Cli+/vDO1OYz7F7q1muK8 v9AloJ0ZXiCNGtOZIreVLlGmbmUyzXD7D+X0jT3M+8UwSR1ftIgdbMuEFbM3tX0m28cn HiuxXCFSjGLLWwbAb6A8NywTVKkDhqBg3SLUPZUQD6bOTK7QLtWvK0qKI8Zhb09oglVi oukQ== X-Gm-Message-State: AKwxytfsHCYdczQvOKCUaztq0SAbks8rUAOQuabEE/Uc6nIHReC7puKD RfTroYev8jvsviEggZ4DTktQrw== X-Received: by 10.99.191.15 with SMTP id v15mr11515302pgf.216.1516817692036; Wed, 24 Jan 2018 10:14:52 -0800 (PST) Received: from ban.mtv.corp.google.com ([172.22.113.17]) by smtp.gmail.com with ESMTPSA id 76sm10920807pfp.54.2018.01.24.10.14.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2018 10:14:51 -0800 (PST) Date: Wed, 24 Jan 2018 10:14:49 -0800 From: Brian Norris 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 Subject: Re: [PATCH v1 2/2] drm/bridge/synopsys: dsi: Add a warning msg on dsi read operations Message-ID: <20180124181449.2fi5l3wdllvxn5re@ban.mtv.corp.google.com> References: <20180123142618.28384-1-philippe.cornu@st.com> <20180123142618.28384-3-philippe.cornu@st.com> <369181f6-1bb4-0559-86c9-5528be7fc459@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <369181f6-1bb4-0559-86c9-5528be7fc459@st.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Philippe, On Wed, Jan 24, 2018 at 01:22:04PM +0000, Philippe CORNU wrote: > On 01/23/2018 10:28 PM, Brian Norris wrote: > > I see you sent this out already today, while I only just responded > > (late) to your questions about it... oh well :) > > > > I got a short period to clean-up and adds features to this driver (1.31 > ip version + maybe the read feature), sorry to have not wait a single > day more. No problem. The key word was "late"; my mail was buried enough I just missed responding. Not your fault! > > 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. > > > > Many thanks for your review. > > I agree with your comments. > > Well, my patch is not good at all because it contains a small part of > the read feature I am writing... but it is not the purpose of this patch. > > No excuse, sorry guys for making you waste time. No worries. These weren't that bad anyway, just a little suboptimal :) > I will re-write a new patch 100% decorrelated from a possible future > read feature. Yeah, that would probably work best. It's hard to write and review good "intermediate" code; we should write it as if the code will last as-is. > I could also wait until I have a working read feature but as it could > take some times, I prefer warning users asap. Sounds good. [snip] Thanks, Brian