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: 180443 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373302ile; Thu, 28 Nov 2019 08:50:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxZvHzMbRiYPPifcAeLE9FRkmVRjQnZnomsiOnIbe5zJ5UKK9ZRDpG/zolkJ8LY2Hl+d8J4 X-Received: by 2002:a17:906:2508:: with SMTP id i8mr42684729ejb.323.1574959813764; Thu, 28 Nov 2019 08:50:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959813; cv=none; d=google.com; s=arc-20160816; b=ON9C+a5/7G4Nr5ajnu/XCAjff3iSstFNUOzrd6sQcWx8szYaTWCP2afe0/Szvd9VCU upMyOsX8m2kRVRD328GvC3iBdiOjPlsaj16QxKG6o3aClbghfSRHGYuokkTXPysCf0ns VxENcdbOoYo7XE2aRw3STESd79EiOgTLRSN5bZsxBAp0im31Uj1ZaLuFgJcnvZ+mo3Ud Ho/wpIRKlpgHGV54XjGWpYIRDrN4TLenuUb7HhQQtwDplAXdH6utjVafT52po0jy0iZU qhalGnA9qvTyRcoF1lhjpTtsZeAgixEiBAyjakENHIxFdseDgdGd60n0um1TLyOznQjh p8Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=h4A+UA0S3l+ls0zS2Gq9BFaj9JODH97JG2yHCpwCb+s=; b=OAQELCfUmbCEr0FhiHzpYEh7wAqO60PIKBbvkQlpxi/QNWSe5d9//buKin40A1vRPP oNZD1/xnN+Qp4eWmCyiv0ZI1UzrDJsnNkr71IgJfQwUI7xM0bPt+zI38vSYNLMK7mMrc VGrjvPExWY+wJjCWvfjivwSSp+fC1rLQDWqi50hfmN4wZZPCzuuhSA77eugtylC7qnhf rbOrSO0XjilRgf6ksI6kCRhrKbVfXYhbpgYmuGV/cOBv1z03B9kULYz9MqflXiUozlD/ 9NYU7IaZLuV5pPbc+Qi9VYo+h7Y7wfqeMTRwMzdVId1/JZSNFZAdoldGiCQMfR63YxYl PhWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wx+K86Gx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e26si12800266edv.82.2019.11.28.08.50.13; Thu, 28 Nov 2019 08:50:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wx+K86Gx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbfK1QuG (ORCPT + 27 others); Thu, 28 Nov 2019 11:50:06 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:40653 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726446AbfK1QuG (ORCPT ); Thu, 28 Nov 2019 11:50:06 -0500 Received: by mail-pf1-f195.google.com with SMTP id i187so9204048pfc.7 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=j1ERSTOXrz/eavXvUSYO7G4B2nOOBXk1Ptl+J3Gxr0jm1g3VlTtgNUJRfpOJp8cGzO pVx2TLGst4jkMMryUfrLs1/N/8d8Bw2j9tBH0iHSmboTspQUTuhCoN+eFLT0S1OWSzNe ZAKtSCy3vvqOxVAho2pXa5YzakMP4jzndtJ2ITXwg74j7pNYL6MV4qUVBjfxHGn5qd6S oUeTDYvma36vaF4cnO5OAkyeT+EKNALVNe8OENRJVZrQeIqiS/tVcuSkPwYtowT0SeMf sLqTXF60VkGNlzSH6f+nSy9sytv02t86IL/JhURywfA7fceKU3lJXmIvnnhXCcAXAfBk Wtyg== X-Gm-Message-State: APjAAAVHJPzH2Kz947PyjC0Ze5Y1Q6cmQ1V5MxoLIxVLLLD7Dis3ftuM Hi0JCnKoku4+iAulpQUzyamN/fxmmUQ= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.17.1 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: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: 180450 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373317ile; Thu, 28 Nov 2019 08:50:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxlAdAb1TnE1sBJNXQo1eajMYbImjIKqfwEjSaTesS8UNjjDJOrKJqz5F0k5T6cW67ArzYh X-Received: by 2002:a17:906:404d:: with SMTP id y13mr57097507ejj.276.1574959814861; Thu, 28 Nov 2019 08:50:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959814; cv=none; d=google.com; s=arc-20160816; b=rBONPWmdkzqHjfgNnE5PJTvxIfeigAVnvYoeY6pN5v2x0GpY/vDVEmDrGnuhrAtgEs 0NgZulIXdoaOzQ+DLb0ofRVDV+U4vT4qNyYUZha7dzq+PRwn7vOlx7mdgkf9sEqbNe2A fcyTE4CW7ZuSUkE+TOno47iUrVztYhgWyXBFs5EnTYxEaSrZh1s86WzlhD6Fl3DdpTvy /49Tu6tpvZYiTKgRf+eviyBuXe7I1BZVIbGY9SkgDA5Cutqm5xCaoFR8Fw18TFgtnu21 o5jt61tZh5SM47Pv5q8TfHMsFVng8A2yoq0XRsyrAVM3QNfdtguBunI+tu6hnvUJ/Eof 4ONg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=3gfqS5lOXPiWWEEMhIxCyyS+fLBSJCNPeR6VbsvmT98=; b=zDmLGhzjaDRllK4xrLCRaXCEmXRRgPMz/pzKLBVawvpF53p3jLk6K3J9ShVHPIdGdo jADA4341yS/pV9JBYz+ih+eneELwxrPEOTBXxMAwMhDD+mjYFP5rXSWK+EQEQrUZZ4NZ W4I5HPf0Kh8pJ3b6hLkQkNKuVdVsEVOxN7rry2XUUZMwA2wF2N/LmdrEzGuxKDuz6kwc Y4Sn87/gmf0hNDmI1wTtc0FLR780e5O41LzQ9EukQDgYh9tleODCmnUJ/0wQ/3wlQd88 S0+H0SwS/gs59v+5XyNVOkXubjO2c3PXsNYSlbZ9C6aHj0PliL3ij8mSs+86xcgb6tVr bYyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jhdXMvF7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e26si12800266edv.82.2019.11.28.08.50.14; Thu, 28 Nov 2019 08:50:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jhdXMvF7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726822AbfK1QuK (ORCPT + 27 others); Thu, 28 Nov 2019 11:50:10 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46277 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726729AbfK1QuJ (ORCPT ); Thu, 28 Nov 2019 11:50:09 -0500 Received: by mail-pf1-f196.google.com with SMTP id 193so13355019pfc.13 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=LmRb/57HaUKdKqZlzyOwspPzeNuktlcDnwHcIPlwGfZQSTPxE6/L9om5bVfFdsl/rz +Hb3V0NM4PPSIDI3A/X81p7XF8rbCVR05THSUCmTWrLhWChAVTDqoZE/4zf7ruilIa+9 LKSRUavqNCJdFXj0mOuOCyOdWoFANRzJEN0dv5g7fKnCb0kot7lEIYGeGAh2kR/PFHB/ n9xGh99/GCiDV/CJuiw14V+JgcsepxzcuzfmgTf4CY139V6YdeUPbc35LF6sv4EYw62m 6rmJ4iOXC7hPPi95IvWYtAygE3SYp5Z2L8EdrlOplyLCbcRfzgY8lt6WfUKbe/DlM7ke IN+A== X-Gm-Message-State: APjAAAXVm9PL7B2RniS2xG5usrydx2fUjZ0hmq1EoqjmctHPtayGlU4U 5K9j0spKJUwXdiFQRYXtscv8oA== 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.17.1 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: 180451 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373326ile; Thu, 28 Nov 2019 08:50:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxS29NBxT1YOinxjxGYGIlJtlHPQ7P3q1TiKhc5crMiLgin85aB7rSraS3ebBr7ALnKQ3tT X-Received: by 2002:a50:f081:: with SMTP id v1mr39414735edl.131.1574959815242; Thu, 28 Nov 2019 08:50:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959815; cv=none; d=google.com; s=arc-20160816; b=VGUookQxXFelpU9uB9YJR7d/Hm6cpvirUIG16QGNJDkRqfgwlnq7d+tfLQAXRnDkBt lnh+waU/rvb+uHiMfgcr1ajGe512AXOKMXCyhdqCfFdsYcqmYfw3zC2oiSp03McWAP2+ NYNYjKPhiG0LbjnVlSmigG4qQhXVFnMuAy6wcfYUfCB2QY2lIPlKCS1SHhBrn/mCM4Aq bnxMuV7G5yiMp7YPMfWrn4Pkr4jHSeTP5s6KnqJ++mDqaL2FUb67Rn70pKU4L4gHIYBU kn/NxRWu0k0O3SJPCo5a8eVFg7/nYUVjkyLXb0ZM5nrJQPX0k3mM8xqGYBTMkkVyheSL aC5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=6rU2ZvHsnSzYwMs7Z05xUbhf11jabY6wDKJCR5AZiJ8=; b=r0sUUhf9PcHIKGmLaNFaTGXGM9z7JZhpUkTW8eB8IWHsQN0Mpwk6PKRpE35UkE7D7m DULGOpRYuytYvnmeVrX/cySdL+yM7tyh70lljuJ1TGQOOWvsUmdYJ0OCifWkVyvxQVxX KWy0NeircPhVtVhV8bhToBdCsbJbpXhgNVC94ClFAOhdLJO5UBOAsFNjaB9rAnRLbHN1 3oD0uWP6ChxefBsGUOsXIQcSIWvlD1F6pcjGbMWyyVNLHbYfSX1hRveglMosViWu7Sug zBpi8iM8NgBkI58Wjipj8XHbQREFPHFr6uHGWUp/D1nhImm1eZQUxFYpiuBDjzu3xRfD 7W5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xLaNPUaU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e26si12800266edv.82.2019.11.28.08.50.15; Thu, 28 Nov 2019 08:50:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xLaNPUaU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726985AbfK1QuN (ORCPT + 27 others); Thu, 28 Nov 2019 11:50:13 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:43789 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbfK1QuL (ORCPT ); Thu, 28 Nov 2019 11:50:11 -0500 Received: by mail-pf1-f193.google.com with SMTP id h14so3190739pfe.10 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=OawF4reN3XpXYevuCvTsuJ85dUCG60pyi1oGQAv9WYV96Cg/kh1Sc51+2ur3MQ6rYQ nJO4pLSlEu7aLvMxZFb7N9rgLfNnW0B+wsFxLiYge6FPfD+3L7W3IFJeefOtXR8fyBJ4 GEoj4s3tySv/X9cj6vl7thYwt59wHz/k/M7twHLARTVZ7ebmuhcdOKgLNTBzYNlNz0Nt +yoEIBFcXkRkNgnKtfYBX0s9ZNBGJ4xE1XcjtjYsqZtb5SnRWFjmeGYCbC4Xzd3htGTb RDBl708tBEPshkI3baDzdG1mZUC7vmw3gDoDCdWXN0rOKdS9QUkY9VfKPa1NdOLnrrfL N9jA== X-Gm-Message-State: APjAAAWDqIh7nMweaHnZcyLewfVIdwkigaI54L37wlR8IPGgzGbQhahy vvS6qEhPKM6xQ53Z/OpRneF7Mw== 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(+) -- 2.17.1 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: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: 180444 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373391ile; Thu, 28 Nov 2019 08:50:20 -0800 (PST) X-Google-Smtp-Source: APXvYqyNPAJ0f4tELuM8elcnRUCq6CTHAJM5NJ98gN/BjwD9p/5r30CF2pSAtrcGgxU7KajPM+xE X-Received: by 2002:a50:c30a:: with SMTP id a10mr39652484edb.281.1574959820578; Thu, 28 Nov 2019 08:50:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959820; cv=none; d=google.com; s=arc-20160816; b=z6rbG0IsuAv9ydSmExlhfqZVF1I+m7uMTqxMd8bWU76gW6Kvi4wq5ek7FShVb6DD49 sstIov38xD6oKlIZ3U1dvO8sXkWP9Ko8bRTlEw9QKmNVJ/RLpZbATGQmFBO8yijww51F d6TwBVUKcz/1LC8E2hVGHjTQz+gkIiA/ZN/S+vFYnORNCznEZZK58P60r3jGkIjAujzP lz9jGBYO/n8VsEMfdfnft2tE/6VvubRCRQQ/oYPWVIudqeuiwO6giJ43sZVB3my/YH2T c0PHG0vN8trMnYVeDC+6Zivz5JDeBtyxwHgt3UTU40NfQDbZBqf7u2zOjpN/nIEy/b5F +xIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=jY7j7XGeZ35a5OePHaCLSQ6i6f4GRHNTIE3RrACf924=; b=SYRK/WN8JWGFYWs4DsB5ouzLPd5Qt+Pq4CuvatkQEHFOlRfvzlQNeWVNKWYfV9CYXO KLXWYwsKctNkd5W0y8CYhH78xqsHXK+Oqp+gtCyEuB1x+pAdxvSKwSBf2kPSit5z52Tu qX9vo4nEyqm/U3UbwZLKIxJ8DhRfsC5t46odowxiEoBitYW3CA+5FcLGMerMLZkpIrMA CAua2cd1y26n3mbAFa5I9SkqwY1oMv3+y9xaGjsycmtVQfEjYivgwgilzMSvEae26gLN wGepfl1M1rXubJw2dF62YmKpweHzWAGKEqDGNhiXu4TjtfwJdcIXbrhuy/8q6e/mE6jq dqbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rk/TdVgo"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e26si12800266edv.82.2019.11.28.08.50.19; Thu, 28 Nov 2019 08:50:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rk/TdVgo"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727092AbfK1QuS (ORCPT + 27 others); Thu, 28 Nov 2019 11:50:18 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:36605 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbfK1QuO (ORCPT ); Thu, 28 Nov 2019 11:50:14 -0500 Received: by mail-pf1-f196.google.com with SMTP id b19so13393170pfd.3 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=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=fqYopEgHYe8a02W3TvgfZuDMXnOOol5VKRNmFBKlG1jr+xWANInhxMgGXj0+fF4rGf 7LedFMvyl1p+6/tO+DlTzUD0uiDYE9wDMBJGEkl5wWcC3iWJmdKn9bT4WnKXgwx8Q2DQ vZv1lQbl3y7rNCpO/TZkz3lWIekrpt9Do50RAkNTC9JFWuGTuJ3wOTOjj3WvbcKFvUtk Oo+rRKM6YcW1BB8tsvLn/aBBsnsNHZLbSCqUuCgr15dHrDAkEK924fCh2/K7XDaId0Fg d5MhV31Nbdy9JmAPq7NxFHnt0pwXioWAX7CdKcaRCW6bh8856UZvpdir3tsLA8mpoXDZ I1cQ== X-Gm-Message-State: APjAAAVSLVmkH0dc94LUsBMf6XPZAOOnfIPwatHBEjTxXC0UqLk2MHHk rDLCCkpEBjWDDXZRDKgXaBz7wA== 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.17.1 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: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: 180449 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373774ile; Thu, 28 Nov 2019 08:50:44 -0800 (PST) X-Google-Smtp-Source: APXvYqxPzyWkMBmpqSw1yeFeygUrg2nsBlfAm/knWwqlIhpye6OToief+8F2vFe+S4wTqOzjUdCF X-Received: by 2002:a50:9f65:: with SMTP id b92mr39198725edf.63.1574959844022; Thu, 28 Nov 2019 08:50:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959844; cv=none; d=google.com; s=arc-20160816; b=0NMWjh8q23ggxWkjjY2XsC+t+jubqqdOqan/c7GAHB+gnGfoAWhQjN7fzEbReuj6aA b6Z+Zlm+r7NnQarSlhdU8w+0DGkSsHmAff8XO+LGvAKln8xVRe0Sj/L/l+9PqVijyws8 3ysM8Lp9oQuc27DuAJIWLJPVOBTtjS/pbIfOgng0O3OzYObTIE409itmghUtO/wPcw3K AxbrigMqWmSjZsioIsHjIFtmbt4OzzsgrpdwO7Nxz/ZlShVA0nvBfKvbiXP0My2oFTfu KM9xLwnt2PKjNBii7nwTH2QxCzmf2S9j1sOwJydNcmQbKe+9QixiamDw7oMGDNIiEJwG cBsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=wD+KHeFwNIT1Ivtv7WYTanJVrN7dwD/1vKpe+xiraBg=; b=GPeX07kkSzBEfw/abNsju6gRbdE1D550P29HXobOsDN+uVlNEQV6yQMaqqUYTH8VzY rN07QgrmcA+Z/rzFCaRxjeRaew5QqATzlx4TCzcI+gjJrrseodjs0Dii8WK8A2RJpwwS DyiTpjtffSurtgVMrz//HN6jUnvNTb6CN8OOk3TiauFoCf33ZvqNJptFqFJxBJLVyLC1 cgniGGkjv7bjQfsJhAFcfjbfP3oLV8LP1CQPQm+qyVnjAG7qYBV303Tzn5K+LKPAOWFG iFJ2CtoHgY23CuOHZC1KcRkML7PUbeNmY5kDU97ICt+q2AVWi2w3EMUMiuWPEe8rGSNe MKPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XxJzsLiK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dc21si12388590ejb.101.2019.11.28.08.50.43; Thu, 28 Nov 2019 08:50:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XxJzsLiK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727231AbfK1Quj (ORCPT + 27 others); Thu, 28 Nov 2019 11:50:39 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:35811 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727104AbfK1QuS (ORCPT ); Thu, 28 Nov 2019 11:50:18 -0500 Received: by mail-pf1-f193.google.com with SMTP id q13so13386441pff.2 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=gltvwI0OAHqspMKRMn0pUnWydq/qAyn5dybgaKKtnhynLQ1HHUeYjYS+y7Wv2hVLkG U59Ya4Rrlq2RxRvhdDZje9gxdgMtnrIWypTq/mqoA6lD/kLTA0Km87GZIIcOR6ABS69P e1knUsZ8Bpe1v2nnjeh6iXLn3q3Vb54KAIeKXk37f5UxF77njUbHwKmvpDUwzvgV96to Q7RgfMEU500rKDPt/RMYTn4lG8vmo+BY3Es4YsyN5WeTQASaOStAmuVjuj+whrTswpsk dpdWOOWsFFYVxf7uxIX9QT43Zy2PVu/i0zpo1gQ81l2TmntFRAhmE09V4LZZj1vocAHj nddw== X-Gm-Message-State: APjAAAWEABB3PRWQk2ka2cF0XLqqXOi4318MgjqA6G4fNqKRo7JBpJsg LjHdpBU0EFGG/FQI3WksscNPJM+bMkI= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.17.1 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: 180447 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373508ile; Thu, 28 Nov 2019 08:50:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwh/uqAIjmVrbb4X8GHqkcF3FJNx+Se1o2KJ2k5u5eK4W4UgjXBV5B9UWfVMo+rxfCyet4Q X-Received: by 2002:a17:906:131a:: with SMTP id w26mr7472610ejb.47.1574959828293; Thu, 28 Nov 2019 08:50:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959828; cv=none; d=google.com; s=arc-20160816; b=XsW4BS/YjRkdYXO6q6lsFvB/p70wFarCxRyiVBSjOqB3yKirFjWEcFNfJe0HVM4Iem rao+vXS8gQpghJ4QqBHxg+Nq/yz95nbL+JjntP8wdYLV2c/kACfN/vNxQlLl23Ov1qPG vwGoe0ep9hXpKdwRhZVopOZfsv3w72H+SamXK612DC9q+U3iNwQyPG8UsBqjOMtz4Grw 6Th4DKT6F9tKA3r5FsKMk17XNnQiaHKe5MJceMIHsbBZRtKrLsVBSluvOF86VjlQ9q6U D/dIatfDWnTtyKuzxvTwpvlfLurxWQEWhY7lr1QbfMTl0uSiNPTbVK5v9EzI8tPXztaa /INQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=zVs3SHcLVbqKmpq6Nb4lGHjdKCb+EPD/oEdMc3bO/jg=; b=CMf2/hTAkCNd2kduPvEtLbwFkMfABnbofE+/E6ttD3Zslr/wGb3/+BRyCWehAryxzQ Tn97Vpvx7JvVfGTcMIo5RvYJhGs+JrvLaUIaDTLwllZHQKDng+OaKxgdy5gzRxKWFm9E 7RsDBjo9l64UZQWDp7dln9eyE3Mi6yGLxeEMlZ7cs+yD7me9fBEx6wR2re1lxH4OAMvs jojb+4SPaQ60o65sqpHNpOq5EWPtn4TX9CDWubQMW/TdsyK1AVX382Z6L4BNoAoa2zjQ 2HhnNv08TTMN5x+TmkuumgZkq2m/cZQDRlucAfBvtH8AYxzh51TP+A6lOI1wsoG1R+J9 dqKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l5Gr5Qjd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si1365292edf.14.2019.11.28.08.50.27; Thu, 28 Nov 2019 08:50:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l5Gr5Qjd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726622AbfK1QuY (ORCPT + 27 others); Thu, 28 Nov 2019 11:50:24 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:43174 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbfK1QuT (ORCPT ); Thu, 28 Nov 2019 11:50:19 -0500 Received: by mail-pj1-f65.google.com with SMTP id a10so12094680pju.10 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=PPvkvRDG4ejENDgefK3j++P3Z95p0ULQ1KaPdX/zKDx3FI81vpH4yn4KZ3f4mQR2Pm X30F3QK39X1c+/R+ueslfHMdwCLJZKnJGpQTBjwbxRnEDuKBFT669M7REcCe5fA4OpoH aUdHommVW5M0Mlo05wn080mVjL1ajg87S/ZxwkW3DrNyUSQMv0NvwTtgRdS3dtvlBgle l2sQwNSs5kYcxCxSHyoHKkGCuNzcn/4JqzBmuj1ZRebsAalnfvGFxpqZ1CqhsLRMjQBC P/ug9LM3X+oVC5cvJBI/6ni5Ym/u68djzJ2Y2clglZXFR2jUTwf4sfSg5JTAR4xelP7f wEjg== X-Gm-Message-State: APjAAAXpOV2/EdULqH/GrdOVCPtq7HvMbsUzX5xR8Eo5PzPdmd4uSHy+ ERd6giEieP9lKCgecne/itguSA== 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.17.1 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) |