Re: [PATCH v11 4/5] platform/chrome: Protect cros_ec_device lifecycle with revocable

From: Jason Gunthorpe

Date: Thu May 14 2026 - 12:04:07 EST


On Thu, May 14, 2026 at 03:34:12AM +0000, Tzung-Bi Shih wrote:

> To help me understand, could you elaborate on why the revocable mechanism
> isn't suitable here?

Stay within one driver. Create the revokable is probe, consume it
within that drivers fops/etc, destroy it on remove. Do not randomly
pass it to other drivers.

> I'm wondering because if this piece of code were to transition to
> Rust in the future, would the concerns you have also apply to using
> Revocable[1] in the Rust context for this driver?

Yes, even in rust driver local revocable objects should not be
spaghetti coded through different layers.

Jason