Thread (21 messages) 21 messages, 5 authors, 2020-07-28

Re: [Linux-kernel-mentees] [PATCH v1] spi: spi-topcliff-pch: use generic power management

From: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Date: 2020-07-24 15:17:27
Also in: linux-spi, lkml

On Fri, Jul 24, 2020 at 01:51:49PM +0300, Andy Shevchenko wrote:
On Mon, Jul 20, 2020 at 7:31 PM Vaibhav Gupta [off-list ref] wrote:
quoted
Drivers using legacy PM have to manage PCI states and device's PM states
themselves. They also need to take care of configuration registers.

With improved and powerful support of generic PM, PCI Core takes care of
above mentioned, device-independent, jobs.

This driver makes use of PCI helper functions like
pci_save/restore_state(), pci_enable/disable_device(), pci_enable_wake()
and pci_set_power_state() to do required operations. In generic mode, they
are no longer needed.

Change function parameter in both .suspend() and .resume() to
"struct device*" type. Use dev_get_drvdata() to get drv data.
quoted
Compile-tested only.
Yeah...

...
quoted
+static int __maybe_unused pch_spi_suspend(struct device *dev)
 {
+       struct pch_pd_dev_save *pd_dev_save = dev_get_drvdata(dev);

+       dev_dbg(dev, "%s ENTRY\n", __func__);

        pd_dev_save->board_dat->suspend_sts = true;

+       return 0;
 }

+static int __maybe_unused pch_spi_resume(struct device *dev)
 {
+       struct pch_pd_dev_save *pd_dev_save = dev_get_drvdata(dev);

+       dev_dbg(dev, "%s ENTRY\n", __func__);
quoted
+       device_wakeup_disable(dev);
Here I left a result. Care to explain (and perhaps send a follow up
fix) where is the counterpart to this call?
Hello Andy,
I didn't quite understand what you are trying to point at. And the result part.

Yes, it seem I forgot to put device_wakeup_disable() in .suspend() when I
removed pci_enable_wake(pdev, PCI_D3hot, 0); from there. It doesn't seem that
.suspend() wants to enable-wake the device as the bool value passed to
pci_enable_wake() is zero.

Am I missing something else?

Thanks
Vaibhav Gupta
quoted
+       /* set suspend status to false */
+       pd_dev_save->board_dat->suspend_sts = false;
quoted
+       return 0;
 }

-- 
With Best Regards,
Andy Shevchenko
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help