File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
drivers/hid/intel-ish-hid/ipc Expand file tree Collapse file tree 1 file changed +11
-5
lines changed 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)
106
106
return !pm_suspend_via_firmware () || pdev -> device == CHV_DEVICE_ID ;
107
107
}
108
108
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
+
109
114
/**
110
115
* ish_probe() - PCI driver probe callback
111
116
* @pdev: pci device
@@ -215,9 +220,7 @@ static void __maybe_unused ish_resume_handler(struct work_struct *work)
215
220
struct ishtp_device * dev = pci_get_drvdata (pdev );
216
221
int ret ;
217
222
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 ) {
221
224
disable_irq_wake (pdev -> irq );
222
225
223
226
ishtp_send_resume (dev );
@@ -281,8 +284,11 @@ static int __maybe_unused ish_suspend(struct device *device)
281
284
*/
282
285
ish_disable_dma (dev );
283
286
} 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 );
286
292
287
293
enable_irq_wake (pdev -> irq );
288
294
}
You can’t perform that action at this time.
0 commit comments