> >Copy that. >The same reason of "[PATCH] i2c/designware: Do not use legacy PCI power >management".
Hi Lee Could you copy the comment here for me? Thanks. What I mean is removing below lines >> >+ pci_save_state(pdev); >> >+ pci_disable_device(pdev); >> >+ pci_set_power_state(pdev, PCI_D3hot); Because it is done in PCI PM core, no need to do them again in PCI device driver. Refer to pci_pm_runtime_suspend function. Same for runtime_resume. Hao >Thank you. > > >Sincerely, >Major Lee > > > > >> -----Original Message----- >> From: Wu, Hao [mailto:[email protected]] >> Sent: Wednesday, March 16, 2011 11:11 AM >> To: Major Lee/WHQ/Wistron; [email protected] >> Cc: Alan Cox >> Subject: RE: [RFC/PATCH] langwell_otg: runtime pm support >> >> >+static int langwell_otg_runtime_suspend(struct device *dev) >> >+{ >> >+ struct langwell_otg *lnw = the_transceiver; >> >+ struct pci_dev *pdev; >> >+ int ret = 0; >> >+ >> >+ dev_dbg(dev, "%s --->\n", __func__); >> >+ >> >+ pdev = to_pci_dev(dev); >> >+ >> >+ switch (lnw->iotg.otg.state) { >> >+ case OTG_STATE_A_IDLE: >> >+ case OTG_STATE_B_IDLE: >> >+ /* Transceiver handle it itself */ >> >+ langwell_otg_phy_low_power(1); >> >+ pci_save_state(pdev); >> >+ pci_disable_device(pdev); >> >+ pci_set_power_state(pdev, PCI_D3hot); >> >> Hi Lee, >> >> I suggest that remove pci related operations, because PCI PM >> core has already do the same things. >> >> >+static int langwell_otg_runtime_resume(struct device *dev) >> >+{ >> >+ struct langwell_otg *lnw = the_transceiver; >> >+ struct pci_dev *pdev; >> >+ int ret = 0; >> >+ >> >+ dev_dbg(dev, "%s --->\n", __func__); >> >+ >> >+ pdev = to_pci_dev(dev); >> >+ >> >+ langwell_otg_intr(1); >> >+ langwell_otg_phy_low_power(0); >> >+ >> >+ switch (lnw->iotg.otg.state) { >> >+ case OTG_STATE_A_IDLE: >> >+ case OTG_STATE_B_IDLE: >> >+ /* Transceiver handle it itself */ >> >+ pci_set_power_state(pdev, PCI_D0); >> >+ pci_restore_state(pdev); >> >+ ret = pci_enable_device(pdev); >> >+ if (ret) >> >+ dev_err(&pdev->dev, "device cant be enabled\n"); >> >+ langwell_otg_phy_low_power(0); >> >> Same as runtime_suspend function, no need to do >> pci_set_power_state and other PCI related function. >> >> Hao >> _______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
