Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1888383imu; Sat, 26 Jan 2019 13:15:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN5earYaDDnbtmW+zgkcybvaSKm9FLgsiS++u9V6p3yszDYncau0+qiTPfbp7B5TxzVeohgd X-Received: by 2002:a62:c583:: with SMTP id j125mr16316895pfg.37.1548537348224; Sat, 26 Jan 2019 13:15:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548537348; cv=none; d=google.com; s=arc-20160816; b=e9eDVv8s6ddthkFAii8pvluvvitLU2buAM429UJ64va1zpyfdbcptp8azVCLZmWdgF YNohKExtjg4b2gNSlYied6Bdwl2vWRJR42VxmWBpwrRwQPdnOknCyGq2Ih0Ehj4DbRHe FyoeGX8h3ZoUAhgQuiThdBTKMBDUQj5uWNxQ+wqgkw++hRADbmkdLr40PXfWOZ6d0hr+ 5oslOT0BiNVXPxWnFnhCCz+HHycVW/yNHToeUmYx4ytI7fYE9DVie3G0QI21/E4AX5au iXDltuWUd1H/sG0yVpNVeXG1Hio5NE4gXy9cDhq/FJOplWWevepPLFvTciDX9otjTC8D qWjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=ZQMGx38XhBGTMF/0CaQDgyTCsEgvPq5pWGrKKNC/swQ=; b=pYD43bzyZXV5ufy1ioaws0lyVX7fqoS8HveYKrdSnprKy1V7yxi3Iw96e1ZWF2SlGB on219tH2aK+vGCUxFx5e1a6Pd8O99SzvyQY370PnPZLUfyKjuJ4m2XIVSRndvA1vjzXh /Tatq2t758zlVBUj9bVbWsFYMs7daRwAkiQu22lwbA/fDfNTky7xq+xGmsaSp3U9/GV+ bxbkjgtFboJOXr84rsghm9/Bv+hG07L2V2ikzft1IN/xWYPrItv4AGtBuT1HjWlUS9XJ A+krGqvZsQRn+wN1SoAvFGnnPxWmx1e7qUNtWZhpdJFR83dPzTJkxOwzhd8F70xcZmQ+ pAtA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si29102250pla.351.2019.01.26.13.15.33; Sat, 26 Jan 2019 13:15:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726461AbfAZVOk (ORCPT + 99 others); Sat, 26 Jan 2019 16:14:40 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:45822 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbfAZVOj (ORCPT ); Sat, 26 Jan 2019 16:14:39 -0500 Received: by mail-qk1-f196.google.com with SMTP id y78so7390872qka.12 for ; Sat, 26 Jan 2019 13:14:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZQMGx38XhBGTMF/0CaQDgyTCsEgvPq5pWGrKKNC/swQ=; b=mgqKoIkC/J2BhdPIQvWs1KkCEzEE7tno9NyoowhdDJ3or5uYEPRJvLpD3kBTq44jbG y118d98Ez2jYNO5oDVJu+DiDN5FzLfRAvckC0KgK839dpkHeYT7E1zGeiQpcd660rMJG e5bJxpQg2dJJUvJAQaHA4qm7Os1gO3zpDANQzU7OSRSX3ZaWJLrkbX/Ma0srpFL6XEGE a3RIkkzNfGufz/Q+vk8U6/1YFivQvZOcaNX/FP1wtV54Na023n2M7npQkeaHimgf8zep M6qqxzZdftQ4cgnk1EHlqmTmmRxJ8xDq6tM6s1Zr/Asjpwbc2OzEsGG8bFDdOd9qFXfX Rv2g== X-Gm-Message-State: AJcUukfjykLk/eZud6IECMZeBtVOSeN2Y5VIPEpqJxIyHiSh0EMmp3mA r1CPdjqghFIWHjY62tS80d0mdgT5Y8ce2zJbG2o= X-Received: by 2002:a37:9a89:: with SMTP id c131mr14580394qke.173.1548537279039; Sat, 26 Jan 2019 13:14:39 -0800 (PST) MIME-Version: 1.0 References: <20190123000057.31477-1-oded.gabbay@gmail.com> <20190123000057.31477-2-oded.gabbay@gmail.com> In-Reply-To: From: Arnd Bergmann Date: Sat, 26 Jan 2019 22:14:21 +0100 Message-ID: Subject: Re: [PATCH 01/15] habanalabs: add skeleton driver To: Oded Gabbay Cc: gregkh , Linux Kernel Mailing List , ogabbay@habana.ai Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 26, 2019 at 5:25 PM Oded Gabbay wrote: > > On Sat, Jan 26, 2019 at 6:06 PM Arnd Bergmann wrote: > > > > On Wed, Jan 23, 2019 at 1:01 AM Oded Gabbay wrote: > > > > > diff --git a/drivers/misc/habanalabs/include/habanalabs_device_if.h b/drivers/misc/habanalabs/include/habanalabs_device_if.h > > > new file mode 100644 > > > index 000000000000..9dbb7077eabd > > > --- /dev/null > > > +++ b/drivers/misc/habanalabs/include/habanalabs_device_if.h > > > > Since this is a apparently a user space ABI, the file should be in > > include/uapi/linux/, > > not in the driver directory. > > This is not a user space ABI. This is the ABI between the driver and the F/W. Ah, I see. In that case, you should get rid of all the bitfields and make the struct members all __le32/__le64/... to make it work on big-endian kernels. > > > > > +/* must be aligned to 4 bytes */ > > > +struct armcp_info { > > > + struct armcp_sensor sensors[ARMCP_MAX_SENSORS]; > > > + __u8 kernel_version[VERSION_MAX_LEN]; > > > + __u32 reserved[3]; > > > + __u32 cpld_version; > > > + __u32 infineon_version; > > > + __u8 fuse_version[VERSION_MAX_LEN]; > > > + __u8 thermal_version[VERSION_MAX_LEN]; > > > + __u8 armcp_version[VERSION_MAX_LEN]; > > > + __u64 dram_size; > > > +}; > > > > The compiler will align this to 8 bytes on most architectures, and > > add another padding field before dram_size. Better remove the > > 'reserved' fields, or make them an even number. > I can't do that, because those fields were once used by the F/W and if > I will change the order here, or add/remove those fields then it will > break compatibility with old F/W. Ok, I see. Then you should add an explicit padding field and fix the comment to make the structure match the actual interface. Arnd