Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3227961ybl; Sun, 26 Jan 2020 23:12:16 -0800 (PST) X-Google-Smtp-Source: APXvYqxasTI4Sau5vHaqMw6wNPPmLPM/PDYY/lN/qBAWvH1H5h25fvBYFSCi2toLlvHeHpYzkJ4s X-Received: by 2002:aca:eb14:: with SMTP id j20mr6348590oih.12.1580109135845; Sun, 26 Jan 2020 23:12:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580109135; cv=none; d=google.com; s=arc-20160816; b=gV0IC8/S3pqLt3M300ypNnEA7QjHyXuz17UX/GIBHHzPVJbcbLuDZL4f1NVCvaUwIf fsiFy3IweSEikYpvPalanKD3LfyFclxv1qNSWMTju+Dy4qGg6kA7QoyDS7MYA4hRLKnR TTK0vP8B1RbhbqgU0lshoglPogJgA7YWM8Yjy2cO4TDPNAQNl7YG51hcyIjO43gqhHFA s3qPMBiAI+uf+iK/jAhbGUTJt8pmQE8DyXEddFjaIijsMB8hKVGGyvyq/uYsM6DT6BsV IKUIh9deF7Zfoug2+QxIjgkhZPiSvvDnF40VCltuvUV9PxD0jKgGnaP9/gnIN7xMrQh/ qpPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qqKrSdPy25zHcvjpMggBFceNxg6/75a+o1jN+qDX4I0=; b=nMX/OvH5jfZkucg7fccKrGc7sIrsvlmQNDvIpjaF1fR+Sf3jGMFw1J2quT3NuBVhda I3QQoHQuxu/fy95pODA4vUcAWjmVoXZpWr1e1xgvchce1J8P/JL0ZEwNfV1ivqT95bq1 9BvLAVk/YsPKs9Ffdy6/mh616ip93aRS1YBStSWpDw6IKmWsL7gTRaoPqi5EgJHhqguX sCi87dK1y/mJqb1DtvmgKuQ6ajMNgbLh4CHGR9Ax2kvyGh0o74Vk2JVFWlaY86Z1kmzM zAk/rLFEiNMrsxJSRIAXjbRz+Ft7ccz4l5Sjzt/cP4SmuSYankNDj8m9kXq4hbzKTaXh ytOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ria3P38t; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7si1889070otp.11.2020.01.26.23.12.02; Sun, 26 Jan 2020 23:12:15 -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=@linaro.org header.s=google header.b=Ria3P38t; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726871AbgA0HLD (ORCPT + 99 others); Mon, 27 Jan 2020 02:11:03 -0500 Received: from mail-pj1-f68.google.com ([209.85.216.68]:53220 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725763AbgA0HLC (ORCPT ); Mon, 27 Jan 2020 02:11:02 -0500 Received: by mail-pj1-f68.google.com with SMTP id a6so2590939pjh.2 for ; Sun, 26 Jan 2020 23:11:02 -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=qqKrSdPy25zHcvjpMggBFceNxg6/75a+o1jN+qDX4I0=; b=Ria3P38ts/aSCoYbFuy7ccyT9jc7KqaGgT/Hd6XhdP3kyCImT1ovndDtdNBaZ61LoL HMxrq8LYk7UHuAhFGeLGEGoNcNVqe0ucvgG4An2KbYsJ/38IXQKxBuqlTuN2Mw/OUWkd qW9E4KRyYTFqLBrDqIRshaDE9/h5zLam4E3JSUKR8f3b0obkv+CGP8U0UXgOva81kY/E nDCZAMIdYfwNe0VDITZGVJFmfRCbbC4RbByh+lKLQT30Hl/lMjD8kmLEvZnZfjILGeD5 22Nx8iBkF2b/VvAzlfRGr+UYLgnHzLfzgCr8kWHc2DcZK6NAuMlTnNLQmQ6s6CBaZNpr GHjg== 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=qqKrSdPy25zHcvjpMggBFceNxg6/75a+o1jN+qDX4I0=; b=aYHDnVAhIuCXeO4JmH5b6Ya4QEF6lkZ7NXZ6OBsqKfbHE9LFUx+qFlcPNkZT05lPOq A4iot2cKq65cQ6wqESPeDQAdoGqZomrLJNrxsGp6Eo1wdBoNFsEbatf4lDnGCBZL9KBj 4QSx4L5MjUqfHePR6ZQFj0xxtnILVBGutdJCmAjhazAzFvb6yfXFsGDGU5O+9jpoo9+v IK8nMiT/TyAsItGG2ilIUj761/BlCpf/9mZPDNX7sXvv/YGvmO3Uz+u43oGZz1T4jNtd hOisuNcGc1EypKKZ27XaA3waDWPV9x3sYLty+FcxbL7r6dMXBskiO9NLw7sUzd7yjDAx 2GUQ== X-Gm-Message-State: APjAAAV4GjRemyTDsD1N7kcx4ttUHi+D+IHxlcp5AVQOXKkFgkTQwhE2 YrfAfbrhbNa1wvrd96tLEq9d X-Received: by 2002:a17:902:a50d:: with SMTP id s13mr15687686plq.293.1580109061891; Sun, 26 Jan 2020 23:11:01 -0800 (PST) Received: from mani ([103.59.133.81]) by smtp.gmail.com with ESMTPSA id x11sm7830074pfd.168.2020.01.26.23.10.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Jan 2020 23:11:01 -0800 (PST) Date: Mon, 27 Jan 2020 12:40:52 +0530 From: Manivannan Sadhasivam To: Greg KH Cc: Jeffrey Hugo , 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: <20200127071052.GB4768@mani> References: <20200123111836.7414-1-manivannan.sadhasivam@linaro.org> <20200123111836.7414-6-manivannan.sadhasivam@linaro.org> <20200125134631.GA3518689@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200125134631.GA3518689@kroah.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 25, 2020 at 02:46:31PM +0100, Greg KH wrote: > 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. > Okay. > Oh, and if these values are in hardware, then the correct types also > need to be used (i.e. __u32 and __u64). > I thought the __* prefix types are only for sharing with userspace... Could you please clarify why it is needed here? Thanks, Mani > good catch! > > greg k-h