From patchwork Wed Jul 11 08:32:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 10519139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C4C91600CA for ; Wed, 11 Jul 2018 08:32:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B007028B89 for ; Wed, 11 Jul 2018 08:32:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A151728737; Wed, 11 Jul 2018 08:32:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1589F2625B for ; Wed, 11 Jul 2018 08:32:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726795AbeGKIfX (ORCPT ); Wed, 11 Jul 2018 04:35:23 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40714 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbeGKIfX (ORCPT ); Wed, 11 Jul 2018 04:35:23 -0400 Received: by mail-wm0-f68.google.com with SMTP id z13-v6so1598930wma.5 for ; Wed, 11 Jul 2018 01:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=myz9PZz0JU4DyqQI42pxLu5+BUUW+GEdx5B8gXjLFPQ=; b=lZDqIgACMmpwyYU+uFxP0K/PZPFxYGVAElN9DPr0kdNPnUkPXmc0QtqS7h8azaC+UO I6TsHyqRLWUhGyBb5FoqaeYF1kQdk9/vbYpAfqAYvEDmm1SeJrX6boV1JZJVudLxM5HZ yfduOsHNS1ARO4XpUHdLizC1wwYDw5E3AckySxbqErVEEYCg8X8HNLcULI+68507O1X6 cHa5ZQgEU64IJ4Ul3hTFMU4BN7jnoRlvGbRGRXsKwu+4cBB+5qrt0lpyvV2jNTXh/G3p 5A6v+SnoBi2ezItTRA25s7AIQvM6344iF6mEHXTgsZ3Z+7IBCGCeBbDxjkkT6sZbpet6 O7og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=myz9PZz0JU4DyqQI42pxLu5+BUUW+GEdx5B8gXjLFPQ=; b=R69bAltP59z1FMy2QKofFDzwywULBcd3aWlUCMmyWhHCufqpX2pbRdzhUqIjTI+2+A 81uQ9mgzPuBBDC1M6KqJp5mh886QQ0rO4aW3QSA5nX0QHG/+G/lGwywfDGkG1gZ4MMKr 9M2eFKJ5bIoV19vIbIpg8U7kdQQVsbJAtDVVavp0wQs0ERuJLQTpKvLzQWXCbCdGyuQt od3u3cSyxtuQ2hU3moWalcpid71x0Y7oiEt13vOthNuKKiLMG/s/JhJVNefzrxc6k4WO 0Aob4Pbdi3vcCIjRSG3RxqATEv9xpEigycIyEmbZm416/4aV2vkcoj1Pkl4uQbILAu6r CKLw== X-Gm-Message-State: APt69E0/UqShi5D332qglZ6SoPvFgTpe9Jd2+GYpYtDf6JGmOjfugqjj a5rSyNRi9r00EMwdw7DWM/OMGA== X-Google-Smtp-Source: AAOMgperQcssx7kceyEKa9VbqIda93EDdnN6B3Mx0tVWOEXDsRlr9EWowya/TxdVAn+VNERIXbjy0w== X-Received: by 2002:a1c:f009:: with SMTP id a9-v6mr17570014wmb.104.1531297932860; Wed, 11 Jul 2018 01:32:12 -0700 (PDT) Received: from localhost.localdomain (141.pool85-51-114.dynamic.orange.es. [85.51.114.141]) by smtp.gmail.com with ESMTPSA id h5-v6sm8206277wrr.19.2018.07.11.01.32.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Jul 2018 01:32:12 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jramirez@baylibre.com, jic23@kernel.org, lorenzo.bianconi@redhat.com Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] iio: imu: st_lsm6dsx: irq not handled unless data pushed to buffers Date: Wed, 11 Jul 2018 10:32:08 +0200 Message-Id: <1531297928-3824-1-git-send-email-jramirez@baylibre.com> X-Mailer: git-send-email 2.7.4 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently IRQ_NONE is returned only when there is no data on the fifo. When there is no data on the fifo the driver can not push to the buffers and therefore user space readers polling for data available will not be awoken and continue to wait. This commit just extends the same semantics to fifo read errors. Signed-off-by: Jorge Ramirez-Ortiz --- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c index 4994f92..4959923 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c @@ -472,7 +472,7 @@ static irqreturn_t st_lsm6dsx_handler_thread(int irq, void *private) count = st_lsm6dsx_read_fifo(hw); mutex_unlock(&hw->fifo_lock); - return !count ? IRQ_NONE : IRQ_HANDLED; + return (!count || count < 0) ? IRQ_NONE : IRQ_HANDLED; } static int st_lsm6dsx_buffer_preenable(struct iio_dev *iio_dev)