Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp607573imu; Wed, 16 Jan 2019 04:43:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN5UOhUBHc2lI5H2CHkAJGln96zMnH1Az+LRWEY1APJCll6+BGwl14q1z5e6tYWuX96e515P X-Received: by 2002:a62:9913:: with SMTP id d19mr9542344pfe.107.1547642588039; Wed, 16 Jan 2019 04:43:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547642588; cv=none; d=google.com; s=arc-20160816; b=x69jibOWiu+SkuVgdK+m9st5WHdLu4nMzX44jCD9hDg5rM2Viz3x3bNaNgEluJ4etL 4aDRPamwVzDFk/a7+zStq617JEQ/IMBc/4dS7MifJY610M9FhNTWiqH3YDuCIX61Pr6k fNyXbevnD1VXMjDFBYzU2TTc33VGxaLkzoENG2DjcosGTtivaJ6lnJDlqxhSOt5S+R+k cSjGSbnYJh3vJkOYu/fkkr7NpnxWGf/DBnheQex9q3J7n1nTiH2E9f54YmXFZCP7Q2t7 VOPNNhLppgTL8Lun4Kcpdx/qFZyPOshJzzkRIyjewYj39ZSUxmW5snc8n/aVubVDmXhc c8XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=micwuTqkYINBkpkLBdnOyIQ+MIOXvCSz8SYpG2mgglM=; b=Bkfp05QniBrnYfUb4+DhgfVa92ACooWL/KBXRS3K6xP+EiICXUyqmj5yXQVueTbaUK AO/GTDb5oGW2MHK4eKW8/ShwlQgqNfjHZmmbl1xBLX0lSSZIO0UGMUuCGypuGHmOuSa3 yvEzWT/QNy2AKteQ/nVPXNgOiYc2xe5dbazc7A0h90b4BoGBJlTgPdl4LgvYurYrZlVg HCjbj+HpzAfMLT9nCv8/GYYyQrEN1lWWuIT2uoBQe28Szlx09DW/9sVXEZtPUO471OEJ w5M7EyJRtG/GUH/l8UTlUJgdQee5HWio9O0CnsFkMU7EPSV9lLH6Gtx1UmQc/YKtntAg l30g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="cjIBB/zQ"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 80si6711367pfz.11.2019.01.16.04.42.48; Wed, 16 Jan 2019 04:43:08 -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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b="cjIBB/zQ"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390413AbfAOVZs (ORCPT + 99 others); Tue, 15 Jan 2019 16:25:48 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:33162 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732817AbfAOVZr (ORCPT ); Tue, 15 Jan 2019 16:25:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=micwuTqkYINBkpkLBdnOyIQ+MIOXvCSz8SYpG2mgglM=; b=cjIBB/zQkOhG9U92+JuXtN6aS Rmu8uy0VW6qxG33mWb1MoxnftqKn4RPeynWbrRlKip6Unh9tHzlXTAvidBrmXzBMeT+qFeG8BIRmO P6SWPecHw7Q3EUeGuZvmKxfmNef3cITTQmHkt9DVbBO1peW6BBBQzmxhC9Sqc8yXsWSGI=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gjWDM-00033W-Ih; Tue, 15 Jan 2019 21:25:40 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id B84D91127848; Tue, 15 Jan 2019 21:25:39 +0000 (GMT) Date: Tue, 15 Jan 2019 21:25:39 +0000 From: Mark Brown To: Martin Sperl Cc: Jon Hunter , linux-tegra , Linux Kernel Mailing List , linux-spi@vger.kernel.org Subject: Re: Regression: spi: core: avoid waking pump thread from spi_sync instead run teardown delayed Message-ID: <20190115212539.GK5522@sirena.org.uk> References: <7C4A5EFC-8235-40C8-96E1-E6020529DF72@martin.sperl.org> <20190115192619.GG5522@sirena.org.uk> <5D3256B1-5DAE-4E3F-9099-5425F4BCA304@martin.sperl.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+HmK7y6O+lKZIGkr" Content-Disposition: inline In-Reply-To: <5D3256B1-5DAE-4E3F-9099-5425F4BCA304@martin.sperl.org> X-Cookie: Violence is molding. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --+HmK7y6O+lKZIGkr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 15, 2019 at 09:58:55PM +0100, Martin Sperl wrote: > Maybe a bigger change to the reduce the complexity of > the state machine would solve that problem and also > reduce code complexity...=20 Yeah, that's where I was getting to with that test patch I posted. > I may find some time over the weekend if no solution > has been found until then. Thanks for volunteering :) > 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. That's a good idea, yes - a single enum much more reflects what we can actually do in terms of transitions. > Drawback: it is invasive, but let us see what it > really looks like... 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. --+HmK7y6O+lKZIGkr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlw+T9IACgkQJNaLcl1U h9ApOAf+MWM+IL1uhFKV6QS0+G2LKoICXpAb4txk4+PMZjEneaHHCPyywK4NC02y gjnpm7BS+A4FuKfDvr2XRFBdd7fkj+08xBv9tGrmUpi4trayMablnZcwwZ293q47 rxGIy+BkUTmzBxhM0Rk6JgI91ZCoUN5gnPrP3LpkfGNS8tcECdPyCJsQDXKqcSwj pNrVxHkArPPGFesoSQNxHDeuGvj0QNURq0kXCk4Dpiy9hvvucO6HImG38RNo5Yow tWWx3K4otQ3+eqiGWxML49BqATXtEs+MvKdfM8beeJAJWmqwam/+MSjYCSLzfPfK JB7+O0fGjQDtXFbkuA79qWMGmRENOQ== =LWLb -----END PGP SIGNATURE----- --+HmK7y6O+lKZIGkr--