From patchwork Fri Nov 15 22:33:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247167 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 A233F1599 for ; Fri, 15 Nov 2019 22:34:07 +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 7769420733 for ; Fri, 15 Nov 2019 22:34:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="llmD0Ozh"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BoaaaX8R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7769420733 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To: References:List-Owner; bh=k1HLQ1VBHOs35sRMirLsbVN8mRuoGhesbAlw41ip/XI=; b=llm D0Ozh3ATglybjT+CSUfzTvgkhH+uUGv5JcySSoLVK/1HvAU79Nfht/kzhk+rc/NrNBNFicDzrEeFH ffSMHl7povp1mhguZyYf9ELCeEKGzOuRFdGYPeSZPZ7bM17mtMv/Cuz9HKmMA79Pkc+ml4VbA4814 cW68hwlNzR72afFfoVbR7d9WkCzv5olMhuJMNMZ5OqUqt3nFHNkLRAbbJx3Ra2UfStNJjznkBcyzU WX8UFqjKSxGtnddCr9zD/NMYR7bE8G+jbFKXdgQ3wB9aAbQad9ay6MCBrL1T3tgA5774RLDwLRxNb 4EUooILY/Wf80eXwsaVq2d/Ewin5Cfg==; 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 1iVkAF-00077e-9i; Fri, 15 Nov 2019 22:34:03 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAC-000769-Eb for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:01 +0000 Received: by mail-pf1-x442.google.com with SMTP id c13so7336628pfp.5 for ; Fri, 15 Nov 2019 14:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Tc+IEmTbMBJCj4EiVIkUr9PV2atSgJthk3up+qVhyOE=; b=BoaaaX8RsyTJpotwcaZaTD6Tyhn833MOIIDHMWr3NTNPT5Mmx71uuoUUG3DF6Dup9s lAeMeISC4gG/92nA7AyPgTb37ys0iuHbAxbDO3MU0OERSfxWYFUPDT113kahRoqHbacV 1t2mCpDH0ZffJLXrG8zehsSd086kaA621p1+yYiMxgHdxcG5EAUKq3YCqy6MmqrI/Es/ jcnzhcv9t4AopOYTO8EQg53V68MNnuwplarZG6y/N4NId2Rw73Yj2+YdKFtJGEvW7J+1 VuZbzXMxe1W0aqKbfqGyJgz/TEKm+UhMbJtGGZ6czxRqmh5bNfZmhSfjIiVFZ/z7ZgGU 1VrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Tc+IEmTbMBJCj4EiVIkUr9PV2atSgJthk3up+qVhyOE=; b=hWIq7e9YSKpC7gH2V3XOpJNQ3i8S5lMJAR/GP4TavvVR7+2tBI75Z48sJNzVNdAIyY dUcYSXNFHw5LCi7tvaan51INDyAZ3F/tqpqXT8mjWL2rnb+8hrcOqOBe46V57S1+W21z Xs/Z3EqoEVWH3HMWszURyNaeSjEdY1Iu8ADG3beVJncQJiJxZGwumN2B4AOwhbjtvkCl WVyojrnUyPQlB/vnsLb3BuWcJIq67S6Ditu9eF8cts3BNJIe/yeWqX73Irvr4W/oJsoA xR2Wjk7SXA8foFA9v5XP3hDLiDIfFs7AvclG50quaWwYichKzcL1349o04bW7mh4ZpXx RF3w== X-Gm-Message-State: APjAAAUI9Ka/nG3tIPu18sYbevWt/0j3KaeZhiCv1fUn6KlPJxKxnWEB uRoX5It2/lwK3M9dgnDoCdmrtw== X-Google-Smtp-Source: APXvYqzUrFqYWdMgMuMww+ixzlV+FmQouQrALIgHfRTCaefzB7ScRo91nDaA8H/KKozVPoI12PkkMQ== X-Received: by 2002:aa7:870c:: with SMTP id b12mr20357084pfo.30.1573857238096; Fri, 15 Nov 2019 14:33:58 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:33:57 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 01/20] i2c: stm32f7: fix first byte to send in slave mode Date: Fri, 15 Nov 2019 15:33:37 -0700 Message-Id: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143400_517307_3B91F820 X-CRM114-Status: UNSURE ( 9.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Fabrice Gasnier commit 915da2b794ce4fc98b1acf64d64354f22a5e4931 upstream The slave-interface documentation [1] states "the bus driver should transmit the first byte" upon I2C_SLAVE_READ_REQUESTED slave event: - 'val': backend returns first byte to be sent The driver currently ignores the 1st byte to send on this event. [1] https://www.kernel.org/doc/Documentation/i2c/slave-interface Fixes: 60d609f30de2 ("i2c: i2c-stm32f7: Add slave support") Signed-off-by: Fabrice Gasnier Reviewed-by: Pierre-Yves MORDRET Signed-off-by: Wolfram Sang Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/i2c/busses/i2c-stm32f7.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index ac9c9486b834..48521bc8a4d2 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -1177,6 +1177,8 @@ static void stm32f7_i2c_slave_start(struct stm32f7_i2c_dev *i2c_dev) STM32F7_I2C_CR1_TXIE; stm32f7_i2c_set_bits(base + STM32F7_I2C_CR1, mask); + /* Write 1st data byte */ + writel_relaxed(value, base + STM32F7_I2C_TXDR); } else { /* Notify i2c slave that new write transfer is starting */ i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value); From patchwork Fri Nov 15 22:33:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247171 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 7A8381599 for ; Fri, 15 Nov 2019 22:34:45 +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 550AF2073B for ; Fri, 15 Nov 2019 22:34:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mKuMRVJp"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TSxkLjju" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 550AF2073B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=C6qTAs0wwn0EYnC0XnxxI+jY2oV6cUCokQAg7CnY+h8=; b=mKuMRVJpvqo408p2qNCHKEvmy/ AEWy/su6hIQ9wZTHJOseKFHdS/57KwyU3iDb1/wyOHIZkPWo7IqcPXSE1qSn1vwwVysFYssMIyNoU +8DJ6JlfGcSKDetZeEyX3lza5Hs7txqNIq7bzfdApjOTvaD/5kFj90qo7qkeYSA7cnHNeq0sI8YVR E/e0v2pKxuJ3hCEYw3NT169TJRQ9IwYm/LVTX/EXMz77z0KQePF2ZkNNhBm7bBLOWysEWDOQ8H3Cl Z74gk1k1numUUjza5unqoFc0DLrAcJt+UZW4FIXwdH/9bxinpl5Uyxew/+9MJ3vB8YtE31x2ScBaK tNe5FtAg==; 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 1iVkAq-0007dE-Em; Fri, 15 Nov 2019 22:34:40 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAD-00076I-LM for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:03 +0000 Received: by mail-pl1-x641.google.com with SMTP id az9so5619898plb.11 for ; Fri, 15 Nov 2019 14:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2t2lfkYvCG1qZ4zH71UsZZVKevqEX7pyTohdYU3/dDg=; b=TSxkLjjusnWyOxYQuwJ0yeo2qVuacsTryAzYn0nABmfZ+giChdSbiAlTILiu0av+QY jkWKBo4DLgZtHrpz+tdF+VlAgQsfA3OdIm5fhLhv9vSP8EAGtXSK+OSQOTBRtAQcct2g QR0Sglw0sLDa8vkUzDJ7iwCPgDCjEiKh+VvE3qSkwQesXq0iaKdptZvJJxiDYbc1N+j4 xaT/k5+AjeJLF9P+ANrQoOWHWCa16LHqeI0KGWEjIvKKArK5TYv/F94+FbsrOhMSzjwN nH0qNcPvGaUtYtZ3JDYIjIjaFjXf66XE2kFG4WMS8hUVt2ONxPzvC68OWC0+AqOf4NGA wEtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2t2lfkYvCG1qZ4zH71UsZZVKevqEX7pyTohdYU3/dDg=; b=C3ST51djrOwk/fH0CwN7mojk77H0VBgjL0MZt622Vr3b1IIrCh1sewVfOk7ZggRE+h vKFPkwcb7eQP2Q/ANJBsC1MIpPeoG6vqgT1MJsz9MQzLfdzLV44KA63XWCHPYV5vtHZ7 8DDlhfOGSc+eRZVkmLP2O07uKaIGyvcSjl0ReH6WMOSz79Fx/5hBlmpU0Zm4uJGz3hQN Kqoup58JuZCbA2DcmgvV1ORaMvEBtXf+NZuL0arIPx+Sg7PEjAQ7ZZ9MJQ15JkBVLcNl 7CEiofJRKLBk1O0fFgj7FTe0ZiyY/c0wN90nepmDfVAV/M9Ng6R1lGmg+0YsbBR9jg6a +JhQ== X-Gm-Message-State: APjAAAX94jKt4SXQgzUJ2pLoH/8kO2p8YKPcKFojmQ2aL9howMT6o9uF jtV/IsbDBjrLax8ALqR422VTbw== X-Google-Smtp-Source: APXvYqyCcGnCxpjNDXnOlQ5PDU1yc/iIX1FpvG9yax85c887grRTZSpLNG9/CAqWEFTR/yqC0+Ui1Q== X-Received: by 2002:a17:902:9a47:: with SMTP id x7mr3791386plv.84.1573857238838; Fri, 15 Nov 2019 14:33:58 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:33:58 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 02/20] ARM: dts: stm32: relax qspi pins slew-rate for stm32mp157 Date: Fri, 15 Nov 2019 15:33:38 -0700 Message-Id: <20191115223356.27675-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143401_700641_E82E7CE7 X-CRM114-Status: GOOD ( 10.31 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:641 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Patrice Chotard commit 86ec2e1739aa1d6565888b4b2059fa47354e1a89 upstream Relax qspi pins slew-rate to minimize peak currents. Fixes: 844030057339 ("ARM: dts: stm32: add flash nor support on stm32mp157c eval board") Link: https://lore.kernel.org/r/20191025130122.11407-1-alexandre.torgue@st.com Signed-off-by: Patrice Chotard Signed-off-by: Alexandre Torgue Signed-off-by: Olof Johansson Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi index c4851271e810..d9dce0c804e1 100644 --- a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi +++ b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi @@ -290,13 +290,13 @@ ; /* QSPI_BK1_IO3 */ bias-disable; drive-push-pull; - slew-rate = <3>; + slew-rate = <1>; }; pins2 { pinmux = ; /* QSPI_BK1_NCS */ bias-pull-up; drive-push-pull; - slew-rate = <3>; + slew-rate = <1>; }; }; @@ -308,13 +308,13 @@ ; /* QSPI_BK2_IO3 */ bias-disable; drive-push-pull; - slew-rate = <3>; + slew-rate = <1>; }; pins2 { pinmux = ; /* QSPI_BK2_NCS */ bias-pull-up; drive-push-pull; - slew-rate = <3>; + slew-rate = <1>; }; }; From patchwork Fri Nov 15 22:33:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247169 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 048D71393 for ; Fri, 15 Nov 2019 22:34:24 +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 CDEF72077B for ; Fri, 15 Nov 2019 22:34:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Kh/Y8cZ7"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="T5gTpPfM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDEF72077B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=Wr+h0dWZpkx+tk9knfQWs65dB/7ZI5b/K9aYCM4yJJo=; b=Kh/Y8cZ76OA+6yKMTxUslEl25d 5rcQdI8hdBC26IMYiZJtSLgSLG/6oLVQsx+LxwrBumwfd4PQv9kKqD4Mm4ddnsdhSNqpQ5AYyQPYX szFlzCoX7gFru2Wb7hmF57IcLsqfY9I53srlbekJLaoMd51VNA5KkVtzBTq7kUHsm+2EvS+sAVQcM oa+aHNZOWv/R9fNT+0qNvr0lubyFsVBv0OaP44VfuO8MnXgSJ+PIS9JfHq1LVTGGxwOKeHF6xgOez l5B5WZQ7b1lg3gxVUu2DP72+egmmitcVT6KEfEjawjXe3vEGiE9Kjc5zRyEr/yxSOZgNIsPEz3NAL oq2wvPFg==; 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 1iVkAY-0007PD-H5; Fri, 15 Nov 2019 22:34:22 +0000 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAD-00076K-LI for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:03 +0000 Received: by mail-pj1-x1041.google.com with SMTP id m71so159509pjb.12 for ; Fri, 15 Nov 2019 14:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5tCHcBKEZssfZtGLO4lrvgsi0FdvjwhVDJVSSTh6psc=; b=T5gTpPfMPcBQaM1Rda0Ndn9G4cEZJwjbmnNlxXqg9buGJ/wlKso18b4SNXgJD7wEjJ rOro72GB7K62gRe3juF5g9nEfWBkcsocfcJAPAukedKksQ9p/Ct99Cz7rAfD0zWrGgCT t55WWai/iFvSieafgwu7rtv7uNqXlW18lIIAG+PCfV+zOwAQgcrzYQZrFYj1SAtAyGdz cUv8qB5jxyGPynQ7jFkXphM8oHv+T229CnEEWm+EoVNr3J8vMlXstQwEIl4FeI/NjSH3 nVfEjRJCBYn8gJpA95V+ZVLMi5mzXl1i+KBtLJVt8bVqYLlL4lqi5vxI1KNbXvHMRRTV JVZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5tCHcBKEZssfZtGLO4lrvgsi0FdvjwhVDJVSSTh6psc=; b=dTXSA4GitOXWsekf9sn9iHxQahoFOdjZrYPDHqDikWcLNuI/GwIpDuo9zK0yUxkQ4n F//BlIBEQ9V3itsH7G6ZIoPnxvK3UouQv31OglwycbfOySnOFMyg3a3HqufAsGVnhYFt /GP7Sp+ocG2YkVaA6VrQPUjfAuDDA0Q8WnGfUTgAWPkkq39djGPJKH7FNv4eDG+Jpkgo wuH4YzEmEhlBfOAYQ55x+7ku2LDS7TDDpMLzUksEV2C0v8HqpNHN2rJX5rzB/3jrAKaF BqCPbuuTkSwVTFMozZ0UwG7CYR11ZcdORcHxyx7v6qflmda4TFvePcJ6PDSyignWYiT8 OsPQ== X-Gm-Message-State: APjAAAXQOQpQPPxQXjhFENUv2CkmM0HIWTVNbBLclbhFiG7m2GtFF6Jl +y82mCd5alj/pdYo7Si25a9Bug== X-Google-Smtp-Source: APXvYqwvOrQGWg4m3FQouJyEIubtEKECASGnP2QVJqCfiGFzcLOOO3tw+OVASMP7PJoPOnKieSXp8g== X-Received: by 2002:a17:902:8d81:: with SMTP id v1mr1565624plo.289.1573857239827; Fri, 15 Nov 2019 14:33:59 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:33:59 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 03/20] mailbox: stm32_ipcc: add spinlock to fix channels concurrent access Date: Fri, 15 Nov 2019 15:33:39 -0700 Message-Id: <20191115223356.27675-3-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143401_692867_5177FE1B X-CRM114-Status: GOOD ( 13.79 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Arnaud Pouliquen commit dba9a3dfe912dc47c9dbc9ba1f5f65adbf9aea0f upstream Add spinlock protection on IPCC register update to avoid race condition. Without this fix, stm32_ipcc_set_bits and stm32_ipcc_clr_bits can be called in parallel for different channels. This results in register corruptions. Signed-off-by: Arnaud Pouliquen Reviewed-by: Fabien Dessenne Signed-off-by: Jassi Brar Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/mailbox/stm32-ipcc.c | 37 ++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/drivers/mailbox/stm32-ipcc.c b/drivers/mailbox/stm32-ipcc.c index ca1f993c0de3..e31322225e93 100644 --- a/drivers/mailbox/stm32-ipcc.c +++ b/drivers/mailbox/stm32-ipcc.c @@ -50,6 +50,7 @@ struct stm32_ipcc { void __iomem *reg_base; void __iomem *reg_proc; struct clk *clk; + spinlock_t lock; /* protect access to IPCC registers */ int irqs[IPCC_IRQ_NUM]; int wkp; u32 proc_id; @@ -58,14 +59,24 @@ struct stm32_ipcc { u32 xmr; }; -static inline void stm32_ipcc_set_bits(void __iomem *reg, u32 mask) +static inline void stm32_ipcc_set_bits(spinlock_t *lock, void __iomem *reg, + u32 mask) { + unsigned long flags; + + spin_lock_irqsave(lock, flags); writel_relaxed(readl_relaxed(reg) | mask, reg); + spin_unlock_irqrestore(lock, flags); } -static inline void stm32_ipcc_clr_bits(void __iomem *reg, u32 mask) +static inline void stm32_ipcc_clr_bits(spinlock_t *lock, void __iomem *reg, + u32 mask) { + unsigned long flags; + + spin_lock_irqsave(lock, flags); writel_relaxed(readl_relaxed(reg) & ~mask, reg); + spin_unlock_irqrestore(lock, flags); } static irqreturn_t stm32_ipcc_rx_irq(int irq, void *data) @@ -92,7 +103,7 @@ static irqreturn_t stm32_ipcc_rx_irq(int irq, void *data) mbox_chan_received_data(&ipcc->controller.chans[chan], NULL); - stm32_ipcc_set_bits(ipcc->reg_proc + IPCC_XSCR, + stm32_ipcc_set_bits(&ipcc->lock, ipcc->reg_proc + IPCC_XSCR, RX_BIT_CHAN(chan)); ret = IRQ_HANDLED; @@ -121,7 +132,7 @@ static irqreturn_t stm32_ipcc_tx_irq(int irq, void *data) dev_dbg(dev, "%s: chan:%d tx\n", __func__, chan); /* mask 'tx channel free' interrupt */ - stm32_ipcc_set_bits(ipcc->reg_proc + IPCC_XMR, + stm32_ipcc_set_bits(&ipcc->lock, ipcc->reg_proc + IPCC_XMR, TX_BIT_CHAN(chan)); mbox_chan_txdone(&ipcc->controller.chans[chan], 0); @@ -141,10 +152,12 @@ static int stm32_ipcc_send_data(struct mbox_chan *link, void *data) dev_dbg(ipcc->controller.dev, "%s: chan:%d\n", __func__, chan); /* set channel n occupied */ - stm32_ipcc_set_bits(ipcc->reg_proc + IPCC_XSCR, TX_BIT_CHAN(chan)); + stm32_ipcc_set_bits(&ipcc->lock, ipcc->reg_proc + IPCC_XSCR, + TX_BIT_CHAN(chan)); /* unmask 'tx channel free' interrupt */ - stm32_ipcc_clr_bits(ipcc->reg_proc + IPCC_XMR, TX_BIT_CHAN(chan)); + stm32_ipcc_clr_bits(&ipcc->lock, ipcc->reg_proc + IPCC_XMR, + TX_BIT_CHAN(chan)); return 0; } @@ -163,7 +176,8 @@ static int stm32_ipcc_startup(struct mbox_chan *link) } /* unmask 'rx channel occupied' interrupt */ - stm32_ipcc_clr_bits(ipcc->reg_proc + IPCC_XMR, RX_BIT_CHAN(chan)); + stm32_ipcc_clr_bits(&ipcc->lock, ipcc->reg_proc + IPCC_XMR, + RX_BIT_CHAN(chan)); return 0; } @@ -175,7 +189,7 @@ static void stm32_ipcc_shutdown(struct mbox_chan *link) controller); /* mask rx/tx interrupt */ - stm32_ipcc_set_bits(ipcc->reg_proc + IPCC_XMR, + stm32_ipcc_set_bits(&ipcc->lock, ipcc->reg_proc + IPCC_XMR, RX_BIT_CHAN(chan) | TX_BIT_CHAN(chan)); clk_disable_unprepare(ipcc->clk); @@ -208,6 +222,8 @@ static int stm32_ipcc_probe(struct platform_device *pdev) if (!ipcc) return -ENOMEM; + spin_lock_init(&ipcc->lock); + /* proc_id */ if (of_property_read_u32(np, "st,proc-id", &ipcc->proc_id)) { dev_err(dev, "Missing st,proc-id\n"); @@ -259,9 +275,10 @@ static int stm32_ipcc_probe(struct platform_device *pdev) } /* mask and enable rx/tx irq */ - stm32_ipcc_set_bits(ipcc->reg_proc + IPCC_XMR, + stm32_ipcc_set_bits(&ipcc->lock, ipcc->reg_proc + IPCC_XMR, RX_BIT_MASK | TX_BIT_MASK); - stm32_ipcc_set_bits(ipcc->reg_proc + IPCC_XCR, XCR_RXOIE | XCR_TXOIE); + stm32_ipcc_set_bits(&ipcc->lock, ipcc->reg_proc + IPCC_XCR, + XCR_RXOIE | XCR_TXOIE); /* wakeup */ if (of_property_read_bool(np, "wakeup-source")) { From patchwork Fri Nov 15 22:33:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247173 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 076D81599 for ; Fri, 15 Nov 2019 22:35:01 +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 D61122073B for ; Fri, 15 Nov 2019 22:35:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GLc6bMui"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UcNOeX7Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D61122073B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=iOc9ZKtEpWTi9xhheLaHWeBpnnVMb2T6Eg4oagzGeq4=; b=GLc6bMuiRsRldqAeYL9DMsLo5Q Kb/HovRoW8UBdrnyIWJeHgeunNJxF9kVdKRiMNsklKNj2bS8Jp7D4BCFdw5NWbiE6PRtLzmBSJLlt HQogEr5OzLksiXOcTYOjvO+Uj99HQ9VcMGy1/sCq/Wi46j7xcnWV01XcZJgSAGeUcfmn8JZb9WLzK Bz9Ao0JB6/QVOJK6n3jcLlCA+bjY9ajwyETth5UIgEZkvIJmyiFCj41J4frDIu53WFc9C8lgRlLxZ UzbeCnsoc77nJkP/vp7ziznjTM/gZoHeMQpCa+rLhKGry69CDVO1AZlkgqnYTOJCobciYRx2yXAAk 6B2QFxSw==; 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 1iVkB9-0007vb-GN; Fri, 15 Nov 2019 22:34:59 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAE-00076W-GO for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:03 +0000 Received: by mail-pl1-x644.google.com with SMTP id ay6so5635197plb.0 for ; Fri, 15 Nov 2019 14:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pnStBG/T13CIghpMMY37iVdEqu6Tf6ypUdEca+Im12A=; b=UcNOeX7QeFUdS+8BsU3HT6dUr5DPakiIHn/4UvPOHLFYqY/K6ujtP4IZer6qWH4PsL kSBTMAw/WQgyxTxeo4ivek0tX/PV86dgJw0UkYo6ERIwQlFRePO6NKrAtfa6NCJ20W2O TsLzkBAGM6YB4DuaLNvOwjU3GdT2dzYF5IIKeZ0U3QUbT9dSuHzqJDl+QXBysh5SV+Ov lw25nX/7WiyUcJ5Xp4DrwnC0HKLo02gWkWh9DR0hT+OxTsQXWX6d6dxK8t070uRMMt9V r9oATtIcUAuwarcVv9V2aewPHt7avcTKRzk1AKnwfy3HSFUqXiDShEdVFb9swtzK8Huo 4nkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pnStBG/T13CIghpMMY37iVdEqu6Tf6ypUdEca+Im12A=; b=mH/ysBVpXZSr951LPYCEZtU6KBJPZ6QW/XRokfW2Ztp5MZ5TpBziO95Ae3RCrLT+B1 2CPR0bzXwhwx/xx9TSq7em+TEIRb3x6nx1qmY2YSUkJxMA8gajTYcMT9ImmTyNr19jVA Xm+NHFKsw1rNG04SeyKIUIDma/F3AZ8o5yPfV36PZnBEE0MzBdGCR0KMHGZKE3rUJRS8 rM/QCwUwZUtlSUEuiEcwDhbefR1bfsV46MVDgBz8vP9abZOrS4GeN+Cm1Rcb2MYEcZgl H3JFKC1ZstmZhGGULjaHHrlzJwp1dzzJhFog41A3cxwgrqIBgiO/jZn+FV2MrBaVIlxi tBRg== X-Gm-Message-State: APjAAAXlmmQDige/1uSBnQhQ36hhnlkFKXXX947ZnMU3H+VEXeGmX75C 35dP/kPu3WITwnH45GYyzsMRog== X-Google-Smtp-Source: APXvYqyUkVVN6TQZYe84qUdIeuFg+UeaXSpsS5sSY6gzAeOIOOHIRLFnS9NzrP3wYAkm6hhStgbJiw== X-Received: by 2002:a17:902:fe8f:: with SMTP id x15mr17473187plm.343.1573857240779; Fri, 15 Nov 2019 14:34:00 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:00 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 04/20] crypto: stm31/hash - Fix hmac issue more than 256 bytes Date: Fri, 15 Nov 2019 15:33:40 -0700 Message-Id: <20191115223356.27675-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143402_541059_23AFCDE3 X-CRM114-Status: GOOD ( 11.77 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:644 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Lionel Debieve commit 0acabecebc912b3ba06289e4ef40476acc499a37 upstream Correct condition for the second hmac loop. Key must be only set in the first loop. Initial condition was wrong, HMAC_KEY flag was not properly checked. Signed-off-by: Lionel Debieve Signed-off-by: Herbert Xu Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/crypto/stm32/stm32-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index 590d7352837e..641b11077f47 100644 --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -365,7 +365,7 @@ static int stm32_hash_xmit_cpu(struct stm32_hash_dev *hdev, return -ETIMEDOUT; if ((hdev->flags & HASH_FLAGS_HMAC) && - (hdev->flags & ~HASH_FLAGS_HMAC_KEY)) { + (!(hdev->flags & HASH_FLAGS_HMAC_KEY))) { hdev->flags |= HASH_FLAGS_HMAC_KEY; stm32_hash_write_key(hdev); if (stm32_hash_wait_busy(hdev)) From patchwork Fri Nov 15 22:33:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247181 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 43BE01599 for ; Fri, 15 Nov 2019 22:35:27 +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 0C27120733 for ; Fri, 15 Nov 2019 22:35:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ilGv7mr4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BmJCSnph" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C27120733 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=3M3/VCrxR+Bs+4Pa2Iy1ufWdDzRNnJXYjUp0nCgp8lo=; b=ilGv7mr4J59ivEYvvjkD3qNW/n Xis3InTYpAle2Q+9FhXxHciJ93j9tDuzYTG6r6IOcC8tFjOhqzXBarMNzDstrsn6hPTk76MwZ2VyE ngq0pAy8zL3p1q3/5VlzdkK09npOu1xZAKHjvilRmI/5Ej+Jb3BxA0a4eOaJ76FPMRtK7s/kYrnz9 d4Nx5C6amwGYD0X6tnNyabx//2bqZjIDhGy7uXDSz/y7mVmhDk6xovidqzEs7hdJVA4mOWT7qLy1Z fo+yUVoDGcD8Hk8ILGZY+++WcmTEYZnGW4r8SjGuGkVdIgdUU7ITEx4G16AHidM4nqNhGqwb6cTFi b7kMRyiw==; 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 1iVkBX-0000vu-RX; Fri, 15 Nov 2019 22:35:23 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAF-00077D-Ai for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:05 +0000 Received: by mail-pl1-x642.google.com with SMTP id s10so5638389plp.2 for ; Fri, 15 Nov 2019 14:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CfdEn/VOoyCYVCEhBtRjG/LrGez0kXMzdfAuimisWqo=; b=BmJCSnphEJxB/SJaEZ55rWx8UacuDIrgu3GGuKP9hxL0m0pDhN7q9J+QXmeNHU3a9S KcLpI35v0bQ7VN2vpFI89zIEmufoawp/UX+aj0AEhPZY1Ca6qiVHFhjEj/1Q6qpfeLYh gjoYQxSbf630RaEl3OM/6BIGdyMcJhAgPgaITE7CHkkMSKWyVALpX3aHE/rIyZ+534CU kKKAtB/FXySeSR4aPKIGgqnJPLZz5ZmoX7PLhvXCyZfRhjY/WwB2qknR22z51CDufEry KwJioKJ8hKDwJTr64gk0X3402S8pXsOhEqAEl6DeZUZcNxfDi9jgwWcFrfWjMc4Hltu1 UKjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CfdEn/VOoyCYVCEhBtRjG/LrGez0kXMzdfAuimisWqo=; b=dCCR3+P8oLkd0LXgMpEhYdIuS426B1JkjyRicy34hkg8fiLs4F4FbAhwHqTE6luWTb rQ2bY3MEq/C09fQcHW62V5XYZmQ5MfMp9qO8U71ZPq7P1pSQKTL73ouy6/DFiEO7nk3a 13QBlOltgCdb2RqNlkQHd/vaB1dzprEtAU1t/TvWyaINOgVYPC9FbLrvGL8CIlYswRSk g+Wc2LsqYLegeqKCv0PRqU8wxAOIPThXfSjnuZcc+vDv8kCX3oik3unaK2/N9N2dQDZv zZOgCWWgXEEQqhCswilwbrnSCEsGMWIn6xans3WA1oATAJzATOna8Q/j26ok/q53KTps GGRg== X-Gm-Message-State: APjAAAUnIivaciqwfqcBrCdGsMpifrj0+o6crCZmHWPL9Fkp1M1fGx/Q 6dkl0vwBAqC86voFNlDMRXv5Gg== X-Google-Smtp-Source: APXvYqxV4R6yv1yepbFn8bEoumDLXUwUoXHiD99iisQY+WW8LBhAQo0WSyIWj7l+f8Q8W16cGA2Gsg== X-Received: by 2002:a17:90a:ca04:: with SMTP id x4mr23087371pjt.103.1573857241601; Fri, 15 Nov 2019 14:34:01 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:01 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 05/20] media: stm32-dcmi: fix DMA corruption when stopping streaming Date: Fri, 15 Nov 2019 15:33:41 -0700 Message-Id: <20191115223356.27675-5-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143403_388562_07CBC837 X-CRM114-Status: GOOD ( 12.23 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:642 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Hugues Fruchet commit b3ce6f6ff3c260ee53b0f2236e5fd950d46957da upstream Avoid call of dmaengine_terminate_all() between dmaengine_prep_slave_single() and dmaengine_submit() by locking the whole DMA submission sequence. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/media/platform/stm32/stm32-dcmi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index 1d9c028e52cb..d86944109cbf 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -164,6 +164,9 @@ struct stm32_dcmi { int errors_count; int overrun_count; int buffers_count; + + /* Ensure DMA operations atomicity */ + struct mutex dma_lock; }; static inline struct stm32_dcmi *notifier_to_dcmi(struct v4l2_async_notifier *n) @@ -314,6 +317,13 @@ static int dcmi_start_dma(struct stm32_dcmi *dcmi, return ret; } + /* + * Avoid call of dmaengine_terminate_all() between + * dmaengine_prep_slave_single() and dmaengine_submit() + * by locking the whole DMA submission sequence + */ + mutex_lock(&dcmi->dma_lock); + /* Prepare a DMA transaction */ desc = dmaengine_prep_slave_single(dcmi->dma_chan, buf->paddr, buf->size, @@ -322,6 +332,7 @@ static int dcmi_start_dma(struct stm32_dcmi *dcmi, if (!desc) { dev_err(dcmi->dev, "%s: DMA dmaengine_prep_slave_single failed for buffer phy=%pad size=%zu\n", __func__, &buf->paddr, buf->size); + mutex_unlock(&dcmi->dma_lock); return -EINVAL; } @@ -333,9 +344,12 @@ static int dcmi_start_dma(struct stm32_dcmi *dcmi, dcmi->dma_cookie = dmaengine_submit(desc); if (dma_submit_error(dcmi->dma_cookie)) { dev_err(dcmi->dev, "%s: DMA submission failed\n", __func__); + mutex_unlock(&dcmi->dma_lock); return -ENXIO; } + mutex_unlock(&dcmi->dma_lock); + dma_async_issue_pending(dcmi->dma_chan); return 0; @@ -717,7 +731,9 @@ static void dcmi_stop_streaming(struct vb2_queue *vq) spin_unlock_irq(&dcmi->irqlock); /* Stop all pending DMA operations */ + mutex_lock(&dcmi->dma_lock); dmaengine_terminate_all(dcmi->dma_chan); + mutex_unlock(&dcmi->dma_lock); pm_runtime_put(dcmi->dev); @@ -1719,6 +1735,7 @@ static int dcmi_probe(struct platform_device *pdev) spin_lock_init(&dcmi->irqlock); mutex_init(&dcmi->lock); + mutex_init(&dcmi->dma_lock); init_completion(&dcmi->complete); INIT_LIST_HEAD(&dcmi->buffers); From patchwork Fri Nov 15 22:33:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247189 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 92A061393 for ; Fri, 15 Nov 2019 22:36:06 +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 6AFD620733 for ; Fri, 15 Nov 2019 22:36:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MPUdvURB"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="k7kBlMxX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AFD620733 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=+OtB1XHIX0LrqBLUwHdY+FMJxgZ8Z84Sgq+ppBgA3+A=; b=MPUdvURB9U1AEZxp/aN7LhHinW UCske5wii3ZbR4E5/XZpYqf3faNXK9SyTs62foum7OUdRBBNq72N+kpAlabD5ia3NwQBqflctZKrz /UvwQVrOcghRBmffu8q1sgYjBm6xeQXuJGd2CByZxD8Cwm67arJTwE7OhACyC0sdeuj7Oi1q/p3qB eRqvKujpqcjghKjMF8vwWINwBBmKWMSMuWz27m4WeWJsPKqmueHlRFBPYiEr08PfUqEYxegNfihky PwmNFzhE73wvw4WkcQUM/UfurPipU4v8kQhIG1hFGCLP44XUq/OvAak4Yyw+82aqIhhtaOWDbcy85 hPIm0nDA==; 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 1iVkCC-0001U5-0V; Fri, 15 Nov 2019 22:36:04 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAF-00077d-Cp for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:05 +0000 Received: by mail-pf1-x441.google.com with SMTP id 3so7322592pfb.10 for ; Fri, 15 Nov 2019 14:34:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6V0ioyUbzQMXQMBXE7qcEPEwz5yqv4QBePomZ4UZPqc=; b=k7kBlMxXsG6gA/UcmlwTDggZ65v+ipn3YUceSw3Oegz9WKEnqSckQYHfAT76F7fPjN s7QKdRMaRPqZFZSI/xOc6FPxjFzbfDiSqxO16UNRWzwpNND4qj7rCnHyntrgf8gWE2+b z31khVZDNGGcS5gNaQpHfSp84XhywQ1G5jrK5dsnXgm8xzY2Bttagju6GbfsQCuUz1t1 a1jGQru7049kf1xVk9PcTip/XRGMTQ3ZDi5E07+5EowNcQ7XYcGxNTDsz6/vv89SFEC4 rOkGhyiZz4rpSal4odmYlyBahCIUN9rZMet/cta0i71K0Th0xdUbgnAkFRClk3lff4d1 /chw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6V0ioyUbzQMXQMBXE7qcEPEwz5yqv4QBePomZ4UZPqc=; b=I4QhlcyTiPLby3RlHe9+L311EY5oEnQ+iC4UNainISCi4JknY7QTxIrMv8aB+1x6kN jqqZJTTZn+ENGY43DZaRoeV/GVg1xNUzUG/uICEIfIW+Cvnl7ntoiv+XmoKrFS5ILG0A k4e6BdHj8ZeVWRPzCyNNDyONqyQ9VidbeYUKKzicZDLkPLOy87PLEblBeZKIqRguYzgY B5tVY+7Gy+sFVD6nReB5JyORLYiDaDP1vovo5xWIm+O0jJ9xWOkMZg277mZ8+F6q8j99 0Pk2DVoEnVipxnVGbrUInqIUcLV1uGBWbVyrVCXjeu9x/vBS0CaRlRxtUAmqm7xm68cw SR9A== X-Gm-Message-State: APjAAAVogLkPkzwwSX1hFfODgyyZ9oBsfFB6REhZVqp2dVGwaogU6rLQ GC/SpOAWGMaNAMCB5sb/UUac8Q== X-Google-Smtp-Source: APXvYqwPDrxT0ltVk6U0vCs9B/kupiJwArvMyWvfpOn2zdkBUlstoIR7TdNRADNMqnuUZbeIdUbysg== X-Received: by 2002:a62:1c8:: with SMTP id 191mr20454995pfb.152.1573857242567; Fri, 15 Nov 2019 14:34:02 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:01 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 06/20] media: stm32-dcmi: fix check of pm_runtime_get_sync return value Date: Fri, 15 Nov 2019 15:33:42 -0700 Message-Id: <20191115223356.27675-6-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143403_439238_6189F25B X-CRM114-Status: GOOD ( 13.67 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Hugues Fruchet commit ab41b99e7e55c85f29ff7b54718ccbbe051905e7 upstream Start streaming was sometimes failing because of pm_runtime_get_sync() non-0 return value. In fact return value was not an error but a positive value (1), indicating that PM was already enabled. Fix this by going to error path only with negative return value. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/media/platform/stm32/stm32-dcmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index d86944109cbf..18d0b5641789 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -584,9 +584,9 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count) int ret; ret = pm_runtime_get_sync(dcmi->dev); - if (ret) { - dev_err(dcmi->dev, "%s: Failed to start streaming, cannot get sync\n", - __func__); + if (ret < 0) { + dev_err(dcmi->dev, "%s: Failed to start streaming, cannot get sync (%d)\n", + __func__, ret); goto err_release_buffers; } From patchwork Fri Nov 15 22:33:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247185 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 DA76D1599 for ; Fri, 15 Nov 2019 22:35:46 +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 B820E20733 for ; Fri, 15 Nov 2019 22:35:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BN7e0Wd/"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uq0Rvs0K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B820E20733 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=4JsuhbnQc6LeP92E4P+0A1erB43bf4rVh7Pjz41h7M0=; b=BN7e0Wd/1x7V9u/ax+0T9BeTWv t5NO59xHaMKRl1/ShnyAqK+mvSOrskSVh2H8b892WwDwrlGjTc+TRtuIi1JVltTiebUWe654wbAS5 QE0yRnbnpD83t0S7+84dP1uOA/JCpQ2RVzXxwwNNwndOrT6E6w++0VW7ohOZJewBE+b1P/xoy1D4B aPiSzvcMEoBqpXBik4a7PMWzDB3hH59wUsK+wBwzLPTR4eXueT9b5vVsSDgxJWQi+lvDSlBfTspY2 V1pbF/8A30IjLqSvrBsSn58OAcR7VmenLrXSLvPLCReNW5FucsfRHUA8iHM8/SFHDY02l/6JyoEEu xUB1ugOA==; 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 1iVkBt-0001EG-7o; Fri, 15 Nov 2019 22:35:45 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAG-00078X-7k for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:05 +0000 Received: by mail-pg1-x543.google.com with SMTP id l24so6604472pgh.10 for ; Fri, 15 Nov 2019 14:34:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=I8DYLlgbe7crhAhNbwNPqGy2McaZWO3AECdzJYJCCco=; b=uq0Rvs0KPR5i9HtlAfbqJ09ftst7366sxovqlgQSCdSMlx7zsOEFlsXzxIZ/RFJepW +xNmN50KWjZEmZ4ahwYGYncO2oNSlvlk9+bSZ0uJj5KwnzYGnYwwpJh3Z0U0CVVPUgeF WBek2r2DnpcVe5urx/INF76BoO8wqFwuN86lGWJuCvpErfOgoUCoWWPI37s5pI2Uuw9X OEj1WNleT7NOb7K1+oFm34vXUlCdixUaNsyhZrrKKyzZ34tRHBi5jpoqITPilNH4uc3A cG9Aay+Ra1kWvl+WOeF5ifVv++jVQtvf2AnAcuQ92MtUnevyPsRG5Pf0brxRmVhP9TbT u6bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=I8DYLlgbe7crhAhNbwNPqGy2McaZWO3AECdzJYJCCco=; b=HDiPq44u/39K+NBZ6eWAwMPr7aEk0xMJgaR+hEHwJXLM6zRyQ3AoWNcA/Qjz8D0Hlz 3tApJmjr7SbiuaPJNDzV5gUrfIEZ1e5Cxm6AZv+vTQP/HZrNS+xt4YL1xmTJVuwQFnjt 5fLE3xXfNMBZFMn7Bv+mXc2ip+oK0MDgz9GfDCBivhsFH+VPMPgWKPu+9Uqrojnr4Y27 AQyF7C8fbT8k0GPyPe0pjWdLgezZcA2nzxpAfbMQHScKAXJ7mgVBbLyOXkRSuAkQj/WK rnoOuofCYgYsAVrJKRa2RtGJXe6gFdSjy8peKOMOHaFkhJpNvGYnG2i4M85vZwGTD9lb mhyQ== X-Gm-Message-State: APjAAAWipS2Va1f9Cdd+3VEIrS6spcAvrr9maSjAd8Yl6PfLebeSr4PO hFPUC8QgPWvLS1clAjUDJGbzRhfe86c= X-Google-Smtp-Source: APXvYqytHqdgYw+McewKp6L1IK0RR+uPnytQnNFy3RGnQfrkQ+RNzORO54L3aq41JZ6v3SKIJheJ4A== X-Received: by 2002:a63:2e01:: with SMTP id u1mr19770443pgu.25.1573857243342; Fri, 15 Nov 2019 14:34:03 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:02 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 07/20] hwrng: stm32 - fix unbalanced pm_runtime_enable Date: Fri, 15 Nov 2019 15:33:43 -0700 Message-Id: <20191115223356.27675-7-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143404_283102_A945F629 X-CRM114-Status: GOOD ( 10.97 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Lionel Debieve commit af0d4442dd6813de6e77309063beb064fa8e89ae upstream No remove function implemented yet in the driver. Without remove function, the pm_runtime implementation complains when removing and probing again the driver. Signed-off-by: Lionel Debieve Signed-off-by: Herbert Xu Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/char/hw_random/stm32-rng.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c index 042860d97b15..37b338a76ba4 100644 --- a/drivers/char/hw_random/stm32-rng.c +++ b/drivers/char/hw_random/stm32-rng.c @@ -169,6 +169,13 @@ static int stm32_rng_probe(struct platform_device *ofdev) return devm_hwrng_register(dev, &priv->rng); } +static int stm32_rng_remove(struct platform_device *ofdev) +{ + pm_runtime_disable(&ofdev->dev); + + return 0; +} + #ifdef CONFIG_PM static int stm32_rng_runtime_suspend(struct device *dev) { @@ -210,6 +217,7 @@ static struct platform_driver stm32_rng_driver = { .of_match_table = stm32_rng_match, }, .probe = stm32_rng_probe, + .remove = stm32_rng_remove, }; module_platform_driver(stm32_rng_driver); From patchwork Fri Nov 15 22:33:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247191 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 DDBC51393 for ; Fri, 15 Nov 2019 22:36:20 +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 BA2B520733 for ; Fri, 15 Nov 2019 22:36:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lcUkS5z4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ypkIu9Lp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA2B520733 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=REvNrhMn1QEP1QirlnzNqzbB4B/ai/fcMAGINQpzg8s=; b=lcUkS5z4N0gL5XV229BmxL/R9z Al1cIQTHUtsFn08O+bLeCPbKOOWCwyqqQ4ZvC2GGwEanpDt48DJENALBJqtI3PrvGbHSHV5Epk7zM mAFXqJjwTMFlc2X3YhHH2KhQLn4j1ihfe1Gdas0ApOI7ZTTfoP7DdAqJxAPqa438zNyfvgBQ9jVmw R1Xl0OEHWSFKZIbJWjoCmegFoSqUa1E6Y6+9arm/iBNC05Lki4PkxdV5UHPvvQYgWgGJRIw1lncWk oRys7eph1YfnhEsEArtEjD+SGQag6S9kw9xex1wACZr9L4ynteLBP/bNh251WiwMdY4aiJZQC01ta Qf77MPbw==; 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 1iVkCP-0001gQ-Uv; Fri, 15 Nov 2019 22:36:17 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAH-00079V-4o for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:07 +0000 Received: by mail-pj1-x1042.google.com with SMTP id y21so159592pjn.9 for ; Fri, 15 Nov 2019 14:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HUM10/8Wh+ACpH8iy+zYVazM7/j5x9SwSLUXvaHdtoE=; b=ypkIu9LpYzuilaTSO1ddkj4eAfzXCWg5IShx48OXs6BvHNF3e7+rx/03wNN1tYaleh SnZM8RHGgSNVrsmiwniMNuQyH174+xgl/q4FEQxe7UVXDuVhTtT/3TIahPM8bt5ZmH3+ ud8Eos51tOebTw0Y0mq1tqIEY0ssGv6FbVUe9ALZXTAWJPcnpmI7iUshmshcvm770Ayk jRwA1AXpceNmz1E6uqRFqcGSLc2lSSfvePTl8s/unV8Lzx+f9sx/TSGf3xflzHr4szxN BXuLl9NHzQ6cEOZbYvbeYcQ1U5te3v0DNBTnZ3Ab2FwTA3bfYQBRlEMA2uNi2PTy8N92 PCxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HUM10/8Wh+ACpH8iy+zYVazM7/j5x9SwSLUXvaHdtoE=; b=DNUaOzWcBbG3+pdAy7K8AMU56oVSOzwMgQtwazTmY3nKTjzSfS7sLd27NRPvyweYCW lhtFVYzt1I121TCSdYAHekKSpRXEKomZKgEKYpIX5A334m2AIHyV7VT6TYmEfEP7O8q6 anfP6E5eX7n/eANNX6mbINm0pDvj4iHV4XdCXAn49l5+PUnLhZOscC6JK1S9lhj8DqVs xvgaRmdVuJU2azVZKVP9OJ1bboDS4UIWVpGTrwlwsH1u2/1x8H5g2HGyKpcId0CedZnT ERIlldmVoHb8pMRdcDQ8lAwRtD5X7+pf2bGb0hu6kbnUUQNDnG0wifeU+UUX6tWInToA yTgA== X-Gm-Message-State: APjAAAW4LOY3FXl/iREgm/NY8zrl8NqlsDjoovd3v0X2r3RHbnna9mrT 5yqBWJ9V+7E96gpUH5kldqAayQ== X-Google-Smtp-Source: APXvYqyMzfmiYdBbALgyJW/Yz44XD67/vMuUxQ8EgtUszaDCbgKhRiI6HNcF282zphiYMjPaFRLwFg== X-Received: by 2002:a17:90a:256f:: with SMTP id j102mr22689164pje.124.1573857244238; Fri, 15 Nov 2019 14:34:04 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:03 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 08/20] remoteproc: fix rproc_da_to_va in case of unallocated carveout Date: Fri, 15 Nov 2019 15:33:44 -0700 Message-Id: <20191115223356.27675-8-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143405_189789_22E86737 X-CRM114-Status: GOOD ( 10.33 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Loic Pallardy commit 74457c40f97a98142bb13153395d304ad3c85cdd upstream With introduction of rproc_alloc_registered_carveouts() which delays carveout allocation just before the start of the remote processor, rproc_da_to_va() could be called before all carveouts are allocated. This patch adds a check in rproc_da_to_va() to return NULL if carveout is not allocated. Fixes: d7c51706d095 ("remoteproc: add alloc ops in rproc_mem_entry struct") Signed-off-by: Loic Pallardy Signed-off-by: Bjorn Andersson Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/remoteproc/remoteproc_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index aa6206706fe3..af9d443e7796 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -183,6 +183,10 @@ void *rproc_da_to_va(struct rproc *rproc, u64 da, int len) list_for_each_entry(carveout, &rproc->carveouts, node) { int offset = da - carveout->da; + /* Verify that carveout is allocated */ + if (!carveout->va) + continue; + /* try next carveout if da is too small */ if (offset < 0) continue; From patchwork Fri Nov 15 22:33:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247193 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 539281599 for ; Fri, 15 Nov 2019 22:36:41 +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 315832072A for ; Fri, 15 Nov 2019 22:36:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rWpSTzMh"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="a5q+0xMs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 315832072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=xauFeyqlGBU8cledy1D83ODj5YtuCT0Kc+XHcJm4SaE=; b=rWpSTzMhZNRy+m8LyHh9I6tPWh GD7OORFIf94+RlpaqO4R9esvNNenxnCcinil2rhYc1jbKcvrqnbZD/Ku5Es7Ebd8MRrqoIzLRHxmH cuyz8Q/j+BvqZZBvgGPtWyMs85HfNXQw/efz0gOM8ugbUmQtkboOo6eHbXOkQO+Ks29W/iZzX0dnj mu4UzV4igj9nj8YA1DNzhjnPePS+sODHRMBW5cykpgtM1GH5jB6XAvH/WCiRh4PCu5/ztdN6hPcNu 2uHXijNTDM2sK5iywh+RERfe2Vi6MVoicdYOBWjrwtyi1cvSIX6OY/3vaEFu8/oXgq0myZezELWKO gri0RD2w==; 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 1iVkCi-0001uc-35; Fri, 15 Nov 2019 22:36:36 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAH-0007AW-Rg for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:07 +0000 Received: by mail-pg1-x543.google.com with SMTP id h4so6617159pgv.8 for ; Fri, 15 Nov 2019 14:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XjmHZ2r/4EcW1pjM4Rd69/tyPSpvDzWdjKn2vf5w1qY=; b=a5q+0xMs8tIeJh8UJ8TVx8rZWUYZ16E5HxEnB0bRUqdlVxfqcyrfWViLr9Pn7dJisY VqRFpH8/EN3p18o/KhB6P43Ky8JCimROhKeXLcPYbCV9IN4oJ2CVylJtMtP7qfwro7o7 SxdF13uvII4gAOlurEJrm50rCXFufEWhRyX+jcjvLDDHPbDNOBjiwTeiV6mHv4gY2lCf v6zbwJPxmKb/vDqIU9Wohh6rRB9E8a5QwUHIEM0ATxuwA7uLwKPIO6cIdiBE5ysfdmSV afv+gI97KSg+6usaoQb/OTeraFQQt+e/l1ahp52XQnTElIh1w5nC/Zk54P7lMFFDyeem GE7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XjmHZ2r/4EcW1pjM4Rd69/tyPSpvDzWdjKn2vf5w1qY=; b=elWBAomW+eeJd/FioTFnkYA4cODnALijHKcBch6AdUydpDuQSHmXSptCn/EDW8GG+Y S4mhI3FdPxzrFQgqvAJnCKrxYyf/BJYcB5A42YUJjSmHJriRfh+4LCnq8l42vyCTu8ov 30uooU8dxzvjkTxU+Fe9Q/W1Fg68ewfcCQZAmx3UfH47MZ9Fhj/MIg95r8iCGZ0qTjWi PLKK5jGLTxd++Atckglol0WmFMzMxmdNbgHXZ4byo4MGvO6qmy++jPThSRT/pBLGvx01 0hvcYF3FkYsU/VHSxLTzE/56u34wdxVPvKPiy43iFme1Cp2rL0S9sSSgNLMD6m4+7mZS oUHA== X-Gm-Message-State: APjAAAXE2WGAGoJGSgy629Sg3NE7e7ysJa3Qbul1gBpF7Z3elh6VBCED jk5O3xc4rmKZREst8jLvtOZx6w== X-Google-Smtp-Source: APXvYqx5QjFoyTLodbBskheBnK+zVxbguR/K9b4TV6wtQaQaNjBS6bpq3F/W36BhzlJQbuO0lG4qiQ== X-Received: by 2002:a63:181f:: with SMTP id y31mr18239880pgl.186.1573857245156; Fri, 15 Nov 2019 14:34:05 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:04 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 09/20] clk: stm32mp1: fix HSI divider flag Date: Fri, 15 Nov 2019 15:33:45 -0700 Message-Id: <20191115223356.27675-9-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143405_995175_FE95267B X-CRM114-Status: GOOD ( 10.95 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Gabriel Fernandez commit d3f2e33c875de5052e032a9eefa64c897a930ed1 upstream The divider of HSI (clk-hsi-div) is power of two divider. Fixes: 9bee94e7b7da ("clk: stm32mp1: Introduce STM32MP1 clock driver") Signed-off-by: Gabriel Fernandez Signed-off-by: Stephen Boyd Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/clk/clk-stm32mp1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index a907555b2a3d..d602ae72eb81 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c @@ -1655,8 +1655,8 @@ static const struct stm32_mux_cfg ker_mux_cfg[M_LAST] = { static const struct clock_config stm32mp1_clock_cfg[] = { /* Oscillator divider */ - DIV(NO_ID, "clk-hsi-div", "clk-hsi", 0, RCC_HSICFGR, 0, 2, - CLK_DIVIDER_READ_ONLY), + DIV(NO_ID, "clk-hsi-div", "clk-hsi", CLK_DIVIDER_POWER_OF_TWO, + RCC_HSICFGR, 0, 2, CLK_DIVIDER_READ_ONLY), /* External / Internal Oscillators */ GATE_MP1(CK_HSE, "ck_hse", "clk-hse", 0, RCC_OCENSETR, 8, 0), From patchwork Fri Nov 15 22:33:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247195 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 7BACB1393 for ; Fri, 15 Nov 2019 22:36:54 +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 597822072A for ; Fri, 15 Nov 2019 22:36:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GbFWz/LL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tD6THbMU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 597822072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=DA9xp8nJaqN32b1xIN9rLjyC2xS0xg7nd4mVWiPhplE=; b=GbFWz/LLJK5sLUzXu0qMcf6gEW WTkf+uVZ44fJz2qKDaVynzGKe/Tuxi1rsRzpc9DC98shaIOEaheuAVnA8txuZEIsNN9RCCl6NeqS7 1iv5o23oPV4XTKtVlWEZfkcL5HsPfnLZUzCDFcn+qXVIII4hvjLLmJ28cTkReQgGiBMBpfEgh8lxq WIIVN1c7g6ZX54KlaCkE5y9KUFgoihFvMbv3UcEGgRXutSXoTgqGlqB6zRa7qcy3+WZKj7aSYr/16 x2iu0coTAr4AMfoL8Yr+UrpGjcGwvZ4048a6x2v6KyQzI6Y9Gt4izoFLHlwDcNb5HJqw45sx/tR63 +KoM68Dg==; 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 1iVkCy-0002AF-Fp; Fri, 15 Nov 2019 22:36:52 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAJ-0007Bb-3Q for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:08 +0000 Received: by mail-pg1-x544.google.com with SMTP id h4so6617173pgv.8 for ; Fri, 15 Nov 2019 14:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JeAIVfldLUVTvSXCSoIJcdwhrHS7EelSGWycmLvcpHo=; b=tD6THbMUpRjMLKRy7mjdFZRPWf6FlQ9n8BkmlAuG3KvMrw6+4glewlNU998SaSVKF8 K1uXfh+VqFX7pN5G1dMZ+PDt3sdSRJUjziV9sIlmfI6iD8wG/dc3DBFAZQvyjct+zTae JDTIYU6eMfFwrytgreUfC0TJi6nwhYOUbr1NUKRqk7A/JJCsETttQq2N/aTbs7oVKz/B 5ePF67K4RWaW231sXOBynfpzKnZ6ZoDkZIG30ycvhJ8hI5uGb0Ulrf+yNIWs61bJjyiw PC/6KEg/oqocsQ5/U1x6oZnJpoTwp0Y67DPWOBkJQ5DYuPj8gJIctO4Awi8svthRg6rH TAlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JeAIVfldLUVTvSXCSoIJcdwhrHS7EelSGWycmLvcpHo=; b=U341wPbwaHjP5Rk8ZLig5dWMzdFB80+Iff24DA0pGgpPZaRduYUIkJpGLdUaqps+RJ PmIiXASFOlFs0jMdaQ1WSybCFLpLzBNVGyjdy6+aMYW2zDr7oIhlFI3BMi8Rc75A4xgp n9OwbSSaXr8Ru6l+dTCly3EMkiD3JsBLlysf7EkKgISbIFRGL6ZZ19xSyzU7oN5gjmVx GNi97XuRvpuotIOMez+9R+DeF/ZFn0Ykfv2G7YZSN2qaSXBsfGPDtKKDYsh4MS4URnoq yN8bd+iLwZxvoDFisJdqcyU/V0anQB4KdjUSqrs6rr5tpuecPCQLkTTaRgRwEa8DFzjZ warw== X-Gm-Message-State: APjAAAWiTB9/MNFqy1u6ROZkPLbI9raKxIHmB+W81YJK+GckYy6py6ib telTR9T0dZmW+jOZ7OFT2iIN9Q== X-Google-Smtp-Source: APXvYqxEuvWJPe5IPrGR1qUJFfqVEooRRTzfUt59swIGQbMJtrGOpHkD3l0yKEsEFfb7ErCC6auxCQ== X-Received: by 2002:a63:6c4:: with SMTP id 187mr19457722pgg.421.1573857246083; Fri, 15 Nov 2019 14:34:06 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:05 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 10/20] clk: stm32mp1: fix mcu divider table Date: Fri, 15 Nov 2019 15:33:46 -0700 Message-Id: <20191115223356.27675-10-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143407_158085_F521253F X-CRM114-Status: GOOD ( 11.53 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Gabriel Fernandez commit 140fc4e406fac420b978a0ef2ee1fe3c641a6ae4 upstream index 8: ck_mcu is divided by 256 (not 512) Fixes: e51d297e9a92 ("clk: stm32mp1: add Sub System clocks") Signed-off-by: Gabriel Fernandez Signed-off-by: Stephen Boyd Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/clk/clk-stm32mp1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index d602ae72eb81..851fb4e9ac44 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c @@ -269,7 +269,7 @@ static const struct clk_div_table axi_div_table[] = { static const struct clk_div_table mcu_div_table[] = { { 0, 1 }, { 1, 2 }, { 2, 4 }, { 3, 8 }, { 4, 16 }, { 5, 32 }, { 6, 64 }, { 7, 128 }, - { 8, 512 }, { 9, 512 }, { 10, 512}, { 11, 512 }, + { 8, 256 }, { 9, 512 }, { 10, 512}, { 11, 512 }, { 12, 512 }, { 13, 512 }, { 14, 512}, { 15, 512 }, { 0 }, }; From patchwork Fri Nov 15 22:33:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247197 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 0BB271393 for ; Fri, 15 Nov 2019 22:37:12 +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 CA5112072A for ; Fri, 15 Nov 2019 22:37:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="u03sZfYL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pM8P5t4P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA5112072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=zxwgVraOA8LvsoZiJXc5dq9TSRxj/aC3iGRRkT7Nhtw=; b=u03sZfYLKAK2e9spqXswl0yyov xjAegryuZyIgSrJq7Sc7Tsbry1mBMHUlVY5wruFvtwPpXwatv3azYlxKCnp8ltfy5un2F30T/FSCQ lEcKKJr7MltMa3yh2Y3aSxvMwec2AK59N8clO8igssF/hMmBCuDI7xDFW54VncHoxejDxYOFByUeI XQAmxbuBzOD8gVCDE/yC0GevmR+T3SpK2t3Z3Exj7bfEhokq+jZ1n3U1rvDsW3HaUdegMVnrBsWxd isSA/SPb9+sXS+y0WGqM3qYewtwOzcEUQlaB+izjyPRVZ0i3+5OtJawrxmX/DZlVWdhJXqZ7QiRt9 2Mkv9KAQ==; 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 1iVkDE-0002Nv-5P; Fri, 15 Nov 2019 22:37:08 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAK-0007Ci-1O for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:09 +0000 Received: by mail-pg1-x541.google.com with SMTP id f19so6611817pgk.11 for ; Fri, 15 Nov 2019 14:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/sm9ffuHyQlqHKvL/cAQ/Bj58CBN3LS1S5BSazdWb9s=; b=pM8P5t4PtpN4KMbwNUNzh+mn2x2kH6Il5JxeWrKcKQ8kx58doVIPMM4rtWksFJl4Yi xpsRjLEis5CKrLOAjaRS2tsUqYI7mBV7IEsmC35MdUVzIJq1+U59yl5C8M/5ckGv0OO2 WsTXDoKyWjG+RTKzRIP3NmhG82iAuiyJHdHZJlXS2fg0egy7r7NhIwEmTwuwZI/snEuz HyEtEYXEheT/4bI8e0D8VFssUGtO3ESnWqkrCqal5Bv0wWXjt+RLeWPfWKS2b2ElEOdH b5dok1fcKq2xCkY6DxuuptOWNO3qxCRJOsuscR83yFKy8B3Q3vLeQv1yOg9D+rhmxnPG /v0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/sm9ffuHyQlqHKvL/cAQ/Bj58CBN3LS1S5BSazdWb9s=; b=LyKfXEbpGSfMIcan5ZZt1C8/r4hS82ji9D/tj32BnM7CfBR63bCsqA2eBdtVF0jwC2 sX6mC0afOx//N5SOod4T4bIWNoKCOt92tUAGFzoieahzMT7uxOtkcc02rsjvrYmR45Z+ 22GVDKXublIaP5JV7bU7t3OvkCtLjR467FAbbnXbFC9nnmfgUMRWa99w0lSRZQ+5dfPi QjZN4UCHXB+p7HV9lD12iZ37a1iseuYn3NQkRkdMiTq50h8/gAhY6suiByAfKlMkpOHd NWMy7Xn08cBjfD6/PFAdOHNONeOJUuLmHLT89jjupgkIpj9XL/iokQ0F8nkjQzClvPnN G64w== X-Gm-Message-State: APjAAAWD/9+8CdedtNwsVkkaNBgbySQqQ8iDCAKr3MP9ibOEKttP8OPl bvzKYnxTqgpcLSPiJekDSTCP6A== X-Google-Smtp-Source: APXvYqxhiASeIh6AbbOCOM1G3JW5aTZMnQlTM00qyXfaFHU8biTlEeNgh5n5hJS1PlX3q3qN6XW4ig== X-Received: by 2002:a63:9247:: with SMTP id s7mr19675322pgn.334.1573857246932; Fri, 15 Nov 2019 14:34:06 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:06 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 11/20] clk: stm32mp1: add CLK_SET_RATE_NO_REPARENT to Kernel clocks Date: Fri, 15 Nov 2019 15:33:47 -0700 Message-Id: <20191115223356.27675-11-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143408_139181_2CAEF043 X-CRM114-Status: GOOD ( 11.58 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:541 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Gabriel Fernandez commit 72cfd1ad1057f16fc614861b3c271597995e57ba upstream STM32MP1 clock IP offers lots of Kernel clocks that are shared by multiple IP's at the same time. Then boot loader applies a clock tree that allows to use all IP's at same time and with the maximum of performance. Not change parents on a change rate on kernel clocks ensures the integrity of the system. Signed-off-by: Gabriel Fernandez Signed-off-by: Stephen Boyd Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/clk/clk-stm32mp1.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index 851fb4e9ac44..8e25ed62f67b 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c @@ -1286,10 +1286,11 @@ _clk_stm32_register_composite(struct device *dev, MGATE_MP1(_id, _name, _parent, _flags, _mgate) #define KCLK(_id, _name, _parents, _flags, _mgate, _mmux)\ - COMPOSITE(_id, _name, _parents, CLK_OPS_PARENT_ENABLE | _flags,\ - _MGATE_MP1(_mgate),\ - _MMUX(_mmux),\ - _NO_DIV) + COMPOSITE(_id, _name, _parents, CLK_OPS_PARENT_ENABLE |\ + CLK_SET_RATE_NO_REPARENT | _flags,\ + _MGATE_MP1(_mgate),\ + _MMUX(_mmux),\ + _NO_DIV) enum { G_SAI1, @@ -1952,7 +1953,8 @@ static const struct clock_config stm32mp1_clock_cfg[] = { MGATE_MP1(GPU_K, "gpu_k", "pll2_q", 0, G_GPU), MGATE_MP1(DAC12_K, "dac12_k", "ck_lsi", 0, G_DAC12), - COMPOSITE(ETHPTP_K, "ethptp_k", eth_src, CLK_OPS_PARENT_ENABLE, + COMPOSITE(ETHPTP_K, "ethptp_k", eth_src, CLK_OPS_PARENT_ENABLE | + CLK_SET_RATE_NO_REPARENT, _NO_GATE, _MMUX(M_ETHCK), _DIV(RCC_ETHCKSELR, 4, 4, CLK_DIVIDER_ALLOW_ZERO, NULL)), From patchwork Fri Nov 15 22:33:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247199 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 1BEA91393 for ; Fri, 15 Nov 2019 22:37:28 +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 ED4D42072A for ; Fri, 15 Nov 2019 22:37:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NDaisPuL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wCXxmzT0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED4D42072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=4utlUvjESTbom57ZQNSlQTT2lIxUo1HS68Hgv5zVVXU=; b=NDaisPuLsAhCIbUx1NQtLRZ+Kl OyPOASKky3RYS7EEv51/q3Zbj7eFZ0YaMnmEC1SYhqQo+L+RS8KgM3y8fa9ELJtaIv85F93d+SbIe BUguPJRCRqrkF7QosKusMionbUBJjfbUfMc83dlIK6qvTJN7GuCz4df8GBgvySGHXMqj2X3WrGJ4u pYh0g59Dg1NR3aFjAiBFQBICw2mxJl9T7vto2U4aiz64CIbLy6/RpzwspGixNXxaapuQ9QWgMtXEv 6RCmUxHLIs3OPjPgyOLcxLZNVvw2GP9VPkW3wg5GKJo+FQb/6gBf4+RamrszHaAL9a/Fw9qlpysMF g7bbGqxA==; 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 1iVkDV-0002dY-RM; Fri, 15 Nov 2019 22:37:25 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAK-0007Dv-Sx for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:10 +0000 Received: by mail-pl1-x642.google.com with SMTP id w7so5613682plz.12 for ; Fri, 15 Nov 2019 14:34:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SMtnKN7Gs980aMHU7BQIQVC2axVHuGxWT+FltL2atao=; b=wCXxmzT0A12PK75MA7nI5jP3tzVW7exsIlZfw+O4eheNL+D7AfmnLUW8+DHy3zzCoT imMdV2IXvTuA9H87PHWJW7BZ1JaN+ZUEYeS1ckOpd7oZ3DKkU8RpBCqa2RgFFtzBhNZU ubWEC8OF8SNb4i33w0ag7PZ9+KXkkiLBpSiR8p8JVqGpc8do+Et/ECFqhKV6FcfSU3Nh BWJl4PpK/32Mi9tIt4EMVAKhaOdIDWTuc68utfJ+H1UFMvl17WpD2yq4hpv84JrGpbIR eT68K8VM6j8kNRxR3gmZWlZI61FuWTkCKyr4/74coj9MYpZ8Iqm7O94Yr4jv9UntJTk8 OazQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SMtnKN7Gs980aMHU7BQIQVC2axVHuGxWT+FltL2atao=; b=N4HSyZ7sV1gDlquyivR+GuTnR4t+3YbLHcjI08a1dILvsILh9WbJSt1vTxR34SDlpn fWQg491tpbSCeIphNpx9idnr3tKnExtGpy4IquTQEmSclLuwts+vgqoBvmgSmYwcPkRd H7TrIafJb0Z/tM+tYMq+Mf0Mqykp9N4PlNHPF7LodZbJ4Yb75TtGbsJ62rdRH13tMTLy xVwWkl0cSh1Zdk0TpisuwpQnEo2C3Lxp5Dz4UybAKT2xviIj9jkbdTV7dlir02FvwKKX bCyp7p+RMO0xlRDIS1k6MhnqnSK4WVGFjNObhq2sxbn0wXJs2Fcp0i5gjnyjz/OP5y63 Zmug== X-Gm-Message-State: APjAAAW2yw9QHCfRwnk9/3nLEoSh5ZLgYf2wRIo/evCMGmkQsxfBDpYD Z5X507Uc8kACo37tObKWqP7pNZqMT3M= X-Google-Smtp-Source: APXvYqwuKwX6BDI8XlSYaGLwJcivbUjXwRHYUP9kUFXgyIgUSmPpiWVI8b+3JiRmUg2D6EAa5Wg8iA== X-Received: by 2002:a17:90a:7781:: with SMTP id v1mr22961176pjk.93.1573857247779; Fri, 15 Nov 2019 14:34:07 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:07 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 12/20] clk: stm32mp1: parent clocks update Date: Fri, 15 Nov 2019 15:33:48 -0700 Message-Id: <20191115223356.27675-12-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143409_003944_273F2C87 X-CRM114-Status: GOOD ( 11.43 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:642 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Gabriel Fernandez commit 749c9e553e1f063eb132a78d80225532cbfedb80 upstream Fixes parent clock for axi, fdcan, sai and adc12 clocks. Fixes: e51d297e9a92 ("clk: stm32mp1: add Sub System clocks") Signed-off-by: Gabriel Fernandez Signed-off-by: Stephen Boyd Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/clk/clk-stm32mp1.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index 8e25ed62f67b..bf3b6a4c78d0 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c @@ -121,7 +121,7 @@ static const char * const cpu_src[] = { }; static const char * const axi_src[] = { - "ck_hsi", "ck_hse", "pll2_p", "pll3_p" + "ck_hsi", "ck_hse", "pll2_p" }; static const char * const per_src[] = { @@ -225,19 +225,19 @@ static const char * const usart6_src[] = { }; static const char * const fdcan_src[] = { - "ck_hse", "pll3_q", "pll4_q" + "ck_hse", "pll3_q", "pll4_q", "pll4_r" }; static const char * const sai_src[] = { - "pll4_q", "pll3_q", "i2s_ckin", "ck_per" + "pll4_q", "pll3_q", "i2s_ckin", "ck_per", "pll3_r" }; static const char * const sai2_src[] = { - "pll4_q", "pll3_q", "i2s_ckin", "ck_per", "spdif_ck_symb" + "pll4_q", "pll3_q", "i2s_ckin", "ck_per", "spdif_ck_symb", "pll3_r" }; static const char * const adc12_src[] = { - "pll4_q", "ck_per" + "pll4_r", "ck_per", "pll3_q" }; static const char * const dsi_src[] = { From patchwork Fri Nov 15 22:33:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247203 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 A44351393 for ; Fri, 15 Nov 2019 22:37:53 +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 6B5D72072A for ; Fri, 15 Nov 2019 22:37:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FKLMJ7p/"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="WeIJk6lI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B5D72072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=W0oPJ2FWTne6dq5zP5u8patgI3/hjA7HaPmKBZRNI9A=; b=FKLMJ7p/6aROZkpQy/VZVd6y7g WPyz45mLa5Vj1fg6K63rWZoRzQ2932us0tcG2+ariWVhDJD/6ywEtSO/DpxxA3rKm1HTdE7H7kZA7 ksZBJf4q6iMZVtNBDaUOv2xeHAF7bOQjtQkRVM/i9FsokP7lFDRQm/8S3pxgOrCNLMqcJJC002skP J2tr95OkyjtUNhN+F/7TZTj2lC1GAKBtz0elV5HTCHKW63IM18KrMxLbGA1/D2vn+n0Q2axQ4sIDk z/Chalqfbe1/Q77jtbIQ8710iB+wu/clt/JInnCc9Rw8aE1h5JHt21nBvvKPKK6axAJEJVqYgAgTF /XdnM5fg==; 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 1iVkDw-00034z-UO; Fri, 15 Nov 2019 22:37:52 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAL-0007F2-V9 for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:11 +0000 Received: by mail-pg1-x544.google.com with SMTP id q17so6617216pgt.9 for ; Fri, 15 Nov 2019 14:34:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4OAg+K/MSQ8LDMB5QZGzBoNYfURH+sTBMSUExg9URq0=; b=WeIJk6lIxyCTX4RCndZxDj9cy9KCsTub6pTQq4mdaj3dFRpi65OWFqCZRA44CBtrxD wyRa0X0CmZhRMy5Zc5o6LHi1MH3tbcQL0cv6gNCqqSz1J3XAMtx2zhJ2JtE+s68O47NN zHR5m5wI7wETwcEBKNsfebJLtuRqn3mfOO7V8dd30qDbuXTHtB4c9BgZjgnwNq49NE0s sHN1LPoBsVxzNYQxP/EzcPTZ08HKWeXQ0I/7fV81CBePfnFtSebCvvcctt33pVFHmB1t 3cJcol2P9GoSGYES+I95jsL41GuvG8R4/j9nrA8bdohfjWKd0oseIzbWJkGjljUdRMSA KFlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4OAg+K/MSQ8LDMB5QZGzBoNYfURH+sTBMSUExg9URq0=; b=lkISzFbkpSofexv5GpKLR9RNsy6PJBA8FUkj0ZfZaAG1NoccE8JgGbjjtYHWwB2NF3 RGN+ibqplbXshcyjFYBH5Vec+nfhHwwX6MNFnLsp7/oejF61u0FP32wZXf/1oxIldQyr 3ZGUbmG4/qQHKg5GRttTsoNZ/hCd8JtG+Lw9+qBjbVSgNxMBThYrbhpKL3U/1gGMi9IU 9BAwvD5ZMVrzYaQ7R1PxV+4PE1THYcskdsS7UcOYdVFsLYCxt5KwbVo1kM2DabCMnJFg zlJI2/I4S5gJVm9zNNf1xOVtnFjvsK6pWqWqgltjq76+pBCBHnPP/jJk+Bwpt3QpVyVM HQ6Q== X-Gm-Message-State: APjAAAWiDJD1m9nPH7g6Vs8+zHOsa0B/vrwaR/OnzZHkt+uFXdkpM6WO 3ZzJM7l/yVZ3AEaQ+gI60baFFw== X-Google-Smtp-Source: APXvYqwvPO8gcw50QrAb2M5Uc8qjsXNsBlM/blU4way61lTUGihMhTmdns75zP4KkzdAtC6LmJhrrQ== X-Received: by 2002:a62:1e42:: with SMTP id e63mr7219946pfe.25.1573857248667; Fri, 15 Nov 2019 14:34:08 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:08 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 13/20] mailbox: mailbox-test: fix null pointer if no mmio Date: Fri, 15 Nov 2019 15:33:49 -0700 Message-Id: <20191115223356.27675-13-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143410_042242_9A3B3375 X-CRM114-Status: GOOD ( 12.27 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Fabien Dessenne commit 6899b4f7c99c72968e58e502f96084f74f6e5e86 upstream Fix null pointer issue if resource_size is called with no ioresource. Signed-off-by: Ludovic Barre Signed-off-by: Fabien Dessenne Signed-off-by: Jassi Brar Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/mailbox/mailbox-test.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c index 58bfafc34bc4..129b3656c453 100644 --- a/drivers/mailbox/mailbox-test.c +++ b/drivers/mailbox/mailbox-test.c @@ -363,22 +363,24 @@ static int mbox_test_probe(struct platform_device *pdev) /* It's okay for MMIO to be NULL */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - size = resource_size(res); tdev->tx_mmio = devm_ioremap_resource(&pdev->dev, res); - if (PTR_ERR(tdev->tx_mmio) == -EBUSY) + if (PTR_ERR(tdev->tx_mmio) == -EBUSY) { /* if reserved area in SRAM, try just ioremap */ + size = resource_size(res); tdev->tx_mmio = devm_ioremap(&pdev->dev, res->start, size); - else if (IS_ERR(tdev->tx_mmio)) + } else if (IS_ERR(tdev->tx_mmio)) { tdev->tx_mmio = NULL; + } /* If specified, second reg entry is Rx MMIO */ res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - size = resource_size(res); tdev->rx_mmio = devm_ioremap_resource(&pdev->dev, res); - if (PTR_ERR(tdev->rx_mmio) == -EBUSY) + if (PTR_ERR(tdev->rx_mmio) == -EBUSY) { + size = resource_size(res); tdev->rx_mmio = devm_ioremap(&pdev->dev, res->start, size); - else if (IS_ERR(tdev->rx_mmio)) + } else if (IS_ERR(tdev->rx_mmio)) { tdev->rx_mmio = tdev->tx_mmio; + } tdev->tx_channel = mbox_test_request_channel(pdev, "tx"); tdev->rx_channel = mbox_test_request_channel(pdev, "rx"); From patchwork Fri Nov 15 22:33:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247201 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 4A24F1393 for ; Fri, 15 Nov 2019 22:37:40 +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 1FEA82072A for ; Fri, 15 Nov 2019 22:37:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NbpZYlmq"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cMafIXdS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FEA82072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=aPGbyVELrWPq+XQC2aBrcOXC6qC4YCIxdlWj6bl/1xQ=; b=NbpZYlmqBBreryEDwLrGAduno3 rVQBavc6WhxOwfxn+96WOYW4vB2vx9XLHXQL7hfrMtEZxDSDdMY9d43U/W+srgEB/Bx2S2cAQt3KQ 82BMMMXda14qRD9yRQW5N70XcDGGhgc3U6EZ2Y9nO0rVCMzjOHBY98IQVnKWRO/7PXfpdeYLW/DE5 UXEQCblz8mtqj41x0TWpVp9spvfXs/MYy5aHDCxa9qWwT5cOYnTE93EgHWTXWdqCtXhj1VVTBx6Z2 vKMPps4tt/tpsegMoB35latkX1RNIyeoaa2Qmnr792fUkuitc6f6b1Wpc+M4cc4JvE3rV5bGAfyQP OA9XckHA==; 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 1iVkDg-0002qQ-Gn; Fri, 15 Nov 2019 22:37:36 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAM-0007FU-Oh for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:12 +0000 Received: by mail-pf1-x441.google.com with SMTP id c184so7345038pfb.0 for ; Fri, 15 Nov 2019 14:34:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RCAvV+63fHypoFXOnsyRxH4xHTzRyP2HC/taWojKmLE=; b=cMafIXdS6g1uj9flwmN+t7PFzSGyqKH/b0cq+G1THxzoFk+UYaUMhkK+sCXvoR+FRO T/JwOcWSRAaDWyQpMyfm6t8Zb6xoOLE3pEo2VEaHnfKiwlYUUFO3RDSGQagkVZ+iwFjP wmmcuLiR+iKDMK2bzVS9A3BLyV6YTliwZCITCbOSSg1eQn5ZOIEhEWr/kh5vqAomZ4ZQ cgRA8eugzOEYPUvEM8fNYj8/Yg/ARhoLFq31/vgr7hZNUdFh2ItkshREq+pM+lKJazBg bqbGPI4XSYbM8QdMhxpjnWpQ3YJz8+9wR7dpzxgu9Pvr/+j05k3lwfNTVW/WugA3V86p o+NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RCAvV+63fHypoFXOnsyRxH4xHTzRyP2HC/taWojKmLE=; b=W8aQa4V5omjic2lzuJ3RVeOT1ivkD15tOTpSf04zLl9SkPuM9OKNIfasaoFIg0Isp7 a/gw+DbAgLV0vXWs+qD5WxfshqCF+lv89i9QyAGh3CDs9vM7gTrNrR2QI45XAwqx2OKZ aYAZx9swRk+eF9wCNn7lv1ZojGZz8+jTzX//IcXrs/Nak3zGweFgcLaa+HgHskvju6uV 114EmCFrBDIOjn+D99xm9pfLapOu39fqtrkOnPxyuA/qn2prUoE5XTuvo2fx/8Kkwpve um2hPgjj1FoVHoDXitKr6WnPzzAy4sBzKZbGNrkn2gQvHDacXX+Xl3ePljXyUkyIX+sN zPwA== X-Gm-Message-State: APjAAAVnf75gJSEt/1Vv5rtWeYnagpZMRA0MsR3o4GH89y3DKH3jKlAf H8bI8YiMK+zU2/qc9YXUAVJaTg== X-Google-Smtp-Source: APXvYqw4qvK8le8SxLbnkh5RF54RDhXA5UUgg6LQQZAv/fDVCg5l5miSaDJNYjoAmSiE4kYzPg4uSQ== X-Received: by 2002:a62:1914:: with SMTP id 20mr19374168pfz.68.1573857249524; Fri, 15 Nov 2019 14:34:09 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:09 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 14/20] pinctrl: stm32: fix memory leak issue Date: Fri, 15 Nov 2019 15:33:50 -0700 Message-Id: <20191115223356.27675-14-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143410_860787_B852F240 X-CRM114-Status: GOOD ( 13.82 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Alexandre Torgue commit cd8c9b5a49576bf28990237715bc2cb2210ac80a upstream configs is allocated by pinconf_generic_parse_dt_config(), pinctrl_utils_add_map_configs() duplicates configs so it can and has to be freed to prevent memory leaks. Signed-off-by: Alexandre Torgue Signed-off-by: Linus Walleij Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/pinctrl/stm32/pinctrl-stm32.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c index a9bec6e6fdd1..14dfbbd6c1c3 100644 --- a/drivers/pinctrl/stm32/pinctrl-stm32.c +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c @@ -410,7 +410,7 @@ static int stm32_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev, unsigned int num_configs; bool has_config = 0; unsigned reserve = 0; - int num_pins, num_funcs, maps_per_pin, i, err; + int num_pins, num_funcs, maps_per_pin, i, err = 0; pctl = pinctrl_dev_get_drvdata(pctldev); @@ -437,41 +437,45 @@ static int stm32_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev, if (has_config && num_pins >= 1) maps_per_pin++; - if (!num_pins || !maps_per_pin) - return -EINVAL; + if (!num_pins || !maps_per_pin) { + err = -EINVAL; + goto exit; + } reserve = num_pins * maps_per_pin; err = pinctrl_utils_reserve_map(pctldev, map, reserved_maps, num_maps, reserve); if (err) - return err; + goto exit; for (i = 0; i < num_pins; i++) { err = of_property_read_u32_index(node, "pinmux", i, &pinfunc); if (err) - return err; + goto exit; pin = STM32_GET_PIN_NO(pinfunc); func = STM32_GET_PIN_FUNC(pinfunc); if (!stm32_pctrl_is_function_valid(pctl, pin, func)) { dev_err(pctl->dev, "invalid function.\n"); - return -EINVAL; + err = -EINVAL; + goto exit; } grp = stm32_pctrl_find_group_by_pin(pctl, pin); if (!grp) { dev_err(pctl->dev, "unable to match pin %d to group\n", pin); - return -EINVAL; + err = -EINVAL; + goto exit; } err = stm32_pctrl_dt_node_to_map_func(pctl, pin, func, grp, map, reserved_maps, num_maps); if (err) - return err; + goto exit; if (has_config) { err = pinctrl_utils_add_map_configs(pctldev, map, @@ -479,11 +483,13 @@ static int stm32_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev, configs, num_configs, PIN_MAP_TYPE_CONFIGS_GROUP); if (err) - return err; + goto exit; } } - return 0; +exit: + kfree(configs); + return err; } static int stm32_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, From patchwork Fri Nov 15 22:33:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247205 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 6ACC01393 for ; Fri, 15 Nov 2019 22:38: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 48EBB2072A for ; Fri, 15 Nov 2019 22:38: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="GCAKjBko"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xA6/rKgN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48EBB2072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=r8amxKgHtULf/csKFN0VUpBpEHeH4VWGMMDmf5ARXZ0=; b=GCAKjBkobciqiQCh6P4OKeu2T3 N412Kpg4dmA8lkS+O2sZAgOwK6shtqeE22G3De11XHlNj+S2gn+5hjLoPKvV36f0kDtTNLGUPrtK4 Oc818i8rl3hM6YME+Sy30r1HUAa0VKz5xRO3hsTgMJqrKUWn7F+MsgT4pmtZ1+lX/DfNeDo75f6vb FyvDnYJu/7Mt2ywhlzrwSGWTYEw/JBeQYMtcDBuGXzNzJZ2/vLKbIT58kb9DuWpCBI13zx6ORrvvi pG36GeZ9TtQIneQ9lylLpVzEabZj0UGGUNKBA1wZ/MI568wsYJdbkNgwXTQ/bWQsqWJ0k82tq+jBQ Lt0amHLA==; 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 1iVkE9-0003Hc-CU; Fri, 15 Nov 2019 22:38:05 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAN-0007Gj-Ms for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:13 +0000 Received: by mail-pl1-x641.google.com with SMTP id az9so5620237plb.11 for ; Fri, 15 Nov 2019 14:34:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=f67vg1P6cp56FC+gFomHmc7P3PWgRttseTI8GzuDMDw=; b=xA6/rKgNfSpMNx7U2CIf58R0lskOLg3y9hYciTIt8ZD92F0abPfnJuNWvlOArEOELy Eg1q0mG7cr3zITCHPC3sYPPWPZpvKqTpZpqj0CiwzgBAHOv+44QxulLsvWlnsWu4gd8H iEOqm1GqavhvEBS16eTYSVDgdfFhUlNs4E2uzERBdCZlfSInyLMACfvujQG9qO/qlK0o Uxl2r/sRt1TU1QCCi/KATL4JehE2IfKdKDi6Uc6qegftMBClBcB7jv9K0QwVPVRGR5/u 9OJPcNqlrci4gxNVVvGbQUOYbTYXj8dLUk0yvBsQPmQBCW0m6Up7CMw0HPCnXfY/E4wQ KWAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f67vg1P6cp56FC+gFomHmc7P3PWgRttseTI8GzuDMDw=; b=mJ8g81y9gDp/VoUMI4NRENqozU/Tf3V5c21mLn6G8IceQPVn5/P+NIo8zNnQWc+zSX NSc1uUdj3YzHg8XzVFUVL4GsvQReb5fDT755VhYspNEqxxwR0GZSbPOSlhsKH5CXM1l8 lwXeA2BE6m100uLOOOBrsrIBtDfmHW/YSHLcKgIEdJou4ZZU/Fq3uCz0XN8WOqVDN8DR P7QljRMFgKUEYl3sBgKC0hLJphmoCXePwpqvuZ4U5WzJzbS1oo8uRyUihQ34SJDERaET ZgqozMCdbHdBqq1lPZ7N3GGimxx3aIzzF1Mv7EFe18COP4aQaHvmV7sxplVLEKvqr6r/ oFLQ== X-Gm-Message-State: APjAAAWlYC2NcInd8SKUIpysqLAAfgyGL6AqNd9m+NNNlByqjwxeO4cy xyy5fXNtH6Dud25zrc2OwMWK6w== X-Google-Smtp-Source: APXvYqy5gmuKV2XPYe0CJ9Tar06N04Tv6DzHZfUu5lOREsiiyK0PNj9Ybul3RHjzrkIoJm7yH+3w2A== X-Received: by 2002:a17:902:ff14:: with SMTP id f20mr17167605plj.225.1573857250463; Fri, 15 Nov 2019 14:34:10 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:09 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 15/20] ASoC: stm32: i2s: fix dma configuration Date: Fri, 15 Nov 2019 15:33:51 -0700 Message-Id: <20191115223356.27675-15-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143411_833826_BD172D92 X-CRM114-Status: GOOD ( 11.37 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:641 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Olivier Moysan commit 1ac2bd16448997d9ec01922423486e1e85535eda upstream DMA configuration is not balanced on start/stop. Move DMA configuration to trigger callback. Signed-off-by: Olivier Moysan Signed-off-by: Mark Brown Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- sound/soc/stm/stm32_i2s.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index 6d0bf78d114d..449bb7049a28 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -488,7 +488,7 @@ static int stm32_i2s_configure(struct snd_soc_dai *cpu_dai, { struct stm32_i2s_data *i2s = snd_soc_dai_get_drvdata(cpu_dai); int format = params_width(params); - u32 cfgr, cfgr_mask, cfg1, cfg1_mask; + u32 cfgr, cfgr_mask, cfg1; unsigned int fthlv; int ret; @@ -529,15 +529,11 @@ static int stm32_i2s_configure(struct snd_soc_dai *cpu_dai, if (ret < 0) return ret; - cfg1 = I2S_CFG1_RXDMAEN | I2S_CFG1_TXDMAEN; - cfg1_mask = cfg1; - fthlv = STM32_I2S_FIFO_SIZE * I2S_FIFO_TH_ONE_QUARTER / 4; - cfg1 |= I2S_CFG1_FTHVL_SET(fthlv - 1); - cfg1_mask |= I2S_CFG1_FTHVL_MASK; + cfg1 = I2S_CFG1_FTHVL_SET(fthlv - 1); return regmap_update_bits(i2s->regmap, STM32_I2S_CFG1_REG, - cfg1_mask, cfg1); + I2S_CFG1_FTHVL_MASK, cfg1); } static int stm32_i2s_startup(struct snd_pcm_substream *substream, @@ -589,6 +585,10 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd, /* Enable i2s */ dev_dbg(cpu_dai->dev, "start I2S\n"); + cfg1_mask = I2S_CFG1_RXDMAEN | I2S_CFG1_TXDMAEN; + regmap_update_bits(i2s->regmap, STM32_I2S_CFG1_REG, + cfg1_mask, cfg1_mask); + ret = regmap_update_bits(i2s->regmap, STM32_I2S_CR1_REG, I2S_CR1_SPE, I2S_CR1_SPE); if (ret < 0) { From patchwork Fri Nov 15 22:33:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247207 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 E28031599 for ; Fri, 15 Nov 2019 22:38:28 +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 BE7FE2072A for ; Fri, 15 Nov 2019 22:38:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="M5hyZ0vJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lUnyeeCJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE7FE2072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=SG61icjPQp7y09v9LQZwRuBnGa56nV0RUj/bnvy3PUk=; b=M5hyZ0vJGcpPRXp60nllZtEZYF VjbfJzH4pAtczRfzpJHOY0KsWZWoYuY/gtv5wqB5wVwh6ywpVaIHbPXZTTOSNwwm6ZMIacuhC5P5Z GfRgsXEpmVo4cx8ly2FFnk7DGgn20AGr7stMCfYpVzr0+c/0kDyEKlGn+0USUICszCS1YvkpHOIR8 Y4vC2Ibn8/PSn8/veAwskmN9p+ECzWwBvJGBE8TQB/QmU0VLBuj4WUv67quj0cNwqqesI1sByLxsM QUQ9Nm89WJBwLQ90HP0Bkr8Eq50MgRzn4xA8tBgT/+Osb8bNHGK0/Hgm5FEoyQhiFtEMvtu8CTx+s Hm2tEwUw==; 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 1iVkEU-0003ZB-3r; Fri, 15 Nov 2019 22:38:26 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAO-0007HI-NH for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:14 +0000 Received: by mail-pf1-x442.google.com with SMTP id x28so7341412pfo.6 for ; Fri, 15 Nov 2019 14:34:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0FzUVopNzASq04/LVv5rKzD9cgfLq5ObIrBYoMo9qvk=; b=lUnyeeCJ4IPMz/XNH2z+dyXgbsLnZDQySzkmpacsxLxrXVqQl5YYPtMDCr/HHxKjVR hU7Y+LuaiVCYaAjIOQjWN7XE8ySh88tskiNLwFDvEcME9WjRgKWKI31q/MYW4ijhkG95 iB/cXtsbnEgCUngeVPLDAl6BX33rNqrbYi6fcdGtnxKTNTBQFt/aemX3uKRsgXeS0agk m5dsnfapvZLJb77v9GDsdm0umUO3c/oDvqDF0UXRKla1EvNzWUNN+FQGF9bj+EE7X21B IdzvJlAJMLMIe18u6ncmei3dFZe6zL8vc2bVx70r1wV15uwQTsYgUDsMuE3R/50EMWIJ uu2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0FzUVopNzASq04/LVv5rKzD9cgfLq5ObIrBYoMo9qvk=; b=KVxf9msngpelbOS5qixyIihNOxlqLomwn1O7EoReZmZJFy3UuLAvNqDP8rzAgTL8je bi9vNjYl51enlQc4mR/jGD675dFymw/CQ1hZXbokCiToBzyMSCtzoDO4i2cxf8iYmq6E qdLY3n6Ll6n39ZWAF4ishgReIupCyhmvzbCS6h5Q+fBPsnvyega6evQN4qV5b1v4454S hh12s//pWgOzelsJktKSwcRItsy9khqBPfK4thKSRaqgHiNCwUiGgJOGYOQsmxemYTiY GYFbmiBGWlYOdtA1wQ0s1uwTyOqZEYAD4yj3KZNJLp6B9O7Z53LNvNbGZImB8J7s3hiA SFZw== X-Gm-Message-State: APjAAAUL/XdzONSeWdboThpRJ8PcsbWYFdleKnuM53+HEaQyDtYCNE8q 5LL+xmcuM5P8Jzox8AxefhTPxA== X-Google-Smtp-Source: APXvYqwIfu18fK0DfDJ9UvpBvk2czYs+yHL1APaCSoHaNFjaDFHmk39inhfdV0r/CZWJE79UEyL9tw== X-Received: by 2002:aa7:843d:: with SMTP id q29mr20193053pfn.156.1573857251386; Fri, 15 Nov 2019 14:34:11 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:10 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 16/20] ASoC: stm32: i2s: fix 16 bit format support Date: Fri, 15 Nov 2019 15:33:52 -0700 Message-Id: <20191115223356.27675-16-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143412_795297_F5E2541A X-CRM114-Status: GOOD ( 12.64 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Olivier Moysan commit 0c4c68d6fa1bae74d450e50823c24fcc3cd0b171 upstream I2S supports 16 bits data in 32 channel length. However the expected driver behavior, is to set channel length to 16 bits when data format is 16 bits. Signed-off-by: Olivier Moysan Signed-off-by: Mark Brown Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- sound/soc/stm/stm32_i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index 449bb7049a28..004d83091505 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -501,7 +501,7 @@ static int stm32_i2s_configure(struct snd_soc_dai *cpu_dai, switch (format) { case 16: cfgr = I2S_CGFR_DATLEN_SET(I2S_I2SMOD_DATLEN_16); - cfgr_mask = I2S_CGFR_DATLEN_MASK; + cfgr_mask = I2S_CGFR_DATLEN_MASK | I2S_CGFR_CHLEN; break; case 32: cfgr = I2S_CGFR_DATLEN_SET(I2S_I2SMOD_DATLEN_32) | From patchwork Fri Nov 15 22:33:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247215 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 D43461393 for ; Fri, 15 Nov 2019 22:39:04 +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 AADA92073B for ; Fri, 15 Nov 2019 22:39:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gEJ1ifip"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="K+EFQOwv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AADA92073B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=WmHcEa39+zc7vteLZQ/NOlgANI/tC/cIBsQWECBJztY=; b=gEJ1ifipQNXMwPK6RKY7GooiCX on7lK43kLU6QsdHYm5DaGfH8wirzpf2wto6rdibMSTEhWNes7i1jo1e9QIJG8y5pjrYofg47ZFP+Q 0YacuwoR9acoGwFLcdqqxb4eoYMmMAmjErUrEEzDCyUhkgiLbYfbmCZduwyQBOKqM8e7JKsPys5JI J1C96KU2EWQXIp1kpxvl95Wh41oGq0CacIaUqsKWQduw7K+Q06MAOlVDQORbTJbyfFw579GuazhHh 6TnhaWzAeJyT1XDfbxBRelSUF9ArFGj7Z6aHBX3BHbw6qmxvQ+9tkUQYsFazD5asY56xx9mtp+Hmw vDUBOh6w==; 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 1iVkF3-00041c-Gm; Fri, 15 Nov 2019 22:39:01 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAP-0007Ig-QX for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:15 +0000 Received: by mail-pf1-x443.google.com with SMTP id q13so7334559pff.2 for ; Fri, 15 Nov 2019 14:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=K6EZMz28tei+A3Fv/t1+BOEFoAHrbvWtLCwNz1ul25g=; b=K+EFQOwvuF5Ea8JFTFkHmNjxaOLY3h/RqojbKXq9i/HQlhlztvlHNcN78FEt9TXC6o gSUamhTirK9XvaurkQpqxAGX9vGVxHMdQiaEQWdY4pU3qEj4HzoubKBVTea2SyfoaOJK BPCTKzxPUfEL6BWFoVxIfRmwHA4tUCwpDJ2n4SjysulPcZeL7QSTvBqV9U6sa5+BoRxN ByG3lYAWlD6MNyS7zATy/bbUyGMR05gPdPv2GsQzG7CJCDbPYpfG/4kCkSVGAS68F2K6 gbCm66gHeb8hSy4KH2drGGvctHA7MuK4Ym++2SmPIVbJl9j9cJZ4kkEEVL0bmc7yyJmw rdUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=K6EZMz28tei+A3Fv/t1+BOEFoAHrbvWtLCwNz1ul25g=; b=VijdaRZ6AMBJWveauugMDtZkzMmRoL9OKxUKdKCJS3Y0D/XLlwVun3QFLOsQF+il6J 6WPc06v51XIKLekTsJW3EJQ8wQ3gGE4EmS7OsTegm+L9Irwd1ePO+LpHdifcZ0sjstWN Lg0KbgizGrSAZti4KJGD+W51UBG6O+sszbihyKw+JyxcVlvsxqHl9uO2aFRfG6iLnNKC vSu1HE2V6uJPUUEpd9yVYQdfuuxxnBo+zzZIOWQyPxNVSuNU89mQWNt5vS7Gn/Ujv9/F TTzV+hagdpiwXHzjbOmZ6iNXStug/pBY0UohfIS/XhyfwAJJVYniXnXpJx1Z25cBeRun fGDw== X-Gm-Message-State: APjAAAUU1c2omxUa3l4Ft3GIuLpSwRg3PZU6OM/GXdRJ6bXzcGM2C413 PKNr126XeeFkUfK4iLKRdn8BYg== X-Google-Smtp-Source: APXvYqwwG/XpWrw8NucKWEIVOJTEWpsvZTO9ZLZ6W3FY/qZdC0OPiY33DETIGgqjWtA92DNeccpTNQ== X-Received: by 2002:a62:447:: with SMTP id 68mr20154481pfe.70.1573857252596; Fri, 15 Nov 2019 14:34:12 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:11 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 17/20] ASoC: stm32: i2s: fix IRQ clearing Date: Fri, 15 Nov 2019 15:33:53 -0700 Message-Id: <20191115223356.27675-17-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143413_861276_9FD501B0 X-CRM114-Status: GOOD ( 11.16 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Olivier Moysan commit 8ba3c5215d69c09f5c39783ff3b78347769822ad upstream Because of regmap cache, interrupts may not be cleared as expected. Declare IFCR register as write only and make writings to IFCR register unconditional. Signed-off-by: Olivier Moysan Signed-off-by: Mark Brown Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- sound/soc/stm/stm32_i2s.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index 004d83091505..aa2b1196171a 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -246,8 +246,8 @@ static irqreturn_t stm32_i2s_isr(int irq, void *devid) return IRQ_NONE; } - regmap_update_bits(i2s->regmap, STM32_I2S_IFCR_REG, - I2S_IFCR_MASK, flags); + regmap_write_bits(i2s->regmap, STM32_I2S_IFCR_REG, + I2S_IFCR_MASK, flags); if (flags & I2S_SR_OVR) { dev_dbg(&pdev->dev, "Overrun\n"); @@ -276,7 +276,6 @@ static bool stm32_i2s_readable_reg(struct device *dev, unsigned int reg) case STM32_I2S_CFG2_REG: case STM32_I2S_IER_REG: case STM32_I2S_SR_REG: - case STM32_I2S_IFCR_REG: case STM32_I2S_TXDR_REG: case STM32_I2S_RXDR_REG: case STM32_I2S_CGFR_REG: @@ -547,8 +546,8 @@ static int stm32_i2s_startup(struct snd_pcm_substream *substream, i2s->refcount++; spin_unlock(&i2s->lock_fd); - return regmap_update_bits(i2s->regmap, STM32_I2S_IFCR_REG, - I2S_IFCR_MASK, I2S_IFCR_MASK); + return regmap_write_bits(i2s->regmap, STM32_I2S_IFCR_REG, + I2S_IFCR_MASK, I2S_IFCR_MASK); } static int stm32_i2s_hw_params(struct snd_pcm_substream *substream, @@ -603,8 +602,8 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd, return ret; } - regmap_update_bits(i2s->regmap, STM32_I2S_IFCR_REG, - I2S_IFCR_MASK, I2S_IFCR_MASK); + regmap_write_bits(i2s->regmap, STM32_I2S_IFCR_REG, + I2S_IFCR_MASK, I2S_IFCR_MASK); if (playback_flg) { ier = I2S_IER_UDRIE; From patchwork Fri Nov 15 22:33:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247219 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 9A0651599 for ; Fri, 15 Nov 2019 22:39:37 +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 612AF2072A for ; Fri, 15 Nov 2019 22:39:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lUBnwZeo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kW+Yur0H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 612AF2072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=9E3uVTMO8rLIizqoLxu7t4Z6cKQA0DLv0+raRIMju3k=; b=lUBnwZeo9K55EtWwqr4LaSQo2H 6YleEh3VF+Qnm9qvsiNxJdB0DeUX0PUlAprZD8AX4hZloia46Q+ErNVjHM/W3W2vkLnxUfvKxAHTX WBlUeMui1sb64MI1obnq2yqD1uXqnJqKVwObnKbbtlQoJAquUWa7fSyluiDGlmx2N391UDOUBOrTu eClU3K5MqVv6o7M70fu5ZlQCbxfod5RO4wUQNVlPVW9QbV7FtzZDyFbjeUgrmrqlFzgR1iBfSdeIz IZ8uhMIprdyRfMk4y/i+Oj3Q9JVJcSrcaqlbQWNtjrWmRgQhEo6pkcDtxCWygR+UJaITNh7quVPkp w7PNGbJw==; 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 1iVkFa-0004YP-Qk; Fri, 15 Nov 2019 22:39:34 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAR-0007K8-4U for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:17 +0000 Received: by mail-pl1-x641.google.com with SMTP id w7so5613856plz.12 for ; Fri, 15 Nov 2019 14:34:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i5dPEh9y2ib6oOQnoQa1Apmmo+YJMTHG/tlqLO0haxk=; b=kW+Yur0Hl2oWdZbkaM/sYlnrLMZqd7UJF+2HEJzbhpeG0T9E+DGIbgyiCtM6Rn8cwG 3TfxjWu0cq0O0Mq8seZ6SifvTMca6kTZcA5Q5IHZ+Vr7wi40pgdbQubrrP3lA716dYDT QQ/hQ5oOCbIRfgmybqfrg2P8aBTK/8ir+9wnrhdvqU1LZfpySWWHgCvwVa7p6SqVvpQM gD8BjoQhLQquamPA0i/EkkyiRTOOctidxeHXr7MaccD44rSjUXB4WVaBQMqEeDQCoqGs A9kZyWu0cxRQ65f0H1+XxOfxGa349XPFVe1fz4McNJfopYkmqTQPeOF1J9eREE1Pb3EO jrUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i5dPEh9y2ib6oOQnoQa1Apmmo+YJMTHG/tlqLO0haxk=; b=HbMjBys2Lw0y877dlsTnRwq554yvvvOc3kmZxtZi3k5a0mOrSTfsL88F7FwxY4UNOq gdMy80HRD+CrHzdZUVf6FLWSDM903XmHCIuzc4D0M1710L9Qg5Szj+kuhEYYPxuHSfjK ZQWuG64z3c3w06iOAsud7+Cx9SHaErR4bvydaCSyH9wKE9QFIctAHUmeN8+3wFWKHBu9 wEXDGBKcDPmDWowdNjMAH7vftIQWzgw6A7BIyiDpEwTRfKO5yNBeXBceb4SPJxADFXRy s0FpG8T5wJcsykJdTE5iBrQkR4/q2b6aWWMWDogzLdukMNwrvaeuSoaq4OYQHolUnoru ndJA== X-Gm-Message-State: APjAAAWq5WGluCPCBO1o66pl5ZH+s3CRc52xkNfPkCr2ZqgJkol/aGUr 77aDlRg7e5wtfDj6s/p6M0oryQ== X-Google-Smtp-Source: APXvYqwHAc5twB501dJRqUfTBvKugpgHSSdUWAlfaFJMgzAPYdC8/2k7gHvhI3UOPNKl6RREJeuPVw== X-Received: by 2002:a17:90a:252d:: with SMTP id j42mr23137114pje.131.1573857253840; Fri, 15 Nov 2019 14:34:13 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:13 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 18/20] ASoC: stm32: sai: add missing put_device() Date: Fri, 15 Nov 2019 15:33:54 -0700 Message-Id: <20191115223356.27675-18-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143415_436157_32BC4F39 X-CRM114-Status: GOOD ( 11.74 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:641 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Wen Yang commit 1c3816a194870e7a6622345dab7fb56c7d708613 upstream The of_find_device_by_node() takes a reference to the underlying device structure, we should release that reference. Fixes: 7dd0d835582f ("ASoC: stm32: sai: simplify sync modes management") Signed-off-by: Wen Yang Acked-by: Olivier Moysan Signed-off-by: Mark Brown Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- sound/soc/stm/stm32_sai.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c index f22654253c43..540c4a00405c 100644 --- a/sound/soc/stm/stm32_sai.c +++ b/sound/soc/stm/stm32_sai.c @@ -112,16 +112,21 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client, if (!sai_provider) { dev_err(&sai_client->pdev->dev, "SAI sync provider data not found\n"); - return -EINVAL; + ret = -EINVAL; + goto out_put_dev; } /* Configure sync client */ ret = stm32_sai_sync_conf_client(sai_client, synci); if (ret < 0) - return ret; + goto out_put_dev; /* Configure sync provider */ - return stm32_sai_sync_conf_provider(sai_provider, synco); + ret = stm32_sai_sync_conf_provider(sai_provider, synco); + +out_put_dev: + put_device(&pdev->dev); + return ret; } static int stm32_sai_probe(struct platform_device *pdev) From patchwork Fri Nov 15 22:33:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247213 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 2B0CA1599 for ; Fri, 15 Nov 2019 22:38:46 +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 07F112072A for ; Fri, 15 Nov 2019 22:38:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qRQac62s"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="AkA2Dg+S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07F112072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=OwK7SV9QtL9kEkMryXq+Svz8owYhYywz1wpK5wQaMLg=; b=qRQac62sqHt1UpCdiDRuxjy/yh vueHMk0uoGFAW48dO8L39yd3MQxTMUytE1+6iZ7qAaycou0be4+Rxrskow/4KWslTfdSPdItvb/r8 U3ZXIMhSeDi0y/XsmcjX+5j1H2+ECPzEFG37VkJT9uV6I3ZRazl14vv10DMgwPZELLdnV0dDpbNNR jiUeagiTiUu5jYMRceHsxEdaz5NXT4PFlcahQUBnpW/r+MEuDHogAQ7cLKziUekfzDQTPwh+BPrLH 9vMr5HtkW9JIoWEMh84LAsmhmMUNjB2PXjqzCDhmZSBYB675eEa6qfitvBWzZcjuUbff2PEdirbvo 1VFgcPhw==; 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 1iVkEk-0003le-9V; Fri, 15 Nov 2019 22:38:42 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAR-0007Km-Da for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:17 +0000 Received: by mail-pl1-x642.google.com with SMTP id s10so5638709plp.2 for ; Fri, 15 Nov 2019 14:34:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=r1ouRyNa+k6U3bqzEPdoAfpCVsnWSnRUjkxZ+vQnSI0=; b=AkA2Dg+SrHTn4/EJ8QynEGN7oPoQ/Aw5fRHMyXpEW6Y6keS6gO6VdGp+FDJ81HaCck LfkmYzBp8QrNwaymjk9ee0qPdxlC88qX2CcJuOT+KoHhzb0ptMpflS2O2yk9g1xcwj+i OsUJI152IuEDboSfUp+G5xjZAwG1t7A0XU/A7qB4I1ptcuIK1x3v8NMEcAQoZZq4bi4E Be+sv3Xu57IO52n36rJiyMgg2w2e6EQhjAwLZeheDCHSoe140YiXAwaGdpXT8hHFrlti FWcDYu761P26xKgxM27ycYqxbciEuu1T6zlil6sWl1pcyhuIHyDlPl4vUH/r7fLTJUmm 52MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=r1ouRyNa+k6U3bqzEPdoAfpCVsnWSnRUjkxZ+vQnSI0=; b=np/A5RSU5re7bim+W0XY0o2MVA8SWS/WIPH6T4yng+IQUVXKlExvy/G+GYNQgBkIyQ sQyfP/Lx7YTjvHz9BJKR3xYk0b/IgrO/moi4AJPMW4SbKOnk/J1+b+HL2hIlqrKD44eM rv4s9bsgmB018zlyGnNf2XE+7qS13YkoibVzZGARCKOtL3Um+CylO2Kz3AbSb38mRLJZ heqnXtw2giaq3p2JR+ziig6gM4oP3ZzIqj+D3tvC6RYqtx3PNNWfklVF//UQqH38/r34 ixerqtVVQbEzO/QZgoX3vQFFbEITuJsEXzylvXSxKgwz5pq9k5QkM7CTy6bTaSmA4aTj p6MQ== X-Gm-Message-State: APjAAAWvebpccDvvr+zhplR7jEZO5LAjR7rHc2NZWSMlbq4986WZvdqh 4q2F/vqXkn2Z9d6GYx3aELlhTg== X-Google-Smtp-Source: APXvYqxC58jH+YVSM8IOmV0kV1VyZBdQVm7yePJM+Y2/BxjPAGsb3xhTH2/dY5iUX2I2iGcgQm94xQ== X-Received: by 2002:a17:90a:9705:: with SMTP id x5mr22110495pjo.37.1573857254692; Fri, 15 Nov 2019 14:34:14 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:14 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 19/20] media: ov5640: fix framerate update Date: Fri, 15 Nov 2019 15:33:55 -0700 Message-Id: <20191115223356.27675-19-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143415_647814_D98986AE X-CRM114-Status: GOOD ( 11.49 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:642 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Hugues Fruchet commit 0929983e49c81c1d413702cd9b83bb06c4a2555c upstream Changing framerate right before streamon had no effect, the new framerate value was taken into account only at next streamon, fix this. Signed-off-by: Hugues Fruchet Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/media/i2c/ov5640.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index a3bbef682fb8..2023df14f828 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -2572,8 +2572,6 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd, if (frame_rate < 0) frame_rate = OV5640_15_FPS; - sensor->current_fr = frame_rate; - sensor->frame_interval = fi->interval; mode = ov5640_find_mode(sensor, frame_rate, mode->hact, mode->vact, true); if (!mode) { @@ -2581,7 +2579,10 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd, goto out; } - if (mode != sensor->current_mode) { + if (mode != sensor->current_mode || + frame_rate != sensor->current_fr) { + sensor->current_fr = frame_rate; + sensor->frame_interval = fi->interval; sensor->current_mode = mode; sensor->pending_mode_change = true; } From patchwork Fri Nov 15 22:33:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11247217 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 ACA8E1393 for ; Fri, 15 Nov 2019 22:39:20 +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 84EEC20733 for ; Fri, 15 Nov 2019 22:39:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="A4RBMrgB"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EuCYF29X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84EEC20733 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=P8agXz3k0KIGgYAhlmyYfH5JH39OgbqppSu5qqwnHVc=; b=A4RBMrgBPGWrm3S2+1HTYHO3QT zKEHbYP/FEm4UcgKd+muDKEVzZt8RkiwK+yZqQ34rPp1jY2v2DKazldxpVT1JxP57TlSkOt17eD// HCRqA5VBR1kDM1YkRFSSRbTHMMO1s1wY12YWXK1jwZE+t5z/sBCPq5JnoO3UgeqKTCjovq36NdoUQ 0+/lxWLp348PsHXeMeGkVEWCsATe+479KIna+d32cRAYzLV9p7KCW+TiL9pa69xBv2ULPDqQE5APN 4gukLtD1VPD7AjnpG5m0UjET6lRQjioUzrLLnL0lRBTgfDiFnhZ1F5iIs6AKKgTzYTqOrbGJgf++7 pFIPwS6Q==; 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 1iVkFL-0004FM-M4; Fri, 15 Nov 2019 22:39:19 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVkAS-0007MA-T0 for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2019 22:34:18 +0000 Received: by mail-pl1-x642.google.com with SMTP id a18so5616894plm.10 for ; Fri, 15 Nov 2019 14:34:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FlA/WYoLeRABK4x8leOELB1KpW2VXeE/7KRkjFeheIs=; b=EuCYF29XK/mB/F3BxjT3sWX6z88YjtNqs+w5TNJQP6w08JiRou935ewYfWNAW/g3Eg FYlTO4DtoNdOTwlSxUFfeQtM32HB8UD4XiO9OLyVfO071D1lvVGMwJJWMxV7DW959l9H 3cEwLuybSJy5RgNBVbsk3HFrKrWbg+s5SFLxWWx6v5gjbraobv8BFodgs84RA1TUiybx 8wvlY+DBrzz7i+IYZ/fG8vjyNWly48fh5ZQWjCLhzQuBoYMt+ckcnb/GiIKLPGqHmTMR H6s2ATHNqRlbPvsQBZJwh0jEIKkumM1yU/gS+DXe538ozDU9zHQll5wun9QYpe4w15+l ifVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FlA/WYoLeRABK4x8leOELB1KpW2VXeE/7KRkjFeheIs=; b=qtZfF2gjceBvZKzx0mWr7MLo34GatCoVkJzTbQ69ztnokUc24vJcgHMtK3BnYdZGEh nm4a0ursFk6hl+k1mLQXIvYwsXFHPaMUvPflxhlIX952Z6bgt/4b/Q+PEVUjQiKQJgSc WLujI9DczX9KszUly7FkAm4i1tVfw8xaT5uI3GbdVIlzbcNpsdBjpjvE8/H1y2yvpctG YuxpGvDqZCJCQN/Mhfg3QFGp01P3UncUniBRflG0bdZjYIG5jRc00QzWb4nhyVQcAjQw SHMSGcIAyLKLLTKmDtPlm/McvWee8JldUrtoOqoRr4HfHEmCX84pPn+LKHZyuw74rqfJ HJXA== X-Gm-Message-State: APjAAAUhPekPhS0rW1+eTnlyANaCseHzfldTaL3yBVUV0uE3ngsOyFDA Jb7YKJtjyv8fbZldFbYJNGlizw== X-Google-Smtp-Source: APXvYqwrPgGdAOCHvG+Dr9yqtqFxSjTdBheEMm1jF9StVEaJaadS7qR9/JmFNyQStGJT1dxmYiuHuQ== X-Received: by 2002:a17:90a:2385:: with SMTP id g5mr22958192pje.117.1573857255728; Fri, 15 Nov 2019 14:34:15 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:15 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19+][PATCH 20/20] dmaengine: stm32-dma: check whether length is aligned on FIFO threshold Date: Fri, 15 Nov 2019 15:33:56 -0700 Message-Id: <20191115223356.27675-20-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191115_143416_976178_EEDA7E43 X-CRM114-Status: GOOD ( 11.39 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:642 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_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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Pierre-Yves MORDRET commit cc832dc8e32785a730ba07c3a357e17c201a5df8 upstream When a period length is not multiple of FIFO some data may be stuck within FIFO. Burst/FIFO Threshold/Period or buffer length check has to be hardened In any case DMA will grant any request from client but will degraded any parameters whether awkward. Signed-off-by: Pierre-Yves MORDRET Signed-off-by: Vinod Koul Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/dma/stm32-dma.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index 379e8d534e61..4903a408fc14 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c @@ -308,20 +308,12 @@ static bool stm32_dma_fifo_threshold_is_allowed(u32 burst, u32 threshold, static bool stm32_dma_is_burst_possible(u32 buf_len, u32 threshold) { - switch (threshold) { - case STM32_DMA_FIFO_THRESHOLD_FULL: - if (buf_len >= STM32_DMA_MAX_BURST) - return true; - else - return false; - case STM32_DMA_FIFO_THRESHOLD_HALFFULL: - if (buf_len >= STM32_DMA_MAX_BURST / 2) - return true; - else - return false; - default: - return false; - } + /* + * Buffer or period length has to be aligned on FIFO depth. + * Otherwise bytes may be stuck within FIFO at buffer or period + * length. + */ + return ((buf_len % ((threshold + 1) * 4)) == 0); } static u32 stm32_dma_get_best_burst(u32 buf_len, u32 max_burst, u32 threshold,