From patchwork Fri Jun 5 13:05:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 11589621 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 4EB63159A for ; Fri, 5 Jun 2020 13:05:49 +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 1B5E4206E6 for ; Fri, 5 Jun 2020 13:05:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uckkleXy"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=st.com header.i=@st.com header.b="Z4GYj0TQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B5E4206E6 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=uckkleXyFvV8Lb WJstQjsSTzVLy1FHxryrZXsr8RNx33pd8IaOe5Kx2FJxe7RmMn0NYGQ0cthbcOpuwHwtVY4jY3xU4 q8PhBiW9cfY/+kjKfTM/2Yhx7k64Yy5UV3xC+LIVTXse9qzw0oc1a96Ve0nDBb42FRp3WAeuGx1v+ M2F5JhelMao4Uy/MtNiS3D7flb8sZZpgzpfbUS+itPhzMpNbsdZBa79ARlhqWPJYBgg7QP/pAWegC 037tuZRhn5sZGWfVM0L8UcW+G6LbM0Ng4A6GpVDfsFVMj+ZWvXFhmDq5tmFCHfNZrJyrGA8LnDogw 1SjMYQ4D1Im6t1sX56Bw==; 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 1jhC2a-0002QW-3i; Fri, 05 Jun 2020 13:05:44 +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 1jhC2L-0002G0-Gw for linux-arm-kernel@lists.infradead.org; Fri, 05 Jun 2020 13:05:31 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 055D1bHP018968; Fri, 5 Jun 2020 15:05:23 +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=Z4GYj0TQc1f6MOtkTmFK6S/f3uMm+wvORJbx7H3FMmxYmtnaTa8GimkP02LWoZwsVE/n Ian2xwt18A66qH+6np7F4MRW+71rty2yQj9AjI05BfMBH7eEuPwcEv2IZb/yuJaAIFG9 zU4BUy1NzTo8w0Y8fIIIlej5rrwNU2G3duM1QmnZv2o6FfBqDh1yysuigus2AXyDlKsl 5UMEiMER3RCwpRzS1jUAb6s9uXBN97fy9DLEJGaPQ5e0LRkhjHs5DVwH3Qn2rk0SmAKr TZzBQaaUgt75PRZTWzB6avIZqwNJGkCE5y+VWnDMPamoucPK34sILBuZBsiXrxtvX1nh nQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 31fat4kmg8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 05 Jun 2020 15:05:23 +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 EB8E3100034; Fri, 5 Jun 2020 15:05:22 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node3.st.com [10.75.127.9]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id D676D2C50BE; Fri, 5 Jun 2020 15:05:22 +0200 (CEST) Received: from localhost (10.75.127.47) by SFHDAG3NODE3.st.com (10.75.127.9) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 5 Jun 2020 15:05:22 +0200 From: Benjamin Gaignard To: , , , Subject: [PATCH v4 1/3] dt-bindings: media: stm32-dcmi: Add DCMI min frequency property Date: Fri, 5 Jun 2020 15:05:17 +0200 Message-ID: <20200605130519.4184-2-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20200605130519.4184-1-benjamin.gaignard@st.com> References: <20200605130519.4184-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG4NODE2.st.com (10.75.127.11) 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-05_04:2020-06-04, 2020-06-05 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200605_060529_857468_282057E9 X-CRM114-Status: GOOD ( 11.74 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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 Fri Jun 5 13:05:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 11589633 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 DEF76618 for ; Fri, 5 Jun 2020 13:06:18 +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 98BE5206DC for ; Fri, 5 Jun 2020 13:06:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UFLfBHr7"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=st.com header.i=@st.com header.b="Mg84Xrsz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98BE5206DC 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=MgDK6Pb7DMd9SFgtFijmKiWOXRpETXLsqI/bRj/TmsM=; b=UFLfBHr7WicxC8 KKS3Q/ITzLnA+UDuA4qFHiMMzIZjgpBXogzHawCYWfxBMmXLFrrwUuiTICEcsD4InDVjdbiWpo9DB hkiZ9a4C/Mowzm42it+sjibaTkYE3yul3iHN+xt1IL+PSJ4f8m3uiNKqcb4qAEImvqt4LP1TUk2Mr xvWfzhEl20i5pWmjQ++wPJx4/U1w96fRKpU+vxvJrDQ+CFrBzBlMd4jpXHfn64n/g0OAiJj+SQOxH S5S50EY+cStd3k7/2726AWt7C5vtsx6EF7EEciGwmRCFnz6rRdMWCyTY/5IyhveNz3LQSjBzA+uJE GWKGy+FlQWP5+ugI4fZA==; 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 1jhC35-0002vM-JK; Fri, 05 Jun 2020 13:06:15 +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 1jhC2L-0002G2-Fj for linux-arm-kernel@lists.infradead.org; Fri, 05 Jun 2020 13:05:32 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 055D2Ben001828; Fri, 5 Jun 2020 15:05:24 +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=QrwYifnaOLog6U8uIZAk8yC8cpKaAcVpWSbrF+6BQTU=; b=Mg84XrszxxO41qed3UcPYuzoFUnaeYnvuyHo1qB+elYGzSYHRJKT/qFLPdF+wcy40xrt C3YPQYXrEaQRIcHb8AtkLsLw79P4aPqLM0QexDFGiHYlAEdKgzkpAGxJSC7YK5vOSI4Q LU63x/KMpRkshvHw3aH1qEZfa5iz/WLPv+8A89ztU6XKwpHf0hMqRCoH1QvKduoD4EWN UFC97cjqGztluX5fMC8BEj53ps4pC6UBV9RvTQszqLH9COTLYzBlLNqU5EXgl7pvkfsS HqEuPpMHslIUw3mP7MZh3Dqe/MpX7LKg9lOCF83dkQ3foSJSzTOGnA4xdrKdtbrw3LKk /Q== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 31faseuktr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 05 Jun 2020 15:05:24 +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 2070E10002A; Fri, 5 Jun 2020 15:05:24 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node3.st.com [10.75.127.9]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 100422C50BE; Fri, 5 Jun 2020 15:05:24 +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; Fri, 5 Jun 2020 15:05:23 +0200 From: Benjamin Gaignard To: , , , Subject: [PATCH v4 2/3] media: stm32-dcmi: Set minimum cpufreq requirement Date: Fri, 5 Jun 2020 15:05:18 +0200 Message-ID: <20200605130519.4184-3-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20200605130519.4184-1-benjamin.gaignard@st.com> References: <20200605130519.4184-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG4NODE2.st.com (10.75.127.11) 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-05_04:2020-06-04, 2020-06-05 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200605_060529_857206_7782A873 X-CRM114-Status: GOOD ( 20.70 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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 Reviewed-by: Valentin Schneider --- version 4: - simplify irq affinity handling by using only dcmi_irq_notifier_notify() drivers/media/platform/stm32/stm32-dcmi.c | 122 ++++++++++++++++++++++++++++-- 1 file changed, 114 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index b8931490b83b..c2389776a958 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -13,10 +13,13 @@ #include #include +#include +#include #include #include #include #include +#include #include #include #include @@ -99,6 +102,8 @@ enum state { #define OVERRUN_ERROR_THRESHOLD 3 +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,10 @@ struct stm32_dcmi { struct media_device mdev; struct media_pad vid_cap_pad; struct media_pipeline pipeline; + + u32 min_frequency; + cpumask_var_t boosted; + struct irq_affinity_notify notify; }; static inline struct stm32_dcmi *notifier_to_dcmi(struct v4l2_async_notifier *n) @@ -722,6 +732,90 @@ 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_irq_notifier_notify(struct irq_affinity_notify *notify, + const cpumask_t *mask) +{ + struct stm32_dcmi *dcmi = container_of(notify, + struct stm32_dcmi, + notify); + struct cpufreq_policy *p; + int cpu; + + /* + * For all boosted CPUs check if it is still the case + * if not remove the request + */ + for_each_cpu(cpu, dcmi->boosted) { + if (cpumask_test_cpu(cpu, mask)) + continue; + + p = cpufreq_cpu_get(cpu); + if (!p) + continue; + + freq_qos_remove_request(&per_cpu(qos_req, cpu)); + cpumask_andnot(dcmi->boosted, dcmi->boosted, p->cpus); + + cpufreq_cpu_put(p); + } + + /* + * For CPUs in the mask check if they are boosted if not add + * a request + */ + for_each_cpu(cpu, mask) { + if (cpumask_test_cpu(cpu, dcmi->boosted)) + continue; + + p = cpufreq_cpu_get(cpu); + if (!p) + continue; + + freq_qos_add_request(&p->constraints, &per_cpu(qos_req, cpu), + FREQ_QOS_MIN, dcmi->min_frequency); + cpumask_or(dcmi->boosted, dcmi->boosted, p->cpus); + cpufreq_cpu_put(p); + } +} + +static void dcmi_irq_notifier_release(struct kref *ref) +{ + /* + * This is required by affinity notifier. We don't have anything to + * free here. + */ +} + +static void dcmi_set_min_frequency(struct stm32_dcmi *dcmi, s32 freq) +{ + struct irq_affinity_notify *notify = &dcmi->notify; + + if (freq) { + dcmi_irq_notifier_notify(notify, + irq_get_affinity_mask(dcmi->irq)); + + notify->notify = dcmi_irq_notifier_notify; + notify->release = dcmi_irq_notifier_release; + irq_set_affinity_notifier(dcmi->irq, notify); + } else { + struct cpumask clear; + + irq_set_affinity_notifier(dcmi->irq, NULL); + cpumask_clear(&clear); + dcmi_irq_notifier_notify(notify, &clear); + } +} + static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count) { struct stm32_dcmi *dcmi = vb2_get_drv_priv(vq); @@ -736,11 +830,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 +931,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 +960,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 +1937,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 +1977,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 +1993,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; } @@ -1930,6 +2029,9 @@ static int dcmi_probe(struct platform_device *pdev) dcmi->state = STOPPED; dcmi->dma_chan = chan; + if (!alloc_cpumask_var(&dcmi->boosted, GFP_KERNEL)) + return -ENODEV; + q = &dcmi->queue; dcmi->v4l2_dev.mdev = &dcmi->mdev; @@ -2022,6 +2124,8 @@ static int dcmi_probe(struct platform_device *pdev) dev_info(&pdev->dev, "Probe done\n"); + dcmi_get_min_frequency(dcmi); + platform_set_drvdata(pdev, dcmi); pm_runtime_enable(&pdev->dev); @@ -2049,6 +2153,8 @@ static int dcmi_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); + free_cpumask_var(dcmi->boosted); + v4l2_async_notifier_unregister(&dcmi->notifier); v4l2_async_notifier_cleanup(&dcmi->notifier); media_entity_cleanup(&dcmi->vdev->entity); From patchwork Fri Jun 5 13:05:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin GAIGNARD X-Patchwork-Id: 11589629 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 B93C9618 for ; Fri, 5 Jun 2020 13:06:10 +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 9764B207D3 for ; Fri, 5 Jun 2020 13:06:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UDFPfk5Q"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=st.com header.i=@st.com header.b="RiKGn1k8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9764B207D3 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=UDFPfk5QpHUhwF QqKGH5lgzx9iHWgtU6R004kjOoW4+lG7G6+WA7bUiUL3TliU1mdK1JSFRJFk+5+4+g/CtPjqwR0qC Q7w8Q80CMJcuooZCWdrYMi/hWvCiFzmUOofLLWDAmkFJoVQgzb1YxyAnUgWsEhvsw416jBpzYHWY5 CjgcuVEh1cjGjDBlUYPr0jHibZyAcfi+oNPWUBv70pYQVQDSCVLMWiRCiY0CoP9OubMqnVQfxL7zN SvgJoSn5XreoLvxMDIYqovKBqHs9a2a713YJjs9WuDWDF/wjiX76S8ipxg9gprwoLM/bE0zikVdrm 01qfoC+raayVOaMfFO1w==; 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 1jhC2r-0002fg-Oj; Fri, 05 Jun 2020 13:06:01 +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 1jhC2M-0002G6-Rj for linux-arm-kernel@lists.infradead.org; Fri, 05 Jun 2020 13:05:32 +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 055D2VRf024213; Fri, 5 Jun 2020 15:05:25 +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=RiKGn1k8pGhuEWzNuWjBbtxEnQzasCQ5waWTwL3TEQcZjYAB1Padx75Qdg+NNyxYxAQl 5WwG0NMUSFaB0Ky86OgzwTMjTIEDWaUxYkRFNgjCxanSdUg2TA+3ILcPPX19Z+eh7oh5 RmHDHx8bTXxrGsxJsz4Nm3O65obdvnjmmDc4C2+fhTYdWwpxt3VXG1MHIQxAcJi7P10I ipNrHlKoUaBwJoK56WiWXmqkwjrCTaYP/QRC4pFFYtsaggbvWm5+vPXNuqfYAQW2q+KX bNn8m/8awz06j3VUBxs83zLlgxSSEFJK2UYp9RG67jHpT+/EW+xFYY6tZpX27BWVsLZK OA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 31fasmbmm8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 05 Jun 2020 15:05:25 +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 372C810002A; Fri, 5 Jun 2020 15:05:25 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node3.st.com [10.75.127.9]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 295362C50BE; Fri, 5 Jun 2020 15:05:25 +0200 (CEST) Received: from localhost (10.75.127.47) by SFHDAG3NODE3.st.com (10.75.127.9) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 5 Jun 2020 15:05:24 +0200 From: Benjamin Gaignard To: , , , Subject: [PATCH v4 3/3] ARM: dts: stm32: Set DCMI frequency requirement for stm32mp15x Date: Fri, 5 Jun 2020 15:05:19 +0200 Message-ID: <20200605130519.4184-4-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20200605130519.4184-1-benjamin.gaignard@st.com> References: <20200605130519.4184-1-benjamin.gaignard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG5NODE3.st.com (10.75.127.15) 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-05_04:2020-06-04, 2020-06-05 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200605_060531_189338_FCE2B966 X-CRM114-Status: GOOD ( 12.41 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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"; };