Re: WARNING in pvr2_i2c_core_done

From: Alan Stern
Date: Fri Sep 27 2019 - 10:21:03 EST


On Fri, 27 Sep 2019, Greg Kroah-Hartman wrote:

> > It turns out the reason for this error is simple: The driver
> > unregisters its subdevices in the release handler instead of in the
> > disconnect handler. There probably is documentation about this
> > somewhere, but I don't know exactly where -- maybe Greg remembers.
>
> Nope, I don't remember. It should happen in the disconnect handler, odd
> of it to be in release, but maybe that's the "easiest" way for v4l to
> handle this?

This isn't a question of "easiest". Unregistering child devices in a
release handler is just _wrong_, plain and simple. That's what gives
rise to the

"sysfs group 'power' not found for kobject 'i2c-0'"

warning in the kernel log. The group can't be found because it has
already been removed; it gets destroyed when the parent USB interface
device is unregistered, because unregistering a device also removes
from sysfs everything below that device.

Alan Stern