From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:54406 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753855AbdKIJJ6 (ORCPT ); Thu, 9 Nov 2017 04:09:58 -0500 Subject: Patch "iio: proximity: sx9500: claim direct mode during raw proximity reads" has been added to the 4.9-stable tree To: amsfield22@gmail.com, alexander.levin@verizon.com, ddvlad@gmail.com, gregkh@linuxfoundation.org, jic23@kernel.org Cc: , From: Date: Thu, 09 Nov 2017 10:09:36 +0100 Message-ID: <1510218576126198@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled iio: proximity: sx9500: claim direct mode during raw proximity reads to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: iio-proximity-sx9500-claim-direct-mode-during-raw-proximity-reads.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Thu Nov 9 09:48:01 CET 2017 From: Alison Schofield Date: Fri, 20 Jan 2017 14:11:30 -0800 Subject: iio: proximity: sx9500: claim direct mode during raw proximity reads From: Alison Schofield [ Upstream commit 6b2e7589b82ff534dd5c6d67dd83c53f13691bec ] Driver was checking for direct mode but not locking it. Use the claim/release helper functions to guarantee the device stays in direct mode during raw reads of proximity data. Signed-off-by: Alison Schofield Reviewed-by: Vlad Dogaru Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/iio/proximity/sx9500.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/drivers/iio/proximity/sx9500.c +++ b/drivers/iio/proximity/sx9500.c @@ -387,14 +387,18 @@ static int sx9500_read_raw(struct iio_de int *val, int *val2, long mask) { struct sx9500_data *data = iio_priv(indio_dev); + int ret; switch (chan->type) { case IIO_PROXIMITY: switch (mask) { case IIO_CHAN_INFO_RAW: - if (iio_buffer_enabled(indio_dev)) - return -EBUSY; - return sx9500_read_proximity(data, chan, val); + ret = iio_device_claim_direct_mode(indio_dev); + if (ret) + return ret; + ret = sx9500_read_proximity(data, chan, val); + iio_device_release_direct_mode(indio_dev); + return ret; case IIO_CHAN_INFO_SAMP_FREQ: return sx9500_read_samp_freq(data, val, val2); default: Patches currently in stable-queue which might be from amsfield22@gmail.com are queue-4.9/iio-pressure-ms5611-claim-direct-mode-during-oversampling-changes.patch queue-4.9/iio-proximity-sx9500-claim-direct-mode-during-raw-proximity-reads.patch queue-4.9/iio-magnetometer-mag3110-claim-direct-mode-during-raw-writes.patch queue-4.9/iio-trigger-free-trigger-resource-correctly.patch