Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1354415
| Path | csiph.com!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Alison Schofield <amsfield22@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 1/2] iio: core: implement iio_{claim|release}_direct_mode() |
| Date | Wed, 09 Mar 2016 21:10:02 +0100 |
| Message-ID | <raSAG-4vK-15@gated-at.bofh.it> (permalink) |
| References | <r7XGy-4zK-7@gated-at.bofh.it> <r7XQf-4Tj-47@gated-at.bofh.it> <r8f0K-89o-7@gated-at.bofh.it> <r9oOl-1uU-13@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=itk59WMRGAa4UcDBNIJJk7PKuycQfJS113FJrspxnuY=; b=1D8ifQ0NHETuxQPoVpOXeGqEelfpqgP6UVdoSvQfzRGO2pk4Y/HfT0raf5RbRrrMZJ H1DP/fX2PcNVqZnp1IfjfJDLejCTBFIH/3S4oa/AjfpmIQJ4TSDMHxc/XTseePAz+0sl uh58Jc7lVk1oIZcAZeMSyjR/N6KAnHtvtAS2nL5qoNiLGwR/mL2yM+aryKmXLTiC0V6W geQ+i0wj22WatFtK6wx+fAc6nK3GVgKfa9wkJ8ug/E8ur+EfiRHn9lxHVD9LXUHJd5Nc ZmaOVoh+b3cz89byh5pg1lsC/H6suasCadFbLy+EtlS0r1GgVfvWx0XzWSJW266FwMJu lIXQ== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=itk59WMRGAa4UcDBNIJJk7PKuycQfJS113FJrspxnuY=; b=ehw5Crr+IyUDjz9NmWYRM4EKfAacsQ9gQp+aMjTdK3tgnmDl7wb9CByK8E5rSSFdrg 59jq3huOn8lzPM/p/rPztcXA/Tvuimnuzbb2pBMZiQEm/Chpv95gcpKk/BOnpLA5qBz6 BjEbsMKOPiBr3mo+FifDS+Xh+StUR5eju6PzUw9/xLgpYf7SYkme6QPzXU4UQQRWs/nm BMTWmdBW4KlrjlLbk21D9Iihd5dfWQ+cGXtOxhSAaEsS1eBLHcYfDrJwXz+DCLqEzBmy TvlXHdCOUSF6yxbFWDSmIE+YPQipVd7c4Fc21UXJJkdXYCfV088LuQJ02RZcmHuU+AUR RPBA== |
| X-Gm-Message-State | AD7BkJKytj1IkHT9NlY/UzIdJ5WZhFkSpT97ssdmEQPDUB8pp+sfHe5gVJ8J9KSzFp4vEQ== |
| X-Received | by 10.66.222.199 with SMTP id qo7mr172320pac.38.1457554018510; Wed, 09 Mar 2016 12:06:58 -0800 (PST) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.23 (2014-03-12) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 46 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Lars-Peter Clausen <lars@metafoo.de>, outreachy-kernel@googlegroups.com, knaack.h@gmx.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Michael.Hennerich@analog.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org |
| X-Original-Date | Wed, 9 Mar 2016 12:06:56 -0800 |
| X-Original-Message-ID | <20160309200654.GA11631@d830.WORKGROUP> |
| X-Original-References | <cover.1456794364.git.amsfield22@gmail.com> <9a2950402af7277a4928a10eade4cc8b1187d8c8.1456794364.git.amsfield22@gmail.com> <56D6EA82.8090601@metafoo.de> <56DB1F3C.8020302@kernel.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1354415 |
Show key headers only | View raw
On Sat, Mar 05, 2016 at 06:02:36PM +0000, Jonathan Cameron wrote: > On 02/03/16 13:28, Lars-Peter Clausen wrote: > > On 03/01/2016 08:02 PM, Alison Schofield wrote: > >> It is often the case that the driver wants to be sure a device stays > >> in direct mode while it is executing a task or series of tasks. To > >> accomplish this today, the driver performs this sequence: 1) take the > >> device state lock, 2)verify it is not in a buffered mode, 3) execute > >> some tasks, and 4) release that lock. > >> > >> This patch introduces a pair of helper functions that simplify these > >> steps and make it more semantically expressive. > >> > >> iio_claim_direct_mode() > >> If the device is not in any buffered mode it is guaranteed > >> to stay that way until iio_release_direct_mode() is called. > >> > >> iio_release_direct_mode() > >> Release the claim. Device is no longer guaranteed to stay > >> in direct mode. > >> > >> Signed-off-by: Alison Schofield <amsfield22@gmail.com> > > > > Looks basically good. > Agreed - nothing to add from me to what Lars has covered here. > Nice to 'hide' the accesses to mlock as well as will cut out the desire > to 'abuse it'. Amusingly we only just 'fixed' the docs to to say this > element of iio_dev was usable by drivers. Once we have these new functions > in use throughout the tree, we will want to flip that back again to internal > only. > > Jonathan > Thanks for the review (& Lars too) Thinking about your note about flipping the mlock field back to INTERNAL (from DRIVER), this change, even when it's applied to all relevant instances, doesn't get us all the way there. While these claim/release functions will remove direct access to mlock where a driver wants to hold direct mode, the drivers are grabbing mlock for other reasons also. (too many reasons/instances for me to quickly understand or summarize) I'm willing to look at it further and comment if that's helpful. alisons
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [RFC PATCH 1/2] iio: core: implement iio_{claim|release}_direct_mode() Jonathan Cameron <jic23@kernel.org> - 2016-03-05 19:10 +0100
Re: [RFC PATCH 1/2] iio: core: implement iio_{claim|release}_direct_mode() Alison Schofield <amsfield22@gmail.com> - 2016-03-09 21:10 +0100
Re: [RFC PATCH 1/2] iio: core: implement iio_{claim|release}_direct_mode() Jonathan Cameron <jic23@kernel.org> - 2016-03-09 21:30 +0100
csiph-web