All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: "Dawid Niedźwiecki" <dawidn@google.com>
Cc: "Benson Leung" <bleung@chromium.org>,
	chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org,
	chromeos-krk-upstreaming@google.com,
	"Łukasz Bartosik" <ukaszb@chromium.org>
Subject: Re: [PATCH] platform/chrome: Add ChromeOS EC USB driver
Date: Wed, 9 Jul 2025 09:16:47 +0000	[thread overview]
Message-ID: <aG4zf8rGnmt5xVtG@google.com> (raw)
In-Reply-To: <CAJ_BA_AMaz0GWxOHJYws95h3fRdErghqUXPBkhrB1_eYegOJ0A@mail.gmail.com>

On Fri, Jul 04, 2025 at 11:03:01AM +0200, Dawid Niedźwiecki wrote:
> > Given that:
> > - The crash you encountered is a common issue for all cros_ec_X drivers.
> > - I prefer to keep cros_ec_X drivers simple and similar rather than have
> >   something special (e.g. the memorized `struct cros_ec_device` in current
> >   cros_ec_usb) for fixing the crash.
> > Could you give [3] a try to see if it fixes the crash and also call
> > cros_ec_register()/cros_ec_unregister() everytime in the probe/disconnect?
> 
> I agree that the drivers should be simple and similar as much as possible.
> But to be precise, I think, it should behave in a similar way as much
> as possible
> (e.g. reboot EC device doesn't cause re-registering), not be implemented in the
> same way. That's why I believe the current implementation of the drivers follows
> the already present drivers in a better way.

FWIW: It depends on the bus details.  If you find my previous message, SCP
over RPMSG also re-registers everytime after the firmware reboot.

One challenge for current version: it makes the driver more complicated than
others.  E.g. what would be happening if some friend drivers try to access
`ec_dev` while the `cros_ec_usb_probe` is writing to `ec_usb` at a time?
It tries to manage the device's lifecycle one level upper than USB (don't
know what it should call, "session"?).

Another challenge: it doesn't call cros_ec_unregister() in its driver removal
entry.  What would be happening if someone re-inserts the module multiple
times?

  reply	other threads:[~2025-07-09  9:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-24 11:00 [PATCH] platform/chrome: Add ChromeOS EC USB driver Dawid Niedzwiecki
2025-06-27  7:53 ` Tzung-Bi Shih
2025-06-30 11:59   ` Dawid Niedźwiecki
2025-06-30 12:09     ` [PATCH v2] " Dawid Niedzwiecki
2025-07-01  8:56     ` [PATCH] " Tzung-Bi Shih
2025-07-01 10:29       ` Dawid Niedźwiecki
2025-07-02  3:58         ` Tzung-Bi Shih
2025-07-02  7:43           ` Dawid Niedźwiecki
2025-07-03 11:37             ` Tzung-Bi Shih
2025-07-04  9:03               ` Dawid Niedźwiecki
2025-07-09  9:16                 ` Tzung-Bi Shih [this message]
2025-07-11 16:00                   ` Dawid Niedźwiecki

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=aG4zf8rGnmt5xVtG@google.com \
    --to=tzungbi@kernel.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=chromeos-krk-upstreaming@google.com \
    --cc=dawidn@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ukaszb@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.