Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1221414yba; Thu, 9 May 2019 12:48:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1pIP/V1zav1VUuaPbzenUrl/aP2BpTmlaj99jZ2efoF5B+ffvMr6nnVsWszzTuILxYQMs X-Received: by 2002:a65:62cc:: with SMTP id m12mr8162509pgv.118.1557431297176; Thu, 09 May 2019 12:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557431297; cv=none; d=google.com; s=arc-20160816; b=BWlPs5c35VaXuOopTSjV8MhLlGPAZrks6xC6GClQHBO9y54CuTN5ReY/SQG3B2qlkF qYhpXrxxn6vrRjlDbaQv63/7XgEM5R/d1YtN9+2whF3Z7YyupVjHTzHPX4lHjTITOFBS vdJxkACQE6a/sBj37lSbLVc2M2800YesBs/wXtUrXZRJ6bKONU6G19a/DLo1WIy/HMhc Pv4ZWJe58FHoHcquPte0m6DfJH9lFot2VkdQOypIpovTuPV61TmfSiApG4acWrQ4pLsK t/ons3tJbHA4iWWUh8YyRLs4/LQH3epHakMxB64DhX9d+Lm8YnJjoXY9zRwc2Y9dUOqz 9U0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=01YyMQNZ3EluIjBllXcKeNprEUgUBphVRcgGRzKHCPU=; b=XyB5+mfH6K1uEpMcNTeAhfQvjFiQdWpG+SGl5NKE+mgZ0m3U/fCNSQJqCU9wLYk7qN VEEEF8lhzzpi2YALpGUqP7hYMCkCAYdGijP9bKgJTcJLRfzqDI/BcQaWQgAn/aNDTXAl tyHlxLcsOiXopOpQKR7JR4dGOGOW7UR9YsULy6i6UMf24PAnxRM+DOJ74aO8MbUZv3Z2 wZTB/pfDi651QAZOQQuUOQazF3mRoZk1eOL3nwJvApBaxp8/T6IiCxyCQXnYmeOay5q1 SVEz12YfAKp7tlvuUlpsnYlOYQi4Vgtw81hikzd1ePz/amTYiR7fzeyCwX2RrL43d61x aL5Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d192si4054122pgc.480.2019.05.09.12.48.00; Thu, 09 May 2019 12:48:17 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726944AbfEITrM convert rfc822-to-8bit (ORCPT + 99 others); Thu, 9 May 2019 15:47:12 -0400 Received: from 212-186-180-163.static.upcbusiness.at ([212.186.180.163]:36596 "EHLO cgate.sperl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726704AbfEITrM (ORCPT ); Thu, 9 May 2019 15:47:12 -0400 Received: from [10.10.10.192] (account martin@sperl.org [10.10.10.192] verified) by sperl.org (CommuniGate Pro SMTP 6.2.1 _community_) with ESMTPSA id 7764569; Thu, 09 May 2019 19:47:08 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: Regression: spi: core: avoid waking pump thread from spi_sync instead run teardown delayed From: Martin Sperl X-Mailer: iPad Mail (16E227) In-Reply-To: <20190123175609.GG7503@sirena.org.uk> Date: Thu, 9 May 2019 21:47:08 +0200 Cc: Jon Hunter , linux-tegra , Linux Kernel Mailing List , linux-spi@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: 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> <20190118191202.GG6260@sirena.org.uk> <20190123175609.GG7503@sirena.org.uk> To: Mark Brown Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark! > On 23.01.2019, at 18:56, Mark Brown wrote: > >> On Sun, Jan 20, 2019 at 12:24:23PM +0100, kernel@martin.sperl.org wrote: >> >> These kind of changes it requires are consuming a bit more time than >> I was hoping for. > > Thanks for trying. > >> So maybe at this very moment the best is reverting the patch. > > Yes, I'm just going to do that for now. > >> As for the root cause of the regression: my guess is that spi-mem is >> just not triggering a shutdown any more because of how message_pump works. > > I'm fairly sure that's what's going on but not been able to get my head > around things enough to figure out what's going wrong yet. While thinking about this again maybe an idea: What about implement a second spi_transfer_one implementation (together with a message pump implementation) that would handle things correctly. Any driver then can select the old (default) or new implementation and thus would allow the optimizations to take place only for verified working drivers... At least this way we would not be blocked because no hw exposing this Behavior is available to us - at the cost of extra code to get maintained. What I would then also like to do for the new implementation is modify the API a bit - ideally I would like to: * Make spi_sync the primary interface which the message pump is also using directly * move all the prepare stuff early into spi-sync, so that for example the Preparing (including dma mapping) would get done in the calling thread And only the prepared message would get submitted to the queue - special processing would be needed for the spi-async case. This should optimize the computations out of the central loop faster. Adding spi-nand support could get added later by someone who has access to a device making use of this. If that sounds as somewhat acceptable then I will try get something Implemented. Any other ideas where we could improve as well? Martin