From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C57FC41518 for ; Tue, 2 Mar 2021 08:12:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 019C064DE7 for ; Tue, 2 Mar 2021 08:12:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1576962AbhCBFfO (ORCPT ); Tue, 2 Mar 2021 00:35:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242895AbhCBDor (ORCPT ); Mon, 1 Mar 2021 22:44:47 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF9CC0617AB for ; Mon, 1 Mar 2021 19:44:44 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id n10so12963835pgl.10 for ; Mon, 01 Mar 2021 19:44:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=6ocpLpD/YC8p2XAnodhqPke9yP3AITZZa1l575H6MVw=; b=JHRHOhgiaoddDWynTZrpm0LW4LFDXMQcRKcMcbdOJtmyfINwmNDmZaMLymueC48zTF LXjl5N8e8EOpVd1LA5MbOCgSlxkj1RdR2BeQM6PI5jAgFWEm7XBADNEzXblAl9KqDfDi PuTLvXSY63nOrAGOOCChUi0melOu/i/F+YJ15x0bo0t+RP0sMtujH7oEcHRuiCexKX1m hvpQ4OVX15bWs6b2Nq3+l1fkBIJcEoA7Z4rJJy0RyXkdYpbwOF7q1LXvIUMqeLmnDqFT u51n3nxiN4UR94MMNwleVgVd6peH3XMEfodhWsISfD9FlpHhIae/MdRoLXtPEUzVnJ22 XUzA== 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:content-transfer-encoding :in-reply-to:user-agent; bh=6ocpLpD/YC8p2XAnodhqPke9yP3AITZZa1l575H6MVw=; b=Mq+BEXwLOx2py34EKjjropoJjGzbzTOayPRr97+SRzKh3wO3ct14trdAqJTRBL/vI5 rH49m+boTQF0qH0qFA7TttVb82FeA85uYwKyPFm3ffSeHd0+Dmrzvh1+ONaThbw6K0pr jfI2H11kV0NrjoDDTeO9rPNT37Da/PV1w5ZiKWUT9yOQiQioktYIiKpZKkT53cJ2Vn1o CDy1PWtfOzyBtVwzur6BycmvoHe0YHyPSCzbMiG8uW8v5vQf4dfj8AOBWpfi1Qnrl203 46dUe67VMEW/NxcRdF1ZbeK9WYberD6zaG9FPiaTFbCYxutIDSdi/cEz6CEDTf/fLq2u vMug== X-Gm-Message-State: AOAM531iZ0NmwAY/xhsSioicnxOV/0yFpzXTO7Shnyx360h8mmVzXA25 uuYI2ZyqnSXx7JRCUh1YyAmJFA== X-Google-Smtp-Source: ABdhPJx/Q+oofnFLde6CKHvTI9rHRmh2kqI4wTqTF5wpOq8Djwac9vMGULsXLHbE4mwfBcRp/551Ww== X-Received: by 2002:a63:374f:: with SMTP id g15mr16584551pgn.212.1614656684033; Mon, 01 Mar 2021 19:44:44 -0800 (PST) Received: from localhost ([122.171.124.15]) by smtp.gmail.com with ESMTPSA id l19sm1018928pjt.16.2021.03.01.19.44.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Mar 2021 19:44:43 -0800 (PST) Date: Tue, 2 Mar 2021 09:14:41 +0530 From: Viresh Kumar To: Andy Shevchenko Cc: Jie Deng , linux-i2c@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, mst@redhat.com, wsa@kernel.org, jasowang@redhat.com, wsa+renesas@sang-engineering.com, conghui.chen@intel.com, arnd@arndb.de, kblaiech@mellanox.com, jarkko.nikula@linux.intel.com, Sergey.Semin@baikalelectronics.ru, rppt@kernel.org, loic.poulain@linaro.org, tali.perry1@gmail.com, u.kleine-koenig@pengutronix.de, bjorn.andersson@linaro.org, yu1.wang@intel.com, shuo.a.liu@intel.com Subject: Re: [PATCH v5] i2c: virtio: add a virtio i2c frontend driver Message-ID: <20210302034441.dcmrx4ughbtusolg@vireshk-i7> References: <00f826ffe1b6b4f5fb41de2b55ad6b8783b7ff45.1614579846.git.jie.deng@intel.com> <20210301115441.a4s5xzwm6d6ohz7f@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01-03-21, 14:10, Andy Shevchenko wrote: > On Mon, Mar 01, 2021 at 02:09:25PM +0200, Andy Shevchenko wrote: > > On Mon, Mar 01, 2021 at 05:24:41PM +0530, Viresh Kumar wrote: > > > On 01-03-21, 14:41, Jie Deng wrote: > > > > +/** > > > > + * struct virtio_i2c_req - the virtio I2C request structure > > > > + * @out_hdr: the OUT header of the virtio I2C message > > > > + * @write_buf: contains one I2C segment being written to the device > > > > + * @read_buf: contains one I2C segment being read from the device > > > > + * @in_hdr: the IN header of the virtio I2C message > > > > + */ > > > > +struct virtio_i2c_req { > > > > + struct virtio_i2c_out_hdr out_hdr; > > > > + u8 *write_buf; > > > > + u8 *read_buf; > > > > + struct virtio_i2c_in_hdr in_hdr; > > > > +}; > > > > > > I am not able to appreciate the use of write/read bufs here as we > > > aren't trying to read/write data in the same transaction. Why do we > > > have two bufs here as well as in specs ? > > > > I²C and SMBus support bidirectional transfers as well. I think two buffers is > > the right thing to do. > > Strictly speaking "half duplex". Half duplex is what this driver implemented, i.e. only one side can send a msg at once, we don't need two buffers for that for sure. Though we need two buffers if we are ever going to support full duplex. -- viresh