lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210903212758.22038-1-mahesh.r.vaidya@intel.com>
Date:   Sat,  4 Sep 2021 05:27:58 +0800
From:   mahesh.r.vaidya@...el.com
To:     broonie@...nel.org, linux-spi@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     mgross@...ux.intel.com, kris.pan@...el.com, furong.zhou@...el.com,
        mallikarjunappa.sangannavar@...el.com,
        lakshmi.bai.raja.subramanian@...el.com
Subject: [PATCH v1] spi: dw: Enable Autosuspend delay for SPI DesignWare

From: Mahesh R Vaidya <mahesh.r.vaidya@...el.com>

Enable and set Autosuspend delay for SPI DesignWare driver.
The number 1000 ms for the autosuspend delay was picked a bit
arbitrarily, so if someone has measurements showing a better
value we could easily change this.

Signed-off-by: Mahesh R Vaidya <mahesh.r.vaidya@...el.com>
---
 drivers/spi/spi-dw-mmio.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
index 3379720cfcb8..8b588ce9c16b 100644
--- a/drivers/spi/spi-dw-mmio.c
+++ b/drivers/spi/spi-dw-mmio.c
@@ -33,6 +33,8 @@ struct dw_spi_mmio {
 	struct reset_control *rstc;
 };

+#define SPI_DW_DEFAULT_AUTOSUSP_VAL		1000
+
 #define MSCC_CPU_SYSTEM_CTRL_GENERAL_CTRL	0x24
 #define OCELOT_IF_SI_OWNER_OFFSET		4
 #define JAGUAR2_IF_SI_OWNER_OFFSET		6
@@ -309,6 +311,10 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
 			goto out;
 	}

+	/* Set initial autosuspend default delay value and enable */
+	pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_DW_DEFAULT_AUTOSUSP_VAL);
+	pm_runtime_use_autosuspend(&pdev->dev);
+	pm_runtime_set_active(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);

 	ret = dw_spi_add_host(&pdev->dev, dws);
@@ -319,6 +325,7 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
 	return 0;

 out:
+	pm_runtime_put_noidle(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 	clk_disable_unprepare(dwsmmio->pclk);
 out_clk:
--
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ