From patchwork Thu Nov 28 16:49: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: 11266379 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 3F87C6C1 for ; Thu, 28 Nov 2019 16:50: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 1CCE5216F4 for ; Thu, 28 Nov 2019 16:50: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="Ii2Ngq1f"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Wx+K86Gx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CCE5216F4 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=kzE4QaWiJwJdoZwxkMkfpgHeDvceqzXWYEGBcna/TQc=; b=Ii2Ngq1fVN9yIkKea6QQQRlDVf H0oMGShWTrKq5Rb2MAvB+Bnctj4f2vKntrXZGr8tHRUZufHBAUB7L5awn2qPQ4ASR3waBilBreDYw cYyw+c/Uz5Bba6D/Tyi+yVOckWUPlBjfCplrTdvyiuZCznGzLfmL4199XuRiegPz7iVZc65NVOttc 07AMc3/i7G+0ctAIdVNLqKAtce3+0oqHVBBZK5yX2ZQrIVi8KLR9iT1wzJ/Wdwab66/ORWF5cWnqh d8sfrOkBLS+GwdxFJvEno7pqjxVNOES7pNx8oHoDxifsocBwuhmjFe9dseaOkT3MmK7w+iI/9j4k+ aOqE816A==; 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 1iaMzp-0004ne-6d; Thu, 28 Nov 2019 16:50:25 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iaMzY-0003mg-LA for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:10 +0000 Received: by mail-pg1-x542.google.com with SMTP id b10so13135061pgd.4 for ; Thu, 28 Nov 2019 08:50: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=h4A+UA0S3l+ls0zS2Gq9BFaj9JODH97JG2yHCpwCb+s=; b=Wx+K86GxA+4smpBpiOHAUU4+1Q2OkAURYY7uZaNtD0cSSiGuNbCLz8fajRC7wmZ7DU rsdklNwN1J1GqRb/PAmQ/dqp42ravrSDKYRfy8b145fzDNOFjMFzq1kFiZnjo7xqN9fn Jz0KRWdykjc1YY6lrHhFY9J9VvKxdIcUIKihIImElhcWco9EODzGGIeieUieUmhPXkgX rdLSL1uLi8lCNEbNnElgBaV/BmBJKlg8iMYAJTKXFiGXg5DC1jLwD36gHhHy4GodjD9a 9dRXiDvOg86GKf5nPK2NEnYEYM+z72ORSvlPE0v4bFbBuJqnGEBykAMJLiolwfZBJ0hg gyHQ== 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=h4A+UA0S3l+ls0zS2Gq9BFaj9JODH97JG2yHCpwCb+s=; b=aX7KrfgXVEZQJjJ3damiJFIMb81syxMHWdTbGLYPVg+1pga9ooiK7LSTO93R9fy4cW O79zzm/hdC7Jl3BglxWLNrWnUDG3a8n78J6W6m0IW/dCgf7ncV3C6kQYB91XvRpxiVDF QVBvegDrt2wWhD4xs0XLA1V5UtQySlzDtzWZq4+NL6eXddQGsnea7YjIk+zz5fkWRyby RbFVm0kx9kLrYM59rQmvls3NaY52Ski+urd27B8eCFMsuLO6V9f0f4JkOzaO+M0kXJ+Y GZlksyNktyTn3kDFHGpQNQWksbSX8SC2beqGmoavjmged0cdFgh1at3OMHk5TwMFEabu CYwg== X-Gm-Message-State: APjAAAX5RmGsgDHnwUmxHqECePeQhk6/yIs+3m6QFqqmMmuwS7zF+L1E 7Bi2dUZXtxw/Sx1raGZAJOVylw== X-Google-Smtp-Source: APXvYqySksv89mq7ZXiuB7jRWQXMsodrA1Fn5AXVdxQeQ0hmfOmPumNTFWUfdW/n9qVFY/Xf8muSig== X-Received: by 2002:a63:fc13:: with SMTP id j19mr11884281pgi.327.1574959805234; Thu, 28 Nov 2019 08:50:05 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:04 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 01/17] mailbox: stm32_ipcc: add spinlock to fix channels concurrent access Date: Thu, 28 Nov 2019 09:49:46 -0700 Message-Id: <20191128165002.6234-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085008_727316_87500A1D X-CRM114-Status: GOOD ( 13.68 ) 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:542 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49: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: 11266381 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 8BC136C1 for ; Thu, 28 Nov 2019 16:50:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62A7D21739 for ; Thu, 28 Nov 2019 16:50:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Bpp6QlgD"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KXOTFhYW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62A7D21739 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=1gwxzXZbUvwOtFe813YgreR5MR1y40XbCI546Q0aKrA=; b=Bpp6QlgDgvKkPDsQSZuG+5CSLz abSR6z5JEAqYkpZD/eG9nB+LUzZbxz95e9NkEgFdCPOLqV57iiJJZteK1euXBBbhcGTIm9ziIcw5b HhXmWYWzB9p2BxtEMjqW8mJKnOgfyOtQobyOE8YmTLy/0ffzDv7ruRkcvJrdUfuZvT1YqTwSkjDwg pbzMOOCHeAgm3hWOfNZ+xP6PV0J5oIP5IyXtODLizQIae7AooVRix5lzV9et3CS4+nhpEvNZHyC6z luHpwBQOMqOGdd0Jt07QM6n7ewO3SaiU7ZvSPVPbbK0CMdn03CZBuFN1sWgwn427Kh1aioRSlItwA GlEavqyQ==; 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 1iaN0B-00055j-HN; Thu, 28 Nov 2019 16:50:47 +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 1iaMza-0003yn-Fq for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:12 +0000 Received: by mail-pf1-x442.google.com with SMTP id y206so4752998pfb.0 for ; Thu, 28 Nov 2019 08:50: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=jEs6QE+VfGFRlxMX16dTWWCBFFIHacBUeuklTX9eehk=; b=KXOTFhYW31M6DowFuVSnZZCtoVs9n/0m0NvfFFZd/SJgu5toTz3abL8mMkd78Ce33g jS4H5Xas4NpISrNogQilOVf2XtLcQFgi241JW6pdGzS9mAe1TpFBHF4dIwqlW2YBDkHi LcwZVULYkgOFnRsBSM5zGwnGB+uoPXjd8zsDy9LydhztAqwlpMUZBUjtnbLpM9/eZcPm B55+nvIbQgZJi8R9mKUwalRDzBnjtNK9Mow4lfWl94dyekaSG6aLvasftGqFRfTwvjev 4w2+wCx0fHYT80fgo1kSm6hUHDAFw5HJI/3UXjlz4QSPSaylm0almF6B7yg9RP1vvNF5 FDwg== 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=jEs6QE+VfGFRlxMX16dTWWCBFFIHacBUeuklTX9eehk=; b=aZylNfgIHRFvyzOtKQXAKH/c9NmYfNsZ3Yrx2FIpq7vFsBrhLOFdeseaoS2g5hVmw6 yVw92WAOI4G0gF5inLQtcdB1z5wzvcX1IuIVK0f2K7EaCrdUMAaJpVg1FRv0c8hozEKf NGNPIAL7KRjM9Gv3Z3aUDLW4NGmYE6f0lrQz9YRsx6tDGjZMVnWvQIx2QPAHuFvKX0oL KZUMNn21aRnviBSVyBZB/DBAFAXvKJaHQsoEW47S64vYF3IzDa5VfAGneQMUQTvsxJTt nU60/9Bjcb6QxhVZr1fHb3BgTp25yCCHa6sD/1lBsi9vA6DLAdYA+Aa2tMwRMjgd9NW+ zJEA== X-Gm-Message-State: APjAAAW3ewzyaLYASLXWn8Dn1UwhxoV1iSJ1dkwJYju8DX2aMKtmE6df kBXWSE0j+7TTIITC+S/lVb5wtQ== X-Google-Smtp-Source: APXvYqx8Qk2Of+BXuSVm+sEuntEca3roAUMLg6UeXFFjMVrolEG4T3O608o00roYtbf9Fj0Zeo7MNA== X-Received: by 2002:a63:e03:: with SMTP id d3mr6794337pgl.395.1574959806302; Thu, 28 Nov 2019 08:50:06 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:05 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 02/17] crypto: stm31/hash - Fix hmac issue more than 256 bytes Date: Thu, 28 Nov 2019 09:49:47 -0700 Message-Id: <20191128165002.6234-3-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085010_548969_1D1CB0C1 X-CRM114-Status: GOOD ( 11.56 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49: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: 11266389 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 13F786C1 for ; Thu, 28 Nov 2019 16:52:15 +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 E525921774 for ; Thu, 28 Nov 2019 16:52:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lYuAbfkl"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JPbZoZDa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E525921774 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=Xb/TUuWrc2LDwnWgyzLNOh1BwLSEzRvbC9LvWJfau+Q=; b=lYuAbfklTwkHLFGudi7jsoMxce HG0YgP843vgdXoGCQ32JjVq6U3qupNdhazfBBYnmzyMQyLoemlGb1+hG6+SdEPs+84spCG5Ti0yVE CSbLq/XSbH0BXuWrxFyLBnnTW/RiyK0LM6cB2jRXqVixI67XbT6rEYvkhQOS3sSR1iHNfV3M7R3iy oy4UAsjTd34VBqxFsBPupGPGGH4L/j4YqAhUQs2uKv8VgA0OrsoG9Grb1PpLM5LtW/Nb90+UeBKs6 cIFOm20nKSE/pMIId/nA+KZaBeQvTuotRht+f09sNAkkBBAapi6/En0xsCAs7fFji5002JPK9kl+z nPcSZe/Q==; 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 1iaN1X-00063O-Dy; Thu, 28 Nov 2019 16:52:11 +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 1iaMza-000476-Jp for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:15 +0000 Received: by mail-pg1-x544.google.com with SMTP id l24so4660437pgk.2 for ; Thu, 28 Nov 2019 08:50: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=xgizS2ja8jWfUkSpIbZzCHqhCFBCkrH3reNwP/GggE4=; b=JPbZoZDaha09542iyB4HlV5SyQ6DTAJpv5Q3TJmdEp9BmETD/i1XTVIb+ywiCIN1nv iFSi5EaDWDVgT3cZefU2WyI90kZhp90IrppihlsCrB90kyAgihmTrdzb79Q6Cs6n2Zt4 64131Dc5KvTzv5O5U/OhW/L8pOVodKVM/9rKcPwZIemHMV2F+g1PsoWpF272QtSYPVIA S1f4qXA2nSYcxs3e955yT1TqqkBPAWHx5BA46tf7JYW9Nbl6jMOgMVxzalEVIIiT57Gt cCnrHd+k9IRVvJnBIPFwv46A1hORlLXKt+xT0ppDT3MlKk1FeZJ12TMXbtME2jcSQW+w CUBA== 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=xgizS2ja8jWfUkSpIbZzCHqhCFBCkrH3reNwP/GggE4=; b=EJw6UHSGgRckej599n/3LO5KcxQFC05L9kcH3KQPTnOCShp9xmS3vn3lB9TpEjSEtR JmkkVbuGvEPQpr9I2tU37DgC7JtnhPM785DC0lY+SzF43T57130WME2gbo/Rf7wubvae JeIt+z6/6XPMr7WD7d9RyHQOPuSFVnDSpwqW6vm4K33GZznu5MEHcMHpL2Qr/JsuaBg/ WAbH84voOMpO3mPhNHF6A3C2aQtsWTwYCrUOmX9JZG1xatRinclwvn8ow8flCTHam/C3 n3/UO2uNqct24+ia8pFV1J4E2YMkbjI05eu6uSgbIDQvZHUTr1CIS6IaABDptjlxefcz Qv+A== X-Gm-Message-State: APjAAAUHWXQYD1imseHBCRjRtjhGHqIGIRwiW7s4yMI31Iym7SyWKjv4 s2gp2MTx/Ub0RHflTi3wcnfKew== X-Google-Smtp-Source: APXvYqyrDO9jQHqib3oqT9BAbQOeWFk5IjUh08VvarLRNXbKvMR2SUbyJX7YPgSzvjWKOAAcE8nJGw== X-Received: by 2002:a62:888c:: with SMTP id l134mr36436770pfd.216.1574959807222; Thu, 28 Nov 2019 08:50:07 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:06 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 03/17] media: stm32-dcmi: fix DMA corruption when stopping streaming Date: Thu, 28 Nov 2019 09:49:48 -0700 Message-Id: <20191128165002.6234-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085010_785937_E6CEF41C X-CRM114-Status: GOOD ( 12.21 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49: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: 11266383 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 5E694921 for ; Thu, 28 Nov 2019 16:51:08 +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 23AF621739 for ; Thu, 28 Nov 2019 16:51:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IlU6p4AK"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jhdXMvF7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23AF621739 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=zBhao7SHYf2/DSKROvNxQs9YR8vcgd/N4e/Z8iISvA4=; b=IlU6p4AK8HnH1ez8Cn6UhJQgYq o6/0yo6kTPraGGfS1jKIKyUAHeXwEsddmyTB9YkRBWKGS6Kbk1oeUgTV4ZusJk6k7dOKsw/GySEM3 IRdXaKQ5jyE8lIS3VyFe+9GijohvTDb3kG9cyk/xujvZbFSqYRdBi8XS2Q+KbcdDcteVMkFE8TbHi F4YLafeW0w6Bshfm2wKWfVS1jwRvlOrBZRNfZX7PrnInCJPxXX/Wx2DzjTDgruOEEGMzo8ykFEzBg 0AN1DtgdnO5RNhv6fq5VHKXqNk8xulp2dXE0kzo4vw1grFWOqxncaf/sfnNAyqE+/w0ZMrpqzQp/L AR2HbNGA==; 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 1iaN0T-0005JL-49; Thu, 28 Nov 2019 16:51:05 +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 1iaMza-0004F0-Fc for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:12 +0000 Received: by mail-pf1-x442.google.com with SMTP id z4so13367007pfn.12 for ; Thu, 28 Nov 2019 08:50: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=3gfqS5lOXPiWWEEMhIxCyyS+fLBSJCNPeR6VbsvmT98=; b=jhdXMvF7E8/2RYD6Amz40/5Dec9vo4TrYTFm/r6nKztuLd4EU47wPRpIEnVGukrPq9 6KJX/Lx31gcsN472LKTKhC9qqVht7WRMvzIuEkgW84gnYt1Q1V5qsybFpoRhsKZYSaZk D8zz/gLD9NiXIi51FQrr8I1tiAgYXwIfUVNtoINE4E40elNOWuicMEf8RRSLfBou5lMD 21OIJW3h2SLpS3astqaYv2D1m65ILNsIQBe50CNQUvHJ8zlw4lYds5HZrqh88S3ZtnkY pMwWQeWqjtQaCpV7SrSyzXfsgvRuVQTusIn9jJ9kHRDKOfFhlkKAT3ImyVmHC6nCcJWO XvqQ== 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=3gfqS5lOXPiWWEEMhIxCyyS+fLBSJCNPeR6VbsvmT98=; b=qenglBMZw6SEFd+f313Nc+BPDKRdjl9KaEtRmTSpMRD3+xvrRWMLYodC8W2pg+4Lk7 faUr3kt+e3fmK3ZONkdQdJ9mnm3Ndr9gCixwVVVCFjU49TVJ1aBU6X7LuYDJj2saGHDa rB9k7LJ0qzlhYMp0Lhk/Ilxkse7XRHb5fjFWTjDNXKEXzuyFDtZNOvfdp6xfQgpr4zEv 4qsTAxlxIVcG+RQw7e8bIOdAcDuCZOhseCCSEZ+vhjk1jUX61WGIWLiXsqbh+4CdSsG+ fcTvOgWs4He0ckTd0eVJ3QTg83PLjrHDyYYWbYunHZt4N6FFHy4ED0HpuNwf1NBZSJOx xKAQ== X-Gm-Message-State: APjAAAWZZp6QAy1sJErhU5ysN6ZqeBkCiKtUP7QQoTc2IiUCvHa6KVUb A7VEi5hlB6wkuVaTN6TyBuDdew== X-Google-Smtp-Source: APXvYqx6xtWr8g9E9T/1JwgyO6jqtT8i4Z+88FKARM8SdyHi8DyEUM3pVBEuVW/Q2yGOKIuP1ovK8A== X-Received: by 2002:a63:e84d:: with SMTP id a13mr1089909pgk.193.1574959808249; Thu, 28 Nov 2019 08:50:08 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:07 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 04/17] media: stm32-dcmi: fix check of pm_runtime_get_sync return value Date: Thu, 28 Nov 2019 09:49:49 -0700 Message-Id: <20191128165002.6234-5-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085010_751765_2F58E4E4 X-CRM114-Status: GOOD ( 13.56 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49: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: 11266387 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 1D1CB13A4 for ; Thu, 28 Nov 2019 16:51:56 +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 EA28221771 for ; Thu, 28 Nov 2019 16:51:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IW/6hV8u"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xLaNPUaU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA28221771 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=6JURbJYIN4ERTVdu7PU43vSp0qjAi2/tlykskmSqGYE=; b=IW/6hV8uNqUxOZBLJ3aQX8u+CP cJFxcm2PA07pjWnbSrrz4TO7jBhvEbVBxgsSGI1/h5UJcHMq44zQorYR+tPJuCfZiwIqBF2lAtkRj LNOIL/OggLunwGQtcuGncPXfhdzfYJaxhgVijDRvXKFruthFSkv5iNtDjcR1ppH9nNB9NvrT6vwfn tpW2Gk/PWXOYkjKoIwGxu8B1Xz/3RzsNhYxLXlerCEXYin37mgpau0/oiKc+qrNTsKnLwSa6mnAaD AGsHiz10LWZT4GjlnPA7hAFEVVUUOZBtNNsnUMMDuUYolK4z7fPKY8ENLAz+hXZ7K1itUFao79S1S /MFFObew==; 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 1iaN1E-0005oz-EA; Thu, 28 Nov 2019 16:51:52 +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 1iaMza-0004KG-WB for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:15 +0000 Received: by mail-pg1-x543.google.com with SMTP id k1so4771060pga.13 for ; Thu, 28 Nov 2019 08:50: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=6rU2ZvHsnSzYwMs7Z05xUbhf11jabY6wDKJCR5AZiJ8=; b=xLaNPUaUIKXCW9bn1eGbhGpqCq44pw7uvqUvbHWA4HXNCC3j8wDWHuHJOglsgXtqSk WHKtLL/F++cUfpC9UOFnfKeZYczymLgalUAVwkbj2XQewDTZaY49MRx4nJHwuX2LQ22g hZCd2n+Fs45bxCw09A83bpNdll58/D85vKQUfLvPhdLeJGezwl2ddQlfKf/glagBUdp8 1m8c/kJuqMChbyaZPNkYaMtKvkiReM3ynaPvfVHGYkjtbrEIXiSF6jmuEjWy5hUisEd3 Mo7glQ+8H5q3aaptBsBgrOKcyZoZ596KJiz3lV9SYRpWfxNey2AXYAhCR4YSM6ExV8xq OwkQ== 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=6rU2ZvHsnSzYwMs7Z05xUbhf11jabY6wDKJCR5AZiJ8=; b=ZaI2R85WPX1yeWlGOPcsrRnxTsQ3418eCHyvEo3/AbB8zNk0GWwvx9IA28owM5FceD SyQ6FIRxry4NQrK7VGzItSq3n0mLy05Owv8kNdBXZctCMvzEuZMpQlZO/AyPB8Kaqn70 tYB2CDmNrufNdIG6yBZQNBtRqOHWEUpabroyPDVWIRsoKsA6xRF5MkORRTxf8J/0Z0fE jnfSSOvsHrKYnT/xjKXlio8C49VK8XKJ/xdtM2B7hnab3/AfWVqCuPL8ZxXWnx0A5DcF 794q79AYEyBdK+bq2gPlEj+/sqXwzkTKZlOhcePXacbAFA3rzDcnJBPxvgu2BIelTJd6 Y0gQ== X-Gm-Message-State: APjAAAWiQqCgp/CnFAsn6HIml5f+Xn24hFzNHmiAnWexmn7rxB2ZPfSC 4/IZgv7kUVzpaz4jKCLDgzaTwA== X-Google-Smtp-Source: APXvYqwwS5sB68lbDlyVrgeTCJ16HYifOS/3Hk6LpNS+0KYfnvpq3hykK4GUDY5gN7r2/bWGXWlThQ== X-Received: by 2002:a63:4547:: with SMTP id u7mr12360882pgk.423.1574959809102; Thu, 28 Nov 2019 08:50:09 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:08 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 05/17] hwrng: stm32 - fix unbalanced pm_runtime_enable Date: Thu, 28 Nov 2019 09:49:50 -0700 Message-Id: <20191128165002.6234-6-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085011_128919_C173A254 X-CRM114-Status: GOOD ( 10.86 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49: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: 11266391 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 DE9F46C1 for ; Thu, 28 Nov 2019 16:52:30 +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 8BDAA21771 for ; Thu, 28 Nov 2019 16:52:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RmV1XVIV"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="j+pGVSDt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BDAA21771 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=E1tyV8MjstiHoo6fFpnVHR8jz/tT8rzXAWjBVeFuMps=; b=RmV1XVIVRP31vcUk5Ng6F65Q01 CtRqgT7JmHn2on1a5EzVtOFY6JaGCu9rRWe6XAUtxwzLbUpkV9zH/qcmPE4rKb3wCJk+C9cs0mpw6 fXALy1MaEyBDdhVKA6i0QXmQysZn4d3L2NoKNbmofjyfUJV7krFtbFUC9Id/tTEnZTMMSFKtGBqzy QRUFePkzROIwbwNdHErBn42SzELcfJiOAOGTkTcEaApvkdlld8rXVTQPNYR+I2rrf4U0p05c0fAKs 2CIh+d90FLTk5mGukxk/A7c2/Wa0wIIctrvevtCtoxdelVJtw4mEx5zc5AdBZItmeOOukf+Xr4kcw RRITp5nw==; 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 1iaN1o-0006G7-7a; Thu, 28 Nov 2019 16:52:28 +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 1iaMzb-0004Qk-IV for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:16 +0000 Received: by mail-pg1-x541.google.com with SMTP id e6so13117373pgi.11 for ; Thu, 28 Nov 2019 08:50: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=/CYFf1/fglZp7zKhC9PXoy9tsiufDFpWHrIfBoNpSeA=; b=j+pGVSDttH9jAktUOyITmB+U/zXlXzbNFhYXzCMcA9YJZsyvOI6ptywHmqwrnG657V ftZVMmSzBzBStJF3FvFBVguNBN8TxhFKRNxvT/m6XssDlhTd8hg+TyGWXhlsA0w59WrP BLzwMuPWzNVVol4FXSGqovGCtodZh3fUTlZJVirJH1GpmyUiwk+0m8+v5p2gzNNNGQxN mVFASCDxrO4X8ORdulic6AyyRWOS3GnWNQdBZiXZSvIY6OrBimlNOZiFKyoeAAResIxx qGIVd/cUVwNW2Qs4NUVrMmgeZSxr6+xP7wLPLbJt1DPDj/umY/SMhtsdLDi8QiGvAYMq kWpQ== 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=/CYFf1/fglZp7zKhC9PXoy9tsiufDFpWHrIfBoNpSeA=; b=WKn7h6Omk/9VAq0ReP+YwAIU/TBVdbJDKiKlYrA/VGlVCuCej/fwL7NxL4Jh3QtyO3 U7bVywTGePSqh+Pz2t0RV6QZPzurd2osXj/8asqUBCZJNhaq69EzB2O1maBjvn3yiuOD OvbJvaC2gukAxKOSmyDVIQA/OjMdalbVozIMfVRQlbBLQkaNvI7MVIAb3MkrDHdFmCFT QmJKoWPgfrBOEUxJQHOP2CWT2B6gyXDbDFIoqQ+IbZ4jkTu6VFqyBnl/Rr2OsZj5430p XLF0/MHknLeobavd6SYbyD83AbSdbdE9W5FLBXpUZiNJ38SH73TuEduYU7Rh7ObGSBsv L7XA== X-Gm-Message-State: APjAAAVcHa6DvDVq5z4Bl4yyKQdu9VPQb3m868pR2JQAyN1DXaXXiYNV 0OBgwi3snI/jXHEl4mUxerd9uw== X-Google-Smtp-Source: APXvYqzpKQyfQldmlacCexxAJBteAtozIdoLogYWnWundKX96otdtVJvtxFQ/5CTEI8XhLTF/bnfEg== X-Received: by 2002:a63:f62:: with SMTP id 34mr11469684pgp.19.1574959810061; Thu, 28 Nov 2019 08:50:10 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:09 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 06/17] remoteproc: fix rproc_da_to_va in case of unallocated carveout Date: Thu, 28 Nov 2019 09:49:51 -0700 Message-Id: <20191128165002.6234-7-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085011_707730_737E8552 X-CRM114-Status: GOOD ( 10.12 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49: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: 11266385 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 ABBD26C1 for ; Thu, 28 Nov 2019 16:51:34 +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 68ACC21771 for ; Thu, 28 Nov 2019 16:51:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nJI+P/t8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LWoQEcDU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68ACC21771 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=UQkAR0SZr8YD6u1ev3OBxMtPtfkQk5vZ9nKILRsX2RE=; b=nJI+P/t84y+61UAuUPVuw5flON FhJLkw7aVfSbFb+OMMml2h/rxaGb8IoGSUGNuBNt1JV0DgZPCxKDfZ27p5wPIDHL0GqF4mCsExvO7 u7bvaD4naQ7YCqwctGo0GJTIItRlSeE3DlbJvWFD/JbFY3GXbVrxBdWvZOcHwP2Bmjn8MD7BqpNb5 ZhuUTwFhknFWJbKrwZy55UTebCVjBfGECVbV+jTR3mRy92+MABzT4gREJZFupTkWihbXQnwXZX6JR d2e89UGQ4DGM1nO3+qFnDNSBOYmRljypln6igqpAoNDluGrPRNWLtm7/TZvnogZrMuelGt4m9Uz2B J7RiXQRw==; 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 1iaN0r-0005al-2Q; Thu, 28 Nov 2019 16:51:29 +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 1iaMzc-0004YO-Cr for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:16 +0000 Received: by mail-pf1-x442.google.com with SMTP id y206so4753073pfb.0 for ; Thu, 28 Nov 2019 08:50: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=as0Dyqn9IW+Ib7FMH96nGeZ/5dUyDxEzw1IqFd6RcLM=; b=LWoQEcDUQHLetfKW6rW+t+LDD68rLNVYtb+J/5JvQjwdW2aCkD/yjcH+jbfyVtvH1P B+MXWFYRYwnd2grVFtyCK+NLuTWUPp1CmRnK1PxI/7J2Wet8vuP/tJwaPXyOeZfxp7Ji ZGgpo5WHMLI1xBw4tmsfd68A6ZnNXU/qJWUVCMaZFYsDsJlKGlnEjQzSGBjQFJac7zMB OFMCPKhQ3B6QDBzyULAvAf0RMWkl1CqZZo+beISxzWF4HTJLMQw8m+3FOr8RT6Ho7QIJ hu2J9gKiVLmU5Pj2CQO7JTKe/GIPgLr/gGT4FzH6qh6IzCdis72ohSNzRZTtpnVdQOJD lTfw== 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=as0Dyqn9IW+Ib7FMH96nGeZ/5dUyDxEzw1IqFd6RcLM=; b=IW96v5edu7pqDwRgemXXwfowVCxEUcs9+2xeaY62WLIQbQN/G8XtmQvjr2ml+K+MZl YXXJ0BkGuyIoyqyJ+QsdW6puPe+Ut1/uJ6EJDc9eSZDv7o5A+qDmhvl9eq3ATQIdksTe JOmxkP+8xbHVOOaCCKTxkK2268UmkfnjNYrJmzsXEXIQFUpn5AleHRw4HXoolmHXgna2 wBW34ciVrCGMIjr8sUeyrVqcb5ptPL0odVfvznsWeba0VVBK7NtMHSiC5IcwNyMPG8jE YS9Xow7vQUhU8FE3x0N3FMOJRpGlzuUroj/pAvFISX0qQoEDOjehuhy5xOGWylUPRDg0 8Ivw== X-Gm-Message-State: APjAAAXYK6RWTO1vQ9nj2yykxcWYaFPRPbR8KugRqyIluLoAmXy4Odb9 ON48qDDCj8iT+lGoHuc27cjbRHsXahg= X-Google-Smtp-Source: APXvYqwOnLS/7vwFXdBkF6U47M0v/d+v//XHzDBLADouTpgt0wZSZX1ch2wKxZSEtHp3izvH+R2zKw== X-Received: by 2002:a63:cc05:: with SMTP id x5mr12334748pgf.141.1574959810877; Thu, 28 Nov 2019 08:50:10 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:10 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 07/17] clk: stm32mp1: fix HSI divider flag Date: Thu, 28 Nov 2019 09:49:52 -0700 Message-Id: <20191128165002.6234-8-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085012_497220_E07E2E20 X-CRM114-Status: GOOD ( 10.85 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49: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: 11266393 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 96726921 for ; Thu, 28 Nov 2019 16:52: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 73A6E21771 for ; Thu, 28 Nov 2019 16:52: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="QlPeArjD"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Yd4WyxjA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73A6E21771 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=GdVhlCL0AfK4ZNns2+YwoXffHjvNCYm7z0MGsPLfUzk=; b=QlPeArjDNAvob99wZoAp1X8sCc Q/scfCIZibY+h0zjS/UxlVHn2BMhpLoH5nlkhsWlt3L3ehjpI4GOc4HPNyV419pd63dGnPngy48y3 QFs/Ss5RXtk8BCm+sx6JWSNF1ogtULrRV1d88OZ2RYGxgoX+hqNaKHfky/9WAEJ+qzVFRO4ZUkCTd 5XleJayiRYsBDtgiWJXKb8HYQq1R7iPIAEwqGgAPwgGFmJ3KU2aB+gy0SZfBnEdRhH4b5lmUiiDkn hFEet5KCa/LccLcQ+zjuRa/VSNfmLGFxIuhLtYwsiieJkPPoE9D+jqFAj8FKJcN9BO5VBwTQZy7kT OG2FeYBQ==; 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 1iaN22-0006WI-IZ; Thu, 28 Nov 2019 16:52:42 +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 1iaMzc-0004bU-D0 for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:15 +0000 Received: by mail-pg1-x543.google.com with SMTP id b137so10825534pga.6 for ; Thu, 28 Nov 2019 08:50: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=k+cv9/8Sp0jhDfTqkaHbtLM5d5QXQGR0f5kzjPotgaE=; b=Yd4WyxjAx8E7rd/IcnhXBtcueXEooIqKr5vao3pVuHgjBkGq4ZaAjKekSK7fI51QyS T3Go3A5pmOJD17IMW7rhikGV8N8kij+CEOuUarK5xLKoctOAsj4Rwd5wLAAmr56yeoyD zLb+afITrkuBO3hkpfMtWS9ljhFWzf2DmSRynq3/Drb6buIrQvZyLD/qSjBn1wF37Klz SUfduIUpjzIj3ZXYWTg5lTfyf4oEsu4X+a+SmVxzVpFdXbFqeexKBTcFf1WGUfXo/+y0 JZ8/aLdbI5VdH2fl9l6bNZIjyKdw5iC78x5Nk8JVNTcsyaxnMNyL91gSeYPRZBsOvJRf q8eA== 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=k+cv9/8Sp0jhDfTqkaHbtLM5d5QXQGR0f5kzjPotgaE=; b=euLO5q72HJqaTPkc7xc2KESqx9rmcBVauq180dvdHzUDQj16MWijKlORCJ98ImSx3m UtX6O54Ku7uSFXxVAPGdKufIR24+oXzGM/J8YfV8h0BezqF0K4O9xr39EkdPTkmssZKt LTc5UOov730S5nAAXdGIXeAkISdujnNuk/E7DvL7MlkhNNMfZaaXpulXtXr/b9w0atAk mG36X/2hj5p/XPbHLESKbZvxl7FdZKD8Fjsb6NH2sLNWfYHWHlglv0+03RX7gRluLoh2 VmYmoUuELbDIoU10qzqTlBrfUHuWbBiUALYLDH34sFPgunqY3RUCNSZuxHlIvpCOFVLZ 8CSQ== X-Gm-Message-State: APjAAAVJoXbjBddlcET01uc/GOH26hqSXlLd/Kj06XZuNK0qF+losKUb FD0J5kNzbGRW0+lSYnMwp/Q4w4SL/t8= X-Google-Smtp-Source: APXvYqxMUMxa1h9uLzPiRHvcVLAXZAzEiAO/Y3bGcLiK5S5NnPVSNJLYsMbhcXpVdJJdVxnfyIP2MA== X-Received: by 2002:a63:3409:: with SMTP id b9mr12187554pga.320.1574959811725; Thu, 28 Nov 2019 08:50:11 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:11 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 08/17] clk: stm32mp1: fix mcu divider table Date: Thu, 28 Nov 2019 09:49:53 -0700 Message-Id: <20191128165002.6234-9-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085012_448550_4C293DC4 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:543 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49: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: 11266395 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 254516C1 for ; Thu, 28 Nov 2019 16:53:02 +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 0286C21771 for ; Thu, 28 Nov 2019 16:53:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="twlS7pb+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bb++BL38" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0286C21771 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=i1idGPO+yEoB8NmuZc9YdlnE/p9oXMPvEYZmVY9k5cY=; b=twlS7pb+doCynVTk3wBGsQGZEL i7wjIa2Uhu6VMyoHaojUedbEHPrDD4Ky43wSJk21mbhU1lI6L5y693LQIr0FSwETs4c7Ug26dtw9n S8FKBCxWrRXzD7I2UMIyD6OpITyTaISXwrNe8DP1r7xK8tvVhaSUa2+WwYKVESTRs9XWblZlxg6zf dI95yx1XaWwXSOF1EM9xGLrtHR5gyp34R3zRNrEXXUrJFPbgNeZdrwk+RhswL9plhG06GeNrF1GLC anfHa6WRlP2m+806t+2ITTkeZPno5yvtz4p+9ecAfk6+exqRkwQBEHsCmSoLha/XE5afYK+wXU7xf n/8ZeQAQ==; 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 1iaN2I-0006m4-CI; Thu, 28 Nov 2019 16:52:58 +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 1iaMzd-0004ci-Pj for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:18 +0000 Received: by mail-pf1-x443.google.com with SMTP id y206so4753103pfb.0 for ; Thu, 28 Nov 2019 08:50: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=WWGEc85+KcM+sGpnyTytKb3X6CvK3FAE9bn+Wq10lGo=; b=bb++BL38yQuo7KNIuQMOdkHafzxGcwnlx5bZPHOIdY6ABklHc3dFnGxtGBwC02EwY2 +vEMBkw/f3ymqZG5gg+5F4x+feO8IGCmzyBWtZ10BLuGTI3Lcid68VnHZpjz3tpappoU nus2CQyYFsvCqXzxXQ8z5hHfp/lQ+6G0VKKca/7ULAMmCZJclI97Vd9c9ZVg2TjZVVGH Pwpr1YsxzFlPUgjFuFE7KgYGWLLESq4ceWMXNOnKPO1h9G9QK38u1pVmAHIDV+IQYC7H IvMQDLqlQfbw4QrD0nGQZWsYZ8UJC+/7kNv0JEHAf/WtrnwcWL6Pye1Xsz/x+JrptJyz DqZA== 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=WWGEc85+KcM+sGpnyTytKb3X6CvK3FAE9bn+Wq10lGo=; b=aLkgp/32RuxxdS1hI1HVPfFhCf4umJDAuFSiEXSbmfuq6R5UQJ4AVgLfNpyr8AmEw3 nZec6rDfQsEef7HeqtqKVUZNqwqo5fp48T1Tz7Zo+ndLsutUO7f3V4p462FmbqQzMcPM Mpd96eE9+Gn+SDz2tek674tCeAOrxSSFyHUkTDDnfm3lkFjPNWTxrC1fhvhJw+8RjLsY SkG9P57UsZGOmYGmpSZNOd1vtmOjZR9VBiADNbFfRuuV7YNHm6lKWSBmfw1aH1zaiHoo 2/2WLZ4MqA/8LPBQ3EKCRhi8xUKa35nIfsK60zT16MfuXywLrxnJAGVcDB730nnbXiy9 TWqw== X-Gm-Message-State: APjAAAXQldnQiY870RSahLCCSd3s9l/RqU56IhkDRdXTyFeyIEpg0gRu luO98tKKDbYe6/HijOLH3JxOgw== X-Google-Smtp-Source: APXvYqzMkKzDz3Dog5p8KaalqQ3tG0sJuebo50vTJTT3XtXtN5R8NONYkk4ffIqqAFEDwHtpP0hc5w== X-Received: by 2002:a62:ae17:: with SMTP id q23mr54443120pff.2.1574959812598; Thu, 28 Nov 2019 08:50:12 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:12 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 09/17] clk: stm32mp1: add CLK_SET_RATE_NO_REPARENT to Kernel clocks Date: Thu, 28 Nov 2019 09:49:54 -0700 Message-Id: <20191128165002.6234-10-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085013_895675_37C7BA0C 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:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49: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: 11266405 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 37B976C1 for ; Thu, 28 Nov 2019 16:53:50 +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 0DF1821771 for ; Thu, 28 Nov 2019 16:53:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="q1uVBC3P"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rk/TdVgo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DF1821771 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=rmvlq50+GMkx/PqJcqtUVlRxNrgBt/8ni4/ZlsxuLCs=; b=q1uVBC3PBanRhDjRjVPGij2uix etG4U39/Sc7KjUhpWacvMNbd/Ivr22VarqonAfcc0F9y1eUPfNU/3AsPrbBL5ojKi6oth0EePFT1z A73R6EYtwMJ0KFGavyleqF+n3UzGuOnPGKwtkSjchr/UqqBaBnZMl//NpnZ/pEhst45y1Zh+Dc8vM 1SDNJp4YC2ld4r5s6Lyk0jcQgGop7Yc/CE98UsssHeHE4gEOKxJJcEfWt0CG+ntWwvc1ZBnewYLpX pph0w4rq7wXPzsY72T5BwAcujffGm6d/AZg7m1UmQFqi7rB8hhqFq1thMnZ4X5Rrt/0D1nGP5l2GX aGpB1i+A==; 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 1iaN34-0007T3-6G; Thu, 28 Nov 2019 16:53:46 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iaMze-0004dH-Tn for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:18 +0000 Received: by mail-pf1-x444.google.com with SMTP id i187so9204185pfc.7 for ; Thu, 28 Nov 2019 08:50: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=jY7j7XGeZ35a5OePHaCLSQ6i6f4GRHNTIE3RrACf924=; b=rk/TdVgoD1IwdNF/bmyE65/dESdOwICMlgGj86MG4i4pagGw7ktUvMFDE6omLZM7Am 3FCdQsSAtE6cELEQg8ed+WrvSkgrD6+bLxTv+Ls7ZxJqFZCV5S+F2WaQ1vAjwKHOhXfU QiHqCQ3FWcWYfmUxBSzbRWZw5qoiQWEWdkguK0EW4tn3e7FXImtRaWK4QLPBrPLdlYIJ BHdEXrOzIenD/PmnpoySm4HkRnCylqayGHDdb+SMImj2Fq6AZKTY9LNSe20vG4PViqxK s13sdUzGfh/dhNaR6DIGF4JPCCnC+kozLTDtGz1YTPyhqEzTiDALZ+82RJY4GLlRrNQd xsyQ== 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=jY7j7XGeZ35a5OePHaCLSQ6i6f4GRHNTIE3RrACf924=; b=TaHP99slNMmYUAqrNuG8PjOV6DRhluqcLMQd4NjwwHrTRnRkdN0Ybcdu4in7Yb/Qg0 M1M5tIqglueRdjRnkZDx3EbYY+CZoSCjRj/Cw4+JyXDZRWzqodzHTFW+qQ34VfIg2VnL eMNJnYCmdnxWF4t185FaUpKrFb0wfRXnZyy3zBgeqq9sga/ssRP+jj5TEiNHgNBxoFNX PYYWpssHEYNOp5kgvROZIVxq1pbuihjMMYi/7Gtwq/iU/J0GySsMqExeYIwFfR+mxsC8 OkQQuxrQ8qSY8cKa3qoSim36p7TeeTCl6YmYFNaU8hwGHbsMblln/LduXvTTYURuBagy tCLA== X-Gm-Message-State: APjAAAXhWOWYuhxV1jLB0VWqu4czVyrcJTpSUDM6+DUCiiEaEyO2NxBM tWc30qFc64AtxVUiY8pZh1RWTg== X-Google-Smtp-Source: APXvYqweYzi4M9AMfmWN/j96HV08rLj6Z1utHyfK7EpXnpTX4iAGw5js/j8Q7AK1jayA/akmq+Oa7Q== X-Received: by 2002:a65:4242:: with SMTP id d2mr12151883pgq.166.1574959813448; Thu, 28 Nov 2019 08:50:13 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:13 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 10/17] clk: stm32mp1: parent clocks update Date: Thu, 28 Nov 2019 09:49:55 -0700 Message-Id: <20191128165002.6234-11-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085015_168056_9A26E644 X-CRM114-Status: GOOD ( 11.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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49: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: 11266409 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 EFD006C1 for ; Thu, 28 Nov 2019 16:54:13 +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 950CE21771 for ; Thu, 28 Nov 2019 16:54:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CyAN8hK4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O9JevNY1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 950CE21771 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=yCCX0DVn7gVBw1Rf3V1LngxbotJ4EL3WEB8CnCcgRHI=; b=CyAN8hK4h0lIOgjSgout3UwjWo hCNl8IqHi5gDOZVX4bgQrtMT0kAB7z8uYwbiNNJfSBa1KPrKvfwxabSK42JXJArYlED+sbmGbyAsC PgwEkMbccRU7x26Ty5v2DRpTQJWi62XtMAUE5Vo5yElVUJ1+uyKNQl4EXvZ0aFM2HUcLEV9vFUQVC SRAt2EX9iZBxIf39eDW7n3SUe1XANyVgqc/K1QBvVoi6/BRKqWKnJM5JomMYF8vCsDhDh1sK1qnyD g1NTUxqWkyRAp+pnvLcGguvBaMkoj/5WbxQUDGQZjgT+5Gat0XWQSQNRbKe8SC3EMYogQsfLNUJ6x /ipBcSKA==; 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 1iaN3Q-0007l9-Lk; Thu, 28 Nov 2019 16:54:08 +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 1iaMzf-0004e2-Cc for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:19 +0000 Received: by mail-pf1-x441.google.com with SMTP id s18so4810056pfd.8 for ; Thu, 28 Nov 2019 08:50: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=Dfqbr0RxajlO5BfpaJ+gj/cruGVf9oBCHGspuRMYLGM=; b=O9JevNY1LOgHwoZQBP3JRCrkxMNX7g335LWvtIGE8TSf0gdh7CvuTTvGfjm78nXgUM +p1zMhh+nbn6ISXwf21PH0Z60BkeYpF4a6JzV8KEkI2WqyswsIDCbpxjl7X+PRhKCzIs DXpIhvG/INtLpkzRZFie2gEw9yF+o67uC62GGi7F3QILehtJeR3fMeC9qJxpd4Rb5bQn 9z5+WTrOoWg7fT07bhstV28T/EBnSeUD0loJ3jbO1F/0igGdeu3+T9Nt13ydF/Z+DFFs rkThpEXWnl23uu7cSgvOhyGVz2L72jGZfYqVGe0hqI/1KBTny0XVSPtvXsQb4D+rZIxg X5Vw== 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=Dfqbr0RxajlO5BfpaJ+gj/cruGVf9oBCHGspuRMYLGM=; b=HaLg1vWbHpszP0M+c0CeB4t8hgg0uYOsND0Q4xawaSDFgx5MmmDfe58hvdCeeoOBCb Ymx78+85K2Oi+XFb/TS+1FfDwyPkMymgJBALdhmJrP+8Tbn294b1TqRW9rfbAF5E/WYi MLJuN9XJFRgcz+H+e0ySRqKfqYzkw6RGX+Ng1Qr17jObtNoRlO2+mibXCqTsbGSyBJGg oYNRdxuGGCCcyFucvHayTWAg7x28jbTqEf7/OT6cGk/Kd0l/jMSEtpFSQd/O8wM0kNkr cWYr1PU8FtHgNxzSGZcawGSiKdOsgASDXtg6rVSQyhgkvJZdw4637b6zWp8N1+NkTppH 1esg== X-Gm-Message-State: APjAAAVImikGSIHb5UUeUCc2LbG/NTZtgpzForr5C7WAFWBvNFVy4Enf Dj8GzB6UhJo/NuIkWCAelo/YelzEJCI= X-Google-Smtp-Source: APXvYqz1CZkfXWlCWREUSYNgSlKLOyyH6hBE4kK1EF/EFkOotdf16LQQAGFxMXT09S3PLDy00ju7iA== X-Received: by 2002:a63:907:: with SMTP id 7mr11914734pgj.361.1574959814421; Thu, 28 Nov 2019 08:50:14 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:14 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 11/17] mailbox: mailbox-test: fix null pointer if no mmio Date: Thu, 28 Nov 2019 09:49:56 -0700 Message-Id: <20191128165002.6234-12-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085015_839278_683B2514 X-CRM114-Status: GOOD ( 12.17 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11266403 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 757446C1 for ; Thu, 28 Nov 2019 16:53:36 +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 503A321771 for ; Thu, 28 Nov 2019 16:53:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CXFHrmBY"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Jq5l6POX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 503A321771 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=74VyuRAKHcKXPL3R+2NIAb41rLSDdi7rAMWfccJlsgI=; b=CXFHrmBY8thVEHpzFpUa9jJbpf TPUShF/PBgyzK86jlxT5EkVqA5cpGQQMjvUrXedLBSr9NpkfCr1L3eQOIrOc+fKmgq3FJAiOWZsrU t9cRrS5/ZRy7KbkYe8svSQ3KylHlafVmXQ73Qf1xs5CfcbCWfowIB6QOOu8k/2eEDu3hsmO6sk4a/ xype9/6rPWH9t9G2ixKnqPl0xK0FWtYhcCxNaUiBVnEGS5ztnWcHsU5uTrJLFMDu+LRV7vjEIYyMe jn23dWd9SlJqnUS38KF6J0DS4xEHjdB7DtDQEeJeKsYZC16a9H/+vvgdS9DDGHcH69QUKM8YMYcq8 ZB6EmFpw==; 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 1iaN2r-0007Ea-1Y; Thu, 28 Nov 2019 16:53:33 +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 1iaMzg-0004eo-6l for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:19 +0000 Received: by mail-pf1-x442.google.com with SMTP id p24so13384723pfn.4 for ; Thu, 28 Nov 2019 08:50: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=nEtPBscm61+nPEVWvbJjdtfKlHF1+Tw29QLFNNlqSXc=; b=Jq5l6POXhKBLihg38Usaui6t0nqV5sQvbWbI6rSgNIYk6n8WGDMMVkP1LG1/2x4qCG UCyeQoB/AbodwEeK9haGNGeVGO8BzgnQuR/VI/1+k7mg0XhxfCHBQ2Jew9pOj0wEvAwy 2WnWtwe73c5FU0NnojZiurA8804vygmxVRyse2+b5ZsZ7WpuLU2PEcTZyZGnx12XnU6r Cmmwe5RWxdl12kf8dT8BkmTrdBhlYSRqHUThpLcxcOwXlRELSCzdl/hd9EzIozpCZQzy eRYJ+rCcOw9gzunEYkOpG2M7cv3cPrz3S8v7jfLhGslUmsAe6+SS9DEnP4dTHmNwFXTb sW7Q== 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=nEtPBscm61+nPEVWvbJjdtfKlHF1+Tw29QLFNNlqSXc=; b=rcEhEQ6B+rZkAPFoDbBZ++XUS7Qs00V4FvI8IqtGVC/HhJKuO1QLS7NW6vBZyTAJ7A 7k9dUFSEh6IqEuujIy/Zj4qHcMmwLpxWjgIVCTRv/ezTiooerkG7wr2Rb5ZhOO/nlIsW zRvkyj/QIa9TJfrXuo8td2IzwNe5Fn6t7EVJIGxxZSi8bu3ZhPMdR1Pj9Wh/Jl6lnA1n /eavxd2Y26ef4qBg8m0Es1OOgXvdwRjIT0GiYI3uWUVt/jZpnSIFEuybMT42kntaOkZ0 tRoenlSkZFz9JFFyDm6kIL8VFtQDy5QxQga6zijY7PR5tpAp0jOsW7qqoxNu6nswVfwI 4MuA== X-Gm-Message-State: APjAAAW7C/1sqyz+LyQVu5hBcs+xq5llCqOvSSrdVBXfXqg2hMIKzNBY FCcu7Ov7JVcAqMMNVT6syd5p7A== X-Google-Smtp-Source: APXvYqwNdeqTwkb0h/ndd1EIs2BFrMN77BDNUueQ03UK/DdSGN5qX3NDPdyxhT5N5ic6H78Oc/vxeQ== X-Received: by 2002:a63:5017:: with SMTP id e23mr12224287pgb.32.1574959815274; Thu, 28 Nov 2019 08:50:15 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:14 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 12/17] pinctrl: stm32: fix memory leak issue Date: Thu, 28 Nov 2019 09:49:57 -0700 Message-Id: <20191128165002.6234-13-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085016_326654_94605316 X-CRM114-Status: GOOD ( 13.83 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11266401 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 459F9921 for ; Thu, 28 Nov 2019 16:53:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 17CCC21771 for ; Thu, 28 Nov 2019 16:53:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WBJa1DUw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XxJzsLiK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17CCC21771 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=m6oWGyMFlVzoJNCzzRp8IQwmT91t1UiAsRb9Rfp7UGQ=; b=WBJa1DUwITgifH50jy4DKq8KNX RMLCTZTMG/IxLqNVlB/dcNjLH3pw9gcqWJm3gN7A7c/4+EnHa32CxxI20B5xqj8RiXNwIlehEYRZh w1tcWvWnkmPAhhHfFsPkyJ7t2d7Zecwgnpx8pAFVNOfsgh2LkVfwE3hCOKoQqhih0eYQTDz/VZBY/ ZzQaDiRH2dbrVDElwjE5koECVJUl93/pXnhpQ/XQ0vxlbWwbSIB7hSG8+i/jMiwL1zxWj3QGFn2PC 9SKHY5tiL1b1YJxMB9qO2NBHd9HmsGXgGAsPrveoh+xVqZuO3WvQkaqLEOELnmpCsKLF/e+H+1Wn0 2rQqkl0Q==; 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 1iaN2Z-00071G-TT; Thu, 28 Nov 2019 16:53:15 +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 1iaMzh-0004fx-3c for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:19 +0000 Received: by mail-pf1-x442.google.com with SMTP id h14so3190842pfe.10 for ; Thu, 28 Nov 2019 08:50: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=wD+KHeFwNIT1Ivtv7WYTanJVrN7dwD/1vKpe+xiraBg=; b=XxJzsLiKI5MPczc6OehjYgyBmdMq1rBlV4V+Ha6DjUUuQDc58zxRJ15aB+Flz2aYMS /2fsKbeii5vSFGyYLFyJL0ieaEG1MHCsh/SccclxbtTiOnqYmeL3m7skNy5lBQvJOuOT m+rX2LH9zpUQ7UCKhfMObYPSO4Z60lL4f3A9/vOxeL99JNhzPvuuT+Z8eWysovrGetzS 8K5SG/rBLI4MDRNqWPudwHilN9b2NSGyWWr9rMZOFPKx1eX691hk+wXM1nql2Rvzn7NL DqT5nYp8ugOe+SrQ/msGWXnfK/LlZqTDFIAy0jA5CwthjBn12uB0UtN/h0ka68rAPhJq JFVw== 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=wD+KHeFwNIT1Ivtv7WYTanJVrN7dwD/1vKpe+xiraBg=; b=Amgd27mK7uqeBYSkRuz09UtaqJ6uVRWWAUKxixVo+ni50EEZ+hliSXPkP3gmqbaH9k 3WK4yQaJcVvtjBa8Vxlad9/fBVaLzCNR8N7GSU/cYC2YfRVELPWoTARip9RCnWX29gqN O1yz+zk/sfKSl9ALLS1/x2Ay/8D1WnGvncD06U5XOZWyaz8YlGVd1vmJeqSWRXEuvuss 64IRoBJAyuNO0lc5W3trXcnrZZ4HJwh9IkUSLJr7kQkcLhzwMhHtAlXSrozyK8ogj71h syGbSvy1tr1gVMkytH30aAk1Lgq6QrrKzbYWvqGhl9ShYbiV1G7D7Tw2jSt593LqAXp/ Qb+g== X-Gm-Message-State: APjAAAX4bEADH1ykAUl9YvfKNK9HI2rxstvevO/4OnthHA1lFU/8DMeF evJn93Ec++kkD6QpWXsu/xcr7w== X-Google-Smtp-Source: APXvYqxS0HAt+GN5cRfQFCDZXmck4pldUrQ2zjv5oJleqUtgJvq5m2IQPbX/dTwWRbfK5ghbhPf7iw== X-Received: by 2002:aa7:828c:: with SMTP id s12mr52785777pfm.166.1574959816244; Thu, 28 Nov 2019 08:50:16 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:15 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 13/17] ASoC: stm32: i2s: fix dma configuration Date: Thu, 28 Nov 2019 09:49:58 -0700 Message-Id: <20191128165002.6234-14-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085017_170182_D39090EB X-CRM114-Status: GOOD ( 11.38 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:49:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11266411 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 5D7DA921 for ; Thu, 28 Nov 2019 16:54:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B2A221771 for ; Thu, 28 Nov 2019 16:54:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pyCr8oN0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="l5Gr5Qjd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B2A221771 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=d2qaNkZVEmXH28LcA5nBoxwcUerT5DsSGX0AyNUpqd0=; b=pyCr8oN0iBSALasFf+94GOg1P1 ot6r/qGWC2MaBoiuezGbuJYzxvZn8ey1VlsvYiRbAOKtUJB4fGE8AeykM5WqVSBRXlxaj/tJwxMaV sVHUdlIsMf6YxIoAOz0wND2yy3kq+5kQdQJZM0Ucp/NUBKrssWaienGzwIEZMh+jmHNh56ZTns3ao wnea3q4F/uIxYxdmlKpjKmxhErIrj/LnFCfZKg+4Jg0xqJZjZNXM3JA8gHLeAXA3P38v9sqc4MdSf 5Zk9LGhitiFAkOX8dX3TQJuKDWs09n8gRg5oKrDw2lX2pu2k5MqCvG4J+xe+Wj3DzEj18Fapa/e84 e6ieXwIw==; 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 1iaN3l-00082o-2f; Thu, 28 Nov 2019 16:54:29 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iaMzi-0004gu-AZ for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:20 +0000 Received: by mail-pl1-x643.google.com with SMTP id s10so11812139plp.2 for ; Thu, 28 Nov 2019 08:50:17 -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=zVs3SHcLVbqKmpq6Nb4lGHjdKCb+EPD/oEdMc3bO/jg=; b=l5Gr5Qjd9pVo0HxGFV6G8A0yjVBGoSZqzaCCL7mejIdkqCP3emkRfKj8vLMjNdrpI5 bvYK/b71kLhhQVKEZiOQWGEt7vBsj8dzHZ4K6L1XdXY/KtWmYN0JevpFOi7pDPo80nKm XUlORXTdlW4bLLGIlr0oIyukod20PdmH18UUtPTZCj6rCyxonWYBR4EL+oIhrfooYI2G 9cNOxHLh8rbhaCK5Ek1WiqhGaSM7g9KLuIuUeWE4xtOiN8xNKP0PgNzKpMklVjQJV15q g49ojWGv2xVRuHFFcgdRV5TslE85XMW6WJzfxKEMOl5c1eKidIUWEnBJOB1YP5/VeAuJ WEwA== 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=zVs3SHcLVbqKmpq6Nb4lGHjdKCb+EPD/oEdMc3bO/jg=; b=IWKpBOZwEF6nbveHF/jXmZqHXRaLs3fxHzUcp9XTtj0rSEnc7xCoPTW21p77fv3kll IfP/KRWe7w8zdoOgUwVt+ga1ZIBFACZIvgiOyj13Y5F2snBoYWMzT2huY7N/VzGUGZ51 bVO8gfXcR0X3f4ZI7Rnm7rjHXWceOhhe7yEcHw7zAdayW5zUYlwmpc45FOgUvirtt2JU 0nFOgJSNgZ0dDwBBRwcDpdW/QG/QnANmfNKi2iTmCHtXSNiK9uk/Gzmfa4Xf5Xyt0weN UIFjmbxD/eZKQYfZRhKa6fW5yQLDNnJbhL0jbDGSe9t1Pkju5qstReIyQMlIP4HJOxpV MTrQ== X-Gm-Message-State: APjAAAXGXRxnBTW0rtOLWP/cKyR8iFvcQEsTdX8cRsKnBcMTiqcugJoE 9jWr0MuyCS/YJzxsZiUGfSiQnfakfVQ= X-Google-Smtp-Source: APXvYqz5iFTxCKBSv+g9xpXEiPFwlT40atPfb9JCN8mALvNzpqC+2vNzcqNyKb0PlddBnmfLwvZVBA== X-Received: by 2002:a17:902:8bc8:: with SMTP id r8mr10661273plo.189.1574959817142; Thu, 28 Nov 2019 08:50:17 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:16 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 14/17] ASoC: stm32: i2s: fix 16 bit format support Date: Thu, 28 Nov 2019 09:49:59 -0700 Message-Id: <20191128165002.6234-15-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085018_376492_9997E290 X-CRM114-Status: GOOD ( 12.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:643 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:50:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11266415 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 508466C1 for ; Thu, 28 Nov 2019 16:55:23 +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 1048B21771 for ; Thu, 28 Nov 2019 16:55: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="B3+bzhux"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rqAF6te9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1048B21771 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=7xdiY0W/upJ3P834ikYfx5pnKGizZw0IWWZzAFLA/Qw=; b=B3+bzhuxReculT8qLQ3rKZ/dWl Klce9JCdoTrvF/dcDmP0eb5gmOY+D9STm4w/t4/+lhb8cSEJmkUWCQisZxIfpEX5fDQ3Ov08txt2U 7Of93Kl9QjGKLZ173zeiLaHjf5j/16VqTqQThgkUq/XfQmr1LxdEeKdGAxuGygCdrP+y0Wa4yQOrZ v+/km2ePYDUFl5GQQUWIeT0sYP/eFH79XEuqoN/YI4IQgOnO/vHBRPuf9B9Fj+zDuA2ecDc4vOQo6 Q2NkRddS8qYtLezyADFfNqTeVQ710q/Y7sWr6vLPSuDmq9qX4c/h+kxf7xTJmlfOH8MkAgpEU2bKf Y8rTaFcw==; 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 1iaN4b-0001Zo-7G; Thu, 28 Nov 2019 16:55:21 +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 1iaMzj-0004hy-DO for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:21 +0000 Received: by mail-pj1-x1041.google.com with SMTP id v93so8843831pjb.6 for ; Thu, 28 Nov 2019 08:50:18 -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=j3tKRddo0sP/VNAlHyU3woPmGtLiTh7D/WlbKBjTt+o=; b=rqAF6te9rthxTZcjJVMOHReLi4Ieoi1PglEBAato0h+n0Nte51no34MOFzYYTnECH7 tjTEGEoyXtjxOY9bbCX1BEZbD1S9gXhuEU3FurHraYK6FfyuLO2wnwN9spCkBk1vBXG9 oZ4ydp3GGO82nT0eUUczi+ThQKTSsyUmPY7YYKA2BdQO6VZoTO/RVjfC0I2Q6ktbxPhR IEN+Bl8Shj2G6ap1l4T2tFQAzKaxwz7/BHTdJMeslUFTaoUgFxR0BgMbPmzl4tX/My7l LLEm4c7IOb6zdU2ScOJxnZH96HtYv9IiHEGbJg/rew3s66cM6VfHq2DSxyfGyg1jzfeZ JZqw== 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=j3tKRddo0sP/VNAlHyU3woPmGtLiTh7D/WlbKBjTt+o=; b=iLEgoQE5za3tzzNGTeouYUx0UG7L6g1bzSrrkIc7QiCZJn0MT/uSYTscrtADvjt2us bdZPuXBCtVbG2TKW0mUIz4XAcH0k3lcOAXlRMctne7eT69U6Rd1yg9Mnj4cRKCL4TWVF XPmBJ6cOe2PaOffQVsPSs7CrcBeEtBIkjBBM4X3dzlujCJXCoTgZhMz77Sup4GYl9EHM TB2/l3JrM+ygwsXt50RBNdpVT92nSw4v2+N1IQf8bdrck2OOUjlbGtWDjwF1MxHu2qOZ zgmSsv9XbSMLmkX35TdvBCrDAiKURNYHNOctkz5DEd1AtYWxI5PLnY2w4c8o/QZyiuVW F8gA== X-Gm-Message-State: APjAAAUVsHduGptCm8rTpofT8/jm3bAHMFnLJuPoTd4F1d9Iv72ER2A9 TW7D6UbXQB/x1ZrnbDO57V9SUg== X-Google-Smtp-Source: APXvYqw6bnbkAyEs9nANIBldH4r+0Epb9o9R/X8vZKnvryS9C7Bs7E5j0NZVw8WMZoHllLJCzCi41A== X-Received: by 2002:a17:902:ff0e:: with SMTP id f14mr10621260plj.3.1574959818336; Thu, 28 Nov 2019 08:50:18 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:17 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 15/17] ASoC: stm32: i2s: fix IRQ clearing Date: Thu, 28 Nov 2019 09:50:00 -0700 Message-Id: <20191128165002.6234-16-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085019_501241_E76484A6 X-CRM114-Status: GOOD ( 11.03 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:50:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11266417 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 111006C1 for ; Thu, 28 Nov 2019 16:55: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 E1BD021771 for ; Thu, 28 Nov 2019 16:55:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BcudIJ/L"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="l+WJiw5F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1BD021771 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=9LGcxOinMbc3+/yAfwP4UKzwvKR3qJFzqBXkMFfnhvo=; b=BcudIJ/LVGUx7hYCWT6wC3tLor tybL3ZMh18j5/Qjaf+B7w9qrX/Bp08vhxW8LQ6ACWyqBwzOHo+S+Qa8sRY0P+GRIMzSDOJK3vCggp f6Ft8I/WkUuavFObw7tkhEDrFz/yyAtcXyj8RO5DChTP8oz3y8dbmBarEYioZ0wmmQD4ak29aRNL4 jlcQG2fOaIeHwYfp8npxtKDhbZ950Zp9na1Nz+9ZoFf3j1kQ1UgX67phw1H+qXaB8t8ho4K6OhGog E5e/iWM4E402Oj9T8KPHF+qKLE+jyUddLIWguT7P+gg1zsw+GAMuU0L6Q0nqN7Em5mnKadwl60Ayb njgE4wBQ==; 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 1iaN4n-0001m7-Rp; Thu, 28 Nov 2019 16:55:33 +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 1iaMzk-0004j8-9X for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:21 +0000 Received: by mail-pl1-x641.google.com with SMTP id bb5so11811168plb.4 for ; Thu, 28 Nov 2019 08:50:19 -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=Pq5KE5gIMiwWIeSMy3T4ZpUVkQI2nKjqwjW9YajORlM=; b=l+WJiw5FLVFlg2GB6XJBFoKiX8wRGvOC39Lkh0eo9GF2U1R5dvDk5qSGf0mZyR0vCc Y7e4vpSWAV0QLx5g1zc+WO0pWa1anz+Bd+U/2YxuciS5ALd7iNeJkkUa8nQJacIba+Pm 0kLdz+ycG9JYZZWa0KBQT0hJPYBJvCoV4sPn10uWObuUAwd5O/pKNS6lfP6kVi4XGlZt 0g5fZWPqGFgLCDLo008WlXCCWNBhf0GsbRKmNpMq8thQiVZRSJ9x8fpfVK/TwTpgQJIE pJHBx8mNVXJMnQR7I8ruSp5OH3kkQDcwIBA372I/NWDLX3AGmAIEQywRGQThamt3rYX6 dl9w== 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=Pq5KE5gIMiwWIeSMy3T4ZpUVkQI2nKjqwjW9YajORlM=; b=lun4phpi/ET+NOV3Zx3pFqM6hIAiNSrlKe9rtVNFqBL8Otke6oe6RbkDrzF2s7Ubnr +SsRXvy7SJxmbfpqaPElMiGOBOKc3hbHToJVf98Re3g7qZDJZXVHsopFnbsJHpvRyY19 JKCI522NJn8C+EQCev0WUkMS/Gbs7L9+QMLQe6sZMwlpQfK5JgY+I7x29x89Y7KZk4qh 3YXk6r0sPV0La08e2Qew94HaNPnAVqufoIrksVaio2+dyXyZA+91uPfbDC3VS8jRnVXT yUp+Fq4h2JKPsY/2OFPpIVWIbecBlatMDf4i05nHLnAuqmEZuryFTftiFMGclysjUgGz LL0g== X-Gm-Message-State: APjAAAXUrxodpEI9iVv/PuijMfWboK6yiewvGpnxffGSlpMfjSrbA1qo zcLi0T/q+3CPlbbkKjxGlR4kCg== X-Google-Smtp-Source: APXvYqy7nY4M8oKkslqOt/PVLmbSbyuu/6WmpZQ19v6gUqyI/h7a+EpQzknbr5KGWOToNNslZQXfxQ== X-Received: by 2002:a17:902:d696:: with SMTP id v22mr10301232ply.66.1574959819278; Thu, 28 Nov 2019 08:50:19 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:18 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 16/17] ASoC: stm32: sai: add missing put_device() Date: Thu, 28 Nov 2019 09:50:01 -0700 Message-Id: <20191128165002.6234-17-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085020_334953_11FEC0DC X-CRM114-Status: GOOD ( 11.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:641 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Thu Nov 28 16:50:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11266413 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 B14FE6C1 for ; Thu, 28 Nov 2019 16:54:47 +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 8F0D321771 for ; Thu, 28 Nov 2019 16:54:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SlwEcK3j"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QdfKOwx2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F0D321771 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=UU0lMK2EZjB2pJHHl9jbp/ZlEfV5/v8cDnd/xEG1YwE=; b=SlwEcK3jvnoglWMsypapV75+si wRUIcApSD0g5cTVsyMx92qOsz2/BxbMUWsUeuaczBtsUSQ9Pggqncwm1CjYZ1QtKDcGnw6dJP/zZH p8DRun90Ch6tSzEkkMk2j7UEcedsyzt9XH7s7+9FvKtXBu3TG14u8WPKTQQc/UsQX30QaU6OYpRby ZTyn3HoCZJJAFA92XkgivrHrPz4A5MCNJIrLr47K+1nTml/ATsVfI71JZl8BFAYkhTUAv/N7U8EHa AoOxgULerIq6SLn74DcNytOiZGrGw5K/dnxzEj1oR9NlJ93dRnN1OSK5COaLq7YiOcujWIggLQm9X utrc4gdg==; 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 1iaN40-0008Gx-Bs; Thu, 28 Nov 2019 16:54:44 +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 1iaMzl-0004k9-Ch for linux-arm-kernel@lists.infradead.org; Thu, 28 Nov 2019 16:50:23 +0000 Received: by mail-pl1-x644.google.com with SMTP id s10so11812207plp.2 for ; Thu, 28 Nov 2019 08:50:21 -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=Ve1daf/mMGyyV9VtqaD9VZ+drFrdziUeyzqFEa1bEX8=; b=QdfKOwx2OJabOfCqE3mEGZgTrv2/gWtfc9aPsAegxShDlcJFxfod9xbR8qUpaUSrKA lN+swYwLnlgLgrSviR4JWJihJonMpuhy7wXqHAnmUInK0mv8323jJHcCIE4QGYw2lsZH q8oKAydylvf86RpUa4wuc+K76Mk8Yr0z0Bp0mJmTZlYpbNQelJuy2w772CJ365QXJ0hK sJQROf9qRH30ngnifsT6wcvVfOsqo0OHmynT5HckidI/ew0Z7ofqawUkSOMQO/qEzAcp C1v01meXvQFJRnBwVFxCG2S+pRY6T9NkCdPIOWPZspbfiwTUWLVf5twPkpqtU/z0nBQI nIVw== 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=Ve1daf/mMGyyV9VtqaD9VZ+drFrdziUeyzqFEa1bEX8=; b=XNDyrUfupwGXvypbuCE9e47Py+F+ebEZYugvx4EH/x53BCxI3qEXeNp+ejB2Rihsu/ fmE87UnE+IRwxO6DgOQ8eN/5skg+quIRU7he62bmQplTP+PLN18WnV+HR4D1DBpciwEf 5TuaL7dCoI9XPdhwtbvfKkFM68QXtzfk4pa4eHMeGkJSvrggYuaErL5yijDLIGxWNAk6 DAmPHQ+c8NNzv/Z6vQya2kdAzUiXuwodqxuv263/QV4yupYnPHfRFSPO1h/brTLRBtPn 4ajBe1+69tA1sVhuvtwdD/2QhdudURaukx4ZbthS5mfZTekT0tZi0nUdRkr7Lvq0r8Zd weqg== X-Gm-Message-State: APjAAAUjjdE1R/0H9MBaaBkr3SAmFZnqEVsv9567M+qV0JGePcfyinxP EIAaCGKNsQ6YNoz+sTomrb2xFSsTCWo= X-Google-Smtp-Source: APXvYqwF9EpUID9uoRJaTP7XOptfqBdu8zh2mx1l+skezdxU/+nVZEZ0krSH/BIt3st7U3Is4b6ZnQ== X-Received: by 2002:a17:902:b181:: with SMTP id s1mr10698227plr.62.1574959820186; Thu, 28 Nov 2019 08:50:20 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a15sm2450343pfh.169.2019.11.28.08.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 08:50:19 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Subject: [stable 4.19][PATCH 17/17] dmaengine: stm32-dma: check whether length is aligned on FIFO threshold Date: Thu, 28 Nov 2019 09:50:02 -0700 Message-Id: <20191128165002.6234-18-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191128165002.6234-1-mathieu.poirier@linaro.org> References: <20191128165002.6234-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191128_085021_481538_CD2CBCC7 X-CRM114-Status: GOOD ( 11.28 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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,