Loading drivers/spi/spi-msm-geni.c +36 −1 Original line number Diff line number Diff line Loading @@ -1003,12 +1003,22 @@ static int spi_geni_prepare_message(struct spi_master *spi, if (mas->shared_ee) { if (mas->setup) { /* Client to respect system suspend */ if (!pm_runtime_enabled(mas->dev)) { GENI_SE_ERR(mas->ipc, false, NULL, "%s: System suspended\n", __func__); return -EACCES; } ret = pm_runtime_get_sync(mas->dev); if (ret < 0) { dev_err(mas->dev, "%s:pm_runtime_get_sync failed %d\n", __func__, ret); WARN_ON_ONCE(1); pm_runtime_put_noidle(mas->dev); /* Set device in suspended since resume failed */ pm_runtime_set_suspended(mas->dev); goto exit_prepare_message; } ret = 0; Loading Loading @@ -1309,6 +1319,13 @@ static int spi_geni_prepare_transfer_hardware(struct spi_master *spi) if (mas->is_le_vm) return 0; /* Client to respect system suspend */ if (!pm_runtime_enabled(mas->dev)) { GENI_SE_ERR(mas->ipc, false, NULL, "%s: System suspended\n", __func__); return -EACCES; } if (mas->gsi_mode && !mas->shared_ee) { struct se_geni_rsc *rsc; int ret = 0; Loading @@ -1327,7 +1344,10 @@ static int spi_geni_prepare_transfer_hardware(struct spi_master *spi) dev_err(mas->dev, "%s:pm_runtime_get_sync failed %d\n", __func__, ret); WARN_ON_ONCE(1); pm_runtime_put_noidle(mas->dev); /* Set device in suspended since resume failed */ pm_runtime_set_suspended(mas->dev); return ret; } Loading Loading @@ -1612,6 +1632,17 @@ static int spi_geni_transfer_one(struct spi_master *spi, GENI_SE_DBG(mas->ipc, false, mas->dev, "current xfer_timeout:%lu ms.\n", xfer_timeout); /* Double check PM status, client might have not taken wakelock and * continue to queue more transfers. Post auto-suspend, system suspend * can keep driver to forced suspend, hence it's client's responsibility * to not allow system suspend to trigger. */ if (pm_runtime_status_suspended(mas->dev)) { GENI_SE_ERR(mas->ipc, true, mas->dev, "%s: device is PM suspended\n", __func__); return -EACCES; } if (mas->cur_xfer_mode != GSI_DMA) { reinit_completion(&mas->xfer_done); ret = setup_fifo_xfer(xfer, mas, slv->mode, spi); Loading Loading @@ -2143,11 +2174,12 @@ static int spi_geni_probe(struct platform_device *pdev) snprintf(boot_marker, sizeof(boot_marker), "M - DRIVER GENI_SPI_%d Ready", spi->bus_num); place_marker(boot_marker); dev_info(&pdev->dev, "%s: completed\n", __func__); return ret; spi_geni_probe_unmap: devm_iounmap(&pdev->dev, geni_mas->base); spi_geni_probe_err: dev_info(&pdev->dev, "%s: ret:%d\n", __func__, ret); spi_master_put(spi); return ret; } Loading Loading @@ -2178,6 +2210,7 @@ static int spi_geni_runtime_suspend(struct device *dev) return 0; } GENI_SE_DBG(geni_mas->ipc, false, NULL, "%s:\n", __func__); /* Do not unconfigure the GPIOs for a shared_se usecase */ if (geni_mas->shared_ee && !geni_mas->shared_se) goto exit_rt_suspend; Loading Loading @@ -2221,6 +2254,8 @@ static int spi_geni_runtime_resume(struct device *dev) return ret; } GENI_SE_DBG(geni_mas->ipc, false, NULL, "%s:\n", __func__); if (geni_mas->shared_ee) goto exit_rt_resume; Loading Loading
drivers/spi/spi-msm-geni.c +36 −1 Original line number Diff line number Diff line Loading @@ -1003,12 +1003,22 @@ static int spi_geni_prepare_message(struct spi_master *spi, if (mas->shared_ee) { if (mas->setup) { /* Client to respect system suspend */ if (!pm_runtime_enabled(mas->dev)) { GENI_SE_ERR(mas->ipc, false, NULL, "%s: System suspended\n", __func__); return -EACCES; } ret = pm_runtime_get_sync(mas->dev); if (ret < 0) { dev_err(mas->dev, "%s:pm_runtime_get_sync failed %d\n", __func__, ret); WARN_ON_ONCE(1); pm_runtime_put_noidle(mas->dev); /* Set device in suspended since resume failed */ pm_runtime_set_suspended(mas->dev); goto exit_prepare_message; } ret = 0; Loading Loading @@ -1309,6 +1319,13 @@ static int spi_geni_prepare_transfer_hardware(struct spi_master *spi) if (mas->is_le_vm) return 0; /* Client to respect system suspend */ if (!pm_runtime_enabled(mas->dev)) { GENI_SE_ERR(mas->ipc, false, NULL, "%s: System suspended\n", __func__); return -EACCES; } if (mas->gsi_mode && !mas->shared_ee) { struct se_geni_rsc *rsc; int ret = 0; Loading @@ -1327,7 +1344,10 @@ static int spi_geni_prepare_transfer_hardware(struct spi_master *spi) dev_err(mas->dev, "%s:pm_runtime_get_sync failed %d\n", __func__, ret); WARN_ON_ONCE(1); pm_runtime_put_noidle(mas->dev); /* Set device in suspended since resume failed */ pm_runtime_set_suspended(mas->dev); return ret; } Loading Loading @@ -1612,6 +1632,17 @@ static int spi_geni_transfer_one(struct spi_master *spi, GENI_SE_DBG(mas->ipc, false, mas->dev, "current xfer_timeout:%lu ms.\n", xfer_timeout); /* Double check PM status, client might have not taken wakelock and * continue to queue more transfers. Post auto-suspend, system suspend * can keep driver to forced suspend, hence it's client's responsibility * to not allow system suspend to trigger. */ if (pm_runtime_status_suspended(mas->dev)) { GENI_SE_ERR(mas->ipc, true, mas->dev, "%s: device is PM suspended\n", __func__); return -EACCES; } if (mas->cur_xfer_mode != GSI_DMA) { reinit_completion(&mas->xfer_done); ret = setup_fifo_xfer(xfer, mas, slv->mode, spi); Loading Loading @@ -2143,11 +2174,12 @@ static int spi_geni_probe(struct platform_device *pdev) snprintf(boot_marker, sizeof(boot_marker), "M - DRIVER GENI_SPI_%d Ready", spi->bus_num); place_marker(boot_marker); dev_info(&pdev->dev, "%s: completed\n", __func__); return ret; spi_geni_probe_unmap: devm_iounmap(&pdev->dev, geni_mas->base); spi_geni_probe_err: dev_info(&pdev->dev, "%s: ret:%d\n", __func__, ret); spi_master_put(spi); return ret; } Loading Loading @@ -2178,6 +2210,7 @@ static int spi_geni_runtime_suspend(struct device *dev) return 0; } GENI_SE_DBG(geni_mas->ipc, false, NULL, "%s:\n", __func__); /* Do not unconfigure the GPIOs for a shared_se usecase */ if (geni_mas->shared_ee && !geni_mas->shared_se) goto exit_rt_suspend; Loading Loading @@ -2221,6 +2254,8 @@ static int spi_geni_runtime_resume(struct device *dev) return ret; } GENI_SE_DBG(geni_mas->ipc, false, NULL, "%s:\n", __func__); if (geni_mas->shared_ee) goto exit_rt_resume; Loading