Hi
On 6/3/21 7:12 PM, Jonathan Cameron wrote:
Given all my comments are either minor or not specifically about code here,
feel free to send a follow up if you want to tidy them up.
Thanks, point taken. Commenting two of those below.
+
+ pm_runtime_forbid(dev);
+ if (!qep->enabled)
+ pm_runtime_get(dev);
Ouch, I'd not encountered this pci related weirdness before
(All about overriding the fact PCI opts out of runtime)
Yeah this conditional pm_runtime_get() doesn't look optimal in remove().
PCI devices must be in D0 when not bound but don't remember now does PCI
core it anyway after remove or not but pm_runtime_get() must be here for
balancing the runtime PM usage count due pm_runtime_put() in probe(),
i.e. device is suspended after probe(),
Exception here is if peripheral is enabled and already powered when
coming here. Which makes me thinking counting is perhaps good to
disable. Kind of pointless to let it count if there is no driver.
+
+ intel_qep_writel(qep, INTEL_QEPCON, 0);
+}
+
+#ifdef CONFIG_PM
Up to William and yourself, but I would prefer not to see these ifdefs
but instead mark the functions __maybe_unused and let the linker
drop them. It tends to be less error prone if the pm handling gets
more complex in future.
I obviously will follow the style here. I remember some maintainers
prefer explicit #ifdef over __maybe_unused.
Jarkko