[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ_BA_AMaz0GWxOHJYws95h3fRdErghqUXPBkhrB1_eYegOJ0A@mail.gmail.com>
Date: Fri, 4 Jul 2025 11:03:01 +0200
From: Dawid Niedźwiecki <dawidn@...gle.com>
To: Tzung-Bi Shih <tzungbi@...nel.org>
Cc: Benson Leung <bleung@...omium.org>, chrome-platform@...ts.linux.dev,
linux-kernel@...r.kernel.org, chromeos-krk-upstreaming@...gle.com,
Łukasz Bartosik <ukaszb@...omium.org>
Subject: Re: [PATCH] platform/chrome: Add ChromeOS EC USB driver
> We have seen a similar crash before but I didn't come out with a solution
> at that time. Could you please try [3]?
>
> [3]: https://patchwork.kernel.org/project/chrome-platform/cover/20250703113509.2511758-1-tzungbi@kernel.org/
>
Sure, I'll try the fix once it gets its final shape.
> 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.
The specification of a certain interface influences the driver
implementation a lot.
E.g. the SPI driver never frees the cros_ec_device struct [1], because
it is very rare
that the driver is removed and reprobed (only manual unbind/bind). I believe the
SPI device structure is constant in the system. On the other hand, the
USB device
structures are recreated every unplug/plug (reboot, sysjump etc. in
this case), so
this approach is unacceptable.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/chrome/cros_ec_spi.c#n752
Powered by blists - more mailing lists