From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D113FC47404 for ; Mon, 7 Oct 2019 17:02:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A6BE5206C0 for ; Mon, 7 Oct 2019 17:02:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570467779; bh=hXYgh/0cKB21RHeIgPu2RU8k3xZMxptal25Ke/FpByc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=1uluH0vLJMcPtO/h+bONyWlfUW5loDOkBa89vNJ3Jb1pe7aap4qex/xl/Jg11QvxV 11YnQpv0d3rjphXL/bPVRlCyDAdcuF+Q1MjZFX7+axm4Nw2N5Sf28LVeamKgZW7Whh MCUCSvqLqSAN1XOQhRtrqcyoSV6838dBUA42qXxE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729056AbfJGRC6 (ORCPT ); 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--