The Linux Kernel Mailing List
 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: Tue, 1 Jul 2025 08:56:27 +0000	[thread overview]
Message-ID: <aGOiu-sXFj1EUQAB@google.com> (raw)
In-Reply-To: <CAJ_BA_CppC58kc-Uv49PSmWFcCih-ySuGDuRcO5-AWQQqcqWVQ@mail.gmail.com>

On Mon, Jun 30, 2025 at 01:59:39PM +0200, Dawid Niedźwiecki wrote:
> On Fri, Jun 27, 2025 at 9:53 AM Tzung-Bi Shih <tzungbi@kernel.org> wrote:
> > On Tue, Jun 24, 2025 at 11:00:28AM +0000, Dawid Niedzwiecki wrote:
> > > +     /*
> > > +      * Do not register the same EC device twice. The probing is performed every
> > > +      * reboot, sysjump, crash etc. Recreating the /dev/cros_X file every time
> > > +      * would force all application to reopen the file, which is not a case for
> > > +      * other cros_ec_x divers. Instead, keep the cros_ec_device and cros_ec_usb
> > > +      * structures constant and replace USB related structures for the same EC
> > > +      * that is reprobed.
> > > +      *
> > > +      * The driver doesn't support handling two devices with the same idProduct,
> > > +      * but it will never be a real usecase.
> > > +      */
> >
> > I don't quite understand why does it need to memorize the registered ECs.
> > Supposedly, the probe function is only called few times during booting, and
> > gets success once. Hot-plugs?
> >
> 
> The probe is called every time the EC device boots from the beginning
> - sysjumps, crashes, reboots etc. It succeeds the first time.
> Once the /dev/cros_X file is created, we need the possibility to
> access the same EC device, with the same, previously created file.
> The only way to do that is to reused the already created
> cros_ec_device structure.

What are the shortcomings if it re-creates /dev/cros_X everytime? Isn't it
also a way for userland programs to be aware of the EC device crashes?

Why other cros_ec_X drivers doesn't need the mechanism?

  parent reply	other threads:[~2025-07-01  8:56 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     ` Tzung-Bi Shih [this message]
2025-07-01 10:29       ` [PATCH] " 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
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=aGOiu-sXFj1EUQAB@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox