File tree Expand file tree Collapse file tree
drivers/hid/intel-ish-hid/ipc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,6 +106,11 @@ static inline bool ish_should_enter_d0i3(struct pci_dev *pdev)
106106 return !pm_suspend_via_firmware () || pdev -> device == CHV_DEVICE_ID ;
107107}
108108
109+ static inline bool ish_should_leave_d0i3 (struct pci_dev * pdev )
110+ {
111+ return !pm_resume_via_firmware () || pdev -> device == CHV_DEVICE_ID ;
112+ }
113+
109114/**
110115 * ish_probe() - PCI driver probe callback
111116 * @pdev: pci device
@@ -215,9 +220,7 @@ static void __maybe_unused ish_resume_handler(struct work_struct *work)
215220 struct ishtp_device * dev = pci_get_drvdata (pdev );
216221 int ret ;
217222
218- /* Check the NO_D3 flag to distinguish the resume paths */
219- if (pdev -> dev_flags & PCI_DEV_FLAGS_NO_D3 ) {
220- pdev -> dev_flags &= ~PCI_DEV_FLAGS_NO_D3 ;
223+ if (ish_should_leave_d0i3 (pdev ) && !dev -> suspend_flag ) {
221224 disable_irq_wake (pdev -> irq );
222225
223226 ishtp_send_resume (dev );
@@ -281,8 +284,11 @@ static int __maybe_unused ish_suspend(struct device *device)
281284 */
282285 ish_disable_dma (dev );
283286 } else {
284- /* Set the NO_D3 flag, the ISH would enter D0i3 */
285- pdev -> dev_flags |= PCI_DEV_FLAGS_NO_D3 ;
287+ /*
288+ * Save state so PCI core will keep the device at D0,
289+ * the ISH would enter D0i3
290+ */
291+ pci_save_state (pdev );
286292
287293 enable_irq_wake (pdev -> irq );
288294 }
You can’t perform that action at this time.
0 commit comments