From patchwork Wed Jun 3 12:45:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 11585639 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3352C1392 for ; Wed, 3 Jun 2020 12:46:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 07AD020738 for ; Wed, 3 Jun 2020 12:46:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Fwfx4Ir8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=st.com header.i=@st.com header.b="nxmb/mIr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07AD020738 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=st.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; 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:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qqlQt9bV20Ge748T3oCg9NiQtlPKiEFMmY4VqWvnvJU=; b=Fwfx4Ir8c0nI1e gCHxMVnEUZ6AE/0mtCCCv0lbejbaUVgmEjQ3gm0uL6HV5PJpo/9Uxdh37FJj5w2rtv177wftjPVBB aLdzdxa/UT73P0v80sUBJMNCnf4uv8Sw5uSarCwV9zXHN4bwfbGvenso0l31REHkfmvrVf1z0MTQh uJalVU7Mxo80DE/SNURuySGr+1daerzZgVWfjkP7dW2XPgFpuSun1COO63a6pr+tGNUbuvzuIbz55 T7si56aBGLlKvVMptAJYTKGs01RbwzcVC/iI63w1czj3u5gMiw4jrjHLlsTIYkYA37TwMMz0rWgYU zA22yOohencQH5yGfXCw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jgSmh-0007Zo-Kx; Wed, 03 Jun 2020 12:46:19 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jgSme-0007YJ-J9 for linux-arm-kernel@lists.infradead.org; Wed, 03 Jun 2020 12:46:18 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 053CgD4B004142; Wed, 3 Jun 2020 14:46:08 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=zWShjHdtkDP9KEzM3tiXokZkb+o6dSeLDNYRf6d3oDE=; b=nxmb/mIrDMRgEFlxZzjDRPIQLRaHmG/XYTkZaHIphD+5bSr30D6uvz5pXEK+AIByCwY3 sAlxXOxBBImp0/VrkVgnc/EIKxov/S4A2UNrA74TM8TG/oeoykThJuGghBibMHJH7Gsz udccshrbY2SdFt4ZwC3V4mq2i1ZIWu9vjaZPmr63cnHnpomcgvjOoE2qqsjd4HV4WhLj yHkfPT2Uhb8oSQ4tTwxk/XGd+SxDOG2c6QpG4QoxWctle1TdC4Fq/oFYROoFXZ7Z6lfe nTKZdGgE/iHbY/GO5VXryoLWiKCcEYfWWzM3H6muY7FDsQqkUJrQDi7vnZzZFpLAqc4R Nw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 31bcm94qen-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Jun 2020 14:46:08 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D0E2C10002A; Wed, 3 Jun 2020 14:46:05 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node3.st.com [10.75.127.9]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id C09A22CB37B; Wed, 3 Jun 2020 14:46:05 +0200 (CEST) Received: from localhost (10.75.127.46) by SFHDAG3NODE3.st.com (10.75.127.9) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 3 Jun 2020 14:46:05 +0200 From: Benjamin Gaignard To: , , , Subject: [PATCH v2 1/3] dt-bindings: media: stm32-dcmi: Add DCMI min frequency property Date: Wed, 3 Jun 2020 14:45:57 +0200 Message-ID: <20200603124559.22652-2-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20200603124559.22652-1-benjamin.gaignard@st.com> References: <20200603124559.22652-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) To SFHDAG3NODE3.st.com (10.75.127.9) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-03_12:2020-06-02, 2020-06-03 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200603_054616_936945_7ECF9297 X-CRM114-Status: GOOD ( 12.25 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [91.207.212.93 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Benjamin Gaignard , rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, valentin.schneider@arm.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Document st,stm32-dcmi-min-frequency property which is used to request CPUs minimum frequency when streaming frames. Signed-off-by: Benjamin Gaignard --- Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml b/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml index 3fe778cb5cc3..05ca85a2411a 100644 --- a/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml +++ b/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml @@ -44,6 +44,13 @@ properties: bindings defined in Documentation/devicetree/bindings/media/video-interfaces.txt. + st,stm32-dcmi-min-frequency: + description: DCMI minimum CPUs frequency requirement (in KHz). + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - minimum: 0 + - default: 0 + required: - compatible - reg @@ -71,6 +78,7 @@ examples: clock-names = "mclk"; dmas = <&dmamux1 75 0x400 0x0d>; dma-names = "tx"; + st,stm32-dcmi-min-frequency = <650000>; port { dcmi_0: endpoint { From patchwork Wed Jun 3 12:45:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 11585641 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDE551392 for ; Wed, 3 Jun 2020 12:46:32 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AC2C520678 for ; Wed, 3 Jun 2020 12:46:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="K+aJdwJI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=st.com header.i=@st.com header.b="FsQ0BrJw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC2C520678 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=st.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; 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:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rYcje0mgBvYohBCaOYd/ZueU/iVB1JF7X0YmGBZV4HI=; b=K+aJdwJItb5KCG jWW1SF3fnH9ZtOfdUB7Iy99fZjlLOsmilFhC8GURoDkfVL9l8mpVvRRsbCi+2PflRhbnr3V73K4GS 7VTfR8ywgD+YWY/biU5NMoJnSsHk/FFLOHduFcn3fc29Lr6lAJfb9SRm8zIAG9WUnB4wM6c5cP7fe AJoKmMSWkYQ7H8I5MHuZpVAuct9gUOfkBIoYSJsM/2GucmQnWNFbq7eoy0do8ucg02UseH6+xv/CF 6986+Sc/k4YvRS0osIUnmgTnIF6Ca7ZQDP93sCBhpHzwGtQb7eERlOxXee7x32DoxiRKMWTQ5t8wq 63WVcVTKJiNKpAGR84cw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jgSmq-0007iB-3l; Wed, 03 Jun 2020 12:46:28 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jgSme-0007YI-Hf for linux-arm-kernel@lists.infradead.org; Wed, 03 Jun 2020 12:46:18 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 053CgD4A004142; Wed, 3 Jun 2020 14:46:07 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=G0SILNyXS/efu63PjZczmnDmrnvI2LtMCvhjjF9NXC8=; b=FsQ0BrJww4WP8OAH0RIssayIft7sb6jnj0uQ+/fpiDkSVRh5Cujhpl+YhxA4BVg551RY n8WbluBSOfOAqcNBvs7HXfcw2kPnNHbbYg9wYas6M4T5NFULnNAPu13ImuirxvHAdAk0 xIk0R3L4zE85Lz7NjlICX8w5HTGtKzpJrhnLivfHbwErxEUv5+hMaNmrDuraMZzim9WE vBv+fIeTrVgfMHJfI3sm1SgcZ3VphI5AaUevGv5K1vIQvM8TSkJQGya9Uwq7NbsyYTJD OiC0I2dfYv3fA7eqSvc4vXQCbwiBhYfa7OI73e+K8WQ/cXO769s4IzPwNRer4G95a5tv Fg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 31bcm94qej-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Jun 2020 14:46:07 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 05C3E100039; Wed, 3 Jun 2020 14:46:07 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node3.st.com [10.75.127.9]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id EC5B62CB37C; Wed, 3 Jun 2020 14:46:06 +0200 (CEST) Received: from localhost (10.75.127.44) by SFHDAG3NODE3.st.com (10.75.127.9) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 3 Jun 2020 14:46:06 +0200 From: Benjamin Gaignard To: , , , Subject: [PATCH v2 2/3] media: stm32-dcmi: Set minimum cpufreq requirement Date: Wed, 3 Jun 2020 14:45:58 +0200 Message-ID: <20200603124559.22652-3-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20200603124559.22652-1-benjamin.gaignard@st.com> References: <20200603124559.22652-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) To SFHDAG3NODE3.st.com (10.75.127.9) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-03_12:2020-06-02, 2020-06-03 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200603_054616_936930_1B2ED89B X-CRM114-Status: GOOD ( 17.53 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [91.207.212.93 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Benjamin Gaignard , rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, valentin.schneider@arm.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Before start streaming set cpufreq minimum frequency requirement. The cpufreq governor will adapt the frequencies and we will have no latency for handling interrupts. The frequency requirement is retrieved from the device-tree node. Signed-off-by: Benjamin Gaignard --- drivers/media/platform/stm32/stm32-dcmi.c | 90 ++++++++++++++++++++++++++++--- 1 file changed, 82 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index b8931490b83b..1b9f24986694 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -13,10 +13,12 @@ #include #include +#include #include #include #include #include +#include #include #include #include @@ -99,6 +101,9 @@ enum state { #define OVERRUN_ERROR_THRESHOLD 3 +static DEFINE_PER_CPU(struct cpufreq_policy *, policy); +static DEFINE_PER_CPU(struct freq_qos_request, qos_req); + struct dcmi_graph_entity { struct v4l2_async_subdev asd; @@ -133,6 +138,7 @@ struct stm32_dcmi { struct resource *res; struct reset_control *rstc; int sequence; + int irq; struct list_head buffers; struct dcmi_buf *active; @@ -173,6 +179,8 @@ struct stm32_dcmi { struct media_device mdev; struct media_pad vid_cap_pad; struct media_pipeline pipeline; + + u32 min_frequency; }; static inline struct stm32_dcmi *notifier_to_dcmi(struct v4l2_async_notifier *n) @@ -722,6 +730,62 @@ static void dcmi_pipeline_stop(struct stm32_dcmi *dcmi) dcmi_pipeline_s_stream(dcmi, 0); } +static void dcmi_get_min_frequency(struct stm32_dcmi *dcmi) +{ + struct device_node *np = dcmi->mdev.dev->of_node; + + dcmi->min_frequency = FREQ_QOS_MIN_DEFAULT_VALUE; + + of_property_read_u32(np, "st,stm32-dcmi-min-frequency", + &dcmi->min_frequency); +} + +static void dcmi_get_cpu_policy(struct stm32_dcmi *dcmi) +{ + struct cpufreq_policy *p; + int cpu; + + for_each_cpu(cpu, irq_get_affinity_mask(dcmi->irq)) { + p = cpufreq_cpu_get(cpu); + if (!p) + continue; + + freq_qos_add_request(&p->constraints, &per_cpu(qos_req, cpu), + FREQ_QOS_MIN, FREQ_QOS_MIN_DEFAULT_VALUE); + + per_cpu(policy, cpu) = p; + } +} + +static void dcmi_put_cpu_policy(struct stm32_dcmi *dcmi) +{ + struct cpufreq_policy *p; + int cpu; + + for_each_cpu(cpu, irq_get_affinity_mask(dcmi->irq)) { + p = per_cpu(policy, cpu); + if (!p) + continue; + + freq_qos_remove_request(&per_cpu(qos_req, cpu)); + cpufreq_cpu_put(p); + } +} + +static void dcmi_set_min_frequency(struct stm32_dcmi *dcmi, u64 freq) +{ + struct cpufreq_policy *p; + int cpu; + + for_each_cpu(cpu, irq_get_affinity_mask(dcmi->irq)) { + p = per_cpu(policy, cpu); + if (!p) + continue; + + freq_qos_update_request(&per_cpu(qos_req, cpu), freq); + } +} + static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count) { struct stm32_dcmi *dcmi = vb2_get_drv_priv(vq); @@ -736,11 +800,13 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count) goto err_release_buffers; } + dcmi_set_min_frequency(dcmi, dcmi->min_frequency); + ret = media_pipeline_start(&dcmi->vdev->entity, &dcmi->pipeline); if (ret < 0) { dev_err(dcmi->dev, "%s: Failed to start streaming, media pipeline start error (%d)\n", __func__, ret); - goto err_pm_put; + goto err_drop_qos; } ret = dcmi_pipeline_start(dcmi); @@ -835,7 +901,8 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count) err_media_pipeline_stop: media_pipeline_stop(&dcmi->vdev->entity); -err_pm_put: +err_drop_qos: + dcmi_set_min_frequency(dcmi, FREQ_QOS_MIN_DEFAULT_VALUE); pm_runtime_put(dcmi->dev); err_release_buffers: @@ -863,6 +930,8 @@ static void dcmi_stop_streaming(struct vb2_queue *vq) media_pipeline_stop(&dcmi->vdev->entity); + dcmi_set_min_frequency(dcmi, FREQ_QOS_MIN_DEFAULT_VALUE); + spin_lock_irq(&dcmi->irqlock); /* Disable interruptions */ @@ -1838,7 +1907,6 @@ static int dcmi_probe(struct platform_device *pdev) struct vb2_queue *q; struct dma_chan *chan; struct clk *mclk; - int irq; int ret = 0; match = of_match_device(of_match_ptr(stm32_dcmi_of_match), &pdev->dev); @@ -1879,9 +1947,9 @@ static int dcmi_probe(struct platform_device *pdev) dcmi->bus.bus_width = ep.bus.parallel.bus_width; dcmi->bus.data_shift = ep.bus.parallel.data_shift; - irq = platform_get_irq(pdev, 0); - if (irq <= 0) - return irq ? irq : -ENXIO; + dcmi->irq = platform_get_irq(pdev, 0); + if (dcmi->irq <= 0) + return dcmi->irq ? dcmi->irq : -ENXIO; dcmi->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!dcmi->res) { @@ -1895,11 +1963,12 @@ static int dcmi_probe(struct platform_device *pdev) return PTR_ERR(dcmi->regs); } - ret = devm_request_threaded_irq(&pdev->dev, irq, dcmi_irq_callback, + ret = devm_request_threaded_irq(&pdev->dev, dcmi->irq, + dcmi_irq_callback, dcmi_irq_thread, IRQF_ONESHOT, dev_name(&pdev->dev), dcmi); if (ret) { - dev_err(&pdev->dev, "Unable to request irq %d\n", irq); + dev_err(&pdev->dev, "Unable to request irq %d\n", dcmi->irq); return ret; } @@ -2022,6 +2091,9 @@ static int dcmi_probe(struct platform_device *pdev) dev_info(&pdev->dev, "Probe done\n"); + dcmi_get_min_frequency(dcmi); + dcmi_get_cpu_policy(dcmi); + platform_set_drvdata(pdev, dcmi); pm_runtime_enable(&pdev->dev); @@ -2049,6 +2121,8 @@ static int dcmi_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); + dcmi_put_cpu_policy(dcmi); + v4l2_async_notifier_unregister(&dcmi->notifier); v4l2_async_notifier_cleanup(&dcmi->notifier); media_entity_cleanup(&dcmi->vdev->entity); From patchwork Wed Jun 3 12:45:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 11585653 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08B041392 for ; Wed, 3 Jun 2020 12:47:09 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D056320678 for ; Wed, 3 Jun 2020 12:47:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rWTd2VCF"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=st.com header.i=@st.com header.b="D5TL8kTZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D056320678 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=st.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; 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:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7V5JwpizStS72zZVlCmxixS5OkeX3qptoJ9rQ9Py8fU=; b=rWTd2VCF7kwEk6 eWtKlkQtym60720azCIsBCnsi/YzxfEw3AM35bWxPjNnlkvesQcm8/LkLVqFQm47vtvarBrtUcF7M EW2gpYl+XEQbaL3co2U3Xa9diNKqswrtfyd+xQzWa77zYyhrfx8G9xz/byf/OWapgScOrR2031CO8 OhAemAdEeeh1E2fK4eFG3CctHfnHIOhbNPayoiTH7LMUR1QV6IkJ5lGjiggoIiz3Ad7jfA80gIJTW 46luhVe0q5sGbp9iOzV3PdcB0a0dQNyy7bgzc0n3ua59jP9cXKJ4jP9mL7g4kJPaaNnb+SUvFHIfQ ZbE7yBSjK6Dfu7GLLrvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jgSnO-0008JC-RU; Wed, 03 Jun 2020 12:47:02 +0000 Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jgSmf-0007YN-Kv for linux-arm-kernel@lists.infradead.org; Wed, 03 Jun 2020 12:46:19 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 053CgFPm027817; Wed, 3 Jun 2020 14:46:08 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=UV2eXHMfLb4/QtK9KJPbsnZv2k9uIAuEYmQYk8262qk=; b=D5TL8kTZweT0eT45TouzWrsmNSNQYw3lM8tr3Fuq6Nxp5UERav2EH9VCq6tbL9ozf5Bl bKnOmGIUfMhCeg81kNu2gKBEMsTCX6YDQUYM8uD78GGI1ldssH5Vqw6AVdSziS8QuTWq FxUV5ngISBHNK4Wf1o/gJDDegfQ+voW+dJvtmO6BYCIaxX+uvjDXAobmrlgySn8C57vS PxdeOn0tyAjMqvza7xlCNPibyVTs/1v4XJUjf88PjNWgqCOH9FqyF64J7ygWhcZAV+Kn 3OghT9vW7sPHKVKxgzMSsLqZ5CTiOhtLkHVlt07Bnwk8JuWUWcC7z/1gS7b+KolLLEah gg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 31bcy0mp7r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Jun 2020 14:46:08 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 23E3E100039; Wed, 3 Jun 2020 14:46:08 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node3.st.com [10.75.127.9]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 1752F2CB379; Wed, 3 Jun 2020 14:46:08 +0200 (CEST) Received: from localhost (10.75.127.46) by SFHDAG3NODE3.st.com (10.75.127.9) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 3 Jun 2020 14:46:07 +0200 From: Benjamin Gaignard To: , , , Subject: [PATCH v2 3/3] ARM: dts: stm32: Set DCMI frequency requirement for stm32mp15x Date: Wed, 3 Jun 2020 14:45:59 +0200 Message-ID: <20200603124559.22652-4-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20200603124559.22652-1-benjamin.gaignard@st.com> References: <20200603124559.22652-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG3NODE3.st.com (10.75.127.9) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-03_12:2020-06-02, 2020-06-03 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200603_054617_969595_B71F722D X-CRM114-Status: GOOD ( 13.20 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [62.209.51.94 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Benjamin Gaignard , rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, valentin.schneider@arm.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Make sure that CPUs will at least run at 650Mhz when streaming sensor frames. Signed-off-by: Benjamin Gaignard --- arch/arm/boot/dts/stm32mp151.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi index 3ea05ba48215..f6d7bf4f8231 100644 --- a/arch/arm/boot/dts/stm32mp151.dtsi +++ b/arch/arm/boot/dts/stm32mp151.dtsi @@ -1091,6 +1091,7 @@ clock-names = "mclk"; dmas = <&dmamux1 75 0x400 0x0d>; dma-names = "tx"; + st,stm32-dcmi-min-frequency = <650000>; status = "disabled"; };