Skip to content

Commit fc19a57

Browse files
lixuzhaJiri Kosina
authored andcommitted
HID: intel-ish-hid: ipc: check the NO_D3 flag to distinguish resume paths
The NO_D3 flag would be set if the ISH enter D0i3 in ish_suspend(), The resume paths can be distinguished by checking the NO_D3 flag. It's more reasonable than checking the FW status. Signed-off-by: Zhang Lixu <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 2db8eda commit fc19a57

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

drivers/hid/intel-ish-hid/ipc/pci-ish.c

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -210,19 +210,11 @@ static void __maybe_unused ish_resume_handler(struct work_struct *work)
210210
{
211211
struct pci_dev *pdev = to_pci_dev(ish_resume_device);
212212
struct ishtp_device *dev = pci_get_drvdata(pdev);
213-
uint32_t fwsts;
214213
int ret;
215214

216-
pdev->dev_flags &= ~PCI_DEV_FLAGS_NO_D3;
217-
218-
/* Get ISH FW status */
219-
fwsts = IPC_GET_ISH_FWSTS(dev->ops->get_fw_status(dev));
220-
221-
/*
222-
* If currently, in ISH FW, sensor app is loaded or beyond that,
223-
* it means ISH isn't powered off, in this case, send a resume message.
224-
*/
225-
if (fwsts >= FWSTS_SENSOR_APP_LOADED) {
215+
/* Check the NO_D3 flag to distinguish the resume paths */
216+
if (pdev->dev_flags & PCI_DEV_FLAGS_NO_D3) {
217+
pdev->dev_flags &= ~PCI_DEV_FLAGS_NO_D3;
226218
disable_irq_wake(pdev->irq);
227219

228220
ishtp_send_resume(dev);
@@ -232,16 +224,20 @@ static void __maybe_unused ish_resume_handler(struct work_struct *work)
232224
ret = wait_event_interruptible_timeout(dev->resume_wait,
233225
!dev->resume_flag,
234226
msecs_to_jiffies(WAIT_FOR_RESUME_ACK_MS));
235-
}
236227

237-
/*
238-
* If in ISH FW, sensor app isn't loaded yet, or no resume response.
239-
* That means this platform is not S0ix compatible, or something is
240-
* wrong with ISH FW. So on resume, full reboot of ISH processor will
241-
* happen, so need to go through init sequence again.
242-
*/
243-
if (dev->resume_flag)
228+
/*
229+
* If the flag is not cleared, something is wrong with ISH FW.
230+
* So on resume, need to go through init sequence again.
231+
*/
232+
if (dev->resume_flag)
233+
ish_init(dev);
234+
} else {
235+
/*
236+
* Resume from the D3, full reboot of ISH processor will happen,
237+
* so need to go through init sequence again.
238+
*/
244239
ish_init(dev);
240+
}
245241
}
246242

247243
/**

0 commit comments

Comments
 (0)