From patchwork Mon Nov 1 14:40:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 12596529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74CEEC433F5 for ; Mon, 1 Nov 2021 14:41:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51B9A60462 for ; Mon, 1 Nov 2021 14:41:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231847AbhKAOnx (ORCPT ); Mon, 1 Nov 2021 10:43:53 -0400 Received: from www381.your-server.de ([78.46.137.84]:34712 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbhKAOnw (ORCPT ); Mon, 1 Nov 2021 10:43:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=ALFLYeBZ2oUI6MC6Ckantl6xoFsQyuUavx3fLKN7D14=; b=kIkg0k09BRh9NEmhgNinOve+vN ZdUmB4mqu1Ewi+KeDR4iwu6CCYeMCRREPY93tCy3eU+UnOXnMy08sGE3rkUti9+x40zRQwVZ2TELq yf5n/uMcWP0aUYRINVYiSo940QtXj9/8kqaEqHC9fUZo5xJQmnjjwOW7RZ/SVfplwY9zbrNLZHA00 oOOBKtjXScY89dtcfM0bEJRAp1n1/cTHXAQsMUC3GQYeGSttW6Hr6Ak7n7Ei01uPu+AymZecmLdqa SInIFx+JmhcV2IGHnr1zKBdf7GT2LpXgDF3ZT0x9WjQunQNBgDdhOk/f8vvEfYSjQHxz+CQk8fGGW sYZGBgrw==; Received: from sslproxy02.your-server.de ([78.47.166.47]) by www381.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mhYUu-0009ip-Lv; Mon, 01 Nov 2021 15:41:16 +0100 Received: from [82.135.83.112] (helo=lars-desktop.fritz.box) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mhYUu-000WpK-Fb; Mon, 01 Nov 2021 15:41:16 +0100 From: Lars-Peter Clausen To: Jonathan Cameron Cc: Michael Hennerich , Nuno Sa , Manuel Stahl , linux-iio@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH 1/2] iio: itg3200: Call iio_trigger_notify_done() on error Date: Mon, 1 Nov 2021 15:40:54 +0100 Message-Id: <20211101144055.13858-1-lars@metafoo.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.103.3/26340/Mon Nov 1 09:21:46 2021) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org IIO trigger handlers must call iio_trigger_notify_done() when done. This must be done even when an error occurred. Otherwise the trigger will be seen as busy indefinitely and the trigger handler will never be called again. The itg3200 driver neglects to call iio_trigger_notify_done() when there is an error reading the gyro data. Fix this by making sure that iio_trigger_notify_done() is included in the error exit path. Fixes: 9dbf091da080 ("iio: gyro: Add itg3200") Signed-off-by: Lars-Peter Clausen --- drivers/iio/gyro/itg3200_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/gyro/itg3200_buffer.c b/drivers/iio/gyro/itg3200_buffer.c index 04dd6a7969ea..4cfa0d439560 100644 --- a/drivers/iio/gyro/itg3200_buffer.c +++ b/drivers/iio/gyro/itg3200_buffer.c @@ -61,9 +61,9 @@ static irqreturn_t itg3200_trigger_handler(int irq, void *p) iio_push_to_buffers_with_timestamp(indio_dev, &scan, pf->timestamp); +error_ret: iio_trigger_notify_done(indio_dev->trig); -error_ret: return IRQ_HANDLED; } From patchwork Mon Nov 1 14:40:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 12596531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8258C433EF for ; Mon, 1 Nov 2021 14:41:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4BC160EE9 for ; Mon, 1 Nov 2021 14:41:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231867AbhKAOnx (ORCPT ); Mon, 1 Nov 2021 10:43:53 -0400 Received: from www381.your-server.de ([78.46.137.84]:34708 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231847AbhKAOnw (ORCPT ); Mon, 1 Nov 2021 10:43:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=ETG+4vdMHRn8TZ85+qnqDk1BL/LkrYfAtdt8NQJdkc4=; b=DATcXcZS9m6DbPCyiMq01WMW1E SOQ31x8x+m4KEhSk0i9YBGWC0oh3Opm3mFasCfkgetlNEJCcktbJpv6Jq5bb2AECRA61I8s8GZA6n LidZ8sBrGMIIlGI30BiPdg2fXOt2qH3O+5mudO2xOavTwqCKJxQWwqcMniO7GNdKyv2BT3JoZ8llq i5XBvkOsusmt7cO4sqolwvNoiaWmcwqJqlRwMm388XQtpEXInFvY8CO5AdG4oP1f7YSmxci+dk5Lx 66nw/Z503lcRCxuIc2UNh+hwDAwgzl8dZjF/nnydyMNa7G/hsjnToTFcKoJb8fNxUpSAeYpLKVFYx y5RaqWxw==; Received: from sslproxy02.your-server.de ([78.47.166.47]) by www381.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mhYUu-0009ir-N9; Mon, 01 Nov 2021 15:41:16 +0100 Received: from [82.135.83.112] (helo=lars-desktop.fritz.box) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mhYUu-000WpK-Ho; Mon, 01 Nov 2021 15:41:16 +0100 From: Lars-Peter Clausen To: Jonathan Cameron Cc: Michael Hennerich , Nuno Sa , Manuel Stahl , linux-iio@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH 2/2] iio: ad7768-1: Call iio_trigger_notify_done() on error Date: Mon, 1 Nov 2021 15:40:55 +0100 Message-Id: <20211101144055.13858-2-lars@metafoo.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211101144055.13858-1-lars@metafoo.de> References: <20211101144055.13858-1-lars@metafoo.de> MIME-Version: 1.0 X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.103.3/26340/Mon Nov 1 09:21:46 2021) Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org IIO trigger handlers must call iio_trigger_notify_done() when done. This must be done even when an error occurred. Otherwise the trigger will be seen as busy indefinitely and the trigger handler will never be called again. The ad7768-1 driver neglects to call iio_trigger_notify_done() when there is an error reading the converter data. Fix this by making sure that iio_trigger_notify_done() is included in the error exit path. Fixes: a5f8c7da3dbe ("iio: adc: Add AD7768-1 ADC basic support") Signed-off-by: Lars-Peter Clausen --- drivers/iio/adc/ad7768-1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7768-1.c b/drivers/iio/adc/ad7768-1.c index 2c5c8a3672b2..aa42ba759fa1 100644 --- a/drivers/iio/adc/ad7768-1.c +++ b/drivers/iio/adc/ad7768-1.c @@ -480,8 +480,8 @@ static irqreturn_t ad7768_trigger_handler(int irq, void *p) iio_push_to_buffers_with_timestamp(indio_dev, &st->data.scan, iio_get_time_ns(indio_dev)); - iio_trigger_notify_done(indio_dev->trig); err_unlock: + iio_trigger_notify_done(indio_dev->trig); mutex_unlock(&st->lock); return IRQ_HANDLED;