Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp907262pxf; Wed, 7 Apr 2021 14:44:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkJrZvXIVNT9dvqEoLfZxbT0Uvou72CmnZNQt7r9jxD+42dwjDJtJi+Vef/cXL3rb6DIHx X-Received: by 2002:a50:ed08:: with SMTP id j8mr7214749eds.351.1617831894158; Wed, 07 Apr 2021 14:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617831894; cv=none; d=google.com; s=arc-20160816; b=Unf2CsOYun8I//F2ErMKYyezYUnLnpkKCT/AIDOzN/p1lCoff7xjzaUSruw2PFW4sn M/nkpxJ58yKCydavAefWGEDjjbQfEOiJ/wYnp628zsujXaEvjBi5k3RYiedG1lcQOvEr mzHlth27syWWFuQykLiELvSytHwWYKhpS98CrA7XYPH80PPSvUncavE+BHWWa7m2dTK1 BYW/86pilF9ZJXIAfVRMYn3XI7imdYSDw5/g1ZUl1QXp1Zqsufiso7llZLXGh0Edi3/C MpubVHPDqfEpN64NFXoc47bN0qM4fE6ddwhfpmY6/hxCQHdn1n0gC7ceWhtxCnF53lEV rt+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:from:user-agent:references:ironport-sdr:ironport-sdr; bh=GOA5WEWsXh9r0V/99dEv7lzhowiFg11ke8a4cpz2iGg=; b=Pj0hVJ3H3r+ju4b9Z1AY8uUByJJjYF3t9xu2tlZGmHNwA59OhE7LMwzd714xtC/rJU 6WcAOhN2gQ+pyRJ+EOWA4Fw+QUpOjStUPG9h2JtKcW4u0U8PE8oj4dXFyv94oIzZyy9L 60xtmHHwukjtfH5et4T8/x/CHJ5G+gdJnTGvl49r0QIyTcF2suKvMSBreApCb1fN5gwk wSV5ksiw9vvI+KS4dB8gESNu8hI8Cvknp2kvVFQzfip6QRx3i4T/7dbB/5uTVnMncUNo ZvKIAPXFOGjONj6JNN41sdg9m7PfqwkDBqaV436tyzQ4A837J8/tH4gI2plro3SWpGxH rv1w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si763823edd.19.2021.04.07.14.44.30; Wed, 07 Apr 2021 14:44:54 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348080AbhDGRXB (ORCPT + 99 others); Wed, 7 Apr 2021 13:23:01 -0400 Received: from mga03.intel.com ([134.134.136.65]:44718 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354793AbhDGRW4 (ORCPT ); Wed, 7 Apr 2021 13:22:56 -0400 IronPort-SDR: NvYdEg7dBCcx2y7w/UeX8UUFtbIW3h2I0w/n0cm4RP9TDI4V5uPElchIwyoNIRPs7FiXKgk/zM 2bOIbvlXFh4A== X-IronPort-AV: E=McAfee;i="6000,8403,9947"; a="193402814" X-IronPort-AV: E=Sophos;i="5.82,203,1613462400"; d="scan'208";a="193402814" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2021 10:22:46 -0700 IronPort-SDR: KwRl/Bnk4CW00c6/1V3Y0pBj3HWwW469ITP0J+7ckACoT5J/yen/fYNsRM+UpncpcDyIEyF8sr 7soW871bFdKw== X-IronPort-AV: E=Sophos;i="5.82,203,1613462400"; d="scan'208";a="519516437" Received: from gna-dev.igk.intel.com (HELO localhost) ([10.102.80.34]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2021 10:22:43 -0700 References: <20210324183610.4574-1-maciej.kwapulinski@linux.intel.com> <20210324183610.4574-2-maciej.kwapulinski@linux.intel.com> User-agent: mu4e 1.4.13; emacs 26.3 From: Maciej Kwapulinski To: Andy Shevchenko Cc: Greg Kroah-Hartman , Arnd Bergmann , Jonathan Corbet , Derek Kiernan , Dragan Cvetic , Linux Kernel Mailing List , Linux Documentation List , Tomasz Jankowski , Savo Novakovic , Jianxun Zhang Subject: Re: [PATCH v2 01/13] intel_gna: add driver module In-reply-to: Date: Wed, 07 Apr 2021 19:22:40 +0200 Message-ID: <85sg42nh5r.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Shevchenko writes: > On Wed, Mar 24, 2021 at 8:38 PM Maciej Kwapulinski > wrote: >> .... >> diff --git a/include/uapi/misc/intel/gna.h b/include/uapi/misc/intel/gna.h >> new file mode 100644 >> index 000000000000..a7e435b74a0a >> --- /dev/null >> +++ b/include/uapi/misc/intel/gna.h >> @@ -0,0 +1,155 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ >> +/* Copyright(c) 2017-2021 Intel Corporation */ >> + >> +#ifndef _UAPI_GNA_H_ >> +#define _UAPI_GNA_H_ >> + >> +#if defined(__cplusplus) >> +extern "C" { >> +#endif > >> +#include >> +#include >> +#include > > Ordered? > What do You mean? >> ...... >> +struct gna_compute_cfg { >> + __u32 layer_base; >> + __u32 layer_count; >> + >> + /* List of GNA memory buffers */ >> + __u64 buffers_ptr; >> + __u64 buffer_count; >> + >> + __u8 active_list_on; >> + __u8 gna_mode; >> + __u8 hw_perf_encoding; >> + __u8 pad[5]; >> +}; >> + >> +union gna_parameter { >> + struct { >> + __u64 id; >> + } in; >> + >> + struct { >> + __u64 value; >> + } out; >> +}; >> + >> +union gna_memory_map { >> + struct { >> + __u64 address; >> + __u32 size; >> + __u32 pad; >> + } in; >> + >> + struct { >> + __u64 memory_id; >> + } out; >> +}; >> + >> +union gna_compute { >> + struct { >> + struct gna_compute_cfg config; >> + } in; >> + >> + struct { >> + __u64 request_id; >> + } out; >> +}; >> + >> +union gna_wait { >> + struct { >> + __u64 request_id; >> + __u32 timeout; >> + __u32 pad; >> + } in; >> + >> + struct { >> + __u32 hw_status; >> + __u32 pad; >> + struct gna_drv_perf drv_perf; >> + struct gna_hw_perf hw_perf; >> + } out; >> +}; > > For all unions: > How do you know which branch is used (out, in)? What field and where > in the ABI points to that? each of the unions above plays the role of in/out argument to its corresponding ioctl call. 'in' part is used when ioctl() is called by client (userland application) - data is written by app. 'out' part is read by app on exit from ioctl(), but only when ioctl() retuns 0. do You suggest adding the comment to gna.h for the above? > .....