chrome-platform.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Pavan Holla <pholla@chromium.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Benson Leung <bleung@chromium.org>,
	 Tzung-Bi Shih <tzungbi@kernel.org>,
	Guenter Roeck <groeck@chromium.org>,
	linux-kernel@vger.kernel.org,  linux-usb@vger.kernel.org,
	 Abhishek Pandit-Subedi <abhishekpandit@chromium.org>,
	chrome-platform@lists.linux.dev
Subject: Re: [PATCH v4 2/2] usb: typec: ucsi: Implement ChromeOS UCSI driver
Date: Wed, 10 Apr 2024 15:27:43 -0700	[thread overview]
Message-ID: <CAB2FV=6We88NrvN8NZYt8NkMFH9N_ZBGyUWVUpGwPdja2X_+NA@mail.gmail.com> (raw)
In-Reply-To: <2024040916-kleenex-machinist-4858@gregkh>

I plan to upload the next version after related EC changes land on
ChromeOS. That might take a few weeks.

On Tue, Apr 9, 2024 at 8:16 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Tue, Apr 09, 2024 at 02:27:37AM +0000, Pavan Holla wrote:
> > +#define DRV_NAME "cros-ec-ucsi"
>
> KBUILD_MODNAME?

Will replace DRV_NAME with KBUILD_MODNAME.

> > +
> > +#define MAX_EC_DATA_SIZE 256
> > +#define WRITE_TMO_MS 500
>
> What are these and why these values?  And tabs perhaps?

MAX_EC_DATA_SIZE is the number of bytes that can be read or written to in the
UCSI data structure using a single host command to the EC.
WRITE_TMO_MS is the time within which a cmd complete or ack notification must
arrive after a command is sent to the PPM.

Will add comments and tabs.

> > +     uint8_t ec_buffer[MAX_EC_DATA_SIZE + sizeof(struct ec_params_ucsi_ppm_set)];
>
> That's a lot of data on the stack, are you sure you want to do that?
>
> And are you sure you are allowed to have this data on the stack?  It
> never ends up being sent using DMA?

I confirmed that this data isn't DMA'ed. However, I don't mind putting
it on the heap, and will do so in the next version.

> And please, don't use non-kernel types like "uint8_t", use "u8" like
> intended.  This isn't userspace (yes, I know a lot of kernel code uses
> these, but as you are going to change this, might as well change that
> too.)

Ack.

Thanks,
Pavan

      reply	other threads:[~2024-04-10 22:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09  2:27 [PATCH v4 0/2] usb: typec: Implement UCSI driver for ChromeOS Pavan Holla
2024-04-09  2:27 ` [PATCH v4 1/2] platform/chrome: Update ChromeOS EC header for UCSI Pavan Holla
2024-04-09  2:27 ` [PATCH v4 2/2] usb: typec: ucsi: Implement ChromeOS UCSI driver Pavan Holla
2024-04-09 10:47   ` Tzung-Bi Shih
2024-04-10 22:14     ` Pavan Holla
2024-04-09 15:16   ` Greg Kroah-Hartman
2024-04-10 22:27     ` Pavan Holla [this message]

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='CAB2FV=6We88NrvN8NZYt8NkMFH9N_ZBGyUWVUpGwPdja2X_+NA@mail.gmail.com' \
    --to=pholla@chromium.org \
    --cc=abhishekpandit@chromium.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tzungbi@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 read-only IMAP folder(s) and NNTP newsgroup(s).