linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gwendal Grignou <gwendal@chromium.org>
To: Enric Balletbo Serra <eballetbo@gmail.com>
Cc: Guenter Roeck <groeck@google.com>,
	Guenter Roeck <groeck@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Benson Leung <bleung@chromium.org>,
	Lee Jones <lee.jones@linaro.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mfd: cros: Update EC protocol to match current EC code
Date: Mon, 11 Mar 2019 23:50:12 -0700	[thread overview]
Message-ID: <CAPUE2usTh3Th8FySCUsbgp_WGEL2k94pxDfwp4GT1uUkksok8w@mail.gmail.com> (raw)
In-Reply-To: <CAFqH_53uYy0oTTYSJkkgM+Sz+uJYpJ3pAq0LtRjCKaZF0FS0gg@mail.gmail.com>

Regarding: """While we are here I'd suggest if we can also fix the few
errors (3)
and warnings (5) spotted by checkpatch. With that it's an ack from my
side."""
These errors and  warning are for code that is not used by the kernel:
WARNING: __aligned(size) is preferred over __attribute__((aligned(size)))
#373: FILE: include/linux/mfd/cros_ec_commands.h:415:
+#define __aligned(x) __attribute__((aligned(x)))
Applies only when __aligned is not defined


ERROR: Macros with complex values should be enclosed in parentheses
#410: FILE: include/linux/mfd/cros_ec_commands.h:452:
+#define __ec_align2 __packed __aligned(2)
and
ERROR: Macros with complex values should be enclosed in parentheses
#411: FILE: include/linux/mfd/cros_ec_commands.h:453:
+#define __ec_align4 __packed __aligned(4)
and
ERROR: Macros with complex values should be enclosed in parentheses
#428: FILE: include/linux/mfd/cros_ec_commands.h:470:
+#define __ec_align_offset2 __packed __aligned(2)
are only defined when CONFIG_HOSTCMD_ALIGNED is defined, it is only
used by the EC.

Using u8 through the EC codebase is a big change, as it will make
merging patches from one EC branch to another painful.

I will post a new version that use BIT() - and yet more defines - shortly.

Gwendal.

On Thu, Mar 7, 2019 at 6:49 AM Enric Balletbo Serra <eballetbo@gmail.com> wrote:
>
> Hi Lee,
> Missatge de Guenter Roeck <groeck@google.com> del dia dc., 6 de març
> 2019 a les 19:58:
> >
> > On Wed, Mar 6, 2019 at 10:27 AM Enric Balletbo Serra
> > <eballetbo@gmail.com> wrote:
> > >
> > > Hi Guenter,
> > >
> > > Missatge de Guenter Roeck <groeck@google.com> del dia dc., 6 de març
> > > 2019 a les 18:20:
> > > >
> > > > [resending in plain text mode ]
> > > >
> > > > On Wed, Mar 6, 2019 at 8:57 AM Enric Balletbo Serra <eballetbo@gmail.com> wrote:
> > > > >
> > > > > Hi Gwendal,
> > > > >
> > > > > Many thanks to send this upstream.
> > > > >
> > > > > Missatge de Gwendal Grignou <gwendal@chromium.org> del dia dj., 28 de
> > > > > febr. 2019 a les 1:31:
> > > > > >
> > > > > > Chromebook Embedded Controller protocol is defined in the kernel at
> > > > > > cros_ec_commands.h.
> > > > > > The source of trust for the EC protocol is at
> > > > > > https://chromium.googlesource.com/chromiumos/platform/ec/+/master/include/ec_commands.h
> > > > > >
> > > > > > Only needed changes have been picked up from this file to the kernel
> > > > > > include file leading to gaps between the upstream version and what the
> > > > > > latest ECs can do.
> > > > > >
> > > > > > Fill the gaps to ease future integrations. Changes from the original
> > > > > > files is header/footer for license and include files for alignment.
> > > > > >
> > > > > > Check this include file works on ChomeOS kernel 4.14 and 4.19 on eve.
> > > > > >
> > > > > > Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> > > > > > ---
> > > > > >  include/linux/mfd/cros_ec_commands.h | 3627 +++++++++++++++++++++-----
> > > > >
>
> Just for if I was not clear after the discussion this is an ack from my side
>
> Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>
> > > > > I'm wondering if we should move this file to include/uapi at some
> > > > > point as this file is also used as user-space API for some userspace
> > > > > applications.
> > > > >
> > > > > While we are here I'd suggest if we can also fix the few errors (3)
> > > > > and warnings (5) spotted by checkpatch. With that it's an ack from my
> > > > > side.
> > > > >
> > > > > Being strict, though, on most cases the variables are going to be used
> > > > > in code that can be seen by user-space programs so maybe we should
> > > > > really need to switch to __u8/__u16/etc exportable data types instead
> > > > > of the uint8_t/uint16_t/etc types (those are not aimed to be used
> > > > > within the kernel). For those types that are internal we should use
> > > > > in-kernel type (u8/u16/etc)
> > > > >
> > > > > There is also the use of the BIT macro instead of the (1 << x), I know
> > > > > that this is a maintainer preference.
> > > > >
> > > > Is all that even possible ?
> > >
> > > Sorry, if I wasn't clear from my side, I should have marked those as
> > > nit, as in this case, I don't really mind, but I remember Lee
> > > requesting some of those changes for this file.
> > >
> > > What I want to avoid is the desynchronization again. As this file
> > > belongs to the MFD subsystem Lee needs to be happy with it or at least
> > > know that we're not following the kernel style because is an imported
> > > file (i.e not using the BIT macro, doing this example because I know
> > > he takes care of this).
> > >
> > > So I think that the main question here is if an imported file like
> > > this is acceptable in the include/linux/mfd?
> > >
> >
> > I find it highly (and more and more) confusing about what is
> > acceptable in the kernel and where, and what isn't. There are imported
> > files all over the place, and they seem to be widely acceptable and
> > accepted. It is difficult to keep track of what is acceptable and what
> > isn't on a per subsystem basis. I'll step back and keep my confusion
> > to myself.
> >
>
> In theory, I should be cc'ied if someone sends a modification to this
> file, also Guenter and Benson. So we can take care that is synced with
> the EC code and doesn't diverge again. I think that this is the main
> purpose.
>
> Thanks,
>  Enric
>
> > > > After all, this is an imported file, and
> > > > we don't usually expect that imported files meet the Linux kernel
> > > > coding style.
> > > >
> > >
> > > I remember seeing somewhere that the EC code was following the Linux
> > > kernel style? Now I am not able to find where.
> > >
> >
> > You are correct: https://www.chromium.org/chromium-os/ec-development
> >
> > Running checkpatch over the code, it doesn't look like that is
> > followed, though, much less enforced.
> >
> > Guenter
> >
> > > Thanks,
> > >  Enric
> > >
> > > > Thanks,
> > > > Guenter
> > > >
> > > > > [snip]
> > > > >
> > > > > Thanks,
> > > > >  Enric

  reply	other threads:[~2019-03-12  6:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28  0:27 [PATCH] mfd: cros: Update EC protocol to match current EC code Gwendal Grignou
2019-03-06 16:57 ` Enric Balletbo Serra
2019-03-06 17:20   ` Guenter Roeck
2019-03-06 18:26     ` Enric Balletbo Serra
2019-03-06 18:57       ` Guenter Roeck
2019-03-07 14:49         ` Enric Balletbo Serra
2019-03-12  6:50           ` Gwendal Grignou [this message]
2019-03-26 17:21             ` [PATCH v2] " Gwendal Grignou
2019-03-27  9:31               ` Enric Balletbo i Serra
2019-03-28 21:48                 ` Gwendal Grignou
2019-03-28 21:52                   ` [PATCH v3] " Gwendal Grignou
2019-03-28 21:58                     ` Gwendal Grignou
2019-03-29 12:14                       ` Enric Balletbo i Serra
2019-03-29 13:36                     ` Enric Balletbo i Serra
2019-03-29 17:44                       ` Gwendal Grignou
2019-03-29 17:56                         ` [PATCH 1/3] ASoC: cros_ec_codec: Rename ec_response_codec_gain into ec_codec_i2s_gain Gwendal Grignou
2019-04-01  7:56                           ` Mark Brown
     [not found]                         ` <20190329175628.31481-1-gwendal@chromium.org>
2019-03-29 17:56                           ` [PATCH v3 2/3] mfd: cros: Update EC protocol to match current EC code Gwendal Grignou
2019-03-30 14:55                             ` Jonathan Cameron
2019-03-29 17:56                           ` [PATCH 3/3] mfd: cros: Update EC to use BIT() and merge Gwendal Grignou
2019-03-30 14:43                             ` Jonathan Cameron
2019-04-01 10:06 ` [PATCH] mfd: cros: Update EC protocol to match current EC code Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPUE2usTh3Th8FySCUsbgp_WGEL2k94pxDfwp4GT1uUkksok8w@mail.gmail.com \
    --to=gwendal@chromium.org \
    --cc=bleung@chromium.org \
    --cc=eballetbo@gmail.com \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=groeck@google.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).