From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5A8A2C43334 for ; Tue, 14 Jun 2022 12:06:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HIWRxop5q9URwNjBrj3J6RF2Hfk5WJFW8d/XKrmbsoc=; b=pwnJqhOg8sll74 G1NV96nj0ix7HKJ3toPOFkzYlrMXD0C26WwwmYD15IV0aHtVwHZWv5a3wQangVWknUZe0c7mj+jc5 YqiriCkngkfJdsx9fYG+5MykBCuThFjoJKm4XDwB0HKtWDRdZIHkqLbydytmDDGNwGnmAYp39UCRq 37Lo96bvFYBnYg8P+YWkSRuk3QXVjg6AZxiXephckZNQdUOvE4uYpOTG8sBax9R5ndePYa4UIm4kL 0CeB2qkeztwSNrUwxhdSOK4GAoTz78MvElBbkwU2Xq+unqPMDg2JMMEktaCVtjosEgnFhwLJLZ6gY HWfnOKxlaCDEAj7OZO6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o15Iq-009Nqf-Uu; Tue, 14 Jun 2022 12:05:49 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o15In-009Npg-Ps for linux-arm-kernel@lists.infradead.org; Tue, 14 Jun 2022 12:05:47 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4965461468; Tue, 14 Jun 2022 12:05:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49F45C3411B; Tue, 14 Jun 2022 12:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655208344; bh=6EaGbSn4r/TeDu88uoSdZfsO2bREhpvtyTSLFRBBdQQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ViSpuB8+mSVxLXaTeNpdJzPIzQppv/MhO+DHwRJwhJDujYPH3xlV2r6xzIH2+nANM lxM+o/YtxX0/jTFV/9OrXQ27QbPFlAkC2/G9qhMlO2eaF0n/K/HOeHkRaubCNaD7hs dPF0wpoF/+UH0qunJs9aZHm8hB+EaF+RtNvhT6YMY2WW/2AIxyclc77Mqthf3oK1Tp Jk61012dq1vEqmnpW6yBwUVCMq2ELSVEwWLcxR3A9yxQKrt+bWzBkBuMhyvF5nhuRU ENQOKzjpBcN/9quZ/bRC78Z7voa7Q6yrPhoxKnoRW1ZPcVwF5VORv3VrA41GYTW4yv Tzd45VXxE0d1Q== Date: Tue, 14 Jun 2022 13:14:53 +0100 From: Jonathan Cameron To: Subject: Re: [PATCH 15/16] iio: adc: at91-sama5d2_adc: add runtime pm support Message-ID: <20220614131453.7099c043@jic23-huawei> In-Reply-To: <68a099ac-7bf6-aca0-4723-af8e48585abc@microchip.com> References: <20220609083213.1795019-1-claudiu.beznea@microchip.com> <20220609083213.1795019-16-claudiu.beznea@microchip.com> <20220611174824.2d696a55@jic23-huawei> <68a099ac-7bf6-aca0-4723-af8e48585abc@microchip.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220614_050545_928561_34EC8333 X-CRM114-Status: GOOD ( 18.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alexandre.belloni@bootlin.com, lars@metafoo.de, ludovic.desroches@atmel.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, Eugen.Hristev@microchip.com, krzk+dt@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ... > >> @@ -1268,11 +1309,15 @@ static int at91_adc_buffer_prepare(struct iio_dev *indio_dev) > >> if (!(iio_device_get_current_mode(indio_dev) & INDIO_ALL_TRIGGERED_MODES)) > >> return -EINVAL; > >> > >> + ret = pm_runtime_resume_and_get(st->dev); > > > > This seems unusual. I'd normally expect to see runtime pm left on whenever > > a buffer is in use, but in this case you seem to let it autosuspend. > > > > That 'might' be fine as you might hit it often enough that it stays up whilst > > doing DMA but it certainly seems odd and less than efficient. > > Or possibly the use of the trigger is enough to keep it up. > > This is here because at91_adc_buffer_prepare() is called though > .hwfifo_set_watermark which is called in iio_enable_buffers() before > iio_trigger_attach_poll_func() which calls in turn > at91_adc_configure_trigger() that turns on the power for the whole duration > the buffers are enabled. > > It is necessary to have runtime resume here to be able to do proper > register settings. Runtime pm is reference counted so I'd take the view that either * buffer being enabled or * trigger being enabled are reasons to leave the device powered up. That'll result in needing it to be powered down in both buffer and trigger disables but that shoudl be fine. ... Thanks, Jonathan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel