Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1031759imu; Wed, 16 Jan 2019 11:31:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN52MX7VSkWrf27dXUfJN+iV/j+9Pnzw6K4rnteLMVwR6+aaOlPisSCS/Fx+9WuHaWMvUzQR X-Received: by 2002:a63:4665:: with SMTP id v37mr10464879pgk.425.1547667074458; Wed, 16 Jan 2019 11:31:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547667074; cv=none; d=google.com; s=arc-20160816; b=q9xw+2u7aXTQYUUZbKv971vUWrFNR0icUhE7Z7cjvL1KC2+LI0Ku3TllmMNID27+2A gdhKt39ReIgrgplEDTCD8IQbQPn6GQwBa+Qv4F2i8vaqc9GQSlTw3Jd7o2x8YSEDKkIO ocvOsvR7AxzZXPFEEb1BMT0YJSRp4Ezf1nDqqWwtPEkQmlLVuhdXlzrFPnP2zoDU5hoS ElyHDOBb+WsmcCiIi07go0LEgoMUaTuZKSk/9dWc6kU2POsnndr74m3eyp41Sz1df2l1 aMXVKqow3kuVy31ct2tYbRmnWRJVp0YrOe917cyFeyWjZPId6UDGc7lQoVhODi3E9gkW LkHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Dr44vRq7v4s7XlHq7f/P6pICuugqkWSjqBeTxrhGIZw=; b=fjPfXenq5saJYps3BJ4aouYZpRBQKuaR3zNC+PdMzl+Sx2Wloov/pIo+LJZ+HlKyr0 qI6/o8WffJ6ORodUrXLJ7yzQX3StzXIfpizhK5nLEsfQtHNHuZ1VJm5YHLGD/+B9cTvU 9YOoFi1g+/BN/90DCbPSYiV6cB0VU7z4RDh+mDeimer7R/1VAn2/SWRt0HB5hugmZ+/X lt9a00EjqXoA+YOiCMiJyMxmaBmzEvKou9Nnkf/pxvvU6hEJO3vwckpPYHyZC3/dREm0 B7k8JsXp0s22hHjtloR7p1dWvl+2COW/RbC4elMr/LqlU7TvjV1JNYK2rcy9a1anZjQR RJCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="RjZk/1ga"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si7311325plg.123.2019.01.16.11.30.58; Wed, 16 Jan 2019 11:31:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="RjZk/1ga"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392303AbfAPLBm (ORCPT + 99 others); Wed, 16 Jan 2019 06:01:42 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:13799 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731617AbfAPLBl (ORCPT ); Wed, 16 Jan 2019 06:01:41 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 16 Jan 2019 03:01:11 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 16 Jan 2019 03:01:40 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 16 Jan 2019 03:01:40 -0800 Received: from [10.21.132.148] (172.20.13.39) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 16 Jan 2019 11:01:39 +0000 Subject: Re: Regression: spi: core: avoid waking pump thread from spi_sync instead run teardown delayed To: Mark Brown , Martin Sperl CC: linux-tegra , Linux Kernel Mailing List , References: <7C4A5EFC-8235-40C8-96E1-E6020529DF72@martin.sperl.org> <20190115192619.GG5522@sirena.org.uk> <5D3256B1-5DAE-4E3F-9099-5425F4BCA304@martin.sperl.org> <20190115212539.GK5522@sirena.org.uk> From: Jon Hunter Message-ID: Date: Wed, 16 Jan 2019 11:01:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190115212539.GK5522@sirena.org.uk> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL103.nvidia.com (172.20.187.11) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1547636471; bh=Dr44vRq7v4s7XlHq7f/P6pICuugqkWSjqBeTxrhGIZw=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=RjZk/1gapRYznJYQ+Oi9IJwa4h/ZEcdQYc7tyTrqknXPPr51ovvRNCT2rv/gtni3g smEh3X1BQ3Jn/06sooeLcahmcjmZw1d+cwqzZ8mn2f6JK1iqXMa7r27qzE5rlBxrRs wVMbrka3MB6c9b/sRhSids/l7gZVSy5hRKRzJfSVklSw0gA2iBRrH6hQuSVib3I5Hg IJtId64GHNjfbTBbExio9YocvCubmGPXzl25B1DQdNKHfZ1VaJHt2BRE2CDIjXZIqW MTR2nZ4euXCVgOC0AtTq3CYTDJnwQJl7Bt3xoIRkcuipzTAUyNZfnw2VlUsh9UOMGt 3O1EO8PLyMvIw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/01/2019 21:25, Mark Brown wrote: > On Tue, Jan 15, 2019 at 09:58:55PM +0100, Martin Sperl wrote: >=20 >> Maybe a bigger change to the reduce the complexity of >> the state machine would solve that problem and also >> reduce code complexity...=20 >=20 > Yeah, that's where I was getting to with that test patch I posted. >=20 >> I may find some time over the weekend if no solution >> has been found until then. >=20 > Thanks for volunteering :) >=20 >> The way I would envision it it would have a =E2=80=9Cstate=E2=80=9D >> as a level (0=3Dshutdown, 1=3Dhw enabled, 2=3Din pump,=20 >> 3=3Din transfer, 4=3Din hw-mode,...) and a complete >> to allow waking the shutdown thread (and by this >> avoiding the busy wait loop we have now). >> This would replace those idling, busy, and running flags. >=20 > That's a good idea, yes - a single enum much more reflects what we can > actually do in terms of transitions. >=20 >> Drawback: it is invasive, but let us see what it >> really looks like... >=20 > I think we need to either drop your change (which would be bad since it > is a big performance improvement, I'd punted it for later when I did the > original refactoring to push the work into the caller threads then never > got around to it) or have a invasive changes to make the new situation > clearer. Right now things are just far too complex to reason about > which isn't helping anyone. What I am seeing on Tegra is that the SPI controller is no longer runtime-pm suspended and so while this may improve performance, I think that this change is going to have a negative impact on idle power. I would be surprised if this problem is specific to Tegra because I don't see how the controller's busy state can ever be cleared :-( Cheers Jon --=20 nvpublic