spi: spi-sun6i: enable autosuspend feature
Subsystems (2)
PATCH 1/1 spi: spi-sun6i: enable autosuspend feature
If SPI is used for periodic polling any sensor, significant delays sometimes appear. Switching on module clocks during resume lead to delays. Enabling autosuspend mode causes the controller to not suspend between SPI transfers and the delays disappear.
--- drivers/spi/spi-sun6i.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/spi/spi-sun6i.c +4 -1
@@ -22,6 +22,8 @@#include <linux/spi/spi.h> +#define SUN6I_AUTOSUSPEND_TIMEOUT 2000 +#define SUN6I_FIFO_DEPTH 128#define SUN8I_FIFO_DEPTH 64
@@ -639,9 +641,10 @@ static int sun6i_spi_probe(struct platform_device *pdev) goto err_free_dma_rx; } +pm_runtime_set_autosuspend_delay (&pdev->dev,SUN6I_AUTOSUSPEND_TIMEOUT ); +pm_runtime_use_autosuspend (&pdev->dev);pm_runtime_set_active (&pdev->dev);pm_runtime_enable (&pdev->dev); -pm_runtime_idle (&pdev->dev); ret =devm_spi_register_master (&pdev->dev, master);if (ret) {
Signature · 1 line
2.17.1
Hi,
Quoted 24 lines · Alexander Kochetkov
If SPI is used for periodic polling any sensor, significant delays sometimes appear. Switching on module clocks during resume lead to delays. Enabling autosuspend mode causes the controller to not suspend between SPI transfers and the delays disappear.
Signed-off-by Alexander Kochetkov <[email protected]>--- drivers/spi/spi-sun6i.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/spi/spi-sun6i.c +2
-0@@ -22,6 +22,8 @@#include <linux/spi/spi.h> +#define SUN6I_AUTOSUSPEND_TIMEOUT 2000 +#define SUN6I_FIFO_DEPTH 128#define SUN8I_FIFO_DEPTH 64
drivers/spi/spi-sun6i.c static int sun6i_spi_probe(struct platform_device *pdev) · line 644
Quoted 8 lines
drivers/spi/spi-sun6i.c +2
-1@@ -639,9 +641,10 @@ static int sun6i_spi_probe(struct platform_device *pdev) goto err_free_dma_rx; } +pm_runtime_set_autosuspend_delay (&pdev->dev,SUN6I_AUTOSUSPEND_TIMEOUT ); +pm_runtime_use_autosuspend (&pdev->dev);pm_runtime_set_active (&pdev->dev);pm_runtime_enable (&pdev->dev); -pm_runtime_idle (&pdev->dev);
You should also mention why pm_runtime_idle isn't useful anymore in your commit log.
Thanks!
Maxime
Mark Brown
maintainerQuoted 4 lines · Alexander Kochetkov
If SPI is used for periodic polling any sensor, significant delays sometimes appear. Switching on module clocks during resume lead to delays. Enabling autosuspend mode causes the controller to not suspend between SPI transfers and the delays disappear.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: spi-sun6i: enable autosuspend feature
commit: ae0f18bef30d0e76dd62be46c59b24c75f175092
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark