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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 8FBC1C433E0 for ; Mon, 1 Mar 2021 12:13:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48AE364E40 for ; Mon, 1 Mar 2021 12:13:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233570AbhCAMNh (ORCPT ); Mon, 1 Mar 2021 07:13:37 -0500 Received: from mga02.intel.com ([134.134.136.20]:6607 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233549AbhCAMNe (ORCPT ); Mon, 1 Mar 2021 07:13:34 -0500 IronPort-SDR: BS4RFWLEvZ7zv7SId9PfN/by8ttb3Zs1Z2DgQJ2mg3PiWP+IyCJM7nMFgXODo2AX5eMiUr1E/r XrugVuKbTQsw== X-IronPort-AV: E=McAfee;i="6000,8403,9909"; a="173573680" X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="173573680" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 04:11:47 -0800 IronPort-SDR: gUA0LbTEcUEdSQsKIp5iXeKjN/nBXDZy5Pog61nPnurKuGwW8gYLa17540bXo984ytkjKEQim2 /ez9RTGvHPaw== X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="435380350" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 04:09:35 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lGhMb-0098Ty-Ql; Mon, 01 Mar 2021 14:09:25 +0200 Date: Mon, 1 Mar 2021 14:09:25 +0200 From: Andy Shevchenko To: Viresh Kumar 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: 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: <20210301115441.a4s5xzwm6d6ohz7f@vireshk-i7> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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. -- With Best Regards, Andy Shevchenko 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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 0D53BC433DB for ; Mon, 1 Mar 2021 12:11:52 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8620B64E38 for ; Mon, 1 Mar 2021 12:11:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8620B64E38 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 3A6454301A; Mon, 1 Mar 2021 12:11:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lspY99Jat5Lp; Mon, 1 Mar 2021 12:11:50 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTP id 0392242FDF; Mon, 1 Mar 2021 12:11:49 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D0301C000A; Mon, 1 Mar 2021 12:11:49 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 64EEAC0001 for ; Mon, 1 Mar 2021 12:11:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5E41D83C76 for ; Mon, 1 Mar 2021 12:11:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FmEHtCkg2vgw for ; Mon, 1 Mar 2021 12:11:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by smtp1.osuosl.org (Postfix) with ESMTPS id D08CB83C3C for ; Mon, 1 Mar 2021 12:11:47 +0000 (UTC) IronPort-SDR: 7UIWdHtKs9HyAXQYtnLrNoIg8B/3IBr7WNlHeAmdfpo4gEbC9jdoIclgi6bjowEADrmZtmomf7 ZkUosCHH5n4w== X-IronPort-AV: E=McAfee;i="6000,8403,9909"; a="185764488" X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="185764488" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 04:11:47 -0800 IronPort-SDR: gUA0LbTEcUEdSQsKIp5iXeKjN/nBXDZy5Pog61nPnurKuGwW8gYLa17540bXo984ytkjKEQim2 /ez9RTGvHPaw== X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="435380350" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 04:09:35 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lGhMb-0098Ty-Ql; Mon, 01 Mar 2021 14:09:25 +0200 Date: Mon, 1 Mar 2021 14:09:25 +0200 From: Andy Shevchenko To: Viresh Kumar Subject: Re: [PATCH v5] i2c: virtio: add a virtio i2c frontend driver Message-ID: References: <00f826ffe1b6b4f5fb41de2b55ad6b8783b7ff45.1614579846.git.jie.deng@intel.com> <20210301115441.a4s5xzwm6d6ohz7f@vireshk-i7> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210301115441.a4s5xzwm6d6ohz7f@vireshk-i7> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Cc: Sergey.Semin@baikalelectronics.ru, bjorn.andersson@linaro.org, loic.poulain@linaro.org, arnd@arndb.de, mst@redhat.com, shuo.a.liu@intel.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, wsa@kernel.org, wsa+renesas@sang-engineering.com, jarkko.nikula@linux.intel.com, linux-i2c@vger.kernel.org, u.kleine-koenig@pengutronix.de, kblaiech@mellanox.com, tali.perry1@gmail.com, conghui.chen@intel.com, rppt@kernel.org, yu1.wang@intel.com X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" 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=B2C and SMBus support bidirectional transfers as well. I think two buffer= s is the right thing to do. -- = With Best Regards, Andy Shevchenko _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization