Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3038132imj; Mon, 11 Feb 2019 12:44:17 -0800 (PST) X-Google-Smtp-Source: AHgI3IZDWccCgm49ZUzSlPQ2CU2hRQhIF0fjZBI0ma3qRIqxGh0Jr3j8FTcHUSlhTciPB9pI8hKV X-Received: by 2002:a63:d904:: with SMTP id r4mr96600pgg.207.1549917857662; Mon, 11 Feb 2019 12:44:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549917857; cv=none; d=google.com; s=arc-20160816; b=HFEJe/MnfbPZVYiRYuN/UNCLHm1sMXxQjidQGCtTrJDkA9FPdz6M344YYlWkQXeuSp yCVNP/vskG3BwHE0YUVMUra8KZIQ8F134w38MJPlrM+BbYxjDJPq0OaOt6uzvi3SLWJr Pb+jpXJd0+yeHDO10an81VwpF4rTGRP7m1aUwiefldwBi02AXcXr1Eu16RjjO/gBGSuK n7KRJWx7WAtH8i5ezVSKIGsnFxsDdm6/i2A1xRsIM7Y3jP14kqb7qEn3IBa07e/h6APa Jlxzo5/GphMFc8k3H53zxnkWZ6Am6YYrZeNwQBrEA/u6BOjKMjk646XyEvWm+TMIU6NN 35Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=thM1K+F9K6CWGm4QaF9OmVoL4Jz200VALqhocRGotn8=; b=U5HQbUospWi6H2GvSLwslHODeSouCFIbIsGPPCsT9nvyoXl3o+8Zztzvd8d4AFx1vs yYQw1gsJB7zpJjL1TLYDyUsrYRSp32hqq0SrdXLPUjPjQ0WfunEA4gQrHwXugWRzuhkq SryftEgUt/fQtr3T5GZpg6M6PHhLGYyehNSIgGM/xRYd5kRSiZocZe2ci01eE5GnN5Lh 87ooNXw1cKPw50oWCeIuu4efZdYhMaVhQCWWnZumAsFo0xKVlX0Vc42BXbmruiHHvPP0 fnhULDpUnq+jN4lYJmq7jRu2KhK1BBe1XHVlnhb3FOCoBwwwKgYWRF2bEqN0t8M13j3Y EHJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yYpB+H6Y; 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=pass (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 e4si9490093pgs.492.2019.02.11.12.44.02; Mon, 11 Feb 2019 12:44:17 -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=pass header.i=@kernel.org header.s=default header.b=yYpB+H6Y; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388419AbfBKUGF (ORCPT + 99 others); Mon, 11 Feb 2019 15:06:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:58146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727941AbfBKUGF (ORCPT ); Mon, 11 Feb 2019 15:06:05 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 18DD32084D; Mon, 11 Feb 2019 20:06:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549915564; bh=yUvElnEvyG65dIWr7xpqH8esN//aSZKgiGIPwUv/d8Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=yYpB+H6YeRhl2VOj4fVvkhOHqj1aC96YEimcfIBrvjZEIP1Wz1FAqIB+NxAko1g81 quUcwy5haLIoxkfOL9SIM850LKt2WtQ+uJ++AXrpll8ppnYPq7GMr9nSl8quEaUyKr R+u4XrnMXEMWDTA0J0r7TDf4xnaxqNkLf0e3s2+o= Date: Mon, 11 Feb 2019 20:05:57 +0000 From: Jonathan Cameron To: David Lechner Cc: justinpopo6@gmail.com, linux-iio@vger.kernel.org, linux-gpio@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, f.fainelli@gmail.com, bgolaszewski@baylibre.com, linus.walleij@linaro.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: adc: ti-ads7950: add GPIO support Message-ID: <20190211200557.7648d447@archlinux> In-Reply-To: <2e692086-4be5-10ea-34b0-4444995c4275@lechnology.com> References: <1549653856-47409-1-git-send-email-justinpopo6@gmail.com> <20190209170042.69a78684@archlinux> <2e692086-4be5-10ea-34b0-4444995c4275@lechnology.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 9 Feb 2019 12:56:11 -0600 David Lechner wrote: > On 2/9/19 11:00 AM, Jonathan Cameron wrote: > > Nope. This is a state lock used to protect against transitions between > > different modes of the IIO device (buffered vs polled), it > > isn't suitable for general use. > > > > The driver should be modified to handle that correctly. > > We have iio_claim_direct_mode etc that deal with the case > > where a device can't do certain operations whilst in buffered > > mode. Note it can fail and should. > > > > Seems there are more drivers still doing this than I thought. > > If anyone is bored and wants to clean them out, that would be > > most appreciated! > > > > If you need locking to protect a local buffer or the device > > state, define a new lock to do it with clearly documented > > scope. > > Just as a reminder, there is a use case for this particular > chip that requires buffered mode and direct mode at the same > time. > > https://patchwork.kernel.org/patch/10539021/ > https://patchwork.kernel.org/patch/10527757/ Thanks, I had indeed forgotten that entirely. So it should have a local lock and not take mlock explicitly at all. Jonathan