* Re: [PATCH] Wireless / ath5k: Simplify suspend and resume callbacks [not found] ` <200910050052.09085.rjw-KKrjLPT3xs0@public.gmane.org> @ 2009-10-05 16:21 ` Luis R. Rodriguez [not found] ` <43e72e890910050921q7f516c67ofe17603d6d873c4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 2+ messages in thread From: Luis R. Rodriguez @ 2009-10-05 16:21 UTC (permalink / raw) To: Rafael J. Wysocki, netdev-u79uwXL29TY76Z2rM5mHXA Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA, ath5k-devel-xDcbHBWguxEUs3QNXV6qNA, John W. Linville, LKML, pm list On Sun, Oct 4, 2009 at 10:52 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote: > From: Rafael J. Wysocki <rjw@sisk.pl> > > Simplify the suspend and resume callbacks of ath5k by converting the > driver to struct dev_pm_ops and allowing the PCI PM core to do the > PCI-specific suspend/resume handling. > > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Do you happen to know if the new dev_pm_ops thing handle WOL / WoW [1]? [1] http://wireless.kernel.org/en/users/Documentation/WoW > #ifdef CONFIG_PM > -static int > -ath5k_pci_suspend(struct pci_dev *pdev, pm_message_t state) > +static int ath5k_pci_suspend(struct device *dev) > { > - struct ieee80211_hw *hw = pci_get_drvdata(pdev); > + struct ieee80211_hw *hw = pci_get_drvdata(to_pci_dev(dev)); > struct ath5k_softc *sc = hw->priv; > > ath5k_led_off(sc); > - > - pci_save_state(pdev); > - pci_disable_device(pdev); For WoW right here we'd do pci_prepare_to_sleep(pdev) and bail out. > - pci_set_power_state(pdev, PCI_D3hot); And here we'd call something like this: pci_wake_from_d3(pdev, !!sc->wow_triggers_enabled); > - > return 0; > } Are all drivers being converted? It'll be a while before we get WoW enabled on ath5k but it is technically possible, the work was tested for ath9k back in July [2] but I never submitted this to be merged due to some inconsistent issues I was noticing with the hardware. [2] http://kernel.org/pub/linux/kernel/people/mcgrof/patches/wow-07-21.patch Luis _______________________________________________ ath5k-devel mailing list ath5k-devel@lists.ath5k.org https://lists.ath5k.org/mailman/listinfo/ath5k-devel ^ permalink raw reply [flat|nested] 2+ messages in thread
[parent not found: <43e72e890910050921q7f516c67ofe17603d6d873c4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] Wireless / ath5k: Simplify suspend and resume callbacks [not found] ` <43e72e890910050921q7f516c67ofe17603d6d873c4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2009-10-05 19:40 ` Rafael J. Wysocki 0 siblings, 0 replies; 2+ messages in thread From: Rafael J. Wysocki @ 2009-10-05 19:40 UTC (permalink / raw) To: Luis R. Rodriguez Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA, ath5k-devel-xDcbHBWguxEUs3QNXV6qNA, John W. Linville, LKML, pm list On Monday 05 October 2009, Luis R. Rodriguez wrote: > On Sun, Oct 4, 2009 at 10:52 PM, Rafael J. Wysocki <rjw-KKrjLPT3xs0@public.gmane.org> wrote: > > From: Rafael J. Wysocki <rjw-KKrjLPT3xs0@public.gmane.org> > > > > Simplify the suspend and resume callbacks of ath5k by converting the > > driver to struct dev_pm_ops and allowing the PCI PM core to do the > > PCI-specific suspend/resume handling. > > > > Signed-off-by: Rafael J. Wysocki <rjw-KKrjLPT3xs0@public.gmane.org> > > Do you happen to know if the new dev_pm_ops thing handle WOL / WoW [1]? > > [1] http://wireless.kernel.org/en/users/Documentation/WoW It does enable wake-up at the PCI level if so configured, so in principle it should handle it. However, for WoL to work there are some things that the drivers is reponsible for, so I guess it will be analogous for WoW. Anyway, the PCI-specific mechanics is there. > > #ifdef CONFIG_PM > > -static int > > -ath5k_pci_suspend(struct pci_dev *pdev, pm_message_t state) > > +static int ath5k_pci_suspend(struct device *dev) > > { > > - struct ieee80211_hw *hw = pci_get_drvdata(pdev); > > + struct ieee80211_hw *hw = pci_get_drvdata(to_pci_dev(dev)); > > struct ath5k_softc *sc = hw->priv; > > > > ath5k_led_off(sc); > > - > > - pci_save_state(pdev); > > - pci_disable_device(pdev); > > For WoW right here we'd do > > pci_prepare_to_sleep(pdev) and bail out. > > > - pci_set_power_state(pdev, PCI_D3hot); > > And here we'd call something like this: > > pci_wake_from_d3(pdev, !!sc->wow_triggers_enabled); All of this is unnecessary, the PCI PM core should take care of this just fine. In case it doesn't, it has to be fixed. > > - > > return 0; > > } > > Are all drivers being converted? Generally, yes, but that's not a priority work for me. I've just happened to have the patch ready, so here it goes. They should be converted, though, to be able to support PCI run-time PM. > It'll be a while before we get WoW enabled on ath5k but it is > technically possible, the work was tested for ath9k back in July [2] > but I never submitted this to be merged due to some inconsistent > issues I was noticing with the hardware. > > [2] http://kernel.org/pub/linux/kernel/people/mcgrof/patches/wow-07-21.patch Thanks, Rafael ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-05 19:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200910050052.09085.rjw@sisk.pl>
[not found] ` <200910050052.09085.rjw-KKrjLPT3xs0@public.gmane.org>
2009-10-05 16:21 ` [PATCH] Wireless / ath5k: Simplify suspend and resume callbacks Luis R. Rodriguez
[not found] ` <43e72e890910050921q7f516c67ofe17603d6d873c4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-10-05 19:40 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox