Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1112995pxu; Fri, 16 Oct 2020 04:21:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjrzEZ5KkPtSuRGvHg6gHR/jU5KofwdQV9vcbXvdzAISMbOnnNdtvXHHAAcbkPFyQOHK01 X-Received: by 2002:a17:906:f2d5:: with SMTP id gz21mr3257893ejb.467.1602847317820; Fri, 16 Oct 2020 04:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602847317; cv=none; d=google.com; s=arc-20160816; b=No/XDhfEyNVCq5rau16ydsLgF3Ccbe2xndPz3O06HI5+f5FE0xNsfZhwtBeldEjq1b HpVtQLUlDMs0lHFwmlB3krg8J7GjtHyexeJXWFsOlY6jifkcqxIPB5SDesHglV3k63wW BKpF6rDQ73OWfYYq36aVgmw+TlmnxIMnIPqxFDJA4SuoH7PT4+IrGkRik9k/WzjZ567J OT2KtHCTzio5ahBByrU94WCk5OZZwVNOtznH8Tz1hhVXG4eMJSr3SbD8BjZjDYfT66Du vVW3NKEfuC/4eM+4wha0vMDZ8K/SdriQcR7am2w6oBE6MLnoovAaxSzfHfo6zAJOX3gz NXCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=l2g0WanDfq/KDOh+/VcHyYkZcE8dM9/DlazBWuJO0Zw=; b=qrF8cn352ww5OT5nJ/Mj1WvBsDmjGqODCJ7CtVVj8JKrUiwLs8WRKC6W8ZUEyQmWBa ey/qvALorWqgQeOhSNqD7OOfVLlbf+pSfSu/FQ67R84ajEiDE4nsZEUsib7yDFMd9dH0 3mfuczXuVUxSxQlh5yroGXYx3F+CiUIp+wStlG4rbxJORXCw7KvMlM+Bz92ZqFhOEWur fHgrCYoRAzJce7gZiFAn+TgsPamQ1+6DkvFyYYCB2xXPPoal3vHh4XsDZCUhhcjg4FN9 zSw1W+tUUwLOFtSd2VNgj+H8rNMaE5CmZrNBtDXqE+VIebFiUSMgTi98RdsUIUD5jKBE vyxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JA1GNd8+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 20si1504635ejx.79.2020.10.16.04.21.35; Fri, 16 Oct 2020 04:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JA1GNd8+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405099AbgJPIu0 (ORCPT + 99 others); Fri, 16 Oct 2020 04:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404750AbgJPIuZ (ORCPT ); Fri, 16 Oct 2020 04:50:25 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93CD6C061755; Fri, 16 Oct 2020 01:50:25 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id c21so1623776ljj.0; Fri, 16 Oct 2020 01:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=l2g0WanDfq/KDOh+/VcHyYkZcE8dM9/DlazBWuJO0Zw=; b=JA1GNd8+HG69mXKrInW+0dljGSbVqvNVsQIb2Q4Wl6dfWRYeempCQLpYb9LCCx0tF/ M//4FdO2QES7EtI0dmhPQ5LSEOjx95yO8c8ekXQETgalMH9LDJJYMryKl7NQY+wTG5P3 Z3pwCjpROLpJoK87+6xDJczYQvv1oZgEbOt5G8VxPFs45ijMGsNewG+SUAGA2oWWhOEg 92Jl18IA1nE773vlSc40rcMiXogokilNW+h5C0A2yh2aFVlfYIbztIhTmG8aiZO7rErV tpHdPSoVBgF27FnMYuUMLviVlfDXNiiunM4jihEFO01voqCV2NAZ4zeKCMGegQKSYFTL fx8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=l2g0WanDfq/KDOh+/VcHyYkZcE8dM9/DlazBWuJO0Zw=; b=uQLr0TtkaGB06LOnQNkX7CcRlBWW3Hvo8su3z8wRAhKbTIZs/IyPY4VmCIKDZreZG/ W0m0jo6GkNRENJCUDOsP8shU6hg5PE8CVbteB6xbLdgw3klWXyVfnTszTNA/0tUGYu1j P7gR5aUGpqgZBT29niAkj8PFJDpj6FxiXRJOaaoY0ugdAC/XLdNxYxF+saTpF6AaeWgC F/TWK3Kj0qL3YoYku0wNiwzpDmAOsX+ZDpQiMD6rQMMjuHagdSIYj2q26Mb7eetWZjOz xj20b2srGAISUET7E2qXbBgOJIGjIU4lZ+KOme3VniFn9rdQNPgA8AsyEKp+u3qU7Cys rqng== X-Gm-Message-State: AOAM533kT5Kn72rUU/CANuGwCyVy8dPo2Lt5ZEXAYT32O2P1GCHWHhVy ylbgKOGI27WjZ4vaBtQ0KEU= X-Received: by 2002:a2e:b5c1:: with SMTP id g1mr1014660ljn.305.1602838224050; Fri, 16 Oct 2020 01:50:24 -0700 (PDT) Received: from ubuntu-18.lintech.local ([80.87.144.137]) by smtp.gmail.com with ESMTPSA id 62sm607435lfk.47.2020.10.16.01.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2020 01:50:23 -0700 (PDT) From: Alexander Kochetkov To: Mark Brown , Heiko Stuebner Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alexander Kochetkov Subject: [PATCH] spi: rockchip: enable autosuspend feature Date: Fri, 16 Oct 2020 11:50:14 +0300 Message-Id: <20201016085014.31667-1-al.kochet@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/spi/spi-rockchip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 2cc6d9951b52..3e77b1a79bc8 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -157,6 +157,8 @@ #define ROCKCHIP_SPI_MAX_CS_NUM 2 +#define ROCKCHIP_AUTOSUSPEND_TIMEOUT 2000 + struct rockchip_spi { struct device *dev; @@ -670,6 +672,8 @@ static int rockchip_spi_probe(struct platform_device *pdev) goto err_disable_spiclk; } + pm_runtime_set_autosuspend_delay(&pdev->dev, ROCKCHIP_AUTOSUSPEND_TIMEOUT); + pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); -- 2.17.1