On Thu, Aug 04, 2016 at 10:41:00AM +0200, Quentin Schulz wrote: > > However, I'm not sure this is even possible. Isn't the point of the > > runtime_pm precisely to not be called while you're using the device? > > I agree on the principle but I am using runtime_pm functions (I am > mainly talking about the pm_runtime_put function) when probing or > removing the driver. Let's say we remove the mutex locks in runtime_pm > functions, what will happen if we are reading raw values from the ADC > when removing the ADC driver for example?
Most likely, the first thing you will be doing in your remove is to unregister from the framework, so you won't be able to start any new conversion. So that case shouldn't happen. > >> + /* Disable all hardware interrupts */ > >> + regmap_write(info->regmap, SUNXI_GPADC_TP_INT_FIFOC, 0); > > > > This looks like the wrong place to do that. You'll disable the > > interrupts of all the devices of the MFD, which is probbaly not what > > you want to do (and if you do, you want to do it in the MFD driver). > > Yes but all subdrivers of the MFD are using IIO channels from the ADC > driver so anyway they would not work at all. I'm not sure what you mean by that. Thanks! Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
signature.asc
Description: PGP signature