From patchwork Thu Mar 2 13:04:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mehdi Djait X-Patchwork-Id: 63419 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp4228309wrd; Thu, 2 Mar 2023 05:16:34 -0800 (PST) X-Google-Smtp-Source: AK7set8Q96DATdxp23TdXiR6t9AILecCb5PMDGn3ph02jz2GEsDCut1oTIbgRTe2m+iCi7V9EssD X-Received: by 2002:a17:90b:3ec1:b0:237:ae7c:15b9 with SMTP id rm1-20020a17090b3ec100b00237ae7c15b9mr11724359pjb.36.1677762993793; Thu, 02 Mar 2023 05:16:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677762993; cv=none; d=google.com; s=arc-20160816; b=lR0OvNa4a2PV+7axHu+Lt2eekxOgPp4YMXDvQdxt809w4fdsf29vTYMZmD2CyV+2LB 6pDrJJn9yyUPo1XdOgSSuV0KHWZe6eY/Q5RALSE5pkxurFd7TmS6sDmOQZmqm39o0IpM +1LJ3IBIvlRyBdyOcvGglh1iaqmIA9kHr7KDa7qqwiNCDdHNQUxtUnFsH7ZlPk8ZvVry LNc6l++KQ4s7UTg7nGtzNf/MTP8xxHB4/Q5I/upTXbk6EoLXfWcx5o13qOdnyYDpAvi4 Nhn4ShCqX6s3u+g6wPJzfHZxe8NN4F2tothQVogKDI8sgkJ1GKgSJCwE5GsUIXUs4C3r 0GSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RzkzX1RgURPfixBUIM5rPRAXQ0wme5cmqoYe05Kozgg=; b=Y4JPRj6UPnl74xVv/ERMGmzQcn4klsKzR39+iEMw1IwQR4romjRvSGKc/apOfeV1F3 vYmFbjAkwkrdpT4nQUsbVJCeTuSNjK9nr4UlEwNn4Fbzpy7gJCcyXMa89OIl5qy9tfwL ZsXtVUg3jw5WpW3AvNyR6t7nVpqH84MRW7Qas1jlt2rR22Zx4bHUc5rXy4e1jwicIoHr GuAau49OOPZOlvqEKraiSWXVJA00m4HaQw70uprk4M1F2M8Cd48HUwCmWp7HkTfRTGKV FEzV0MEzSsYjoGmw1ZeKEu4OeurUZF/QHew7rYnMGR8q08IDGwEogwad57sKzWFL8r87 0HeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="hX/GniBW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j14-20020a17090a738e00b00233a9c98466si2201011pjg.189.2023.03.02.05.16.17; Thu, 02 Mar 2023 05:16:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="hX/GniBW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbjCBNFe (ORCPT + 99 others); Thu, 2 Mar 2023 08:05:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbjCBNFd (ORCPT ); Thu, 2 Mar 2023 08:05:33 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BF7034F5E; Thu, 2 Mar 2023 05:05:29 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id g3so11828060eda.1; Thu, 02 Mar 2023 05:05:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RzkzX1RgURPfixBUIM5rPRAXQ0wme5cmqoYe05Kozgg=; b=hX/GniBWzMvBnDAlzovo5h0O8iQGQvHl6FYLmuQIxa8sqaI4bnF9VjcBmLWwWwsgnK R7quH4LaPShX3r1dtDB27Ph48mn+AV1Ow3rli3+e+56phry0hVtR2CoZ2BMKs69jMvpX O7isb1vGNbHm2bx3AhZ3Z0m2K9Q+uGd3LgvNIsdI704TN9puJpu3pM4gqyULxf5mhVXY R3XwWXc76l1A+RNhodVVAIwIhf9zdYHcbday/Pfap9EPcqnObntPxkYUwws4rfUBAwxW FQzhwhLWLdtEpkEjtw0JE1EwKAUojXempx06r2vUkEejzitrUlG0h9WuIt1MbyJawFQW yk5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RzkzX1RgURPfixBUIM5rPRAXQ0wme5cmqoYe05Kozgg=; b=wnDr97OcuULc6hhQh0q8V63F3/43aWG/MQYKHohOS9jfXo0y1edGcvFTA3/x7tk3n7 00iITU56Qk2T/uWrPpIEr0fGQTFy5CncN/wbjudumdVrAKjyjR09s15t5Lahjqa7Elcy BIn7mCd5l5i1F3vBTpFpc0FmXkABQ+t9WDr3RG12mpwt4RfkSq5/Z2NzgOkwpUXSw6lL usSuJWvNCi+GmnAMmNVuHlVpbwpwXyYhXdGf50fQMT3ju8E7QwKfanrrveQRYXqqL3RU xPp/rbK3UPH34yek7zLM/rNF/8J0MylN7LKiuNRFkHRGqGd6zj9XhfKjCc4EbSun+aIG XyMQ== X-Gm-Message-State: AO0yUKV9o0yQsoOUsVeCL0Q/hGqJ9Nll8/qPM4PZ4RxJrPiJYjuDCNn7 hpZBPl/6Z5sI16Io99ieyac= X-Received: by 2002:a17:906:2cd3:b0:878:5372:a34b with SMTP id r19-20020a1709062cd300b008785372a34bmr10359533ejr.45.1677762327784; Thu, 02 Mar 2023 05:05:27 -0800 (PST) Received: from carbian.corp.quobyte.com ([2a02:8109:aa3f:ead8::dc02]) by smtp.gmail.com with ESMTPSA id u7-20020a50d507000000b004af759bc79asm6932903edi.7.2023.03.02.05.05.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 05:05:27 -0800 (PST) From: Mehdi Djait To: jic23@kernel.org, lars@metafoo.de, andriy.shevchenko@linux.intel.com Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Mehdi Djait Subject: [PATCH v2 1/2] iio: Improve the kernel-doc of iio_trigger_poll Date: Thu, 2 Mar 2023 14:04:35 +0100 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759262009249086400?= X-GMAIL-MSGID: =?utf-8?q?1759262009249086400?= Move the kernel-doc of the function to industrialio-trigger.c Add a note on the context where the function is expected to be called. Signed-off-by: Mehdi Djait Reviewed-by: Andy Shevchenko --- v2: - Changed the expected context of from interrupt to hard IRQ context drivers/iio/industrialio-trigger.c | 7 +++++++ include/linux/iio/trigger.h | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index a2f3cc2f65ef..bb0a44df8740 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -192,6 +192,13 @@ static void iio_trigger_notify_done_atomic(struct iio_trigger *trig) schedule_work(&trig->reenable_work); } +/** + * iio_trigger_poll() - Call the IRQ trigger handler of the consumers + * @trig: trigger which occurred + * + * This function needs to be called from a hard IRQ context. + * + */ void iio_trigger_poll(struct iio_trigger *trig) { int i; diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index f6360d9a492d..42da55dc3aa7 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h @@ -151,12 +151,6 @@ void iio_trigger_unregister(struct iio_trigger *trig_info); **/ int iio_trigger_set_immutable(struct iio_dev *indio_dev, struct iio_trigger *trig); -/** - * iio_trigger_poll() - called on a trigger occurring - * @trig: trigger which occurred - * - * Typically called in relevant hardware interrupt handler. - **/ void iio_trigger_poll(struct iio_trigger *trig); void iio_trigger_poll_chained(struct iio_trigger *trig); From patchwork Thu Mar 2 13:04:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mehdi Djait X-Patchwork-Id: 63420 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp4231746wrd; Thu, 2 Mar 2023 05:23:57 -0800 (PST) X-Google-Smtp-Source: AK7set+sN39sTves9dio8si339wOTHH/nBKMr9tcvVdCE3M9ooNPcSHG1uZh00DqqN4skUo3WG2M X-Received: by 2002:a17:902:714a:b0:19c:fa51:621b with SMTP id u10-20020a170902714a00b0019cfa51621bmr8061369plm.67.1677763437458; Thu, 02 Mar 2023 05:23:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677763437; cv=none; d=google.com; s=arc-20160816; b=mk5NXP/y+jrdy8pBtVDZaAl4URuHhq7OMcS42IqiYrJOsjhwruChIVNxncWL7VysDY E7qRVAf0v/j9IXUV/DVLKUQ+TsWD+2/gxs0iGBD/j3vVhOgN4tISMAwKkqI1UkY+8+80 Cs0aSofHU6BdfS4gb9XBaEHV1Jw3ljFmRHlaUXrFJWNlnNbbbq7Sza59YIpVxEHY8hyS ASY1whh3wxQvCa1114rOSPNqBVcWySG1dMhDDTszS48WfDQVYKNrXxxkUKb4qofTVLAR FTnIT1ZjoUp+Z2CzMysbhVLmI8ZPftpQIU6l3Js+8y/y1+95LVSaszBiLovXHAsoFrGl U9vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gyOazVhvz6WefZ2pFKJ+bCWZWTrgwzVFjWHxe+hRwjo=; b=p/35GNiJjlWHx3tE5RxPbev7wiD2hD7J9uNr9O1N7Yh+8Lq463dwgj/8XztqoqVrAi RWl2hYDbnHLkPf5bVJ+0HDYPtF3Uoxx+Q+NviT7DCvJBFGyqnlrm0wR9bvLke55VOyqE Q5djBH079w+DT+LhcmEFrR6vGg2NaOCU78CISdpyIRF5DRjK76Kp0SHfCr1a9VwzooOS z66PBKr7xIUORvVcj108TyuFEz6TLobIQ8VyM7EQVjbQQEr/hJPR+pbyIT6ejAaUKraG bvyL/b46sY3XWhbMaraRQqsPoRq9uVj3fCxox1Bh8S8zLLV+W3X5faeBfHDtkCRl6FYM SlTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Uz3ATVtV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a170902f79200b001968c61066esi15122225pln.493.2023.03.02.05.23.43; Thu, 02 Mar 2023 05:23:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Uz3ATVtV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbjCBNFn (ORCPT + 99 others); Thu, 2 Mar 2023 08:05:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230007AbjCBNFl (ORCPT ); Thu, 2 Mar 2023 08:05:41 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D67536FFB; Thu, 2 Mar 2023 05:05:38 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id g3so11830091eda.1; Thu, 02 Mar 2023 05:05:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gyOazVhvz6WefZ2pFKJ+bCWZWTrgwzVFjWHxe+hRwjo=; b=Uz3ATVtVgQuo8c13OQli1KBxNLp7mG8IfocOwvvxR3wHjTbN3x+/IoHDTR1zwhFmoU RUq2QaZUrzLnIwyOuihZgaB5pE62qnRxl7Nwjg67n5km4Y9P+cnsWKGuCcqlq6jzL7/Y uhrQMhFtj5C5Gt9Kg2wTBfrk9cqrDotGfgZSovDA0iwHkRPsnLv2I1COH31mHPfTDn6y kj5ov1fhBE87U6Dn4KgMzb1hl0pQ7DezhDmm+eMt5LW6qioDC4zf+OrQcAoDD7udqk5c lnpNWDFW8hdb+ShwBefOpeum1Pgok22SRJnK4ho/nqG+v+28coaqYeqIF0JfurDTH7jI dfFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gyOazVhvz6WefZ2pFKJ+bCWZWTrgwzVFjWHxe+hRwjo=; b=TkEzmkh3rcT49b62UcoX3hej/4bBFgVC3mm9HIAslCHyjauIYi05ajq1taUTxnSuwm 1AH8mfWSxbXzowlPa6zTFcSJHPw1nmW0DXxGgdJkio4Oe4ZZIcAzYZMqw7LhkZ+eLblq R5Pr+s1A8bReUIVnjgmHIcf7cdtaftJKtoGmi09su7G7uLOzZBJDvPqRV9XBbqXgzh2A QUsRxgykNDKc4ebNaLm2SSIKjbov5LZ+o1rDl2jvjYmiiOiMm6mxHq9Bc7L2t5d6BT4N Ft5SUedYhTP0Rx8Id+VttjqoFA3b7hd1urwoG96QoM4/0avQ2GnHRixVWbUhZnJrwZCv By8Q== X-Gm-Message-State: AO0yUKXed3dRQjH7sIrGKKd0Y86XneB5tSLZXlFjZTy9xh3DNzUjupTR ZB2Yr5+UhCjS1Jmxk3qL/6bEGOwzj2Y= X-Received: by 2002:aa7:da81:0:b0:4aa:a280:55b5 with SMTP id q1-20020aa7da81000000b004aaa28055b5mr1842522eds.20.1677762337719; Thu, 02 Mar 2023 05:05:37 -0800 (PST) Received: from carbian.corp.quobyte.com ([2a02:8109:aa3f:ead8::dc02]) by smtp.gmail.com with ESMTPSA id u7-20020a50d507000000b004af759bc79asm6932903edi.7.2023.03.02.05.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 05:05:37 -0800 (PST) From: Mehdi Djait To: jic23@kernel.org, lars@metafoo.de, andriy.shevchenko@linux.intel.com Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Mehdi Djait Subject: [PATCH v2 2/2] iio: Rename iio_trigger_poll_chained and add kernel-doc Date: Thu, 2 Mar 2023 14:04:36 +0100 Message-Id: <841b533cba28ca25a8e87280c44e45979166e8e2.1677761379.git.mehdi.djait.k@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759262473971332863?= X-GMAIL-MSGID: =?utf-8?q?1759262473971332863?= Rename the function to iio_trigger_poll_nested. Add kernel-doc with a note on the context where the function is expected to be called. Signed-off-by: Mehdi Djait --- v2: - no changes drivers/iio/accel/bma400_core.c | 2 +- drivers/iio/accel/kionix-kx022a.c | 2 +- drivers/iio/accel/mma8452.c | 2 +- drivers/iio/accel/msa311.c | 2 +- drivers/iio/adc/ad7606.c | 2 +- drivers/iio/adc/at91-sama5d2_adc.c | 2 +- drivers/iio/adc/max11410.c | 2 +- drivers/iio/common/st_sensors/st_sensors_trigger.c | 4 ++-- drivers/iio/gyro/fxas21002c_core.c | 2 +- drivers/iio/gyro/mpu3050-core.c | 2 +- drivers/iio/humidity/hts221_buffer.c | 2 +- drivers/iio/industrialio-trigger.c | 12 ++++++++++-- drivers/iio/light/acpi-als.c | 2 +- drivers/iio/light/rpr0521.c | 2 +- drivers/iio/light/st_uvis25_core.c | 2 +- drivers/iio/light/vcnl4000.c | 2 +- drivers/iio/light/vcnl4035.c | 2 +- drivers/iio/potentiostat/lmp91000.c | 2 +- drivers/iio/pressure/zpa2326.c | 2 +- drivers/iio/proximity/as3935.c | 2 +- drivers/iio/trigger/iio-trig-loop.c | 2 +- include/linux/iio/trigger.h | 2 +- 22 files changed, 32 insertions(+), 24 deletions(-) diff --git a/drivers/iio/accel/bma400_core.c b/drivers/iio/accel/bma400_core.c index b612d0146d4d..0b78248596bc 100644 --- a/drivers/iio/accel/bma400_core.c +++ b/drivers/iio/accel/bma400_core.c @@ -1709,7 +1709,7 @@ static irqreturn_t bma400_interrupt(int irq, void *private) if (FIELD_GET(BMA400_INT_DRDY_MSK, le16_to_cpu(data->status))) { mutex_unlock(&data->mutex); - iio_trigger_poll_chained(data->trig); + iio_trigger_poll_nested(data->trig); return IRQ_HANDLED; } diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c index 1c3a72380fb8..6fc490a60e81 100644 --- a/drivers/iio/accel/kionix-kx022a.c +++ b/drivers/iio/accel/kionix-kx022a.c @@ -900,7 +900,7 @@ static irqreturn_t kx022a_irq_thread_handler(int irq, void *private) mutex_lock(&data->mutex); if (data->trigger_enabled) { - iio_trigger_poll_chained(data->trig); + iio_trigger_poll_nested(data->trig); ret = IRQ_HANDLED; } diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index f97fb68e3a71..ea14e3aaa30a 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -1067,7 +1067,7 @@ static irqreturn_t mma8452_interrupt(int irq, void *p) return IRQ_NONE; if (src & MMA8452_INT_DRDY) { - iio_trigger_poll_chained(indio_dev->trig); + iio_trigger_poll_nested(indio_dev->trig); ret = IRQ_HANDLED; } diff --git a/drivers/iio/accel/msa311.c b/drivers/iio/accel/msa311.c index af94d3adf6d8..6690fa37da8f 100644 --- a/drivers/iio/accel/msa311.c +++ b/drivers/iio/accel/msa311.c @@ -951,7 +951,7 @@ static irqreturn_t msa311_irq_thread(int irq, void *p) } if (new_data_int_enabled) - iio_trigger_poll_chained(msa311->new_data_trig); + iio_trigger_poll_nested(msa311->new_data_trig); return IRQ_HANDLED; } diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c index dd6b603f65ea..1928d9ae5bcf 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -477,7 +477,7 @@ static irqreturn_t ad7606_interrupt(int irq, void *dev_id) if (iio_buffer_enabled(indio_dev)) { gpiod_set_value(st->gpio_convst, 0); - iio_trigger_poll_chained(st->trig); + iio_trigger_poll_nested(st->trig); } else { complete(&st->completion); } diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c index ed4f8501bda8..f155609f1141 100644 --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c @@ -1194,7 +1194,7 @@ static void at91_dma_buffer_done(void *data) { struct iio_dev *indio_dev = data; - iio_trigger_poll_chained(indio_dev->trig); + iio_trigger_poll_nested(indio_dev->trig); } static int at91_adc_dma_start(struct iio_dev *indio_dev) diff --git a/drivers/iio/adc/max11410.c b/drivers/iio/adc/max11410.c index fdc9f03135b5..7acb2d0359d2 100644 --- a/drivers/iio/adc/max11410.c +++ b/drivers/iio/adc/max11410.c @@ -677,7 +677,7 @@ static irqreturn_t max11410_interrupt(int irq, void *dev_id) struct max11410_state *st = iio_priv(indio_dev); if (iio_buffer_enabled(indio_dev)) - iio_trigger_poll_chained(st->trig); + iio_trigger_poll_nested(st->trig); else complete(&st->completion); diff --git a/drivers/iio/common/st_sensors/st_sensors_trigger.c b/drivers/iio/common/st_sensors/st_sensors_trigger.c index 899b640c0a70..a0df9250a69f 100644 --- a/drivers/iio/common/st_sensors/st_sensors_trigger.c +++ b/drivers/iio/common/st_sensors/st_sensors_trigger.c @@ -85,7 +85,7 @@ static irqreturn_t st_sensors_irq_thread(int irq, void *p) */ if (sdata->hw_irq_trigger && st_sensors_new_samples_available(indio_dev, sdata)) { - iio_trigger_poll_chained(p); + iio_trigger_poll_nested(p); } else { dev_dbg(indio_dev->dev.parent, "spurious IRQ\n"); return IRQ_NONE; @@ -110,7 +110,7 @@ static irqreturn_t st_sensors_irq_thread(int irq, void *p) dev_dbg(indio_dev->dev.parent, "more samples came in during polling\n"); sdata->hw_timestamp = iio_get_time_ns(indio_dev); - iio_trigger_poll_chained(p); + iio_trigger_poll_nested(p); } return IRQ_HANDLED; diff --git a/drivers/iio/gyro/fxas21002c_core.c b/drivers/iio/gyro/fxas21002c_core.c index 3ea1d4613080..c28d17ca6f5e 100644 --- a/drivers/iio/gyro/fxas21002c_core.c +++ b/drivers/iio/gyro/fxas21002c_core.c @@ -813,7 +813,7 @@ static irqreturn_t fxas21002c_data_rdy_thread(int irq, void *private) if (!data_ready) return IRQ_NONE; - iio_trigger_poll_chained(data->dready_trig); + iio_trigger_poll_nested(data->dready_trig); return IRQ_HANDLED; } diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c index 6a6d84a3deda..a791ba3a693a 100644 --- a/drivers/iio/gyro/mpu3050-core.c +++ b/drivers/iio/gyro/mpu3050-core.c @@ -939,7 +939,7 @@ static irqreturn_t mpu3050_irq_thread(int irq, void *p) if (!(val & MPU3050_INT_STATUS_RAW_RDY)) return IRQ_NONE; - iio_trigger_poll_chained(p); + iio_trigger_poll_nested(p); return IRQ_HANDLED; } diff --git a/drivers/iio/humidity/hts221_buffer.c b/drivers/iio/humidity/hts221_buffer.c index 2a4107a79662..11ef38994a95 100644 --- a/drivers/iio/humidity/hts221_buffer.c +++ b/drivers/iio/humidity/hts221_buffer.c @@ -68,7 +68,7 @@ static irqreturn_t hts221_trigger_handler_thread(int irq, void *private) if (!(status & HTS221_RH_DRDY_MASK)) return IRQ_NONE; - iio_trigger_poll_chained(hw->trig); + iio_trigger_poll_nested(hw->trig); return IRQ_HANDLED; } diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index bb0a44df8740..19cf36bd3de5 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -223,7 +223,15 @@ irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private) } EXPORT_SYMBOL(iio_trigger_generic_data_rdy_poll); -void iio_trigger_poll_chained(struct iio_trigger *trig) +/** + * iio_trigger_poll_nested() - Call the threaded trigger handler of the + * consumers + * @trig: trigger which occurred + * + * This function needs to be called from a kernel thread context. + * + */ +void iio_trigger_poll_nested(struct iio_trigger *trig) { int i; @@ -238,7 +246,7 @@ void iio_trigger_poll_chained(struct iio_trigger *trig) } } } -EXPORT_SYMBOL(iio_trigger_poll_chained); +EXPORT_SYMBOL(iio_trigger_poll_nested); void iio_trigger_notify_done(struct iio_trigger *trig) { diff --git a/drivers/iio/light/acpi-als.c b/drivers/iio/light/acpi-als.c index e1ff6f524f4b..2d91caf24dd0 100644 --- a/drivers/iio/light/acpi-als.c +++ b/drivers/iio/light/acpi-als.c @@ -108,7 +108,7 @@ static void acpi_als_notify(struct acpi_device *device, u32 event) if (iio_buffer_enabled(indio_dev) && iio_trigger_using_own(indio_dev)) { switch (event) { case ACPI_ALS_NOTIFY_ILLUMINANCE: - iio_trigger_poll_chained(als->trig); + iio_trigger_poll_nested(als->trig); break; default: /* Unhandled event */ diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c index 668e444f6049..9d0218b7426e 100644 --- a/drivers/iio/light/rpr0521.c +++ b/drivers/iio/light/rpr0521.c @@ -431,7 +431,7 @@ static irqreturn_t rpr0521_drdy_irq_thread(int irq, void *private) struct rpr0521_data *data = iio_priv(indio_dev); if (rpr0521_is_triggered(data)) { - iio_trigger_poll_chained(data->drdy_trigger0); + iio_trigger_poll_nested(data->drdy_trigger0); return IRQ_HANDLED; } diff --git a/drivers/iio/light/st_uvis25_core.c b/drivers/iio/light/st_uvis25_core.c index c737d3e193ae..50f95c5d2060 100644 --- a/drivers/iio/light/st_uvis25_core.c +++ b/drivers/iio/light/st_uvis25_core.c @@ -161,7 +161,7 @@ static irqreturn_t st_uvis25_trigger_handler_thread(int irq, void *private) if (!(status & ST_UVIS25_REG_UV_DA_MASK)) return IRQ_NONE; - iio_trigger_poll_chained(hw->trig); + iio_trigger_poll_nested(hw->trig); return IRQ_HANDLED; } diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index 69c5bc987e26..5e041a491390 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -1068,7 +1068,7 @@ static irqreturn_t vcnl4010_irq_thread(int irq, void *p) } if (isr & VCNL4010_INT_DRDY && iio_buffer_enabled(indio_dev)) - iio_trigger_poll_chained(indio_dev->trig); + iio_trigger_poll_nested(indio_dev->trig); end: return IRQ_HANDLED; diff --git a/drivers/iio/light/vcnl4035.c b/drivers/iio/light/vcnl4035.c index 84148b944000..14e29330e972 100644 --- a/drivers/iio/light/vcnl4035.c +++ b/drivers/iio/light/vcnl4035.c @@ -89,7 +89,7 @@ static irqreturn_t vcnl4035_drdy_irq_thread(int irq, void *private) IIO_EV_TYPE_THRESH, IIO_EV_DIR_EITHER), iio_get_time_ns(indio_dev)); - iio_trigger_poll_chained(data->drdy_trigger0); + iio_trigger_poll_nested(data->drdy_trigger0); return IRQ_HANDLED; } diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c index b82f093f1e6a..0083e858c21e 100644 --- a/drivers/iio/potentiostat/lmp91000.c +++ b/drivers/iio/potentiostat/lmp91000.c @@ -118,7 +118,7 @@ static int lmp91000_read(struct lmp91000_data *data, int channel, int *val) data->chan_select = channel != LMP91000_REG_MODECN_3LEAD; - iio_trigger_poll_chained(data->trig); + iio_trigger_poll_nested(data->trig); ret = wait_for_completion_timeout(&data->completion, HZ); reinit_completion(&data->completion); diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c index 67119a9b95fc..421e059d1f19 100644 --- a/drivers/iio/pressure/zpa2326.c +++ b/drivers/iio/pressure/zpa2326.c @@ -829,7 +829,7 @@ static irqreturn_t zpa2326_handle_threaded_irq(int irq, void *data) } /* New sample available: dispatch internal trigger consumers. */ - iio_trigger_poll_chained(priv->trigger); + iio_trigger_poll_nested(priv->trigger); if (cont) /* diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c index ebc95cf8f5f4..96fa97451cbf 100644 --- a/drivers/iio/proximity/as3935.c +++ b/drivers/iio/proximity/as3935.c @@ -257,7 +257,7 @@ static void as3935_event_work(struct work_struct *work) switch (val) { case AS3935_EVENT_INT: - iio_trigger_poll_chained(st->trig); + iio_trigger_poll_nested(st->trig); break; case AS3935_DISTURB_INT: case AS3935_NOISE_INT: diff --git a/drivers/iio/trigger/iio-trig-loop.c b/drivers/iio/trigger/iio-trig-loop.c index 96ec06bbe546..7aaed0611899 100644 --- a/drivers/iio/trigger/iio-trig-loop.c +++ b/drivers/iio/trigger/iio-trig-loop.c @@ -46,7 +46,7 @@ static int iio_loop_thread(void *data) set_freezable(); do { - iio_trigger_poll_chained(trig); + iio_trigger_poll_nested(trig); } while (likely(!kthread_freezable_should_stop(NULL))); return 0; diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index 42da55dc3aa7..51f52c5c6092 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h @@ -152,7 +152,7 @@ void iio_trigger_unregister(struct iio_trigger *trig_info); int iio_trigger_set_immutable(struct iio_dev *indio_dev, struct iio_trigger *trig); void iio_trigger_poll(struct iio_trigger *trig); -void iio_trigger_poll_chained(struct iio_trigger *trig); +void iio_trigger_poll_nested(struct iio_trigger *trig); irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private);