Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4552503ybp; Mon, 7 Oct 2019 10:06:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3S4F7UUxNkvgMT4n6oHqPIfv02W66V1sYCltQLofU6nYrJu1MvdQR8mvvTLXi13ouqCBn X-Received: by 2002:a50:c052:: with SMTP id u18mr29982383edd.88.1570467982044; Mon, 07 Oct 2019 10:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570467982; cv=none; d=google.com; s=arc-20160816; b=w4skw72aHansEZfb5mMM78/hVYP0AxYGVMXQOos8y70XNhG49nd/QnGQ6wveavy/i6 +nDUDT5A9kJMSj/rshGZEsnOSYmGK9P6il3bTpDz0KS7aebQVO4/IsDhkLM30FAI23sS Vx1PzI9VV+gVK0o+ybSN8iUNaatZGMN4FU9hV2h5w3Zy5tv2MlrOeevg+xLzGYbIIl8F /ncQCB8XPO5j07JFWYf1lNIF7dqc/kizqMt7bnRxAlCmYO3ae24p/MORnu187xp2ERCF Cu9Nf2XMKMiPeTQA26zJVSe8yX/Q4KeQ9QeNhcqcN3Ns74Dgt3JEbEKZYNd+VOmY224u 94uQ== 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=ZOY/izmiavLTIQj54n6IQkVCG9+85gWQy14tT3EDmV0=; b=WbWVkSd2XOPQn11AsLgx9JOGCZ8Jn4lwptktZNg7Enl9MCxDVc7DarVkMfBxepwtaw nCKujE7bklUNlX9UWMrjp6DbH8TMi0HDecRZQktXGtd4DMfwkCa0nUyFiPrnGPRRdVG7 +qdLUv0Bo53hT3v6fsbY57hbst5nhj6S975CXgEoQ9xunJU+ixY/UWftlzLSB6hgfpBD 3N1grDTBRxMVVjiFGhXP+QKSvl5WfxPr55O/webtgYZfBpQOpOdHhx8Tu47ZGUalt6ln pZej3gqckm2LR45Fv7S+8jzlNRusPWUtUEKvFoLXxadj+bkElqWmmY/ChfDpaDivDUT8 U8mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=lf4bkH0B; 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 p23si6202290eju.435.2019.10.07.10.05.58; Mon, 07 Oct 2019 10:06:22 -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; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=lf4bkH0B; 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 S1729049AbfJGRC6 (ORCPT + 99 others); Mon, 7 Oct 2019 13:02:58 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:56826 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727801AbfJGRC6 (ORCPT ); Mon, 7 Oct 2019 13:02:58 -0400 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=ZOY/izmiavLTIQj54n6IQkVCG9+85gWQy14tT3EDmV0=; b=lf4bkH0BprDzs3rAmSZ1xRNM0 QovVJMVonDYUSzpYubXfiAmSoYm+U+RQWN53l9/0xyVdlGtODEi7uLdOZUebcDAAcxZsgPQgpxvKW kgi3YNwrj85wJO1ybM9japYeUzuDF7ZJb1AMApcVPbswj6cK+aZmQq/LqnRAY7XzmCfLo=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=ypsilon.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iHWPO-00044c-W2; Mon, 07 Oct 2019 17:02:55 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 08620274162F; Mon, 7 Oct 2019 18:02:53 +0100 (BST) Date: Mon, 7 Oct 2019 18:02:53 +0100 From: Mark Brown To: Lukasz Majewski Cc: Geert Uytterhoeven , Colin Ian King , linux-spi , "linux-kernel@vger.kernel.org" Subject: Re: spi: Add call to spi_slave_abort() function when spidev driver is released Message-ID: <20191007170253.GA5614@sirena.co.uk> References: <20190926121438.655f1f10@jawa> <20190926144342.327a3c66@jawa> <20190926160645.0a2623fa@jawa> <20190926151752.GU2036@sirena.org.uk> <20190927003849.0c9e4335@jawa> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline In-Reply-To: <20190927003849.0c9e4335@jawa> X-Cookie: Death to all fanatics! 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 --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 27, 2019 at 12:38:49AM +0200, Lukasz Majewski wrote: > Maybe, it would be sufficient for now to move the spi_slave_abort() in > spi_release() before we decrease (spidev->users--) the use count? I think that should be OK, or possibly safer to do it at the start of the if (!spidev->users) section to avoid problems with fork()/exec() combinations. It'll need an if (spidev->spi) check as well, if we manage to hit that we've pretty much lost anyway though and I'm not sure I see a route to sensible error handling. --+HP7ph2BbKc20aGI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl2bb70ACgkQJNaLcl1U h9DHBgf/W/m+2jSATkcpdM7/FcRS/sMhWH6GHQp/pY+NkbGheVslqR70gaBKZl00 uVGBSaHg4XeQBndvtXyeqxAOOAqD9EvLXbRmAxDXcaezzr2K0UrysXvnAWJl80R6 UdzKeYw2gGchXz00zbWxnfcxcgQIvS4kRHfqoqb2LleeuL7g8S5rSdERpfoAGZG6 hVdax2Rpeskq0nGOzibmvi7N0+zQLn/379s0kXtavs+IfxT47eSPkkAv7V7ZOEPU 3BT0hYwJVBRC2Wb5m8Ddz0Cnt/mm0gTzURVxF+fTDj9uCXXxDEebrMpRLv1tcCfn 4+AI295/ZNCOaYqQzhx8/WYenQnqMg== =Yu7g -----END PGP SIGNATURE----- --+HP7ph2BbKc20aGI--