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: 180445 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373313ile; Thu, 28 Nov 2019 08:50:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxJ/UH5JaWA6vmezZCRYEzr7jlfst9kRVFGS2u/jCT9Y84PCYO/nrVwR4+Yrm1S6p81ADmc X-Received: by 2002:aa7:c1cd:: with SMTP id d13mr13967136edp.288.1574959814341; 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=oq7ulnx00XGoQHQILKnKjnts208QHmjX6Td2EnigAw+XahmlqrtKP97xAA3ZuDrTm/ Ca7VWAEb8WRhaub+7qyJI63bEZUHId/8wJ56xRNZ9NWBTfsUt3EwovUdLoM6qXJxHOrz i7TfMkVl7Rj8RTFY1kzifKOiEOonBXBU6NOY0wizPpk0qe9+dkZc+Of3XUnLLD6nrsK/ j68P2WTXIj533MWII1zg6xDT7ezAQUx+sit+XwLF5yQNLmBuCuEcu5/k4miP0bnlY87E oPTmFWYb2qa/14E49barz7cQj6AUaKuzkpqrElHCMvPu+b8zzJkcKKN3rKXi7TD2+Clu 0dUg== 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=jEs6QE+VfGFRlxMX16dTWWCBFFIHacBUeuklTX9eehk=; b=d4Gb7l/W5uQq9x94agJ6tqFzc8mG9osVVcEY/SVM1mEG+HP1JdgcGnKg3+d8GVbqma TChby4krIXPX6N4VCIphmXuqTgwrxXybh7gyj7zv+SEbA83kK4AzsQpw3MIIqyZatEMd ujb/5/5G3mia59cjExCBVG0z7cBmzykpZIXobpB8SRRmbufimvmzJWfI3ecz22a1KyBE IU0rEdEk01/UQgxAhW1IhGuNgbYzC+CReYlYta5JHNv6SLV2N0LSMAlWFu90h2oINjd1 f4yDtpIJL4bEZseWQsuQshtzVf0oVvdgry9kEz6xNlf/QYinGuoHGt85Ff21bMmkl4TG 8Lyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KXOTFhYW; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 stable-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=KXOTFhYW; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1726446AbfK1QuH (ORCPT + 15 others); Thu, 28 Nov 2019 11:50:07 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:41733 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726726AbfK1QuH (ORCPT ); Thu, 28 Nov 2019 11:50:07 -0500 Received: by mail-pg1-f195.google.com with SMTP id l26so2991841pgb.8 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=ZYOu3iT/MmssupDzJ4iVjRxFWsEU9OK3xMPBYFxwYiqMCEJEYYaiGw+J1gWFH0Hxkv BbIYByDM5l22HW+TDMrooVcLaX6kUUZeqtdBAvSxglT/a8JwHZ9NU4oop6lCTfQfI34L CE8/homtXtouTVsBb60AXK2H9rzVTp0Qu1/fr0ndQgYHkE+j0BP8vbV53wBkw8rykxEg NhUA4YO/cmH5GZh89w8mi0YDEK+t4nMpqWzA8O/fVAbkiXfQrN6IwdxGFi2Y6E+BIn06 vIYQR959esDejYiCSljKeL+D9a8lyJDUSXzgnHAQ8e3kpZKTdgEsEL0HfNjd/8HAaF7W apAA== X-Gm-Message-State: APjAAAU+uaPjz3iUrr4H9JF5eKaOt7qPN7aPQsmI2eMWp22RLLGyokgo e04s5+IKrT4XCTa5bkWyPhVqzTqXkRU= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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(-) -- 2.17.1 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: 180459 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp374240ile; Thu, 28 Nov 2019 08:51:11 -0800 (PST) X-Google-Smtp-Source: APXvYqz86hW2v3F4hVapYK4bCeMnmkiz+sMeXS8t9CDPU7eCotSZhQB6sDch8pROojA9wqgz6rPQ X-Received: by 2002:a17:906:4d93:: with SMTP id s19mr55778634eju.285.1574959871678; Thu, 28 Nov 2019 08:51:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959871; cv=none; d=google.com; s=arc-20160816; b=WpdFT3fcEqPZ+c3C4Z/fLclXruorZIdTG2TjDzdDMcIMFwpbt93e1ABnSyYOMrt3Tm bfQsNMHJk67mEvZObISBhmtHNcHyBSUs90RuM9svf6rpe7Kgh8lspvJLiIzNxUFPMG8+ XNnuzY7EDE7AVhBC++CxP9rwPeIngKYCpItXuySFGTV5otRLSXbK6QXcGLPqFStdiZb1 PQlnFSB+0b2rR1TDDlWa6VVTGPwJCuso4lJZ4tmbwqCd3/D4WlQmMBLRGea21cURLsx0 vF/gmlOlMl26lLZBlY/1E1KEu9E0zN3Q/8ffE5aHfT07ePObypwAuNy+9/1GKfTgp2Rv KNIw== 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=xgizS2ja8jWfUkSpIbZzCHqhCFBCkrH3reNwP/GggE4=; b=CXA8FCbJOM1gsIgIEsHH4X4nJzglycyLnS5Uu+tOoCnznxv7qjlWPR3EOM82yaHR8K 81S0YDSKCvjBKcjq0yGyqj9Edfi8Mj4ECaNMX89hVVc8MFob3ky7n7Rny/glPNwGnrWE OTx0MNiB58PHBXrSWgR/c0dTIieiUZlQVt1hgzpz1DP6LmpghIgq1bRTMYo4Tos89oDN tkQ44IMjnc+MBK2Spmg3UhzalEYEh17AQ8hFr2KJQ3nW6pwOrhlMyGUTbqQTOpiUKnEk hI52keQKG1AfSjM2snLE0XZpwGjKaUpi9DKUTQAt2/Go9mqreYTFha/mtN9SDHt5ZFSF RRnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JPbZoZDa; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 t7si627442ejd.268.2019.11.28.08.51.11; Thu, 28 Nov 2019 08:51:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=JPbZoZDa; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1726616AbfK1QvK (ORCPT + 15 others); Thu, 28 Nov 2019 11:51:10 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38096 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726733AbfK1QuJ (ORCPT ); Thu, 28 Nov 2019 11:50:09 -0500 Received: by mail-pg1-f194.google.com with SMTP id t3so12695034pgl.5 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=GgwGujjvm/ohtdCz2XALWxb4TI8j8MW5PcZZlkMxuhek6GonQsqI2oOr9lZAcB+nnc hpXAGSvDHeBPGShJbR8/QHIaHCbgmBlhrNythn8HHLTLw0o2eNWiGzbjhuX9PU8P0ZMQ K7/s2BUK9SpsXPYfFwB641Pz3mFMbFfLdZuIt/x7Alj4oHsfHwWLTG0HbZtS/JaHNDES fWTR5p1HGORWeqHjM05oHyskf3bNipiqBaI2p3CRhhw7GNZ8fzwX6K/TsPtSeTMnKo3m PozKmynv3NA7ZGZs1wC9ajeHZuNsGZFc6fZ/lSIELbbJUqTy9AA5QdyNFaNg6gP1Rl/z xVJA== X-Gm-Message-State: APjAAAUpirffdflyJiahNrYLqNaMLczRFC7pnQVeRFijz7B34U5pFEQN 173Y4Wo1IH1DTdWwwMWBcxEX644EpNY= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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(+) -- 2.17.1 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: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: 180458 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp374007ile; Thu, 28 Nov 2019 08:50:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxAK9D7gpvrawEP/8d3D03ck3DU0XRe5hzrJMGfdQnDyqqh7IDn3sMJ4gYZS4/4vNKfCasl X-Received: by 2002:a17:906:751:: with SMTP id z17mr55232798ejb.313.1574959857383; Thu, 28 Nov 2019 08:50:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959857; cv=none; d=google.com; s=arc-20160816; b=m48yxTZsuu7FfVDd7/hzBmChzm1ZqydqAQ6m3CEqqpsyjWyWQxItoqXmZ40EAoSlkR Z8PPDwTJKalImZoK25h3aQ80rv9clCX87BaAFjiUefx4IB4VGUbW28hzfjFU504rkR76 yTe3LOMiho0Yspefr7Si3lY6DMBQxdkmQVn3pKIvtcflgamKfRT7lPZN1b+BquG3EeNm opo87y8NP9ikroYEZJJZbCDuV3NQBFzFA0hn6+Bf+S5fbBPr6DW+2W8EYm8HJJEcLL75 zcd7aZYEiKUgKN/vq3TWhmV5BuFxHzyyhbMhbEW7cq7uAKeShQr4Z5HrBR2S9qgDriRR MxNA== 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=/CYFf1/fglZp7zKhC9PXoy9tsiufDFpWHrIfBoNpSeA=; b=sZGxg1787hzJCUsG2cugeM1Sks2IfJklesPaRmMK9eONiAEHWdVegcYn6EYPcdsEuQ ep8J1YtKOCEGBOGYXw9OgjQSzqnde6SjDweT7HIiHxC/998cHA4AZC83P1MNPC2QcDxn uo287WF6lBodTPIWjUrhUiQGshl/+TI03KTZBh6iyT5RFn3tPDf/nhaUkPyardeMJbIn 6mY/E4B+/9OiVWkksqgt2o+Xk/5LZtCcMNxlqoNczYAan25Ld6O6ESTHxm+rJjLzCRjb Kgnk81mgQruKdt6IPhsxgllGPBNib9cSI8TdzqJbQtBYldQ1U/C2WN5QQp/NhiK0eNXJ vkqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j+pGVSDt; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 pw18si5701892ejb.72.2019.11.28.08.50.57; Thu, 28 Nov 2019 08:50:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=j+pGVSDt; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1726970AbfK1QuM (ORCPT + 15 others); Thu, 28 Nov 2019 11:50:12 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33020 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726726AbfK1QuM (ORCPT ); Thu, 28 Nov 2019 11:50:12 -0500 Received: by mail-pf1-f196.google.com with SMTP id y206so4753048pfb.0 for ; Thu, 28 Nov 2019 08:50:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/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=hv1+TPi5+VT3sUIWYc8E4p8ALKcq61oJqK+J1G4k1DYXFQJ7GMGVK+c1MMYqkQHNLr nBZr7gYDT7atmL0BC9DFoRyzBX5N6RM0sFIuGQhOAAkb7uYtGBEVqoBE1xhrXQj1oUxs i+WDUBksa0pdv2cGMAmJ1kLLDjEX5/tlxIiqyMWLYDRUW9OtCBBE1xxrLijKYfYE/NLV 1RCebsPSK7yPUJ1hxyGaF01czvD5krSHvJNBygOOa3n2PbOxwwGPMcotBHJFplMuBMJl uxwSBqoyNxdcRatT//N/CQTo4DfVdK6zfi/KzUQg3eL3THSEcbhDqOmid6gFhvILtkKV AAhw== X-Gm-Message-State: APjAAAV7swRj09KNurBDZLBk3C8/+2WlwX0MllNF+ZtLKRo4v2EWoehs R3vN+4FBJdrGwkcD2yb16K9CKMyznxk= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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(+) -- 2.17.1 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: 180454 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373340ile; Thu, 28 Nov 2019 08:50:16 -0800 (PST) X-Google-Smtp-Source: APXvYqyhPtVzu2+JZjATKgDyI4ZueFa+ePndFXyWZMUfSs50BXcwgQU8Yc4I9s7VABRqJvm7NoSd X-Received: by 2002:a17:906:f90e:: with SMTP id lc14mr7310225ejb.70.1574959816553; Thu, 28 Nov 2019 08:50:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959816; cv=none; d=google.com; s=arc-20160816; b=Bcvm5vEJxj//N8JchCPfHaWNP92LiNfRJr90PtLHWVt6vjqp/+inyctAkeig3tlRrQ 5cjMj8vt1T3zcGGJjAvGpV6ieL7yxFU3Ejs1JvCZaeKHkrYSoUz9euZKQ2yanVseSIoh /HuspwtVG1h/UIglnjtT3bAhNGWFUI20rtNw4I01T0r5ZOtQ65H2328dp/vQBZUcW7aI uE+OsvUZo9m3kdGp9ARXNf2XU7TUSZxS7t5JO3IGCuBamSavfJWHv/4NC3viicPFs7vQ XVCxGfagLqyQ3JHS/Tj7tEgQ29y4JyGs3jLNgpAPYhIQ6SnktnQiYDpNn6w9LvjUAZi/ cXaw== 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=as0Dyqn9IW+Ib7FMH96nGeZ/5dUyDxEzw1IqFd6RcLM=; b=sRgvYEaesF3qPrb6Qg0JCWCiPli695yGF8R5OfWAL9T7rvpX/p+6ZmAZObCLhDKMVy EpOcfxFIHwQ9M5KS2q6KTukCSr0pzxCxJvVUj9ZIu8tFWu58E3wZJvUmAxagGCXeDcch fIdoEvCPdQOd1WeyiTVyckmqqOci7QvamKD79E2ElBFQDYwVUL9tO6z+c+6hGwLFu7Ef W3lmrGvPXFUh2ENIa8Kfups4in0DzbPAFm+bhWQTP1jsSSn8lr5xuPLLGlOYggqvFyPG ZPq3lx0tU+QocVDT6znRdHlfio1f2QWTaq49eNuhjP42jwZY1ZDosYSRv2UAde2rWATR otkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LWoQEcDU; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=LWoQEcDU; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1726980AbfK1QuO (ORCPT + 15 others); Thu, 28 Nov 2019 11:50:14 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46808 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbfK1QuN (ORCPT ); Thu, 28 Nov 2019 11:50:13 -0500 Received: by mail-pg1-f195.google.com with SMTP id k1so4771103pga.13 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=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=fT3Uldd1q/vsdY8lEpNtfBC1AOw+HPN5D84CQ0G6cEJq3C9k9dlat0fV7wWDgk9B1f s2C/RyGsGpfQDml4oH5QCLituzHbxX7+47y9KGzG7VOtStPl7+qxv2stjlSj2b2jvUiK 426YfMkOKG/pdycS89Le192vMH1+Anp2hr0bV0RnivguyRCK4jnkkUQyg+U5421/ogP5 YHsu/KD9qjyeZOfFNvrAW7wmtsb2Qu0E9fqmLeEz25oZSLZwuelA+T6DCsS4WBTDS/ew 171Nb4kNBjwCFclOD53ZnG3ONExHlI9KXUQ796edGiHf82Lb+Gos7oXo48w9VOVUGDwA aRDA== X-Gm-Message-State: APjAAAVud5plyJFlC6cdpLxOXeKHq6srHlX8O8VW+FYXANDHaPWTg3Jn l0CiaZInf0tVTLrLUI0dM8wFOHFzv9c= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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(-) -- 2.17.1 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: 180457 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373900ile; Thu, 28 Nov 2019 08:50:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwTNvw9LeVdmJ9p7a+9c854/X9izmIrhqCuR6IZcUq0vkKFblNIs9Gu8+KXkJH0lKlNng/u X-Received: by 2002:a17:906:c355:: with SMTP id ci21mr30865602ejb.284.1574959851833; Thu, 28 Nov 2019 08:50:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959851; cv=none; d=google.com; s=arc-20160816; b=vXgJTmYQHnOu16mQedHIHufcnMVDrFJuS6/WL+JsBr2h2KQA3QJXwvt/1EBTAdlS4p VqPJHfq8EOvZyDW3fAdSEaOj6zImJI495IRPCb/E5pD7akl1ZOk9hj+sC7IyXk8PEZau PaiDFU+z178ouXjF09RdZYfglsWqNmM0MFPjtajGzjuPIyEUzMhkKEolnKxzQcff+hMv moAaIjmT5/tp4tvXrgyc9kSVlLpB7IHLnfAGdw427bv362nKIfSrkkZjsgAIUxYnfORr JLALMPypEzyMCVEn39kZatZth0xslF5CBh2KYrTkmbKm4QqW3GGVO+c31P2a76XI860i R/MA== 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=k+cv9/8Sp0jhDfTqkaHbtLM5d5QXQGR0f5kzjPotgaE=; b=EBjPXQoTuwvSm6Ynu0A3UNTB6qqa5z8RHQOviD74oAnv/W9mVK2jFpzQPk2D5sXZfl isdD+cIPNmFc0Aydq7reEHHkszO1ZIaT4K5NCyKujbXIipuu5u8cx6HlqMDCuKOLrFul vxdyS80itPP9CucKs3cCT/XtDxA2leRXFCPHiwjhKlKbKTfUA5KDNjTO0XYjN5qmIVXf QiMcLDmLuXTS7FEYg2la9CYE/4sns9c71eW/WGH+98SmGN3tNpj3pSN3xmJUhWZ6d6QE bvsffmWlc3fB8ofG/FzBQq1gO+BHLva2n7F5aeQYR8/50TjcXZ2XDQTfkAWSa2UnQZ2m ZOuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yd4WyxjA; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 v19si12552865eju.331.2019.11.28.08.50.51; Thu, 28 Nov 2019 08:50:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=Yd4WyxjA; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727076AbfK1Quu (ORCPT + 15 others); Thu, 28 Nov 2019 11:50:50 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44300 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727007AbfK1QuO (ORCPT ); Thu, 28 Nov 2019 11:50:14 -0500 Received: by mail-pf1-f196.google.com with SMTP id d199so8731197pfd.11 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=hf+JG8DXXzDP2GOScurPnyQQERysSfZJmfQ5YiC1F9G43+dIMMFr1Tm8+cxV0GpPDO Kh53ZyQjGp153mS1YjrOwrD+eU05qbsbuzMOLTkl+V4hYSoZ78SPGPwPL2luFVKySrfs 0Url5qMsvjuw/eTfZoVFodWiLmgwbV/eXW+vZf8N4AzFfuxbuQBinzXCIxgVasKyOYeb 4+/zZvCeeBBg9W+FFXY2gOTWavIssuBGQWs9dizYVZ+0VLfmftf/8J4eovSL0YrkhZaN GNQEaaNBQVCWB4cTNpB35RMT57hCi7u51ak7Ug3dJaJMYVf/4CQnLkWFvDBSNoCxmAhu qkHA== X-Gm-Message-State: APjAAAXbv087nNLIEaXaNhpsCVs6w1FJmRTzjwSlIe7ilfFu0gC2WMIU xTwUWmN3UPESy+Vj4+NRI5H5gNNLmB0= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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(-) -- 2.17.1 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: 180455 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373337ile; Thu, 28 Nov 2019 08:50:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwJnjusk8CU4nu5fyu9SupsuY9LFoUPGnDp8nmJbXZOQ9yWIIqqyQPgt/gmvHARUhF7UlaH X-Received: by 2002:a17:906:cd27:: with SMTP id oz39mr8178701ejb.48.1574959815625; 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=ZOqI4LbODV7h31NNu5LYbo3vaEWtOmYeFU4KfsnsuDMa8lj0eg23gMriVmjxIoY20o fe4P4zsnklZvToTkc75YhXYAu2fJV3SSlNa+j8RjQHaippW/3o7LGCneRG13v/ZwOmVI /Wv6pP+ACSF/UJsaQC/PMqlI891uhI0K9xeEEVzxRTVOBpzXuCCuXRB9MY0c/f+8eKRa iLQoUtNwvnh0a+h8cqs2QqWYnmTiLMbCgXuhadgIulc0j9O1rWrUn7NUJUNyTCSy9aRx 3X/HMx6FZnNGc365ZGqxTrXrLKF27z9QV08djuNag0Q7Cd6o0A+Xtm6sPpBS7yUVrnDK EsRQ== 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=WWGEc85+KcM+sGpnyTytKb3X6CvK3FAE9bn+Wq10lGo=; b=hC1rAd+80afsfDrgQMLL6XVwieqA36CuYzM1fMPqgJUzLeJapy1jKfDzhkTqFCy8Nl F8TVP+JRRowt2c2aJ5b0Yh7npIwLB0Haqkz1lppgJSZqMhXc1R5b2UZC9c0Vh0XQhx7q ZvMVTajEqrRHCnVRvSPDdCY+61+TvvvhJFWH0XDwKGCWpVkNnnWkas7UMUfnPnsI8L6W S7g5v0VeZgeZQvAeMs3r6ASPDMM/l6GRjkPKTpk6o1udPIgPxfPp8qNJ3COm9xy+M8G7 P+QiQ5F9qKnSNLYcs/1OLJuzibS50ykhO8rHNo/pAxjK3Ci7Wtb7BQ/57A3JQdCQ5gn3 YgyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bb++BL38; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 stable-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=bb++BL38; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727022AbfK1QuO (ORCPT + 15 others); Thu, 28 Nov 2019 11:50:14 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43794 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726980AbfK1QuN (ORCPT ); Thu, 28 Nov 2019 11:50:13 -0500 Received: by mail-pf1-f194.google.com with SMTP id h14so3190792pfe.10 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=MSrF4gjNe7ZC+2wggiLINPGmoqoUQrLbCSEbogxfpK65mzvlROB21vUscea9GMxjDn ipJWWJdhQag07KONElaSCmUtRcUlibjqZ0p4hb2LFbjdH4+Y70ziR+DEAmh4oWVWrAdP yUqEWeaXTp8yaQcz5o8yUsoGl5aoyH6XIlcKnppScCXCjC7Y0dSmmD/gay4gHmgo4gWX 9GPE2tLb/oFM8qvdpqpejvfvHPviw0GV/1+Hw6ENUqldJpEpH+XzE3lpbg2PNq3a5T87 VquJL2pecc/B1qgqug3iMpVQYFexTjO17n2asMa3yCvgqq8cqNu0RoFe22lmSIV7Bc7u ChTQ== X-Gm-Message-State: APjAAAWqrCFyRBwbO9MXYQp/pnnkRBK3yZibapQQ8awtKOl01vOEg0bE 9sGuHMjlZyJDSMYI5KJVH3oqXbAa7kg= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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(-) -- 2.17.1 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: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: 180452 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373789ile; Thu, 28 Nov 2019 08:50:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzmZxsystkYpfcilcR/VHOlB9ZCpXCm1KespOoPWr/nVAMKVlBo4RusPMUVWw0qo7TWykTR X-Received: by 2002:a17:906:e087:: with SMTP id gh7mr55683800ejb.278.1574959844937; 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=yh3/5rHaU9/dGjxT/AIj6lwCzm3TOlPJi/1QPaQ9M5dEcoR72PAx31lJ52zd6DTrBM wecN4LsUp4HElf5R/CtFSHZL3ngL6TRyE+ZqttsrkF8LfJ3k3NbUJhT1HTBzGcekQJjq oo9oaIg38Soj64NVYRr1YEuHoJh8oj3NuXvrenPoISZ4WEKc+ReNb8Qp4pJYldiuTmFB /ja7cAMp20VVZ6qgVCyYEXUbZbzK62Km05xybQDhbUaeub4F65utmJcUQJy3HUe9Xz6S n9HWBUvrOKNuP/BX2I9+ojMAYJnbs4h+MBgn4bB9KhWsmLm1yNujnJuljnb8XA6YQOrt Rk6A== 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=Dfqbr0RxajlO5BfpaJ+gj/cruGVf9oBCHGspuRMYLGM=; b=RRsbNRpQxULKAeD0wwN7VaR2e5Gj/NF4OwOnZglAyOYH/O6M3AtnE5slWGIaoUuz9v rKucJ8rXoUHNFR0QKu+0RnoHCzQEOSZWVFnE7ioZbv6Qmha+gvxDIbu3tgfs4xOJVtDS ZIyjSogYhacw2aIOz0vJLvUd9naq4IUaEMGB7aMgsZzAfLsqO6cWA0xccCk6Hwpwz1CY FecUORD27Nbvq+o9UGNeAxC5qWOYCz7wJ5R+YapkOKOvOwdmRP4vF8yNp5hVOZk37Eb2 DrTcCzOIi4+KO42ebKA/kZ0GPJ6ZLCkzWdxJe5Ddq3DTQrOcF1TNg3reyElcNzK0cD8R 9kKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O9JevNY1; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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.44; Thu, 28 Nov 2019 08:50:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=O9JevNY1; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727085AbfK1QuR (ORCPT + 15 others); Thu, 28 Nov 2019 11:50:17 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:45955 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727047AbfK1QuQ (ORCPT ); Thu, 28 Nov 2019 11:50:16 -0500 Received: by mail-pf1-f196.google.com with SMTP id z4so13367112pfn.12 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=Irc2rV5FO6EeeSCHIP/PAyt05AM95e2qPngSUsZqs3Zhby1HAAB0tjMP8l+mQffKgs +ih3rSccx70HiSCGX0nht6zsLuuQW5xQXr4ls5TFHJfv058/29CQ4qfZUnJ92b/EyWeV FL75zjKsLge3wsikL/vuryI4h2M8l1wW+qO+dGOUYL1y+n1Dqrfq7zoMy7gFEz96LR1s AqpxDLkfdanrFuhkyUta5XNBCYYzL7qZBgUPhyJ6HIX8QHHlmpy5ZyRast9wEAGV0dQY z4xie9oPWkA91KJ7Mu7oCi6UkLuj6Wbr+7KDOlkcg7wt+FRecBnXLA5t95FtNZZGuXIL vMMg== X-Gm-Message-State: APjAAAWSTySh98nyoiRC3G65sqIuGrmfsH3ymQu0K9RZZjalat/s58oI A9hGInKL7WAJbVAWAilrpuWmbGUm7Gc= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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(-) -- 2.17.1 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: 180453 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373812ile; Thu, 28 Nov 2019 08:50:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzPjCvatrAGoBIGqlLs6OIr5iU/IQ/SHtia8vgIThEFyNhuGG8ywVFqj8uZmi4Xhu17gDLJ X-Received: by 2002:aa7:cac7:: with SMTP id l7mr39714036edt.196.1574959845778; Thu, 28 Nov 2019 08:50:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959845; cv=none; d=google.com; s=arc-20160816; b=Sj9Hg1qInPOvXCl0yBc5uXUl6D50rTTtN40NZCfJyOP3PQ8QO8JfRs7F8T8ZHAdV10 ANwvUiAPYPIVm5D4sN2mzMue+bBBXvTkjw7T/hXg5eJ9k0XfaZDbU2GWSr/FSu0szrtG duS0ve2jIF/PBPBjV/OITTAdmPTc7oWYe4Tmr5V+3r7S7id50CgFASzULXhCp5ZFAyNa hWUMvrgFqVfh7ld+4iu89W3uj+h2U4X+5cVW8v9usJjX9TG1ic8KxTlHZ+GLFenQevEh YQ1zi8o9HU8iC0JzBFeT8cRFAGS8+zabkIbTKDmsPxkQnI+pMGgxVJQsvkmxgrLZqXZS 3xyw== 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=nEtPBscm61+nPEVWvbJjdtfKlHF1+Tw29QLFNNlqSXc=; b=QO3aJcvQrvg1QXAoNVhZdsu59tvTZqXlwL8LshaZPesKq1YwMtY3FGPcxnHRgqSMeK 72tPL5KM1OHszdi0b8cPbpqX/M/rueydC4W6vw3w5lTreBXkG/h2I8bEyoqk+qWoaMip iib7ABX3EdJaw96KQvjdNm+8qMJeoq5ILVd1Wzp0dJ1U5w46aGwKWBdAkJduQi3oM4cN wXmLRTmyabZpVvcsfQK3BWu9R+fWceUIsI8+l0WFYJT+icvqgY30gI55Zlo1uYoyBBwP WGbts/4OdwQGN3RVrIGz6BEpXB9l1rvh1D5JHp+plhO+3OeXEs+J7FvMqgwStuCFL6V6 99Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jq5l6POX; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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.45; Thu, 28 Nov 2019 08:50:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=Jq5l6POX; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727104AbfK1Qun (ORCPT + 15 others); Thu, 28 Nov 2019 11:50:43 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46813 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727079AbfK1QuR (ORCPT ); Thu, 28 Nov 2019 11:50:17 -0500 Received: by mail-pg1-f195.google.com with SMTP id k1so4771167pga.13 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=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=B6rCxL3ng+mCqGXvz66depga2RiKIKN5mdWSEVMHZg6xWOtT0smVMMq6pDyCEpmmwr loHTvKCFe8Ik4vy2ddbIWzo3la9eVjeFF5ECoO5DPbqMGLMz1c3HTM2wCt6QUA8Xcp1Z L5T5MMQZ1JbSKPR+eMRmwLGb7WocaVwiN9AqJZxvTgRTke6z6Wt/0PGuLjfQCRih0QSu PQe/rIY+8EjhAuxoAlsM8v9lxFqI4xSYz30JotpIhSA4FtD9SOAx8kH0xuAKZydMl8Up p7ZUidRLyUrzb7uniAhbTTjEMP2wlkovXFietxyMnpKv4R6+wqz4TXu7Ksz9saLxU+LN rEFA== X-Gm-Message-State: APjAAAX0pXcaJfg5lLQADBiZhwSWsuSodeZA1WIuXCX1CvQngerH/1BQ TqLK6JnsIxb+EnNCdmXlA78/tdE6Tgs= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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(-) -- 2.17.1 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: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: 180448 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373685ile; Thu, 28 Nov 2019 08:50:38 -0800 (PST) X-Google-Smtp-Source: APXvYqyUF4+T6yTllAh3vDkszkJEv9VLFTwkJOV0fT7oDqbMxLgzyKkQMS/NAWzNq0XeJV6DR+EK X-Received: by 2002:a17:906:76cf:: with SMTP id q15mr38411755ejn.247.1574959838430; Thu, 28 Nov 2019 08:50:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959838; cv=none; d=google.com; s=arc-20160816; b=qm3oVr82PhmwIP3SAMXFvQ2UeIeoTgpEfKW3XcWZsbzECAMRhSTjTBikfmJnD66dok SaekrMm3AHG8DrAlY1YhsegNqPNTRExYxg9A6HFQlr6V0xAcOTl3+hW1daR7NeZIBKmN lV0lDW+y4x917YGGBZTdEY3JPnmKFEQi8LyQoz0ub/qF9dznQJbaU1H05AThybCV7TxX HgiDfLo5fpKpjCLX8GqaSiKYkj8exUH35zrrDERyFKnTLld83fkc1+IBby1CfBdMFKVZ s7hVHc4XxaYppPgn0rc5a+Uoij4En5EGv2ihCagMEN55w/vewbda/StwjoPTxtyCaVN8 ifkQ== 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=j3tKRddo0sP/VNAlHyU3woPmGtLiTh7D/WlbKBjTt+o=; b=TgW51WHqOzpsr8/K1qetxjzj0s3L+L3bHNViqICWrVW547VQAzmrIyjvBAiKLfLGHv gboDFlD3ZzZ4lP09YvudGr217bi2azdW5oXJdd9Bqg/fJY3SLdljvSYuv0cO9SPasRfF UOPSKi1Kx1CbmOqNn7SpdD09Ph3NHle9w5Fv0p8s+Yrx3P5ArDeVzVVwaOorw18jEqjG DEAkCNJfxq8uZw00o0hBcsrPjAPW+jgT+kMvoGgiK0SrqUMp9tnvIAExE5B5dDDogUWx VWncgmkhVeH6vOId1ZeyqbCfJ/PRi3IS5sPrZWGgicoQB6i5gqKbJnFrseXL83h+eg36 7YYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rqAF6te9; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 v1si3296298ejr.0.2019.11.28.08.50.38; Thu, 28 Nov 2019 08:50:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=rqAF6te9; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727118AbfK1QuT (ORCPT + 15 others); Thu, 28 Nov 2019 11:50:19 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:38237 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbfK1QuT (ORCPT ); Thu, 28 Nov 2019 11:50:19 -0500 Received: by mail-pj1-f65.google.com with SMTP id l4so747321pjt.5 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=JDxgpqtj5wFN960fo/20crO85HW/8JHdQKKXimOILNM5+od1+L34hxVZ9I1Y1BzkTJ miAL27OIRId2yjtONUG0xZYGc3IVrq4dvH+c34+YSLygR/7gOKsOU9FBtZYihGyz/VXk CqVpFXgJ6uhg60AvuIlJBdH4ErF3IXiDJJjPlPT50Nxvi2vdmO4m/sZVS/2fjCmxDeRU 3HexwMgcMLxQMukbfnkhu54Nc+Gjyz63YQLn+wei3D361RpOM5luqCK4u+aCG351MVzp P2NPbAewAby/DDqp9cTzFBST9hru8ovRxKdn9hyAsOLbjj4iFr5hl4wvMp5gXXGYQGK+ tEyA== X-Gm-Message-State: APjAAAW10nSCLMgy0d1N7cBUs/NrIoZwIYW6D/UZCBRbwtBiPjs5mH9F wgJzRDC95BFRfWryCyfrKqVyUSK0IQY= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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(-) -- 2.17.1 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: 180456 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373426ile; Thu, 28 Nov 2019 08:50:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxh+QtGegeXPM+z/XddWvWtj33dmlcmNhXx/smnIskf5qLaJl2QiP2G8DBaFmzywb4QY49A X-Received: by 2002:a50:ee96:: with SMTP id f22mr38907149edr.86.1574959823319; Thu, 28 Nov 2019 08:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959823; cv=none; d=google.com; s=arc-20160816; b=cmI9KjS6rZmKhMc8k5T0UfSJrqVePvszWfC+rWpM5evndtzh7mSGgcRacFZAAY6TGs RYWT4I8imMu9x08zJf5SLZxi6+MNP4Rhdj/eAZifvOJIEW/Y93/NujBOFEw4PnAPo7wg M8Ijg4Cowb6vgOW05MetYSztRPaAdzOOQObN2UZUfKbqGZdtjHtwNlOjxOBd1PMxP9oC SV5EEw9Q5iprVxZLjdLeXz3brPrXpmJT9lvVGU+PSk7MsRHSqs0xyzWWA0AlfPvZBhWD O4fjWrGsrAHY2/y5Su3tm7Vg+jD7fel84W69jsvFQZZL2KdEmKIJdzlzfRVUs9VDJdtF 0sIQ== 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=Pq5KE5gIMiwWIeSMy3T4ZpUVkQI2nKjqwjW9YajORlM=; b=lDIVkRFxpswwh+xSl1NDXdUohxlL07MCKgH3onoWHVkFoUAtgwC+73dX8U+mXeUbvw VyVjyPnk09L0msry4yLzHdxbXhd4d6YmwRgPBOtn7H2SpOFvp+zezASgsDKU/lLFhN4+ dW4HG5wl7lIlY8mwbuJ0TRDOcCOvjbQnCG3OC7QuerXdnesrAmiNUNi/OnR3owgnfrFP V6AE0fltYw4dcCi0QNNBTbuoNRMeHyTuRWCd09iZ6R5b4hDXZv3ZlqwUTa8ATMFFGTQS Q7p7dFvXCjHAF832HGPczgd5LG/8u4Xi7Nl7biWkPl0Gx/9hRL5ff9puebTzG0+W32XA F/Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l+WJiw5F; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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.22; Thu, 28 Nov 2019 08:50:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=l+WJiw5F; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727126AbfK1QuV (ORCPT + 15 others); Thu, 28 Nov 2019 11:50:21 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:36604 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbfK1QuU (ORCPT ); Thu, 28 Nov 2019 11:50:20 -0500 Received: by mail-pl1-f194.google.com with SMTP id d7so11814807pls.3 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=n2ttEdN5nVtTDVrxcmngy7GC+lrqfjaFCeB4N0HHMVMEQ9OIb1NilKd2g4Mt3pLY12 BL92mcVhT977jlAxN6jOM32P9wkPsy3zZbbHUBHrtreRYxWovu8kur91Ye1ypcYndyF4 b6f3OiwjZgUvacwIVlpPxXynS8lY/aeJYGm/Qz73OUnVMiTyXjBUey1RyhWSkfmvFGJk imcd7noP4nve7ChlXua4pYYR7UrLzHI7raDpnE/1gZrEfitX+L/D7dyeWHAmCT4hezUd OkcSm0mif6krA9jFCjAkodr06qOpnO85oaOYp0UNCuzBaNUmg4I+9BZe8X+7woKqskGX duKA== X-Gm-Message-State: APjAAAUS3nSoY2LmKgYpA+N6YPm7yWFwOJRah9gXIwOxvYr55yAg1Jzz bIVoKW6SqcsU2hnCnogDGVU5Wb051Xo= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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(-) -- 2.17.1 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: 180446 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp373447ile; Thu, 28 Nov 2019 08:50:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyuhtv5BrkJop7xqaLO5Bv4J8TcDVzf8H+VDhYSmCJ8Hwo7T7W2DjO26zSVkCCXi083DAFO X-Received: by 2002:a17:906:404d:: with SMTP id y13mr57098202ejj.276.1574959824543; Thu, 28 Nov 2019 08:50:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959824; cv=none; d=google.com; s=arc-20160816; b=LAvooScVqAbzFUYanimmB4rsbfqns/tPvDRKfEeylGode5/ct+++GPFfWRJIbBkRK3 NzSFaB9hJU/d2a0y1MDY2B0LDtrXH26OX9e0Di9fXvVzYliRLzEpmISFxMEH1WFl7hwI ceiP8QxiQcKBTTLjOFNK1zEsBxtu7fCx5vM6e0C0ogKesGyEMgpZHvtBZZciQbCgRUo0 qj7Xejn47C0gZczSfbMX9ifzXLHV0pAyJxHBQajoFU8mv/w5WF5/QvmWiNuxR6StE1sG W2kohOxg1zcaQp0CSgK6yTHvGMFqO0iTTc8faGBqLom4oHuzKEnmFeNuH3NoryexmXFv q+7g== 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=Ve1daf/mMGyyV9VtqaD9VZ+drFrdziUeyzqFEa1bEX8=; b=BCzt06VGcD2xltp1M3NE+ELNqnLZebUft4sHnydek3xRNxmIwq9WV0ydoj9yjXxuOv 0PzMTQAkb1xU4/BBBz+ycafzpcQ3clkwqk+OKmJzDHosoOoy3A8GC0e5eEWjSJnSnVEJ P2eD1qPVKJYfpPX4/kZ1ySPq7FWjrJ+Zx5hrwzgOF3nCe6QcEFlcywCes3A6JtvfkDfQ 8m0hwa2sOGdxmg6g7g+Mamf9XMEdM5L1g4sKJQOpM3ZV1DmTOi0xfhcVbQScHNmtn4nT diN758g8R/Gju1zm2dXgtcpN2GDMwewDY2ejdnuZ7KE3SqnaB2E03UiZ4UeoMIBBbuKi ZSfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QdfKOwx2; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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.24; Thu, 28 Nov 2019 08:50:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=QdfKOwx2; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727139AbfK1QuX (ORCPT + 15 others); Thu, 28 Nov 2019 11:50:23 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:36604 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727128AbfK1QuV (ORCPT ); Thu, 28 Nov 2019 11:50:21 -0500 Received: by mail-pl1-f193.google.com with SMTP id d7so11814815pls.3 for ; Thu, 28 Nov 2019 08:50:20 -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=tkdlmQdNTIw6ZQH7ytmRljZVi/da/Ekxap0KCkmsDUjfKeX0UidBKZvQ7wxWFEKruB 0wWfGzH33V1yNmtJXyxumSwa/pvoMfSGag5nAhbFko2KtnPNpzZ86K/NKqylplNImb10 jK3q3b4xz2TN2gsBm3CxpNlI42XDJMoX25KC+/V1+xeSZAzuFwYzFONnbBZcnJziYAOE pg/1HK7RNH+Zz75DAK1wKnYXqrjjm5MMnzldENe34/PfDjXi8lCaMgAECKyzj9+9+nMb NA01Kt6iQzE59GZT/rtj/HLKMX8Lyx+zU635UEPP9z9OGa/obwasdT3+LI0Z22MIrNGb 7mrA== X-Gm-Message-State: APjAAAUGrlkPYDWV+0iRxVZAX6nnszdmDlyt+HaQHrPMdkeQ5n2mzwF0 i5qfjMHhl+CLA3O2OptwtPhdB5Rmw1w= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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(-) -- 2.17.1 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,