Hello Daniel, > The DP AUX adapter is registered in .attach() but only unregistered > in i2c remove(). Unbinding and rebinding the DRM device while the > i2c driver stays bound registers the adapter a second time, which > fails. Also unregister it in .detach() and on the .attach() error > path, which so far leaked the registration. remove() keeps its call, > which waits for in-flight AUX device users before devres frees the > regmap; drm_dp_aux_unregister() does nothing for an adapter that is > already unregistered.
The drm_dp_aux_unregister() docs don't say it is idempotent, so is it fair to assume it is and always will? I think it would be much cleaner if user drivers took case of calling it at the appropriate times, not more. A flag similar to it6505->extcon_state used in patch 3 could allow that? Best regards, Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
