Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3488086imu; Fri, 18 Jan 2019 11:14:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN79BjcOmuqqzSIIwvaEAcp30gTiRwMjGsaogz+s/ONSu+5oCKw5J/QWoT37t/wupufIVAP+ X-Received: by 2002:a62:d148:: with SMTP id t8mr21104053pfl.52.1547838878098; Fri, 18 Jan 2019 11:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547838878; cv=none; d=google.com; s=arc-20160816; b=gd44lQdHMCgF3/iFhE6dXWU2j8hbN9kXbz5C3Cy4DBOXQddpbBCgMRgE6hprpVs49R AI4aN6hpWze14ChKSlpvr055p7Z8kFDpyOkV2I+S3AK02+lJPfIIal2MgiDfHOkwgjxv 0n1KoeedAG7MfOrNScpllboeoHTmIGXlYPij5soGzCx2/Gq4d9K99IpcDIo5DFf8Iqji wwlhOCOJwPU5piNhHoyzqDLzTh0DuexDU+EHdMWM9aqZaDS6QyYbaAT391R/3iiJY2Ch 41Kumkp/pNsWDu9s8whygcqhBLpnpO3HNBwSYl/52qpr1WhfILiro+YoGwkLTshvJMlQ HXnQ== 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=iTfN4IZcke/gzOJ1Ua6kwNvEgiE6Jf880CODCiJIqDc=; b=AnJqLELZRg6UeMecHg40n3oi2BlTd5YL/rFeSA5CTgYZXI6zRueVrVe/iUX+KJKZdO wW5MEoeYDa3F8UoSv61t8zsYH+6APOdnRAOPCkROA5rzFh4WNefPn2pawjdi4k5VQCCR kpZavsL3B5vb5HvE0boAFr325aOvBMU7Jv5w3bLmATS+gE3FPR2FYUOCtJAzmAX8GQ/5 1uKCeefHM3nofQxVvIi0Abl4kEygdKhlsBI+pewwbosQ0RKESFQINo55znlSTV/Lhs1P PoWuweZx6PYDu3wohsf27AiVMGuOBAC7unl20Hl6yCLtRF/dxx9Mkw5kX+tzud8mjMzM U1NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=qn6Fc6he; 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 j20si4973850pgh.224.2019.01.18.11.14.19; Fri, 18 Jan 2019 11:14:38 -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=qn6Fc6he; 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 S1729280AbfARTMJ (ORCPT + 99 others); Fri, 18 Jan 2019 14:12:09 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:57280 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729115AbfARTMJ (ORCPT ); Fri, 18 Jan 2019 14:12:09 -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=iTfN4IZcke/gzOJ1Ua6kwNvEgiE6Jf880CODCiJIqDc=; b=qn6Fc6he6I6Xu6gKHw6ISt2ou iKfVa0KkOLy+eWiA+z+y9sCV+BtiA5d//191cgG9MvzfGNkP4OH+zuP5fzguN/bzBhz6cMSrpC58I t5K0WoenlGVBrV6eABTSN3vbvchF1trkGS0UY8qlUzAJK2hK8I2ETYSvIu7Y7viIxjPCA=; 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 1gkZYh-0005XH-FC; Fri, 18 Jan 2019 19:12:03 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 09C7A11276E7; Fri, 18 Jan 2019 19:12:03 +0000 (GMT) Date: Fri, 18 Jan 2019 19:12:03 +0000 From: Mark Brown To: kernel@martin.sperl.org 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: <20190118191202.GG6260@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> <20190115212539.GK5522@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XaUbO9McV5wPQijU" Content-Disposition: inline In-Reply-To: X-Cookie: You can't get there from here. 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 --XaUbO9McV5wPQijU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 18, 2019 at 06:11:31PM +0100, kernel@martin.sperl.org wrote: > Does something like this looks acceptable? > diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h > index ec210286567c..677fc5025033 100644 > --- a/include/linux/spi/spi.h > +++ b/include/linux/spi/spi.h > @@ -288,6 +288,21 @@ static inline void spi_unregister_driver(struct spi_= driver *sdrv) > module_driver(__spi_driver, spi_register_driver, \ > spi_unregister_driver) >=20 > +/* define SPI Controller states in the state machine */ > +enum spi_controller_state { > + SPI_CONTROLLER_STATE_SHUTDOWN =3D 0, > + SPI_CONTROLLER_STATE_IDLE =3D 1, > + SPI_CONTROLLER_STATE_IN_PROCESS =3D 2, > + SPI_CONTROLLER_STATE_IN_TRANSFER =3D 3, > +}; Yes, it does! > SPI_CONTROLLER_MODE_EXCLUSIVE could replace the bus_lock_flag. > I am also not sure of the =E2=80=9Cconvention=E2=80=9D of memory mode (i.e > using mem_ops). Is it maybe implicitly spi_bus_locked - i.e > typically only a single device? Yes, it does - we're basically handing over the entire SPI bus to another bit of hardware that will do memory mapped flash access so we can't really have anything else trying to do SPI operations at the same time. --XaUbO9McV5wPQijU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlxCJQIACgkQJNaLcl1U h9CDdQf+I7iveblkgIuqYYemfISQk+f97Jh7CYalr7//EB65ABrPeVKbeWdEWNEd O3lQckS5I1XBelmk78Kw1keMvy7yev5LKvadKyXMIS/HPOaCaC8GnuVQ039Zk0iX tIeK/uCe2Its32BjZ5b0WbDt68JInIEpf7iuqTQs7hVDmvmx2TovvbXdSkoaqkpU qx8wkH0+sxeLLqBelfzvsy7J3ETSRd+c6Je3gCH9Jk15qYO8x+XdY6PRL+3Pz5zs U3gVWY8cwTD4v7tORNPNi0W8oB01KoXcrk7cvCUteYS3nSVn2h5GKO05IDrDlhAO +5qJMOnCzhhWFsctQcfxD0kQI+tBCA== =0ySs -----END PGP SIGNATURE----- --XaUbO9McV5wPQijU--