Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2330322ybl; Sat, 25 Jan 2020 23:45:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyj5fslFBqJJL39g1SO8petj/6vesG5AADE9zjkWBxj49eullpQtqf7S12NJdPTWK3cN/gY X-Received: by 2002:a54:4896:: with SMTP id r22mr4346121oic.30.1580024705530; Sat, 25 Jan 2020 23:45:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580024705; cv=none; d=google.com; s=arc-20160816; b=zeBqGiGjFFPhGayieAqNzveYEZq+HWXKYZqMnz64KUr1bd/pwB5plfCoxDUEq64EHs 1mWcLO3TzvyTo6WkDtsk45iZjCokxzKnXf9dpba044qypFxtzIyd/DmXqVKPKTJt31WD Mn5ivK6vGqg0Q/2AE+8FYNazKDGsuWhObywNNA85JW5pQTAr+q8Vfsx903J++gvGJFpv thhldOJodabvRlyHO2eOzexQD7sJxuzZXWka+mstvhToEZftEA0QfgJMlzMyAfOj2Vxe Iu264xUAiTW7m5fTfOKqAzTi2XUv7kr+q5NRX/vU5+3j3IPQiKpN5uQYYN0IMtcauuCd zhPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8+br+1pagkf9N6YIOREgkfIaGRHhnFBrg/oXXFkGb5c=; b=TqFJ/9jaegYsN9R/Ue+ieviJwCN2npC475fe+cDA4CVPx1HDOGGzd4w0IEYYol4syN 2CXd1qN9h7ePyX8h+tD1FoSngq/J2Fq3NkrOw7r6a05Glw4n3KZGoJP6PKv0+RU1N6v8 4rIiYvS+x4AsAQKtljGLw5YX79lqb4s5HadzgN92aunJSQQnfwExw/O/WLfYLRzR1kUX zy6Hr1FPoFpP5uzIh6umweHqN6DyPQMHpBeOoOS2wnB1CPr3UFVBE1lpQowpyTSRCk5O 5DT7wZpKf9DppYPSShYYFsetMgt9aEQq3fEoKF4Fj3CukwhGvkIuWriFdN0yEyNqvG23 x7dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VZHsB8jH; 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 t12si5480158otq.53.2020.01.25.23.44.41; Sat, 25 Jan 2020 23:45:05 -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; dkim=pass header.i=@kernel.org header.s=default header.b=VZHsB8jH; 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 S1729219AbgAZHnD (ORCPT + 99 others); Sun, 26 Jan 2020 02:43:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:48320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbgAZHnC (ORCPT ); Sun, 26 Jan 2020 02:43:02 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 91B7E2083E; Sun, 26 Jan 2020 07:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580024582; bh=5EL2+31aM2DXNdXTnQvBx6rGRxurmW8mKfYO+eTZI48=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VZHsB8jH6YZ6hbrCa7Chx7t1+GD0eCNo0pWpW3dgMnLswtZg5NvwMXMNRTA6HCb1w 9DN5vAQLz17Y8sPTXNvk9IPxdvnhvH9ha+VOpH/lcioyHzn/AZlC8F0hh1Gaeldlnu n5rIYpu6fa+8gxWfl07Ps2ba7+Mh84wsVNzro0Sg= Date: Sat, 25 Jan 2020 14:46:31 +0100 From: Greg KH To: Jeffrey Hugo Cc: Manivannan Sadhasivam , arnd@arndb.de, smohanad@codeaurora.org, kvalo@codeaurora.org, bjorn.andersson@linaro.org, hemantk@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 05/16] bus: mhi: core: Add support for ringing channel/event ring doorbells Message-ID: <20200125134631.GA3518689@kroah.com> References: <20200123111836.7414-1-manivannan.sadhasivam@linaro.org> <20200123111836.7414-6-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 24, 2020 at 03:51:12PM -0700, Jeffrey Hugo wrote: > > +struct mhi_event_ctxt { > > + u32 reserved : 8; > > + u32 intmodc : 8; > > + u32 intmodt : 16; > > + u32 ertype; > > + u32 msivec; > > + > > + u64 rbase __packed __aligned(4); > > + u64 rlen __packed __aligned(4); > > + u64 rp __packed __aligned(4); > > + u64 wp __packed __aligned(4); > > +}; > > This is the struct that is shared with the device, correct? Surely it needs > to be packed then? Seems like you'd expect some padding between msivec and > rbase on a 64-bit system otherwise, which is probably not intended. > > Also I strongly dislike bitfields in structures which are shared with > another system since the C specification doesn't define how they are > implemented, therefore you can run into issues where different compilers > decide to implement the actual backing memory differently. I know its less > convinent, but I would prefer the use of bitmasks for these fields. You have to use bitmasks in order for all endian cpus to work properly here, so that needs to be fixed. Oh, and if these values are in hardware, then the correct types also need to be used (i.e. __u32 and __u64). good catch! greg k-h