From patchwork Fri Nov 15 22:33:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179525 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13126210ilf; Fri, 15 Nov 2019 14:34:00 -0800 (PST) X-Google-Smtp-Source: APXvYqwIZ5Eyalq9NtOseyD8If0O9nKs4Xqi2Na9iyiuWJUsc79c0PlrDJ19OrqE25L/KgG7MNrB X-Received: by 2002:a17:906:1395:: with SMTP id f21mr4305540ejc.152.1573857240468; Fri, 15 Nov 2019 14:34:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857240; cv=none; d=google.com; s=arc-20160816; b=vlTWVQx6jFCV3anEtxYwnKEtik/NGywPC85FGjHt3OTmqZXqxEpduXyMD3OD4fD1+0 TT+CRJHMPeQyprLvcwIHt00y9AaAQPIOwSo30z85yVQ3nZU+Rz9ZKXpTTnuZAbbtTKPt Vtc1sYieJPgFAnrhPB7e9qVGNYFmaCZyopYZYkYg7Xzow4MNe58EsWjT5yIuidMovrLC NEocUZOgp8A55m9Pu07ZaOKwvZ5yOGMIPInpNa7nPQZYyY3x6NDjud0ZmSjST594R58R dHEpRENcc2bHfgbDdYWAaF1202DfUVCvZcRDnAdR99JERNJfAYLNjlo7a1CSO18PP1Ul uOIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=Tc+IEmTbMBJCj4EiVIkUr9PV2atSgJthk3up+qVhyOE=; b=RA1S5Z1qY/MoQ8ABO7uXD21JVvvIrexDo7iP/+NbzwJb0sZhEKuyb8aHozNUbYXLKF nzjYiaQUH9hyUVy+ZiOe8WFlQO+zkU81n2lwRljGvEa9NB827vYbVNm3iY5qSBRBuk+E q9mJMYeuwDNIUrUsacY43FhMiZcDU1GXlgPs8syICWVpRQM2QqLjIAsMMzae2Ix20yhw qBS85G6nYB+xuAG66o2/+VI9jucykEs62Q3bJDOG5lrPeAVcvAXs174ajpvVHsitDauK +DWIQkzzczke+sJAROMtE2zVVyAHsbFg3ryc0C4CU8GJ6+mo90hWIxISYvxCxkS3iLcW sCxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BoaaaX8R; 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 be24si4552697edb.156.2019.11.15.14.34.00; Fri, 15 Nov 2019 14:34:00 -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=BoaaaX8R; 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 S1727020AbfKOWd7 (ORCPT + 26 others); Fri, 15 Nov 2019 17:33:59 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:47086 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbfKOWd6 (ORCPT ); Fri, 15 Nov 2019 17:33:58 -0500 Received: by mail-pg1-f195.google.com with SMTP id r18so6596813pgu.13 for ; Fri, 15 Nov 2019 14:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Tc+IEmTbMBJCj4EiVIkUr9PV2atSgJthk3up+qVhyOE=; b=BoaaaX8RsyTJpotwcaZaTD6Tyhn833MOIIDHMWr3NTNPT5Mmx71uuoUUG3DF6Dup9s lAeMeISC4gG/92nA7AyPgTb37ys0iuHbAxbDO3MU0OERSfxWYFUPDT113kahRoqHbacV 1t2mCpDH0ZffJLXrG8zehsSd086kaA621p1+yYiMxgHdxcG5EAUKq3YCqy6MmqrI/Es/ jcnzhcv9t4AopOYTO8EQg53V68MNnuwplarZG6y/N4NId2Rw73Yj2+YdKFtJGEvW7J+1 VuZbzXMxe1W0aqKbfqGyJgz/TEKm+UhMbJtGGZ6czxRqmh5bNfZmhSfjIiVFZ/z7ZgGU 1VrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Tc+IEmTbMBJCj4EiVIkUr9PV2atSgJthk3up+qVhyOE=; b=WBjur65KQrBOnTsvZv2cAo2f6lLIpdu/6OUelGIWeW0GKbRDfVL7iB1iezZC97SXvt epTq4mDbFcx2Z9v2lEZJgXvCpCctZTAJkqALkKcVA1fp10MUpemfnMRdo3pTfU5edohI 4V1bcel9rTakCBKXMdrOKfMO9EHFiie7ofs7Z8S3sJVo6Op3YPUmfFW5AaUpSwahi56m WhRi76hPxOlewcE1CKLfa2Ei4pLcDxxfQ6AlqETTlYZaZMtWyf0yj39+z0JdmpsVtdFk VfcIKdTUZoBgATyXH2J82CpuzYfpxanoWhtrLltkBpr/ECWzBxRCVEYM6yexdd214fRw 6VRg== X-Gm-Message-State: APjAAAWUi9wFgxmh7pagXSRq+YA3+Hf5DE57jSb04n9CzDHL4jaeBi3s q+2YzRmll2pzRzUVjt1qipPWbt4dBLQ= X-Received: by 2002:aa7:870c:: with SMTP id b12mr20357084pfo.30.1573857238096; Fri, 15 Nov 2019 14:33:58 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:33:57 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 01/20] i2c: stm32f7: fix first byte to send in slave mode Date: Fri, 15 Nov 2019 15:33:37 -0700 Message-Id: <20191115223356.27675-1-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fabrice Gasnier commit 915da2b794ce4fc98b1acf64d64354f22a5e4931 upstream The slave-interface documentation [1] states "the bus driver should transmit the first byte" upon I2C_SLAVE_READ_REQUESTED slave event: - 'val': backend returns first byte to be sent The driver currently ignores the 1st byte to send on this event. [1] https://www.kernel.org/doc/Documentation/i2c/slave-interface Fixes: 60d609f30de2 ("i2c: i2c-stm32f7: Add slave support") Signed-off-by: Fabrice Gasnier Reviewed-by: Pierre-Yves MORDRET Signed-off-by: Wolfram Sang Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/i2c/busses/i2c-stm32f7.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index ac9c9486b834..48521bc8a4d2 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -1177,6 +1177,8 @@ static void stm32f7_i2c_slave_start(struct stm32f7_i2c_dev *i2c_dev) STM32F7_I2C_CR1_TXIE; stm32f7_i2c_set_bits(base + STM32F7_I2C_CR1, mask); + /* Write 1st data byte */ + writel_relaxed(value, base + STM32F7_I2C_TXDR); } else { /* Notify i2c slave that new write transfer is starting */ i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value); From patchwork Fri Nov 15 22:33:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179526 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13126299ilf; Fri, 15 Nov 2019 14:34:05 -0800 (PST) X-Google-Smtp-Source: APXvYqxMouPflvhL+PCntFX4GgGB5UOsan1O4LP2Bd0Bfs6q1sqii/hhM0sQM+/uditDmUOIsi7o X-Received: by 2002:a5d:5284:: with SMTP id c4mr4944335wrv.376.1573857245112; Fri, 15 Nov 2019 14:34:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857245; cv=none; d=google.com; s=arc-20160816; b=JfwELfuEWCC4ttNVEg6+m2gW3DL/Te78i5VJQdcSEmc1PYA3j/q835t0uB3+tULBRI REJ39/Aeoop3H4mXIshcgmFVeO5d+IDR7LyWKW9Jor5KCzJvAwwKXn6aJjMMaHV6TL+m xRG+a+GJUdYkxN4cCujy8aChQKuZqHMiMfW98jOBbLr67+/No+FwYrh37RZK1HCdvLMp KMTLG/zpEThPkmgJFvASY0jTRKIQH1ZPCtDGBCqii6Cg7xk7FXpDj9aWipxBWC5KJDjF Zj1bP2mlWltRw5fixAP36sBGU9P4onn+Qagoon3aZ1FblbWpK/X0Fy+NtoyzP9Rf6R2u G37A== 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=2t2lfkYvCG1qZ4zH71UsZZVKevqEX7pyTohdYU3/dDg=; b=iXWO+OUQSkxypp5CHpOY+vSGwdEE4dzJKluxgWUbU5nkpZvx+3yQbGLtnIiDcdWcmI l92avYtX4uLfLiSflAbe8AUlk+ebdfUA/aGY2v/PhqGGgD9SCBRP7vIFByY5ZhzxdiZD 8XF5gzeyeoOtcNZTzpUQ5wlxGazdiyFvPeOSRZMpDnd/1aVJPu0bwQNmjpB8USyL0bDI 5L8I5AaZZ4mbLd0IZQjRv2qCdAfdc5crGvg6iNHhD5xuO5TL6obiq5m2+4PqlLBMQalx OWf73LSW7s6Gz3kfHfEXQafnQm+kyf6e0PX+mo33CzBNI0uQXXGZ66q3b9qvck5FxPBR keZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TSxkLjju; 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 be23si6995091edb.103.2019.11.15.14.34.04; Fri, 15 Nov 2019 14:34:05 -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=TSxkLjju; 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 S1727181AbfKOWeB (ORCPT + 26 others); Fri, 15 Nov 2019 17:34:01 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33813 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbfKOWd7 (ORCPT ); Fri, 15 Nov 2019 17:33:59 -0500 Received: by mail-pl1-f194.google.com with SMTP id h13so5643028plr.1 for ; Fri, 15 Nov 2019 14:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2t2lfkYvCG1qZ4zH71UsZZVKevqEX7pyTohdYU3/dDg=; b=TSxkLjjusnWyOxYQuwJ0yeo2qVuacsTryAzYn0nABmfZ+giChdSbiAlTILiu0av+QY jkWKBo4DLgZtHrpz+tdF+VlAgQsfA3OdIm5fhLhv9vSP8EAGtXSK+OSQOTBRtAQcct2g QR0Sglw0sLDa8vkUzDJ7iwCPgDCjEiKh+VvE3qSkwQesXq0iaKdptZvJJxiDYbc1N+j4 xaT/k5+AjeJLF9P+ANrQoOWHWCa16LHqeI0KGWEjIvKKArK5TYv/F94+FbsrOhMSzjwN nH0qNcPvGaUtYtZ3JDYIjIjaFjXf66XE2kFG4WMS8hUVt2ONxPzvC68OWC0+AqOf4NGA wEtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2t2lfkYvCG1qZ4zH71UsZZVKevqEX7pyTohdYU3/dDg=; b=e5/IJYSo6re7kNarFud4StX8+Qf4bIfJ6nzSObVXG+MlARCAcmUhpuw4VRiu22Rle6 Cse68n+oiqM54jGGHkj1Kv+/eivngKf39qGuAX7s/3+GRuMvrK7dPy1N1MfebwNYSspA oh3mix9JrK2PWjOKb6H34KzF5aV0XrziSctN+I0Nz2EPnQSR5XOkY4rEGfgadWe2824X b/usc1mkxrPQPajSrM8MOxn84IjwzxznX7/1puoq5eyqpixApyZ31X1D1NOwdyVNCh9r 4UyLpoQLq5czUXk4cspkbjASnfWuNFFA4i7hMN6FvMEC9PHTyukyb2Up4MDIqQO80K60 CEzg== X-Gm-Message-State: APjAAAUHP9AltWVEDNsgmqxus1PIdUTY/p8BbqBHspp97Q+Ar+ExtOcn werfWcrmMrGTpnyOta+dO2EB5Q== X-Received: by 2002:a17:902:9a47:: with SMTP id x7mr3791386plv.84.1573857238838; Fri, 15 Nov 2019 14:33:58 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:33:58 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 02/20] ARM: dts: stm32: relax qspi pins slew-rate for stm32mp157 Date: Fri, 15 Nov 2019 15:33:38 -0700 Message-Id: <20191115223356.27675-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Patrice Chotard commit 86ec2e1739aa1d6565888b4b2059fa47354e1a89 upstream Relax qspi pins slew-rate to minimize peak currents. Fixes: 844030057339 ("ARM: dts: stm32: add flash nor support on stm32mp157c eval board") Link: https://lore.kernel.org/r/20191025130122.11407-1-alexandre.torgue@st.com Signed-off-by: Patrice Chotard Signed-off-by: Alexandre Torgue Signed-off-by: Olof Johansson Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi index c4851271e810..d9dce0c804e1 100644 --- a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi +++ b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi @@ -290,13 +290,13 @@ ; /* QSPI_BK1_IO3 */ bias-disable; drive-push-pull; - slew-rate = <3>; + slew-rate = <1>; }; pins2 { pinmux = ; /* QSPI_BK1_NCS */ bias-pull-up; drive-push-pull; - slew-rate = <3>; + slew-rate = <1>; }; }; @@ -308,13 +308,13 @@ ; /* QSPI_BK2_IO3 */ bias-disable; drive-push-pull; - slew-rate = <3>; + slew-rate = <1>; }; pins2 { pinmux = ; /* QSPI_BK2_NCS */ bias-pull-up; drive-push-pull; - slew-rate = <3>; + slew-rate = <1>; }; }; From patchwork Fri Nov 15 22:33:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179544 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13127411ilf; Fri, 15 Nov 2019 14:35:10 -0800 (PST) X-Google-Smtp-Source: APXvYqygAA2FK6++AJ/ECNxX8gqp3BKXjSmYELme+TdhKpReIl4DHDez4NfAX+i/Cgi/uj02kqLh X-Received: by 2002:a17:906:c4e:: with SMTP id t14mr4617090ejf.48.1573857310157; Fri, 15 Nov 2019 14:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857310; cv=none; d=google.com; s=arc-20160816; b=XngTVnUloLyPr/oq08yw7WTaYBlKFf7oMVOqyeyjTPdgPMkVoKHplrpXP7NFs+9Yi2 mM8XjxOWIS5vNM9McIxa+ifTqWfXK4lQaeN8okZyj0/G3smIhDQhNWiuuKsU016lSKT2 ttaA4+V7BOZi0W0PlgiloyLekMf/2Vl+OIFa7i/31lnYAeZHzRhjdo+IFQ0bqBd0KrGl MAjUN1ojIRUlpHbSp+jg/4225Vf2Vk1H6IZqePZf2kQY2wk7SD1AxlBiAJjIPHrlajTW /mVd87UpnVLJLsT6QtbW3nrM9KyHmhPqiLVWYnmauE04jhuQoWV6loZhqM1/dilJ9Y33 hT8w== 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=5tCHcBKEZssfZtGLO4lrvgsi0FdvjwhVDJVSSTh6psc=; b=Wxnl3A1Tqd2P3qKRv5VbMinLRF21rnql4EkdBFb6cIGUK1n1MsSA5mebYhKUNyM5ew i8rIYagwmlm0ktYT2UT5ocMho1CrPrUfmhzn/KDADKZOKYx8f0OI63SzTV0Fjarmf8cz jUW7kXulSgnoL+FRfD9BKGpwTcl13aDqjU5/fWGKBnY1gEoqSI6VqPfxe8cw6loM8bDH PGKm+jw8m4VJYe1M7ZCf2cwY5yKf1S7hSoyDeiR1UW8xQ21L2v16WjeP6mPrhSy6EM4l 7Bw0NgHguavvp8gT7koMIymu39vR3UvUpPr6TPy0+B2NnuhkCSmjDIPRWSrWg/cYnwdI XRmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T5gTpPfM; 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 n2si6758121ejx.38.2019.11.15.14.35.09; Fri, 15 Nov 2019 14:35:10 -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=T5gTpPfM; 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 S1727606AbfKOWfH (ORCPT + 26 others); Fri, 15 Nov 2019 17:35:07 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:35869 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbfKOWeC (ORCPT ); Fri, 15 Nov 2019 17:34:02 -0500 Received: by mail-pl1-f195.google.com with SMTP id d7so5632997pls.3 for ; Fri, 15 Nov 2019 14:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5tCHcBKEZssfZtGLO4lrvgsi0FdvjwhVDJVSSTh6psc=; b=T5gTpPfMPcBQaM1Rda0Ndn9G4cEZJwjbmnNlxXqg9buGJ/wlKso18b4SNXgJD7wEjJ rOro72GB7K62gRe3juF5g9nEfWBkcsocfcJAPAukedKksQ9p/Ct99Cz7rAfD0zWrGgCT t55WWai/iFvSieafgwu7rtv7uNqXlW18lIIAG+PCfV+zOwAQgcrzYQZrFYj1SAtAyGdz cUv8qB5jxyGPynQ7jFkXphM8oHv+T229CnEEWm+EoVNr3J8vMlXstQwEIl4FeI/NjSH3 nVfEjRJCBYn8gJpA95V+ZVLMi5mzXl1i+KBtLJVt8bVqYLlL4lqi5vxI1KNbXvHMRRTV JVZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5tCHcBKEZssfZtGLO4lrvgsi0FdvjwhVDJVSSTh6psc=; b=Sw1woIRnhqTxI/Ro8oOVBjg6YpL1xdHhd47++IdzlBFuprgZIIdYGKbsmm4U0ydkRe nqFoHEUgsaVECWAKnyeDIwLzSOXlFJOQWyNz8DxX8SFIxRTRwKAmMn+im/VK8UgCyha4 tOaALUvqH3PgsOEGp8yHls07pLQnrmg3VtpGsPXh4AVJbShcTwjE+O85y8mii5sBi0Dg hB1ZKkwHbIDAkaoNzvaQXEwRmULDDAhIOHfNN5Lg42q2kVx+6m6P5JVH9UgU6IJZpqPc x0v9TIZqDevgAKX2nT2+JZwafTeLTkADArb/oDb654S0X8uwPrnzd9NKA8TH6I4q2qjG 3d9w== X-Gm-Message-State: APjAAAXl/KGJtW3Vo5i6/qxDPgSA1qgpPxm2OWWglG6jeJmJnfwDsTC8 qi1dRbfwK68jAWsQORJlJ9BH3WMeboA= X-Received: by 2002:a17:902:8d81:: with SMTP id v1mr1565624plo.289.1573857239827; Fri, 15 Nov 2019 14:33:59 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:33:59 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 03/20] mailbox: stm32_ipcc: add spinlock to fix channels concurrent access Date: Fri, 15 Nov 2019 15:33:39 -0700 Message-Id: <20191115223356.27675-3-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> 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 Fri Nov 15 22:33:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179527 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13126316ilf; Fri, 15 Nov 2019 14:34:06 -0800 (PST) X-Google-Smtp-Source: APXvYqwwyB9VOFv8JC7X60hcces4bkLXOxJUBaNR51ATm/3fl/xYrTKY5LAsXryhkSqTei6tO6Rv X-Received: by 2002:a17:906:fcdb:: with SMTP id qx27mr4365511ejb.255.1573857245934; Fri, 15 Nov 2019 14:34:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857245; cv=none; d=google.com; s=arc-20160816; b=j3tuqxlR0kFxea3j+Y7KRsYlltHBg4xgW5hJ6V9Wc7zlXNoBtZGfNq+uTZvAgMvU9c X2U0QRty7GejLc+2AVWDvP7o4pxCero3RXXbIN/qPH+CFJFrT7XPhJd1kf+h2YTKqEqk 5fH/N44k3KlMg8c/0NuEdRr/V42EA4LoMqiBOTlmgJCueBtMsebP82IpwIhtbfs8KbwE Zi0txuRDhIlkGa86DUaRg+oKn/EFyx7+quBgCRTKGY2F79DpmqPhjbS+PGdvLHwIYNDv 5EpzmEtULuYMCIo69KpTPhkGr6LG8EmKvsDr3snmXyuHyizVnw0V/nCyhinAr+31fFPG XkEA== 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=pnStBG/T13CIghpMMY37iVdEqu6Tf6ypUdEca+Im12A=; b=E4vfvrd8OWCV+zctc724+j4fHlgF5VZoUaUTBa8mREQFJXMTdHx4Uir2A+uQ+Zg3mC Sk2lB8tSDjYOiCXqUg/Ii8PIIEF1YVDiszPlwsvMpuOzka5PBxTeoYlOdy+3KXCn8P+v M9DtSYcE++8T+1TICOEcUELuf9DhGTEQUN0osvpd9EVnvCMa3UHikx/pPIjPKnSS8xH+ 2hNIDoAMs0QfTyYqhSIChWtwF3eRwZjLAIrSsL1NMCcCNvFCzml4BHPE1nXq1kssTPb5 K1Sp2IxL09AkJ60k0anwJxphVa4tQICKPIQaCBmkr1Uj7WpqYX6rc6Z9kKXwx9uKyAQa VTyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UcNOeX7Q; 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 be23si6995091edb.103.2019.11.15.14.34.05; Fri, 15 Nov 2019 14:34:05 -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=UcNOeX7Q; 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 S1727220AbfKOWeE (ORCPT + 26 others); Fri, 15 Nov 2019 17:34:04 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43964 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727178AbfKOWeB (ORCPT ); Fri, 15 Nov 2019 17:34:01 -0500 Received: by mail-pl1-f195.google.com with SMTP id a18so5616516plm.10 for ; Fri, 15 Nov 2019 14:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pnStBG/T13CIghpMMY37iVdEqu6Tf6ypUdEca+Im12A=; b=UcNOeX7QeFUdS+8BsU3HT6dUr5DPakiIHn/4UvPOHLFYqY/K6ujtP4IZer6qWH4PsL kSBTMAw/WQgyxTxeo4ivek0tX/PV86dgJw0UkYo6ERIwQlFRePO6NKrAtfa6NCJ20W2O TsLzkBAGM6YB4DuaLNvOwjU3GdT2dzYF5IIKeZ0U3QUbT9dSuHzqJDl+QXBysh5SV+Ov lw25nX/7WiyUcJ5Xp4DrwnC0HKLo02gWkWh9DR0hT+OxTsQXWX6d6dxK8t070uRMMt9V r9oATtIcUAuwarcVv9V2aewPHt7avcTKRzk1AKnwfy3HSFUqXiDShEdVFb9swtzK8Huo 4nkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pnStBG/T13CIghpMMY37iVdEqu6Tf6ypUdEca+Im12A=; b=S0USZpYOt+njxTIcdLLhWzXZta10kaap4bn3+9R6I6ay9MBNkI9EDCXqACsJ/aVM21 DJGyFZogpvjBEuR+Emrsjn5QsIyTTRQFL2eu57b4SUg01gErJLC6CjL24AkjCkm5DZoR HqI6VrlzmxopzypbQhkB1qbofKdP+6AzDcIYQ8Rs7xZqFSaTz5BPXD2GeaWTBsR6toXu 1/iWSUaX5Lhb6UJkYHBAIfOOgtnuIbkcNqk0fUTvFvTgDv/auDo/oPhuBFGz4+azAA5H 4Tq4Px5sf48TwcHQdNfd4nHUoc1r2EOKLAHNsU9+6n2GfukkLks6tBUICyGRHgXxrzgi qT+A== X-Gm-Message-State: APjAAAV8bz3r+uhXSgQwcVJDj8t5gHzT20wIpcssvb7WEwgyPEdSEGxh FnqMl3oCb5laAXei6IL9Sx+UCw== X-Received: by 2002:a17:902:fe8f:: with SMTP id x15mr17473187plm.343.1573857240779; Fri, 15 Nov 2019 14:34:00 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:00 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 04/20] crypto: stm31/hash - Fix hmac issue more than 256 bytes Date: Fri, 15 Nov 2019 15:33:40 -0700 Message-Id: <20191115223356.27675-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Fri Nov 15 22:33:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179540 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13127163ilf; Fri, 15 Nov 2019 14:34:56 -0800 (PST) X-Google-Smtp-Source: APXvYqwR7s6KQA2tByIETBT3KfV5ANJ8z7kNkRi5NGH0cLB0I2QJ7wLB+Wtf7y7wiuPs6bx4j13D X-Received: by 2002:a17:906:bfe3:: with SMTP id vr3mr4364373ejb.273.1573857296056; Fri, 15 Nov 2019 14:34:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857296; cv=none; d=google.com; s=arc-20160816; b=cploBBwQq6ku+IXLQxRz1YinxmZp+bMdwftosewBtEHb5NqJh8qeqX6KiCSjKmyiet R5NyGIXeHOrHGzxrBzLcoDCUGf031TR8V2+gwcE4Pm2Q9Ic5dhXwqh947/sMxTBJzeMx dyzOwTPbaoYT8tceXLy47YNyUWkIqsqU1lLO7aaACmDvsRDvpGkwCZgnA1T4C80d2Lo0 f1EKv8zwoeq0m5KEKud/XI7aIcn367zs8cl3TwWpYHjc/fozbq4pUGdwVqUkMpfQH/RS zaWrMvYaMU6vEEB+TgU7LLT8OfrVWvuJzw48wgkulvvv7HAPmlEe52wM3zvWo2Y3nPcv sWeQ== 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=6V0ioyUbzQMXQMBXE7qcEPEwz5yqv4QBePomZ4UZPqc=; b=xW7JhnJUXarza4a5LEfby0Icbkn6TpTkBAjEjmh9FbJbDBF0M+BgB3DM7z5qBbIx3y zkc2bBUaxW8Eju1No3i5d3Xf8gLq+o1clj6oaHlqrtBWehBRw+9WneNYOIj42uOMNYWs ioigF/MSPt6g/+iGR21iGH2TU0BUcA8ZRuu7oinMGU59bgnMkKwT6rhg4Pv3rIsiOBDT GEKgBoY1V9c6jRktwJT+fWq+a6peqaEnlnQOkwK7NUJ+unzaJ3g+DO91M1/D/Xe2geHW p2KagWFMbPIbjacCrPtTI0zw4uBkh3b/oyX8B0sg4j0ZiiD5Aw47xsbu72QlLYdLOxKO Xl8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k7kBlMxX; 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 h3si3757303ejc.136.2019.11.15.14.34.55; Fri, 15 Nov 2019 14:34:56 -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=k7kBlMxX; 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 S1727275AbfKOWeH (ORCPT + 26 others); Fri, 15 Nov 2019 17:34:07 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41580 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727210AbfKOWeD (ORCPT ); Fri, 15 Nov 2019 17:34:03 -0500 Received: by mail-pf1-f196.google.com with SMTP id p26so7327667pfq.8 for ; Fri, 15 Nov 2019 14:34:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6V0ioyUbzQMXQMBXE7qcEPEwz5yqv4QBePomZ4UZPqc=; b=k7kBlMxXsG6gA/UcmlwTDggZ65v+ipn3YUceSw3Oegz9WKEnqSckQYHfAT76F7fPjN s7QKdRMaRPqZFZSI/xOc6FPxjFzbfDiSqxO16UNRWzwpNND4qj7rCnHyntrgf8gWE2+b z31khVZDNGGcS5gNaQpHfSp84XhywQ1G5jrK5dsnXgm8xzY2Bttagju6GbfsQCuUz1t1 a1jGQru7049kf1xVk9PcTip/XRGMTQ3ZDi5E07+5EowNcQ7XYcGxNTDsz6/vv89SFEC4 rOkGhyiZz4rpSal4odmYlyBahCIUN9rZMet/cta0i71K0Th0xdUbgnAkFRClk3lff4d1 /chw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6V0ioyUbzQMXQMBXE7qcEPEwz5yqv4QBePomZ4UZPqc=; b=gtPjIjAIS0RoNd6B7kOaMSlpnGdV22uhzyTogsru+3wyINTwysI/+rG1Ahf/dYoylK uIlOMVY2DYoSKtosa3e1Ezy2IrTYo/KiRI/PF8FNQdjpUL4uP8m/1pVCso29Wmwf2bYj 2JNkM7qX4xmTclwmVTBwYdCM9RoUMnJ+VAdpOCsvXAvFJLRvsZSUFxGDQ1fIaY2yIsNM SPf/qJ+bCNOWGRlleHG35Rm1tXfe9E+7eC+PSMIW4j1O9oBj0b4nKoSzvUa19XkOH88q MFuWXLuNvvrhPpe1Qr0LBlAzHYStOq2iq0WW2hktmUI0c6TDlO+CnbueubeSMq/VT6+5 r22w== X-Gm-Message-State: APjAAAVr4l+K50kXPZLjd9PWRoAbiJHFXK6yb2IWQf3LvEn+9PFDvFqS KRnSFAGy08u92o8RBZgzOxeHag== X-Received: by 2002:a62:1c8:: with SMTP id 191mr20454995pfb.152.1573857242567; Fri, 15 Nov 2019 14:34:02 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:01 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 06/20] media: stm32-dcmi: fix check of pm_runtime_get_sync return value Date: Fri, 15 Nov 2019 15:33:42 -0700 Message-Id: <20191115223356.27675-6-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> 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 Fri Nov 15 22:33:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179538 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13127045ilf; Fri, 15 Nov 2019 14:34:49 -0800 (PST) X-Google-Smtp-Source: APXvYqwqlctjrdr4MgiT3FV450v6Ltm6cRbHcog9/aPDrmxj0Nqq0speY+tV+LiCr9ZojQNW81W+ X-Received: by 2002:a17:906:a989:: with SMTP id jr9mr4355764ejb.160.1573857289653; Fri, 15 Nov 2019 14:34:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857289; cv=none; d=google.com; s=arc-20160816; b=d+KwJd6Lp2uJ/O5lnuVoZl6+AA7h+r2GFEPwXb5P+i9iV50JOs6aRp8IsNFyeLjl3+ IC7aWrfqA59HH9W8fQGAELMnIJ8RHLGQzl0BdOAl2tbeRw+D7tY/4EAQtp0wQRtQ1UQl FpjlwtZskyL8QS1xpTrhgZfSbZZt6ePE9ai0gkVLaX2CQiIJxLdRO9Idi7A7bEywfIXr 6V0X1kq9BOmtl7v55NMpB8u3OMFxRtXmTe4NRXL47tEftCZAOtoMLytUIP3q0vZtbUOL JzxC+YsSQYnIyIaEdvETocDLnDxDxSAQWstYrg792bxxrtkWCg0E0ZRGPMkZ1Sz5PYpb Pf8w== 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=HUM10/8Wh+ACpH8iy+zYVazM7/j5x9SwSLUXvaHdtoE=; b=YvBYn3PiXCtahuVNEDVdmhEEfxoJ7hGpoEFcQSHrFbWqWILBC7Kv51dAUtLdyqyqOD icw18BCDdwEa+MiPSHpunf6da4jJPiymXtUs97ryAsYzpxFysdFNvSgf+ihknTvnd108 gWT+J0Q8LEuJyQ+iFKrBpvgcSwwSiJiclpTsbYxcfl7p6T2+RY2U7s0caP0ShKugJtVP hSdROcpi4Mny0zdbEX1Ywqpm17Olh/hc08A3YqRLx563WQDLQPdXmnfMALDLnYJOk/Ax JbWiNG3d/q2JLgbDcErT+DVlF8Gcq/G5gV3Y9vxibTcpY/YalwEF4+L2HB1UBQumv3jK iPQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ypkIu9Lp; 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 re9si6820483ejb.332.2019.11.15.14.34.49; Fri, 15 Nov 2019 14:34:49 -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=ypkIu9Lp; 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 S1727333AbfKOWeI (ORCPT + 26 others); Fri, 15 Nov 2019 17:34:08 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43972 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727178AbfKOWeF (ORCPT ); Fri, 15 Nov 2019 17:34:05 -0500 Received: by mail-pl1-f195.google.com with SMTP id a18so5616598plm.10 for ; Fri, 15 Nov 2019 14:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HUM10/8Wh+ACpH8iy+zYVazM7/j5x9SwSLUXvaHdtoE=; b=ypkIu9LpYzuilaTSO1ddkj4eAfzXCWg5IShx48OXs6BvHNF3e7+rx/03wNN1tYaleh SnZM8RHGgSNVrsmiwniMNuQyH174+xgl/q4FEQxe7UVXDuVhTtT/3TIahPM8bt5ZmH3+ ud8Eos51tOebTw0Y0mq1tqIEY0ssGv6FbVUe9ALZXTAWJPcnpmI7iUshmshcvm770Ayk jRwA1AXpceNmz1E6uqRFqcGSLc2lSSfvePTl8s/unV8Lzx+f9sx/TSGf3xflzHr4szxN BXuLl9NHzQ6cEOZbYvbeYcQ1U5te3v0DNBTnZ3Ab2FwTA3bfYQBRlEMA2uNi2PTy8N92 PCxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HUM10/8Wh+ACpH8iy+zYVazM7/j5x9SwSLUXvaHdtoE=; b=FbsaVQwDT5MgW+SH1whWg+ZhCOphNIa9kVvTQIU11YC3qn+Imq/oGryB3zi/VQpWYZ 4ONj1aBZFlVvrOC0M2+nISjhPB6z3b7MYAt7PWTWGmkgh7g2maobB+beUSwHQ+R1SoyY xDz3S43E5xb22srIbCPvicRlAvhwO4Fd1C7giAANPi9UqerQ8Kh/lJqs+B3iprSbJpqJ DRcL6zEPKjxbFACADOhOqCxNdP2uL+l4l2+d1FkJsmRlpH23fVVDGObUsKRwqgc1XzjZ lq9xAu7p9U/yWzzj9ZEm07QDxHfBwuON1jGD0xloKDcrPqC+2IaLXyJyluMgvl7b3ILW wzQg== X-Gm-Message-State: APjAAAVDBX/kT5D5RnyXgfSzg0MdHgICNxmsBFFEE0SqIIpSMQ3WwGX/ Blfik74mOimfHjO3Y05ctVT96h7uBSk= X-Received: by 2002:a17:90a:256f:: with SMTP id j102mr22689164pje.124.1573857244238; Fri, 15 Nov 2019 14:34:04 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:03 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 08/20] remoteproc: fix rproc_da_to_va in case of unallocated carveout Date: Fri, 15 Nov 2019 15:33:44 -0700 Message-Id: <20191115223356.27675-8-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Fri Nov 15 22:33:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179539 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13127118ilf; Fri, 15 Nov 2019 14:34:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxx+SPOrTgmGUY5l54czqOL8Arh32Skl4thqyazDhtZ02HSo8g0oCdt3WX0cFGG4zVdy/nL X-Received: by 2002:a17:906:e88:: with SMTP id p8mr4385558ejf.15.1573857293146; Fri, 15 Nov 2019 14:34:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857293; cv=none; d=google.com; s=arc-20160816; b=fvWzVClwtTNJ04zO+4PWg55iMhxy6Qm32jlYR+m3WAT9Ou7p5rl29YujP7GOvXTJ5h 8GWHFIbnJrj57EPzFa/rcv/kOOqQQvYf3Sw66CknBv2MlSLtAffr8+dHQSCAubdp7dt0 WtUGpxA3kOXEsHSuZhJPPTnKGdUPgOMAZHgyYKK4A2kl8JLg4NHG9IcSxDIGkHQXaTSJ FM3TDL1vhu87TRuTGNpFRMY5e0kIwdwVLx9r6tvmMUhM7VivEeUrY1bGkhY0u+S62iuQ duaGhnzzjWNIFP/1EqdNlY995kGv/t2LBm4CNUFoSAMs9b4bVnsZ8oEqpttVdQWeia9k Hi5A== 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=XjmHZ2r/4EcW1pjM4Rd69/tyPSpvDzWdjKn2vf5w1qY=; b=sv5p+iC4ClKxINmCKMgFUKWvgswgsBB0hBQN7zxWt3V1A3f8H0N8K1CuuVWXFD8/oV GF++FdOn75ij5rqM1aRuvW2F77L0h7jv1WDEK8FwlbA2t0nLsNaYMGiP+v4OBDYmdyaI Qclq+UoLwysqEugZRVFBBGdtlAM9oxRW2/Ny0PsysIhHEmpGSO9WURuTsl1FkZD0kQ1p Va6nZjjKoukcdLlVHEOvgdT0Y5lHVyvbi+v45mvtwXeXsLbnAN5v4NP2WsINLTF68M9n E/G5X4S8nBipc1NmcKZa8pKxu7yd9lX1Sy/vyBD0QfJKuZpFDpaLY1uYS5LAuvIqHmHH NQew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a5q+0xMs; 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 re9si6820483ejb.332.2019.11.15.14.34.52; Fri, 15 Nov 2019 14:34:53 -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=a5q+0xMs; 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 S1727567AbfKOWev (ORCPT + 26 others); Fri, 15 Nov 2019 17:34:51 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38664 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727276AbfKOWeH (ORCPT ); Fri, 15 Nov 2019 17:34:07 -0500 Received: by mail-pf1-f193.google.com with SMTP id c13so7336752pfp.5 for ; Fri, 15 Nov 2019 14:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XjmHZ2r/4EcW1pjM4Rd69/tyPSpvDzWdjKn2vf5w1qY=; b=a5q+0xMs8tIeJh8UJ8TVx8rZWUYZ16E5HxEnB0bRUqdlVxfqcyrfWViLr9Pn7dJisY VqRFpH8/EN3p18o/KhB6P43Ky8JCimROhKeXLcPYbCV9IN4oJ2CVylJtMtP7qfwro7o7 SxdF13uvII4gAOlurEJrm50rCXFufEWhRyX+jcjvLDDHPbDNOBjiwTeiV6mHv4gY2lCf v6zbwJPxmKb/vDqIU9Wohh6rRB9E8a5QwUHIEM0ATxuwA7uLwKPIO6cIdiBE5ysfdmSV afv+gI97KSg+6usaoQb/OTeraFQQt+e/l1ahp52XQnTElIh1w5nC/Zk54P7lMFFDyeem GE7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XjmHZ2r/4EcW1pjM4Rd69/tyPSpvDzWdjKn2vf5w1qY=; b=S+p9kivv5dSk6HrPg2gYiKxqc3HMl9JZRRslvy0pny+ZUes05NhtJ3opAqOoFLRc8S gGPTZXAxReQR305Ei9lTY+whfrwu32XY/IxiqBsIgxx0YlDKyF2bFVebWY0B/QG1/6u2 Cf8gGC0a0eZ1SVRkObZfAjxsc0AiN2Niyd3qqOSJbsSZeQ/PE/DaiP07+S16qxbGVd1n l2BT7lS1nTo2M98pO3DRwcZ8KF3s7QpGhlV2yvvfghYO2iJXmZOggt31Y09+OKfMRrkd H0ddUkJNnpgorhwI37dfP0oWhBViYsfSTSrtbPene2/6zoMBX23QRqzqr2jnNxW7mseJ 3cEg== X-Gm-Message-State: APjAAAVRQ3TpWtUkc6h3AiQ+oS6qatIxGqay8LPDlrADu41/gdXpCcKL 3DgZ4P8RMXowsqgkih0zm0XDBDPyzMc= X-Received: by 2002:a63:181f:: with SMTP id y31mr18239880pgl.186.1573857245156; Fri, 15 Nov 2019 14:34:05 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:04 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 09/20] clk: stm32mp1: fix HSI divider flag Date: Fri, 15 Nov 2019 15:33:45 -0700 Message-Id: <20191115223356.27675-9-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Fri Nov 15 22:33:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179528 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13126406ilf; Fri, 15 Nov 2019 14:34:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxNlS5928OtYhZFD+29c7kw1VFHggLgpyn1grshI6GbYlxc7g9OrvYDFLmgu+vhIsd3l8tp X-Received: by 2002:a17:906:3606:: with SMTP id q6mr4306078ejb.307.1573857251568; Fri, 15 Nov 2019 14:34:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857251; cv=none; d=google.com; s=arc-20160816; b=CSemgOZ0mwqxcf/iBz2nh00+pCWBBHvBLv7zjBGQghW/tbJYfPh6IRUG8OMBJ1Ms5u Bot7Q96yEIt7rDKNqyuD+D8ik+VcvXBQw2aUPVBvXLnUbrZK15pFjC0ybyCedpXzR4aR YMsUlr4WbofX17SQFs0fIy6t2UewQCTE2AuCTSJP0YT5NCGzyzcplL2MzwihjyUT5H40 hrQz32GOjQDxxKkBycGgZ79BHQEFCOer+CohmhzlhAesdpLqE8Mj+GWGMPWll8TAJqnf WESkbKnL8/C2faTXTorBMAT38FRDGbb/mLhOWMy+rXnKa/2WS4p2fc6SQC5RtsZO48iM XywQ== 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=/sm9ffuHyQlqHKvL/cAQ/Bj58CBN3LS1S5BSazdWb9s=; b=nj1qP1rnDh7bSXjAMrs1HwO2mmFp0d5uon+BYHwkAb+bmRSm+TXRjZp7NDg9jr5S2H J7SfJyPL8mzfS28Aqa3nEVwKiqzMnN3P7uMg6cPVamp6EQWcCJFmXRPLDqpf2bGraTRH nxsHzHilS/JAJmjyPl+N2rtRZ0YxhF43aTyGDZDHC9+07rVyw8d7tWpaI5R+KBmvIMpp JvTZQfSxxru7eg3i7ZK2jwkugmLdH9OmJiR11vMt2w01SByc0ApixesJXfJvojrwaZ4x huhrNEsJW8tbZ5rXLGcQW/2dMqBbtwARKIIyDjHzyV3Yh1fkWHb3BixVErjgxL2q+oWe ji3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pM8P5t4P; 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 be23si6995091edb.103.2019.11.15.14.34.11; Fri, 15 Nov 2019 14:34:11 -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=pM8P5t4P; 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 S1727352AbfKOWeK (ORCPT + 26 others); Fri, 15 Nov 2019 17:34:10 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45907 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727296AbfKOWeI (ORCPT ); Fri, 15 Nov 2019 17:34:08 -0500 Received: by mail-pg1-f194.google.com with SMTP id k1so5313075pgg.12 for ; Fri, 15 Nov 2019 14:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/sm9ffuHyQlqHKvL/cAQ/Bj58CBN3LS1S5BSazdWb9s=; b=pM8P5t4PtpN4KMbwNUNzh+mn2x2kH6Il5JxeWrKcKQ8kx58doVIPMM4rtWksFJl4Yi xpsRjLEis5CKrLOAjaRS2tsUqYI7mBV7IEsmC35MdUVzIJq1+U59yl5C8M/5ckGv0OO2 WsTXDoKyWjG+RTKzRIP3NmhG82iAuiyJHdHZJlXS2fg0egy7r7NhIwEmTwuwZI/snEuz HyEtEYXEheT/4bI8e0D8VFssUGtO3ESnWqkrCqal5Bv0wWXjt+RLeWPfWKS2b2ElEOdH b5dok1fcKq2xCkY6DxuuptOWNO3qxCRJOsuscR83yFKy8B3Q3vLeQv1yOg9D+rhmxnPG /v0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/sm9ffuHyQlqHKvL/cAQ/Bj58CBN3LS1S5BSazdWb9s=; b=Ju4Dszw09ENSkH7A4cFltRB5iE7hYriMhBdhJE00NLUiDmJYP4WHVB9enw4KmouUQq n9l9J6V6y4AIyKjdjVvrbXkMEhWPwT1OqOe0QxF3plCCG+OnSEvBSOWKBomYVy2uEsIM A1RzE24zbE7WdRlJ66Os16Q+srr1dfqzZxPGZe426mMWD/zu+xhte1rWp9uSMvwvkVFn +bLmGdpyeBK1g3+4ocV0Wt2tAmX15Wj9WTAntiCLecoRhHyhvW2fSHpBnwC3NxR93A69 RrVOifrtrcGW+Ad7nCT3E6+buZJvIw+Kqjl9DtWKrnSn/pC0DIhl4W2SaXBUamEF7CJx J5MQ== X-Gm-Message-State: APjAAAWr76efhzACLCSZ0jbMDfzqY2j4OBLs6nMy4CWIFpRRje2RvyIY x2ETXnoXDzr4BaT5I6c2yA5yfQ== X-Received: by 2002:a63:9247:: with SMTP id s7mr19675322pgn.334.1573857246932; Fri, 15 Nov 2019 14:34:06 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:06 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 11/20] clk: stm32mp1: add CLK_SET_RATE_NO_REPARENT to Kernel clocks Date: Fri, 15 Nov 2019 15:33:47 -0700 Message-Id: <20191115223356.27675-11-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Fri Nov 15 22:33:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179529 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13126492ilf; Fri, 15 Nov 2019 14:34:15 -0800 (PST) X-Google-Smtp-Source: APXvYqzZnhg4GP7LHfYqxMfU6RYWPp/LcvHhfdz0r52v9bJCbLDzmTj82wxA10irISt5Zfd1DX4Z X-Received: by 2002:a17:906:938c:: with SMTP id l12mr4382538ejx.135.1573857255856; Fri, 15 Nov 2019 14:34:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857255; cv=none; d=google.com; s=arc-20160816; b=ICFe8XEVTIVOEU2xBE2fbvXKq24E79kCf49qzRMJKTS6op1Lnxm0tFaHMTZ8Ia6ia+ EvH97ejJpdmFb1If/t0Y7w0yVysskH9UXKGOliUZBN21aNr3lyn9/4a+KW5E/IQAGQbf +5HWZhybnKkjAJMjJiH4grmyK86iCP2cL1DvjhofVeQQDwwUlc+fyt6zP18qa+I9gSjo N90menN6AwlvfJw9Jh+Z2AeArpXFqjSLKg5JCv1V/nDDKbZ0jLmLmHPNEIOlherz4OHc lt3Dt9PC0BE5PoDTgIYEB2t6wzZQFfCAKMcRLdii6CUw6s4NkDC0NmmRObmMI7DpFhF4 bZLA== 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=RCAvV+63fHypoFXOnsyRxH4xHTzRyP2HC/taWojKmLE=; b=pzcZEnFcT7TZPDsgGiscXx37J4nIufFDzIrYNt4PofLM7Vd5iB4APPrIUeEPdHH2kB /dewBwQRxBDE5d1ZGp2AQoNxfI/IjUB1y3tJwRx51dlX/WbQ5O0eUpvl6eTY/n7h+CF4 v0OhrSdq/61QMK8NKMEwH6VlwUx2bQ1ymuOueeuO/d55VmeiKLdPYLqRsUbmqUhWy4GI gomtYLoWBocaFfNDdrYfykZL7L7+b1IKQiEfLTmLLiqa7B3hjoxzHYYvDTmI8d5LDKED KSQtBxxpyvTgjIzDf0EegBMqxOulsaGLvLuWwzpjc3aMg8LO67dpp0fKiFtbu4fqW1Xr R3xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cMafIXdS; 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 gq14si6458339ejb.190.2019.11.15.14.34.15; Fri, 15 Nov 2019 14:34: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=cMafIXdS; 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 S1727354AbfKOWeL (ORCPT + 26 others); Fri, 15 Nov 2019 17:34:11 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43213 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727348AbfKOWeK (ORCPT ); Fri, 15 Nov 2019 17:34:10 -0500 Received: by mail-pf1-f195.google.com with SMTP id 3so7322706pfb.10 for ; Fri, 15 Nov 2019 14:34:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RCAvV+63fHypoFXOnsyRxH4xHTzRyP2HC/taWojKmLE=; b=cMafIXdS6g1uj9flwmN+t7PFzSGyqKH/b0cq+G1THxzoFk+UYaUMhkK+sCXvoR+FRO T/JwOcWSRAaDWyQpMyfm6t8Zb6xoOLE3pEo2VEaHnfKiwlYUUFO3RDSGQagkVZ+iwFjP wmmcuLiR+iKDMK2bzVS9A3BLyV6YTliwZCITCbOSSg1eQn5ZOIEhEWr/kh5vqAomZ4ZQ cgRA8eugzOEYPUvEM8fNYj8/Yg/ARhoLFq31/vgr7hZNUdFh2ItkshREq+pM+lKJazBg bqbGPI4XSYbM8QdMhxpjnWpQ3YJz8+9wR7dpzxgu9Pvr/+j05k3lwfNTVW/WugA3V86p o+NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RCAvV+63fHypoFXOnsyRxH4xHTzRyP2HC/taWojKmLE=; b=XBXr206p1i/T7DJ7baL0364i/JRv3FQikyv8fKTapZDbr6WjvURTQS2Xqc1vWC7qrJ dXRm22pvrHmVv47MZCzTkNo3p0Db/deJ4CTg4+Uv/TMptPh+GRqtgWaGye35jKdou971 EIyfiGOY0G8emqWAi/Rg1Rh5XgBGnqc49GVnmC7cFpKsd5yITAnKDaWCp5Az9AqC0gPd d/hb4c/VdkiadSSMhsdy/XYO115OucslS1WyNIr2Q8zWQ38tw8yBV5Ofb8TdpnU0Ggbt r5VOdBbayObPgO5fhC8ZCBMnA0hUX7LD61b/Q0yE1wgOXVFddDC87z8+eQMGptI2KF7S +jkw== X-Gm-Message-State: APjAAAVb/au6v0wFUQ+Td7AKXxjeLgqPtekB2Egohzi58eIt/RBNQkxM +Si+Zlpo+BE1dfq/FkLC/TdW1Q== X-Received: by 2002:a62:1914:: with SMTP id 20mr19374168pfz.68.1573857249524; Fri, 15 Nov 2019 14:34:09 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:09 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 14/20] pinctrl: stm32: fix memory leak issue Date: Fri, 15 Nov 2019 15:33:50 -0700 Message-Id: <20191115223356.27675-14-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Fri Nov 15 22:33:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179536 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13126857ilf; Fri, 15 Nov 2019 14:34:36 -0800 (PST) X-Google-Smtp-Source: APXvYqzhxUCfNa0zbeQRcjT8+21CYUfAuIpVMKjCAnVYO2fgPHHTo4oThOpSkSzgw1MEYconm0Vm X-Received: by 2002:a17:906:6403:: with SMTP id d3mr4531085ejm.258.1573857276464; Fri, 15 Nov 2019 14:34:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857276; cv=none; d=google.com; s=arc-20160816; b=wuQa5VK4eiRFzqctweitVq2gIFcERtk/iR4JbU6Xr8XZU8UibqYwI2PRSbM9IUZfXm uENvF9hJ9hTR4d3bKxXUSN0yjgS8bnmzeMz/zFU/1w942ybyN3i/nDhSZ2A78OMQomod YgklVMEDvjPbcbM7U6BrVMTCwqQFvLYmnAnsP2OC2GvbHCCWCUNznPXNlCl9qyUXMkg1 +mio+U/IqcauZce0yQECMbTfaxEelxwRAVQxhBTRgLkx7NAt78hkWOWwWz/FI7biucD1 mry4uqj2jqp/SOcH+akYP7opph7u+EHvMr/HE/EOdO06f9dk0Qs/auduh8CJChyV0oHt tUKg== 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=i5dPEh9y2ib6oOQnoQa1Apmmo+YJMTHG/tlqLO0haxk=; b=moWRhDcx7VgkdpsugmOlGahK/YaIBNYSKzp/CqdSoqQbaizDERWssyy4OBGDdxs4lR ptoMytyczAg306kpII0ruIizmLTrFuhYOe2knUdknThchFJM1uxJT7Rx1+fnElOsqt4F r6tOvDh9m1L4raJB0vMAyIfY/A+ZnSEU/cwZG4QKNEhPy2w6Ad/DZ2XICwaCKKyqMtA+ 8gbMAerEQLNy2pzIrPORwSE0oiG9tzg8LzK2F1Z7hEaCJQ80UvdfCLFVN0pkuZYdn4DU cgFgdAksYdFoivFilpNrSYobvNrRUxw50Au3kGZ/jBpdQt6RBZAsyq4qTSVlgZww4GnM n3Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kW+Yur0H; 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 nw21si3992007ejb.222.2019.11.15.14.34.36; Fri, 15 Nov 2019 14:34:36 -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=kW+Yur0H; 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 S1727519AbfKOWed (ORCPT + 26 others); Fri, 15 Nov 2019 17:34:33 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33839 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727427AbfKOWeP (ORCPT ); Fri, 15 Nov 2019 17:34:15 -0500 Received: by mail-pl1-f194.google.com with SMTP id h13so5643375plr.1 for ; Fri, 15 Nov 2019 14:34:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i5dPEh9y2ib6oOQnoQa1Apmmo+YJMTHG/tlqLO0haxk=; b=kW+Yur0Hl2oWdZbkaM/sYlnrLMZqd7UJF+2HEJzbhpeG0T9E+DGIbgyiCtM6Rn8cwG 3TfxjWu0cq0O0Mq8seZ6SifvTMca6kTZcA5Q5IHZ+Vr7wi40pgdbQubrrP3lA716dYDT QQ/hQ5oOCbIRfgmybqfrg2P8aBTK/8ir+9wnrhdvqU1LZfpySWWHgCvwVa7p6SqVvpQM gD8BjoQhLQquamPA0i/EkkyiRTOOctidxeHXr7MaccD44rSjUXB4WVaBQMqEeDQCoqGs A9kZyWu0cxRQ65f0H1+XxOfxGa349XPFVe1fz4McNJfopYkmqTQPeOF1J9eREE1Pb3EO jrUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i5dPEh9y2ib6oOQnoQa1Apmmo+YJMTHG/tlqLO0haxk=; b=FNG/rCud7GMPheacCjKlX6tKss9ewqFhnFy2g0tTDX0jPoqCimf0k6zqubfOP2jy3C Q2bAJ2769Ue9fyjYKw8ZyacbbDNyoeWQnGryJo4I1SKnMgk4+HYWW7fypaooof57KufY S3lFk5jenrS3TyArV2E45I9ciLAOdvWC3spl6kCy8AGVPd4p+gTTajmuWrRn79A5Z19y QjzvmJ2n4Vvc6R/fGu8oN3/vFfpLbglsE6oMcjdIHbIUhiDbxLx2vB2HcqVk+zewrKmH x0a4wmaE/kINWjfAuNTV27a40REY21KRrbsd2VPQN1GhVXqj5uEPFTQ5nlL+/YD29yvO nLkQ== X-Gm-Message-State: APjAAAUoOeblGBNAe2ry7SewU94jTanPG7ulwcaUOZO/92zYg+HNPQj1 Q2ns3XZFF56ywFbWJpKGkDiaEQ== X-Received: by 2002:a17:90a:252d:: with SMTP id j42mr23137114pje.131.1573857253840; Fri, 15 Nov 2019 14:34:13 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:13 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 18/20] ASoC: stm32: sai: add missing put_device() Date: Fri, 15 Nov 2019 15:33:54 -0700 Message-Id: <20191115223356.27675-18-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Fri Nov 15 22:33:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179535 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13126650ilf; Fri, 15 Nov 2019 14:34:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwxF4jrNYHGzThdCI89q5ycba56s/yghbuKMYpmi0F3hac1RQNDBZUUIHaM/7Hgfggs51Ur X-Received: by 2002:a1c:f415:: with SMTP id z21mr17823878wma.140.1573857263970; Fri, 15 Nov 2019 14:34:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857263; cv=none; d=google.com; s=arc-20160816; b=sOKqdzOmgM4UqHAZNXkPLPdRpvrSa/LraIMEPIQ5tSUZShs4sTUYUPBx9WDQMkIj/e d3eOIpJcVePQqtovRm3XyXb6aYb9WlJpn0AWbdAtgmANuk3ICVyTbG61SjwsrMK6ageM dyGJ8/cGeUTMJLQRdpJotGN/gX9jA7a01VYC3D4w7xVa3C7Z9EHZ2HN5nOqm5dlfJJz4 TyhY+CTKR169Ket34UT0Yw69k9ABvkVY1Z+0ypscaNX2srEeX1VgF/p1lU5sisnXtz3X 6EVNM/efejic1NWrOB1qhjzjg5WFV5vT/7tevvcSLxarJqiECVhgX6Np6WxIEC4IuLxA ZYLg== 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=r1ouRyNa+k6U3bqzEPdoAfpCVsnWSnRUjkxZ+vQnSI0=; b=MuyksDtk/2mdKYCJipYJ9gQIoNzDF8Dg2fVp6wUW7g+oUNUvIZeLzZQKD8vEJiNBkQ 43JhaUHcebr7nYkdF7KcGUm5NwZzarCPHxPBIZqY07brz/Xx475bfJAxl7R7n1imfaOO USpABls1kuR83bSO1t6YVnkwThqv/gIlob6/hO2KgcoWDUf4m+Fnh/+wlx+P6qKhYd1j R6m7XYnLwIq8tk6zw8pxW8AZOftnfle7pBmPgnAGP+4O0QvGryj2sNpJ+6onFZM6CeFm dgPNVXDZ/TZVuBLopGsv/StYtQOGu7aDJe2+5wsSkWneA6hUGx8FQXEpFF2XfBPHlD7u w+zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AkA2Dg+S; 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 z31si7981710ede.236.2019.11.15.14.34.23; Fri, 15 Nov 2019 14:34:23 -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=AkA2Dg+S; 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 S1727494AbfKOWeW (ORCPT + 26 others); Fri, 15 Nov 2019 17:34:22 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:41343 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727413AbfKOWeP (ORCPT ); Fri, 15 Nov 2019 17:34:15 -0500 Received: by mail-pl1-f194.google.com with SMTP id d29so5617389plj.8 for ; Fri, 15 Nov 2019 14:34:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=r1ouRyNa+k6U3bqzEPdoAfpCVsnWSnRUjkxZ+vQnSI0=; b=AkA2Dg+SrHTn4/EJ8QynEGN7oPoQ/Aw5fRHMyXpEW6Y6keS6gO6VdGp+FDJ81HaCck LfkmYzBp8QrNwaymjk9ee0qPdxlC88qX2CcJuOT+KoHhzb0ptMpflS2O2yk9g1xcwj+i OsUJI152IuEDboSfUp+G5xjZAwG1t7A0XU/A7qB4I1ptcuIK1x3v8NMEcAQoZZq4bi4E Be+sv3Xu57IO52n36rJiyMgg2w2e6EQhjAwLZeheDCHSoe140YiXAwaGdpXT8hHFrlti FWcDYu761P26xKgxM27ycYqxbciEuu1T6zlil6sWl1pcyhuIHyDlPl4vUH/r7fLTJUmm 52MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=r1ouRyNa+k6U3bqzEPdoAfpCVsnWSnRUjkxZ+vQnSI0=; b=qlaDrbIXBxG8J1105GRXaShN616NHlzaAMd/lzAL8XC2XW1OVX8btuMGWMRxCRMvMz W3DeqM8qtzGN6L/UfNirE5IAtYCLigwN9bVo56AHg+tGRoQ1EZsL/Bh/FLHhLVn31VLr NzU/zeRnOybLgvaTgrBwDT99etao7KrlnEMRcD8Ta1WkMwPS7PSyoHm1OLxXmEWgT1ET uWkkDEe1mUn5rBPrcJSUVrQagSrVM3Yl1/hbFKmfkoa3l0nI+9DaLqZzBYbh2HwRClGT dyIh8ljifrkCkH3sJSZk1Ai6Uzofl0pYj3InEusthVDNFPobhWTXIp2YGgfmU/UaAzqA zb8w== X-Gm-Message-State: APjAAAWD7G+OmUINkB6UOEiFojsaEWBM3L9Xoa4TCsXToFaxGEQgc0Qv tveiGwlztw6uiuCgD5ak41vRb0spSS4= X-Received: by 2002:a17:90a:9705:: with SMTP id x5mr22110495pjo.37.1573857254692; Fri, 15 Nov 2019 14:34:14 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:14 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 19/20] media: ov5640: fix framerate update Date: Fri, 15 Nov 2019 15:33:55 -0700 Message-Id: <20191115223356.27675-19-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hugues Fruchet commit 0929983e49c81c1d413702cd9b83bb06c4a2555c upstream Changing framerate right before streamon had no effect, the new framerate value was taken into account only at next streamon, fix this. Signed-off-by: Hugues Fruchet Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- drivers/media/i2c/ov5640.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index a3bbef682fb8..2023df14f828 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -2572,8 +2572,6 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd, if (frame_rate < 0) frame_rate = OV5640_15_FPS; - sensor->current_fr = frame_rate; - sensor->frame_interval = fi->interval; mode = ov5640_find_mode(sensor, frame_rate, mode->hact, mode->vact, true); if (!mode) { @@ -2581,7 +2579,10 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd, goto out; } - if (mode != sensor->current_mode) { + if (mode != sensor->current_mode || + frame_rate != sensor->current_fr) { + sensor->current_fr = frame_rate; + sensor->frame_interval = fi->interval; sensor->current_mode = mode; sensor->pending_mode_change = true; }