From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28EA4C433DF for ; Mon, 19 Oct 2020 07:05:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B4A422203 for ; Mon, 19 Oct 2020 07:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727322AbgJSHFs (ORCPT ); Mon, 19 Oct 2020 03:05:48 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:39973 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727223AbgJSHFs (ORCPT ); Mon, 19 Oct 2020 03:05:48 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5202F5C006B; Mon, 19 Oct 2020 03:05:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 19 Oct 2020 03:05:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=EMlZBo15epeEdVjKu5nXc3zhaks PLbuojCDzDSKauhc=; b=Ff1Tz88cw07JCNE4wxm2z6vwZsWuT4T2rTUS33F7n6q XHFHexp9DeQs0nK222i5ND3s7PA3kVEMZq8HNrYIYKWoPRRVdzleJBZlzPIJgynx 9lQlNeNp4bV2ND9OOkMcsoN9C2ZKLjUYOOMC8XBTErt8ofG3/DQG9ZClExOy2jRG PcVoIDAvSeHCWqsHCRdGp6d7bPvSmMTqhjWsGnqqR0E8N/J1Zx7y617FPLUImR6h vt293NCnps/TY4gMxNuR4d6j4IE2c9LWPjuhpjA8s136sa+i+e0+f4YyGAWrXGty qp7Tx7ovldoxBGZTiEN+kVlYbb/A66nMuPJKsBN9K4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=EMlZBo 15epeEdVjKu5nXc3zhaksPLbuojCDzDSKauhc=; b=S0aG4V4Ttx2iboTB84z+Qk rPBcyuX74KZPKeB8akRNaQbKeSUcKrPmZt1JI+IY4r6Wee7ttUVvmhljdzBFTag3 +Nc/BnamdgFPvmg5ICJAWOpWEZ9bNWC8BMWtV4eqamRDEv8Sgyx56Pu7OPPdy5l6 aCtzktK9FiH67N2sblZ/19CHSWcK972pf291mznvK02sOUELJ3XD9U4IeMhsfBT2 HX/KHn/whI34h9pg4EIpYOB7MvX5UQ2YfmXdcU8+aWf7AzYhfzjWi9+ssR9/VS6u vd/ZHAob/vR9KX17xkdZ+xq1cpNJGyVQbZXgyrCmzqTGwpeXUhU2MVLAxjFS4PBA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrjedtgdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 287113280059; Mon, 19 Oct 2020 03:05:45 -0400 (EDT) Date: Mon, 19 Oct 2020 09:05:41 +0200 From: Maxime Ripard To: Alexander Kochetkov Cc: Mark Brown , Chen-Yu Tsai , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] spi: spi-sun6i: enable autosuspend feature Message-ID: <20201019070541.qy3v2r3sg5itdhds@gilmour.lan> References: <20201016083826.31427-1-al.kochet@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zqg3emlloxikctnv" Content-Disposition: inline In-Reply-To: <20201016083826.31427-1-al.kochet@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --zqg3emlloxikctnv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Oct 16, 2020 at 11:38:26AM +0300, Alexander Kochetkov wrote: > 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. >=20 > Signed-off-by: Alexander Kochetkov > --- > drivers/spi/spi-sun6i.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c > index 38e5b8af7da6..4cc0280e934c 100644 > --- a/drivers/spi/spi-sun6i.c > +++ b/drivers/spi/spi-sun6i.c > @@ -22,6 +22,8 @@ > =20 > #include > =20 > +#define SUN6I_AUTOSUSPEND_TIMEOUT 2000 > + > #define SUN6I_FIFO_DEPTH 128 > #define SUN8I_FIFO_DEPTH 64 > =20 > @@ -639,9 +641,10 @@ static int sun6i_spi_probe(struct platform_device *p= dev) > goto err_free_dma_rx; > } > =20 > + 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 --zqg3emlloxikctnv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX406jQAKCRDj7w1vZxhR xQZMAP9MvzwkJ7KYvidr8Tqy6Uun4yiI03CcELJ3laGSQezVEwD/diF7Gju+JH4x NZedwB1YqwnhUGqHXmb8Mf8hYxkjMgY= =bZcy -----END PGP SIGNATURE----- --zqg3emlloxikctnv--