On Thu, Mar 05, 2020 at 07:47:47AM -0600, Pierre-Louis Bossart wrote:
On 3/5/20 7:36 AM, Mark Brown wrote:
In what way are the dependencies not well managed and why aren't we requesting the GPIO on device model probe anyway?
there are a couple of machine drivers where the gpios are requested from the machine driver. I have no idea what it is done this way, maybe the codec exposes a gpiochip that's used later? I was hoping that Andy can help, I don't fully get the acpi mapping and all.
This doesn't answer the question: why is the machine driver not requesting the GPIO on device model probe?
The issue happens when running our test scripts, which do a set a rmmod in a specific order: rmmod of the machine driver, then doing an rmmod of the codec driver. Somehow the second fails with the 'module in use error'.
It's probably because the devm_ release does not happen when the card is unregistered and the machine driver resources released since we use the component device. There might very well be a bug somewhere in the devm_ handling, I just don't have a clue how to debug this - and the .exit() makes sense regardless in other cases unrelated to GPIOs.
So you've removed the driver which will have unbound the device but devm actions don't seem to have fired? That seems worrying...