Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1859761ybx; Sat, 2 Nov 2019 07:42:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqySkWLUbxJN+/j+G3MYAivVITE3Yldk5EIo1SIabuyvCbmcnymHRPBHBb7ZTbaLsF/EzJPf X-Received: by 2002:a17:906:784c:: with SMTP id p12mr5116516ejm.60.1572705730882; Sat, 02 Nov 2019 07:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572705730; cv=none; d=google.com; s=arc-20160816; b=0E0MdIKs8RlS8Wrswk1h7DbsXClRNyAUB+zOVKBkQaf7p1IVT229RFr9IFp8u6zkEu qJOG+eb8a1UwGC1jBaVJqxo7AJaiG5ksGEb24SHYZuM6rMayWaz+RGdoPZvB2Bz1tcFJ q1PzQKZYQgg8Pis1PKcHFyOmCbue/ZEFA/UJ+nZA2YugtYAcObx7LetyjL6uIue6/cQE sVaMhweV824MuWU0/VDoH1Zn+1CueE9KDPPDLG0QAoV9hXpjUzeko+u1O7pHJbqfyLY/ NlLGyEci2lgaJcuhfJ3OFf1WgTGPCrFqdjfdQIalw/8oWtGRxnLBSMt/vm6BP0JRzIth /scA== 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=0Iaaxs2logTh4+bJyDNjDWRZd6IBrUay7gNsNuM8CEU=; b=j1Zulc3UTEPfAzFkrgH4SUnowfqlOQat4Wiqmu52Z7fN4EwU7oO1ifLZe8ocYJe2u2 Deo+k+5cKL74hZOL22/cFWU8Vs7UsrUYplbAQ//v6iKxodAr4NfyDqVUb4NBTwSx6PLd um4Wp55O5p8ojkRn7b+0xmtfK/mMj5Z5rlwVaaG/S8tYi5tb2LGQJ1UoI7wtkpsb8ipE I94Qt3VVFQDh2zXQXE/aPL5xiWGa72nwn6ZYCYfEtJV78MurGy3RF80xGrOiKu/hQ7Z7 eh2KwaCgYWdaI742ujaYtqv44pWpS3ohJd6V9KvhvyrNJ4cypJ2hr9I9LeHzIWsClOCz DKSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yOcBL8AI; 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 35si3258786edl.409.2019.11.02.07.41.46; Sat, 02 Nov 2019 07:42:10 -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=pass header.i=@kernel.org header.s=default header.b=yOcBL8AI; 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 S1726574AbfKBOkq (ORCPT + 99 others); Sat, 2 Nov 2019 10:40:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:46850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726430AbfKBOkq (ORCPT ); Sat, 2 Nov 2019 10:40:46 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (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 56AFE20862; Sat, 2 Nov 2019 14:40:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572705645; bh=pkm9tdn2nbnZk9K6vYRlSU4X9Ut4KEpxn0BjOdLIpYE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=yOcBL8AI0u6vxlRIaoqOu8P9AkF9C90A5LmK/uMz8Q8YUr3Yh36eK/sDh9ZvMmEK4 vCg3MYJVC9nuAUwR/OiuvVzNg7DmREunI33ncXY9CAgC2WB5WP0jiA6t9HaEzeEufQ MiPG7JuMGJpV2mHFVeHzdMnsLHy+LoTurYZwOpK4= Date: Sat, 2 Nov 2019 14:40:41 +0000 From: Jonathan Cameron To: "Ardelean, Alexandru" Cc: "matt.ranostay@konsulko.com" , "linux-kernel@vger.kernel.org" , "linux-iio@vger.kernel.org" Subject: Re: [PATCH] iio: hdc100x: fix iio_triggered_buffer_{predisable,postenable} positions Message-ID: <20191102144041.2c8bc85d@archlinux> In-Reply-To: <46d418bd0546c98e22a0d331741c053274c2170f.camel@analog.com> References: <20191023082714.18681-1-alexandru.ardelean@analog.com> <20191027165813.5a5b0519@archlinux> <46d418bd0546c98e22a0d331741c053274c2170f.camel@analog.com> X-Mailer: Claws Mail 3.17.4 (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 Mon, 28 Oct 2019 07:11:51 +0000 "Ardelean, Alexandru" wrote: > On Sun, 2019-10-27 at 20:37 +0200, Matt Ranostay wrote: > > [External] > > > > On Sun, Oct 27, 2019 at 6:58 PM Jonathan Cameron > > wrote: > > > On Wed, 23 Oct 2019 11:27:14 +0300 > > > Alexandru Ardelean wrote: > > > > > > > The iio_triggered_buffer_postenable() hook should be called first to > > > > attach the poll function and the iio_triggered_buffer_predisable() > > > > hook > > > > should be called last in the predisable hook. > > > > > > > > This change updates the driver to attach/detach the poll func in the > > > > correct order. > > > > > > > > Signed-off-by: Alexandru Ardelean > > > Seems fine, but should have cc'd Matt and I'd like to give him time > > > to take a quick look. > > > > > > > Reviewed-by: Matt Ranostay > > Apologies for not CC-ing Matt. > I guess I wasn't paying [close enough] attention to the output of > get_maintainers.pl > > Thanks > Alex > Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > > > > > +CC Matt. > > > > > > Thanks, > > > > > > Jonathan > > > > > > > --- > > > > drivers/iio/humidity/hdc100x.c | 19 +++++++++++-------- > > > > 1 file changed, 11 insertions(+), 8 deletions(-) > > > > > > > > diff --git a/drivers/iio/humidity/hdc100x.c > > > > b/drivers/iio/humidity/hdc100x.c > > > > index bfe1cdb16846..963ff043eecf 100644 > > > > --- a/drivers/iio/humidity/hdc100x.c > > > > +++ b/drivers/iio/humidity/hdc100x.c > > > > @@ -278,31 +278,34 @@ static int hdc100x_buffer_postenable(struct > > > > iio_dev *indio_dev) > > > > struct hdc100x_data *data = iio_priv(indio_dev); > > > > int ret; > > > > > > > > + ret = iio_triggered_buffer_postenable(indio_dev); > > > > + if (ret) > > > > + return ret; > > > > + > > > > /* Buffer is enabled. First set ACQ Mode, then attach poll func > > > > */ > > > > mutex_lock(&data->lock); > > > > ret = hdc100x_update_config(data, HDC100X_REG_CONFIG_ACQ_MODE, > > > > HDC100X_REG_CONFIG_ACQ_MODE); > > > > mutex_unlock(&data->lock); > > > > if (ret) > > > > - return ret; > > > > + iio_triggered_buffer_predisable(indio_dev); > > > > > > > > - return iio_triggered_buffer_postenable(indio_dev); > > > > + return ret; > > > > } > > > > > > > > static int hdc100x_buffer_predisable(struct iio_dev *indio_dev) > > > > { > > > > struct hdc100x_data *data = iio_priv(indio_dev); > > > > - int ret; > > > > - > > > > - /* First detach poll func, then reset ACQ mode. OK to disable > > > > buffer */ > > > > - ret = iio_triggered_buffer_predisable(indio_dev); > > > > - if (ret) > > > > - return ret; > > > > + int ret, ret2; > > > > > > > > mutex_lock(&data->lock); > > > > ret = hdc100x_update_config(data, HDC100X_REG_CONFIG_ACQ_MODE, > > > > 0); > > > > mutex_unlock(&data->lock); > > > > > > > > + ret2 = iio_triggered_buffer_predisable(indio_dev); > > > > + if (ret == 0) > > > > + ret = ret2; > > > > + > > > > return ret; > > > > } > > > >