Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5063283imu; Tue, 15 Jan 2019 10:30:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN6IbrYcSpQTBE1opDNTkE5koTvHrz+SHSKEhGmhDYmjPhLuESkmHcRbRz2MrrY3TwK+wYqh X-Received: by 2002:a17:902:5ac7:: with SMTP id g7mr5489991plm.212.1547577036517; Tue, 15 Jan 2019 10:30:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547577036; cv=none; d=google.com; s=arc-20160816; b=UO5vqdPWi3X4F0IwB+1TaTWgBydQzsLRLjkyc6T1U0hGk2DcMqT0lLXg5M/cIE8GIf iuD7Y55Kr3vpSC5Gbq2sAoSI86D8ZCkGbyQ4ZFPzo6gfdRGzTHaI8gw1FNGrRPpLIzLN ebglHxxnXFQPVO+wKuLodn16ox00DGce3kWSaUgNHCiOaUEtERZGXoDyKksPcIcNuEFU /BlU4nWCpZBaiKulfBp1+EP8SdZVuLpUMZNzdje6n2a0Fc7qiJ0q//GO3FSnDAQE0DiY z2aEQ4vrutiVpe6ozGJh63UkdTmNmum359bCFSxQInXkni+ShabUk4hBqcTwjBdhx9RE //aw== 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=mP/HvQkX74Z2elzZYLUn8AWa6PlcEajW0R1UfiPCOQE=; b=UFi7rczvR46lDoT1aOer0Vm5CptMn2O2zEtwoL7K/jXXahptEHS3C79G7CALbVFbZ/ 3zVv+FhbT/xF+BpkowLZan1p32jYzSn/6R9BDFyyQwvRHUrZAXh89Y4i6Dt/YeWAR7Is lnFIHpObceuxWGO1jgeVF3FqCvKUOsTYuDWdBD28AzQqu+YxdNMV4jZMYY468nnngnlj 328sa9/DkoR08XPY1ET9NV+o1qppvXoZE4FK0g1bk8GcqZQLUz9PsQnru+Jxf/0p/qSD kH79Nq9Npq1KTw/nq4ZNb1HsUjPZXa1fC1BX54kOzTk3KN6a4neR4nVA7MlFBO1MYqXT CfCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="PEn/CnfH"; 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 g92si3898383plg.392.2019.01.15.10.30.17; Tue, 15 Jan 2019 10:30:36 -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="PEn/CnfH"; 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 S1730363AbfAOQJS (ORCPT + 99 others); Tue, 15 Jan 2019 11:09:18 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:7091 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729187AbfAOQJS (ORCPT ); Tue, 15 Jan 2019 11:09:18 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 15 Jan 2019 08:08:57 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Tue, 15 Jan 2019 08:09:17 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 15 Jan 2019 08:09:17 -0800 Received: from [10.21.132.148] (10.124.1.5) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 15 Jan 2019 16:09:16 +0000 Subject: Re: Regression: spi: core: avoid waking pump thread from spi_sync instead run teardown delayed To: Mark Brown CC: Martin Sperl , linux-tegra , Linux Kernel Mailing List , References: <7C4A5EFC-8235-40C8-96E1-E6020529DF72@martin.sperl.org> <20190115151009.GC5522@sirena.org.uk> From: Jon Hunter Message-ID: <313fc9d6-a142-91c2-8868-188bc70c019f@nvidia.com> Date: Tue, 15 Jan 2019 16:09:14 +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: <20190115151009.GC5522@sirena.org.uk> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1547568537; bh=mP/HvQkX74Z2elzZYLUn8AWa6PlcEajW0R1UfiPCOQE=; 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=PEn/CnfHPWSz40gYFW8ntg49mhs/14xzuurP9VeECkLWb0vLcVn5uD1Y6oQkAY7sZ WfeM73Gv9F3cr+Ssx+RiYSoWxWY5rBx2aZgRoImSAUBwvS7KDGo0jvev96PEad3mMi IwHdaymajGN5DCg/KjDIjYChZMLEzqBNXLpJMJdr+PBin1YkCfXWuPL/NtMCodLRBa Yw6JYnf9ImaGSNIB+bchEadjvoYyL6JL53zdkwsXB9a89Z4lHi8udgeDbmZ7LpnJAy 282blYh1DWcewz7hc1qyCirUCPhhr0WDLdK1AO7dXy4/IrCldi4EmJX3XB1uSO4meH rCfCeFb6S8h0g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/01/2019 15:10, Mark Brown wrote: > On Tue, Jan 15, 2019 at 02:26:02PM +0000, Jon Hunter wrote: > >> It seems that __spi_pump_messages() is getting called several times >> during boot when registering the spi-flash, then after the spi-flash has >> been registered, about a 1 sec later spi_pump_idle_teardown() is called >> (as expected), but exits because 'ctlr->running' is true. However, >> spi_pump_idle_teardown() is never called again and when we suspend we >> are stuck in the busy/running state. In this case should something be >> scheduling spi_pump_idle_teardown() again? Although even if it does I >> don't see where the busy flag would be cleared in this path? > > Right, I think with the current code we just shouldn't be checking for > busy in teardown, since there's now a fairly big delay between idle and > actually turning the hardware off the name is just super misleading and > the logic confused. I don't have time to test right now but does > something like the below which changes it to a flag for the hardware > being powered up work: I tried your change but the same problem still persists. Cheers Jon -- nvpublic