Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4291280pxb; Tue, 2 Mar 2021 11:13:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyemogPkxjS/z1IWEG4Qa7RHYdZEDeWt+M1reEc07AxgyuuzjJ+ZsOz87pTU67e+hVvpgN X-Received: by 2002:a17:906:63c2:: with SMTP id u2mr21878650ejk.346.1614712384043; Tue, 02 Mar 2021 11:13:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614712384; cv=none; d=google.com; s=arc-20160816; b=VHAV4fIToct1Iuc3JfA9kRtpp/maqmmQ0z2FYQH+H0ES3Hsms/CkuxKmm/N7eIq8EO 7zNdWhAqaF4opLJRamKA3Wn4209AX33iN49gvKBPMqn7/nxyT8dOOD+YQ3Eb5EybW2Tt D3KczbCKZbf+y/5wnAxTieOUoy/sRQknHoK2ASpIwxeeaskLNMKqepP3FkYjff/NVreS RJz7m96l3gepA+Mw1nt7rJUmrUTP20B3+aAbQhQwP/KWxTAu2aayQTr8T7oRZpm0uTLp 7YYkSa2PKHLK6GJCSFHWVvLQ5yHpshAAVP3ZMGImAwd02ePzZEGH/5+nyQZj97mBm/Mh yMYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9W7+TO0f4l1oeUZ2kxdZaL80iPIivjtmW4SAISVlUwA=; b=uv1EwM5yaTrUhW8HGgufRfET2mjDWIakDD8A1NnPxwKAWsqeXzxC99Q0aJpIXnZJ34 f2J40bFSqOyN0TnmvlDFOkQRgxBviN46B/Woj6jORFyQxIkZFGWd31jdQ3l0MdR8Q/uT DHM2saqIrupSKPID0+Jw+bgbU/CR+y49f9qEphBnG0lfKLfT4ECcFKbb37yRoovraR+b KnAH7mn/NGIrC9eKmQ63Xla025xmTlu2lZQdmHmjQpGTkU+GXoWLImNe84MyyCHjHEu6 ukIYKmBFFi9o/aM+Wo7OkucefVp/8aJti1IjPfsP+HtLGgEpHEQPoOplyUggsnW5lFb/ tQQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pvd3mHzS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v2si10791811ejg.251.2021.03.02.11.12.39; Tue, 02 Mar 2021 11:13:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pvd3mHzS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1577465AbhCBGWp (ORCPT + 99 others); Tue, 2 Mar 2021 01:22:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1576028AbhCBEXQ (ORCPT ); Mon, 1 Mar 2021 23:23:16 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97636C06178A for ; Mon, 1 Mar 2021 20:22:36 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id s16so11261910plr.9 for ; Mon, 01 Mar 2021 20:22:36 -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:in-reply-to:user-agent; bh=9W7+TO0f4l1oeUZ2kxdZaL80iPIivjtmW4SAISVlUwA=; b=pvd3mHzSbnat8rwuvGgMx1Rkbj4wzxvmwHI4vUb0EYlh0QNx/7rnLyICtbujHxiRXS zCw0Z01u0JSeBsmvfbWev/7w8RZiLnMN9IPzACgVJoSe4sCpXUQDSfOLmwBivzhrYOUE Aal60p8XyKOPaDwmN0Ny2ZHvb8WV6CbkiYNqEruxgK/jZmxv20sULGEmOWg0MFKOOoa3 lfgqqwvEOCtuC1AhdQGhCjnnJ3Atesb9aFVlJLwUo3lgB7xBNhVYvpOP7BrXk4Rwp1FM Uv1F881GHNs2J8l9xWf76rOjxsw5DajCt6XTYyzhQwDYXi1VN82iqcKVFwhP8RYn/vXq urNQ== 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=9W7+TO0f4l1oeUZ2kxdZaL80iPIivjtmW4SAISVlUwA=; b=Fwk2+JTEuGFKD927x1wU8iGJEWPudZcQ0To4o/N6IOidCZgTPc1tAbgUCoAknUIW9u opWVFlBrCVg82oNukt7ryhFEQK6M+n846XbMmi14YyWKQ8arv2tG4QWXxeCmWGVPdach tVhd6J8yS5VkfJj93gGjjScKzfRvY62gj5MOcLCQTybB2ZTgISNBJ2uIWuq9jW2bpAwP 4lsOKG17EoKPE20uq8Up14CP96I9PHXCsA70l6e+XfmFNpW63RrParJlmpnbVLo0brox ARdiIJj5qi45Qi/GWxYvTdx46pJYjJ/kFkZaL1Y5WF29qlBEH4iPlqp9NugZEoyR5box BrZQ== X-Gm-Message-State: AOAM530n9wSXvu8MW8Ge4Cv1DjB1OtBFUB0YJ040K7BoCvfBpzEX5PF9 FKvjPxg2pzDPwUbg255cAa5glg== X-Received: by 2002:a17:90a:bb0c:: with SMTP id u12mr2360894pjr.234.1614658956110; Mon, 01 Mar 2021 20:22:36 -0800 (PST) Received: from localhost ([122.171.124.15]) by smtp.gmail.com with ESMTPSA id b1sm20415638pfp.145.2021.03.01.20.22.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Mar 2021 20:22:35 -0800 (PST) Date: Tue, 2 Mar 2021 09:52:33 +0530 From: Viresh Kumar To: Arnd Bergmann Cc: Jie Deng , Linux I2C , virtualization@lists.linux-foundation.org, "linux-kernel@vger.kernel.org" , "Michael S. Tsirkin" , Wolfram Sang , Jason Wang , Wolfram Sang , Andy Shevchenko , conghui.chen@intel.com, kblaiech@mellanox.com, jarkko.nikula@linux.intel.com, Sergey Semin , Mike Rapoport , loic.poulain@linaro.org, Tali Perry , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Bjorn Andersson , yu1.wang@intel.com, shuo.a.liu@intel.com Subject: Re: [PATCH v5] i2c: virtio: add a virtio i2c frontend driver Message-ID: <20210302042233.7ppagwjk3rah3uh3@vireshk-i7> References: <00f826ffe1b6b4f5fb41de2b55ad6b8783b7ff45.1614579846.git.jie.deng@intel.com> <20210302040114.rg6bb32g2bsivsgf@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210302040114.rg6bb32g2bsivsgf@vireshk-i7> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02-03-21, 09:31, Viresh Kumar wrote: > On 01-03-21, 16:19, Arnd Bergmann wrote: > > On Mon, Mar 1, 2021 at 7:41 AM Jie Deng wrote: > > > > > --- /dev/null > > > +++ b/include/uapi/linux/virtio_i2c.h > > > @@ -0,0 +1,56 @@ > > > +/* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */ > > > +/* > > > + * Definitions for virtio I2C Adpter > > > + * > > > + * Copyright (c) 2021 Intel Corporation. All rights reserved. > > > + */ > > > + > > > +#ifndef _UAPI_LINUX_VIRTIO_I2C_H > > > +#define _UAPI_LINUX_VIRTIO_I2C_H > > > > Why is this a uapi header? Can't this all be moved into the driver > > itself? > > > > > +/** > > > + * 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; > > > +}; > > > > In particular, this structure looks like it is only ever usable between > > the transfer functions in the driver itself, it is shared with neither > > user space nor the virtio host side. > > Why is it so ? Won't you expect hypervisors or userspace apps to use > these ? This comment applies only for the first two structures as the third one is never exchanged over virtio. -- viresh