From: Andy Shevchenko <andy.shevchenko@gmail.com> To: Vaibhav Gupta <vaibhavgupta40@gmail.com> Cc: Bjorn Helgaas <helgaas@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Bjorn Helgaas <bjorn@helgaas.com>, Vaibhav Gupta <vaibhav.varodek@gmail.com>, Mark Brown <broonie@kernel.org>, linux-spi <linux-spi@vger.kernel.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, linux-kernel-mentees@lists.linuxfoundation.org, Shuah Khan <skhan@linuxfoundation.org> Subject: Re: [PATCH v1] spi: spi-topcliff-pch: use generic power management Date: Fri, 24 Jul 2020 13:51:49 +0300 [thread overview] Message-ID: <CAHp75Vdh-ssrmGgTc=gE9dWLhWDAw7_QHJKFeWKHpO-JqBdsEA@mail.gmail.com> (raw) In-Reply-To: <20200720155714.714114-1-vaibhavgupta40@gmail.com> On Mon, Jul 20, 2020 at 7:31 PM Vaibhav Gupta <vaibhavgupta40@gmail.com> wrote: > > 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. > Compile-tested only. Yeah... ... > +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__); > > + 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? > + /* set suspend status to false */ > + pd_dev_save->board_dat->suspend_sts = false; > + return 0; > } -- With Best Regards, Andy Shevchenko
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andy.shevchenko@gmail.com> To: Vaibhav Gupta <vaibhavgupta40@gmail.com> Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, linux-spi <linux-spi@vger.kernel.org>, Mark Brown <broonie@kernel.org>, Bjorn Helgaas <helgaas@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [Linux-kernel-mentees] [PATCH v1] spi: spi-topcliff-pch: use generic power management Date: Fri, 24 Jul 2020 13:51:49 +0300 [thread overview] Message-ID: <CAHp75Vdh-ssrmGgTc=gE9dWLhWDAw7_QHJKFeWKHpO-JqBdsEA@mail.gmail.com> (raw) In-Reply-To: <20200720155714.714114-1-vaibhavgupta40@gmail.com> On Mon, Jul 20, 2020 at 7:31 PM Vaibhav Gupta <vaibhavgupta40@gmail.com> wrote: > > 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. > Compile-tested only. Yeah... ... > +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__); > > + 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? > + /* set suspend status to false */ > + pd_dev_save->board_dat->suspend_sts = false; > + 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
next prev parent reply other threads:[~2020-07-24 10:52 UTC|newest] Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-20 15:57 [PATCH v1] spi: spi-topcliff-pch: use generic power management Vaibhav Gupta 2020-07-20 15:57 ` [Linux-kernel-mentees] " Vaibhav Gupta 2020-07-22 13:45 ` Mark Brown 2020-07-22 13:45 ` [Linux-kernel-mentees] " Mark Brown 2020-07-22 20:01 ` Vaibhav Gupta 2020-07-22 20:01 ` [Linux-kernel-mentees] " Vaibhav Gupta 2020-07-24 10:51 ` Andy Shevchenko [this message] 2020-07-24 10:51 ` Andy Shevchenko 2020-07-24 15:16 ` Vaibhav Gupta 2020-07-24 15:16 ` [Linux-kernel-mentees] " Vaibhav Gupta 2020-07-24 20:16 ` Andy Shevchenko 2020-07-24 20:16 ` [Linux-kernel-mentees] " Andy Shevchenko 2020-07-24 22:37 ` Bjorn Helgaas 2020-07-24 22:37 ` [Linux-kernel-mentees] " Bjorn Helgaas 2020-07-25 10:42 ` Andy Shevchenko 2020-07-25 10:42 ` [Linux-kernel-mentees] " Andy Shevchenko 2020-07-25 10:44 ` Andy Shevchenko 2020-07-25 10:44 ` [Linux-kernel-mentees] " Andy Shevchenko 2020-07-27 7:06 ` Vaibhav Gupta 2020-07-27 7:06 ` [Linux-kernel-mentees] " Vaibhav Gupta 2020-07-27 11:12 ` Andy Shevchenko 2020-07-27 11:12 ` [Linux-kernel-mentees] " Andy Shevchenko 2020-07-27 13:08 ` Vaibhav Gupta 2020-07-27 13:08 ` [Linux-kernel-mentees] " Vaibhav Gupta 2020-07-27 13:17 ` [PATCH v2] spi: spi-topcliff-pch: drop call to wakeup-disable Vaibhav Gupta 2020-07-27 13:17 ` [Linux-kernel-mentees] " Vaibhav Gupta 2020-07-27 13:38 ` Andy Shevchenko 2020-07-27 13:38 ` [Linux-kernel-mentees] " Andy Shevchenko 2020-07-27 13:46 ` Vaibhav Gupta 2020-07-27 13:46 ` [Linux-kernel-mentees] " Vaibhav Gupta 2020-07-27 14:08 ` Andy Shevchenko 2020-07-27 14:08 ` [Linux-kernel-mentees] " Andy Shevchenko 2020-07-27 14:17 ` Joe Perches 2020-07-27 14:17 ` [Linux-kernel-mentees] " Joe Perches 2020-07-27 17:29 ` [PATCH v3] " Vaibhav Gupta 2020-07-27 17:29 ` [Linux-kernel-mentees] " Vaibhav Gupta 2020-07-27 19:21 ` Andy Shevchenko 2020-07-27 19:21 ` [Linux-kernel-mentees] " Andy Shevchenko 2020-07-28 16:31 ` Mark Brown 2020-07-28 16:31 ` [Linux-kernel-mentees] " Mark Brown 2020-07-28 16:31 ` [PATCH v2] " Mark Brown 2020-07-28 16:31 ` [Linux-kernel-mentees] " Mark Brown
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='CAHp75Vdh-ssrmGgTc=gE9dWLhWDAw7_QHJKFeWKHpO-JqBdsEA@mail.gmail.com' \ --to=andy.shevchenko@gmail.com \ --cc=bhelgaas@google.com \ --cc=bjorn@helgaas.com \ --cc=broonie@kernel.org \ --cc=helgaas@kernel.org \ --cc=linux-kernel-mentees@lists.linuxfoundation.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-spi@vger.kernel.org \ --cc=skhan@linuxfoundation.org \ --cc=vaibhav.varodek@gmail.com \ --cc=vaibhavgupta40@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.