For information I solved suspend/resume issue by adding following code: ret = pm_runtime_get_sync(&serdev->dev); if (ret < 0) { pm_runtime_put_noidle(&serdev->dev); goto err_serdev_close; } But I think the hardcoded prepare issue is still valid. Best regards, Mohamed Ali Le ven. 24 juin 2022 à 09:28, Mohamed Ali Fodha <fodha.mohamed.ali@xxxxxxxxx> a écrit : > > Hello, > > I am not able to send data (serdev_device_write(gserial->serdev, > standby_cmd, strlen(standby_cmd), MAX_SCHEDULE_TIMEOUT)) to gnss in > suspend callback (from sta8089_set_power): > > static const struct gnss_serial_ops sta8089_gserial_ops = { > .set_power = sta8089_set_power, > }; > > but it works during prepare. To do this I have to patch the following API: > > @@ -21,10 +21,11 @@ struct gnss_serial { > enum gnss_serial_pm_state { > GNSS_SERIAL_OFF, > GNSS_SERIAL_ACTIVE, > GNSS_SERIAL_STANDBY, > + GNSS_SERIAL_PREPARE, > }; > > static int gnss_serial_prepare(struct device *dev) > { > - if (pm_runtime_suspended(dev)) > - return 1; > + struct gnss_serial *gserial = dev_get_drvdata(dev); > > - return 0; > + return gnss_serial_set_power(gserial, GNSS_SERIAL_PREPARE); > } > > Is it normal that sending data during suspend doesn't work? > I think there should be a solution to use prepare without patching > gnss_serial_prepare. > Any ideas please? > > Best regards, > Mohamed Ali