From patchwork Mon Dec 16 17:47:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181771 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4654503ile; Mon, 16 Dec 2019 10:08:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxnz9gh6anUtRkqmwxuI9LBRhjQdpBBUv9stWYdVNsgW+0iAn8hFovD1CYS4T2C+UsHuNf8 X-Received: by 2002:a9d:6c8:: with SMTP id 66mr33068078otx.271.1576519690230; Mon, 16 Dec 2019 10:08:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576519690; cv=none; d=google.com; s=arc-20160816; b=xCIfbxe2Ib0vEP1/MFyAViNh4ynr7sc9y7Qyd4mQhNqZQHMEikgZMo05TMc/bXi3kD OwNHfkKqwfpNhVXKuYbwNfnaPar/j4pJc9Ac7JYNZSqucqX+rv+UATMD+OcNmUA5IrpS F9NYyv0suEv7bms3vwUYnAZ59EOLRtPC3lyy2wg5q9RK8a46KiHAOeN2Ujjf4IyJ96A8 OTt8QPSA1jxczKsLdLLZocoRbPEZV5Nv82VvhVAGF9mOyno9DCN85jxP7h+Chyv7DVby UgbykdSi0+AuDFbl30RDz3uEjLHDH9BFITXB9kD+PILfr34VFreazUx6RbODNY2oPQvI ORkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Kb7rH2jug0lJk5VBj2BKHczTmQHPT98dsyA+HXVLtRQ=; b=uU6zR7hOomyQ7rFyAzrx5mkMAJFlraQmRV/XYNI96svJ1MCiz8QY8i+nPTQVkKDm3A IsuFwuzYYTf/+YciKsg+tRZnJkwtmt4OLsHgFQMscxUkaIDzx2ia6oP6whMb1k591rus YGmZAD/bsX9yErLYnY3iA3nrxgI+CJpOuXEaGtcTYaGV9qi6TnREi8JEhewrSRm4tBdV ooiEeLZdxvvG8kCsODyJ3VLAZpfu8P+K0rZQ5zGFDTb1gFPfnQ8Dl6S+eQClJfGTT4aK yBC10aMmaGmxUW9U2uZ+SRuNmMagDmTltIT7YgpeeW/Ou+NO1+5crAMd791dz1zkXE5E KRKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=G3LoYbvu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si10724619oir.132.2019.12.16.10.08.10; Mon, 16 Dec 2019 10:08: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=@kernel.org header.s=default header.b=G3LoYbvu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730092AbfLPSIJ (ORCPT + 27 others); Mon, 16 Dec 2019 13:08:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:49396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730219AbfLPSIE (ORCPT ); Mon, 16 Dec 2019 13:08:04 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 998A6206E0; Mon, 16 Dec 2019 18:08:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576519684; bh=zlK8phi/sh4xEBUruI/ErgInYWuipq1OWubLY7IOSrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G3LoYbvuzQQx2huoThAwzmBK0rx+aFEElIO5OFy7ybvKYECwJeyl+k+kYVbgsolO6 LctwF3PpmQSzIw/Fr7m/y096Xra+JUK7wK61XyWk9dzxZ4vWq7uNRx96UTmsmVoLXA aFyhlBnb1vk+B9ZqKebw3Oizr6qVl9Cs+LpCMp84= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Osipenko , Bjorn Andersson , Georgi Djakov Subject: [PATCH 5.3 026/180] interconnect: qcom: sdm845: Walk the list safely on node removal Date: Mon, 16 Dec 2019 18:47:46 +0100 Message-Id: <20191216174811.685771041@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174806.018988360@linuxfoundation.org> References: <20191216174806.018988360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Georgi Djakov commit b29b8113bb41285eb7ed55ce0c65017b5c0240f7 upstream. As we will remove items off the list using list_del(), we need to use the safe version of list_for_each_entry(). Fixes: b5d2f741077a ("interconnect: qcom: Add sdm845 interconnect provider driver") Reported-by: Dmitry Osipenko Reviewed-by: Bjorn Andersson Signed-off-by: Georgi Djakov Cc: # v5.3+ Link: https://lore.kernel.org/r/20191212075332.16202-3-georgi.djakov@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/interconnect/qcom/sdm845.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/interconnect/qcom/sdm845.c +++ b/drivers/interconnect/qcom/sdm845.c @@ -807,9 +807,9 @@ static int qnoc_remove(struct platform_d { struct qcom_icc_provider *qp = platform_get_drvdata(pdev); struct icc_provider *provider = &qp->provider; - struct icc_node *n; + struct icc_node *n, *tmp; - list_for_each_entry(n, &provider->nodes, node_list) { + list_for_each_entry_safe(n, tmp, &provider->nodes, node_list) { icc_node_del(n); icc_node_destroy(n->id); } From patchwork Mon Dec 16 17:48:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181773 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4656904ile; Mon, 16 Dec 2019 10:10:00 -0800 (PST) X-Google-Smtp-Source: APXvYqwGaYs77wOwJ5mS3qs7+nd99v9mq6WKqLdphhqm0C/8hb5xh0MG7QcS9iA4Iv1O73mbApIp X-Received: by 2002:a05:6830:1e5a:: with SMTP id e26mr31456078otj.351.1576519800571; Mon, 16 Dec 2019 10:10:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576519800; cv=none; d=google.com; s=arc-20160816; b=iKpSA7eV2XT8ETElpOkVx0vzhq5iETcKH7yeItxXYa5ng/oZ4wy/RYaG3iEF4lTNnE XFyWa959VTbXpOxAhstFQKivWUxezUlimtnlUzg4d1qrJLqNjpJEtoyuwwJ8BP8UIUE3 7NydQ2ErRCYVw0EdOyWi0U9otqhAjmTS7Vc5hk27brmmbgNVjyq6MpP+VjppMhAcLIvt +U/QlIqB19engySifgSqYgdOaYe2WqS4aNYN6+bXGqiva/RN4JGic87dCB/HLTz5eXmU 0ycoKxlBhYeK46FLVAerMlHKUECmHVtiM9i6iUmylgsSGV54YABwf+IQwKFm6zibjg6g eiAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MZf+Xw64B9aCTBHLkgJQHu3FWLkjCSyCcecHZ6GD+dk=; b=ukz9hGqSwmKoBVFIdT9Ejt7k+KtUSP5dcXxcOnzbEcr4/mYjEeNI4iqNB+JjIIO4uR FQhBrozOiAp9pBPsUEGqlZepxuBw+DRG2ZInyOc6qk/59rUp938CLgIPdLVnZzWZlZzU xfj7cWyjCGjuz0deJdYSjqiRu6tNemTh517WHPfOHwj4VzL6EPYNTmD13o5ZFAEi3L65 iVAuQ4Xmk/5xs8PgVRpbDySfliq1/zFFg2IVQcSp3TkdVBeWdFHmgF15Fi1W3X0Xt1cq /p76IxEbNhIejikCJ+BpI8JbeaFCQwUHv5kRZ+mS0vUDYt1/AKLzRMBKRuOGntXnK4f3 aYvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZhIR+LP0; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z21si10451472oti.160.2019.12.16.10.10.00; Mon, 16 Dec 2019 10:10: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=@kernel.org header.s=default header.b=ZhIR+LP0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730300AbfLPSJ6 (ORCPT + 27 others); Mon, 16 Dec 2019 13:09:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:52646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730188AbfLPSJ4 (ORCPT ); Mon, 16 Dec 2019 13:09:56 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B5E5C206B7; Mon, 16 Dec 2019 18:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576519796; bh=QBrHzF/bDur2YZKXK3pZ0+nH4CtHkNb06QOzdb7jU/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZhIR+LP0UYnKwUljIK73GZJgLpq3mk3VJMrALT6w3bZ7NIghxu7kIzcnjq8CxQfa1 H4pNM+UBLC3+is68JiuvK/MxpRK7xALN61FZlp8IjzlxJaUV6e3uUM0UQzcNGnR9ke /NXrioLc/qhdmK10s2uv2CLBIBshsxgHqirRnEZE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sumit Garg , Herbert Xu Subject: [PATCH 5.3 070/180] hwrng: omap - Fix RNG wait loop timeout Date: Mon, 16 Dec 2019 18:48:30 +0100 Message-Id: <20191216174830.209592374@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174806.018988360@linuxfoundation.org> References: <20191216174806.018988360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sumit Garg commit be867f987a4e1222114dd07a01838a17c26f3fff upstream. Existing RNG data read timeout is 200us but it doesn't cover EIP76 RNG data rate which takes approx. 700us to produce 16 bytes of output data as per testing results. So configure the timeout as 1000us to also take account of lack of udelay()'s reliability. Fixes: 383212425c92 ("hwrng: omap - Add device variant for SafeXcel IP-76 found in Armada 8K") Cc: Signed-off-by: Sumit Garg Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/char/hw_random/omap-rng.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c @@ -66,6 +66,13 @@ #define OMAP4_RNG_OUTPUT_SIZE 0x8 #define EIP76_RNG_OUTPUT_SIZE 0x10 +/* + * EIP76 RNG takes approx. 700us to produce 16 bytes of output data + * as per testing results. And to account for the lack of udelay()'s + * reliability, we keep the timeout as 1000us. + */ +#define RNG_DATA_FILL_TIMEOUT 100 + enum { RNG_OUTPUT_0_REG = 0, RNG_OUTPUT_1_REG, @@ -176,7 +183,7 @@ static int omap_rng_do_read(struct hwrng if (max < priv->pdata->data_size) return 0; - for (i = 0; i < 20; i++) { + for (i = 0; i < RNG_DATA_FILL_TIMEOUT; i++) { present = priv->pdata->data_present(priv); if (present || !wait) break; From patchwork Mon Dec 16 17:48:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181774 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4659392ile; Mon, 16 Dec 2019 10:11:52 -0800 (PST) X-Google-Smtp-Source: APXvYqwNAuFAlMP6b79F/PVLp5fIIt/sO2+pC75kYVEUVfZmJBDcbsoASWSYX1iw2Osa0kDTHeKw X-Received: by 2002:a9d:7c8f:: with SMTP id q15mr34513369otn.341.1576519912497; Mon, 16 Dec 2019 10:11:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576519912; cv=none; d=google.com; s=arc-20160816; b=DP9eK7KZShLaO3sqBDKjxaAEutui+QCvl+E1bVU4jVDNDk7eEAJZYjUw71qtLJTpjW pz5/52bWNxm4aJvXOp6HY+MQdDbZsnkkjd+tCes3JRzaayw1X9ALSNH9ABee5/EeJECp Q7prd6WuBs33jURU0mZgu6/qUacuCJD2CROcFXbtOWjTeCv/9ADP+K/hnLpi5eduOlid FsLORO5XsFnDWUvsKkOKq7uGX0PAfa7wLXduIvYwLNzA64eOmbqHrr0h8nXbMTQZgYic r2g5nWe31KKV0zWuKmO9qlaoMBEC8wipC7Y7kq+apbOaSFWSYN3OR9qgVKG1dH+VrAE6 QSwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hhx10U1ifVP//yvTNZCN8MOhSwqAbAN9NV/PRc9xVPE=; b=ENOsleqPin+8oaG0g1wL9KDB+IKaLImzKjsoI7+3Aaea+C5A0Z1n7Ma2xICwFdS1cK rjCeNNuHI3SLKr7mPmJe/Wv+fg3/m88jlj1C5k/a+obhNYVGOwULcy7u1fVUnZ/KkqTe eRVle+uPnUN105g1m7yHi+hVnq/eCaLsQj31c3rzcvLvxQF3pE4/cUcll/K4gyf8nlpX 6tB554qrrZsTqRbAEmSpJRiZtSklNgDn5QUGHR5gVv4God3DqWSEBb/efzkjSrhH2CWy eJHtO9K91EtORtX5/tKzsnmLOrKJTnhlf3oREkeCDFWUFwpC6BHso1yLfaMXZ2MpnWMP 8Cfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qGIFrQao; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 11si15312212otz.101.2019.12.16.10.11.52; Mon, 16 Dec 2019 10:11:52 -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=@kernel.org header.s=default header.b=qGIFrQao; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730849AbfLPSLv (ORCPT + 27 others); Mon, 16 Dec 2019 13:11:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:56176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730832AbfLPSLs (ORCPT ); Mon, 16 Dec 2019 13:11:48 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DD9352072D; Mon, 16 Dec 2019 18:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576519908; bh=00g5RKiIENXMC3oLyUK6qvQXapP1X6bpjKBjMZkmUmE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qGIFrQaobMNG/LsTmsqCpIuCF47JVbxBxTt8vdWD+/lrpzWx8NmT+OHYOd8delBqY Z+CIwFn7FYDwtpX2a65M258xAH4691aNuKe9hJtzDRj+clrM5MKbGGQRYhIYqTz+Z4 NC2teG/eE+XygGsQ0ngiKrN60Sd1fU9Q+elI0UvM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Nicolin Chen , Daniel Baluta , Mark Brown Subject: [PATCH 5.3 078/180] ASoC: fsl_audmix: Add spin lock to protect tdms Date: Mon, 16 Dec 2019 18:48:38 +0100 Message-Id: <20191216174830.960022512@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174806.018988360@linuxfoundation.org> References: <20191216174806.018988360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shengjiu Wang commit fe965096c9495ddcf78ec163348105e2baf8d185 upstream. Audmix support two substream, When two substream start to run, the trigger function may be called by two substream in same time, that the priv->tdms may be updated wrongly. The expected priv->tdms is 0x3, but sometimes the result is 0x2, or 0x1. Fixes: be1df61cf06e ("ASoC: fsl: Add Audio Mixer CPU DAI driver") Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/1e706afe53fdd1fbbbc79277c48a98f8416ba873.1573458378.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown Cc: Signed-off-by: Greg Kroah-Hartman --- sound/soc/fsl/fsl_audmix.c | 6 ++++++ sound/soc/fsl/fsl_audmix.h | 1 + 2 files changed, 7 insertions(+) --- a/sound/soc/fsl/fsl_audmix.c +++ b/sound/soc/fsl/fsl_audmix.c @@ -286,6 +286,7 @@ static int fsl_audmix_dai_trigger(struct struct snd_soc_dai *dai) { struct fsl_audmix *priv = snd_soc_dai_get_drvdata(dai); + unsigned long lock_flags; /* Capture stream shall not be handled */ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) @@ -295,12 +296,16 @@ static int fsl_audmix_dai_trigger(struct case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + spin_lock_irqsave(&priv->lock, lock_flags); priv->tdms |= BIT(dai->driver->id); + spin_unlock_irqrestore(&priv->lock, lock_flags); break; case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + spin_lock_irqsave(&priv->lock, lock_flags); priv->tdms &= ~BIT(dai->driver->id); + spin_unlock_irqrestore(&priv->lock, lock_flags); break; default: return -EINVAL; @@ -493,6 +498,7 @@ static int fsl_audmix_probe(struct platf return PTR_ERR(priv->ipg_clk); } + spin_lock_init(&priv->lock); platform_set_drvdata(pdev, priv); pm_runtime_enable(dev); --- a/sound/soc/fsl/fsl_audmix.h +++ b/sound/soc/fsl/fsl_audmix.h @@ -96,6 +96,7 @@ struct fsl_audmix { struct platform_device *pdev; struct regmap *regmap; struct clk *ipg_clk; + spinlock_t lock; /* Protect tdms */ u8 tdms; }; From patchwork Mon Dec 16 17:49:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181775 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4661792ile; Mon, 16 Dec 2019 10:13:45 -0800 (PST) X-Google-Smtp-Source: APXvYqy99m6T6nFGg173yS3RdlYlPKzsvU/czdQzkQiPU/19Lok9XbqkUiSIjUzVUWc2wMu3qRC7 X-Received: by 2002:a05:6830:2110:: with SMTP id i16mr32219878otc.337.1576520025058; Mon, 16 Dec 2019 10:13:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576520025; cv=none; d=google.com; s=arc-20160816; b=0anK0CY+i7vxFs4YxCbKOAM4TSbT76IZB+9AWrh4ODLS68ZpYfwl5ZRG2HFqF1+rBb 4w9W1BuOshYhg6bCcbHCZqwF9xkX0yfya2mF/I/6of5iD/jIVg4uTIq9awRGDctfxLu+ Pcy6Yzon2Sn/pXyPXdkQXwWYblhYAQpBxyJbhbP2jJHWbcIreldtc6YbHYBu8Hw4TfD+ 0g4zCeFvE8clIK8BHBAbhK5IgAfmML25U0Xz7pI86wxRGSJp7uRiIjbivmqqAQhzp21r NJmgWD2wtYOxprzxNmzrhITNjJhTWpCmGl78XV0vKaBV2R5EaV/d8krj8yLtRjwltDkd ykrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6gzpBaurV2pbGYeo4dbaffg7HecLjR3Mkpt2ajvxTsQ=; b=zTyrguqsXmWRPGO3wrcuhjs/K3/GCOdsDBlBGIszC58Mk2QUEaOwbmDjTeIWK6hYPz 42jW9iWd3/CvhWSdd7EBavu7gHfgl3k8GiesLpmppeejbw8Wh7e7yNtbDhX4tVy0G8AQ c/wXEeFCKfu/JmT1/mJb33cRqvxgR1gkVUH1CzKzWBo3fYSFK21dBhijZDZ8vGuvjS23 utP+wleibwt94O3dk4LmkVk6K4CJYcH9D/RkGG5WXKA+8xQUpMxTuQFoIxLkg7a4ZGvY XT0UyIXUo4n+74bYK7+QsNTwY+o0LcSfwx0da29vD6XvWcz1INfR/bpNa0HJYv7dDgZ8 L0FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RbHy3TSn; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f60si11380774otf.119.2019.12.16.10.13.44; Mon, 16 Dec 2019 10:13:45 -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=@kernel.org header.s=default header.b=RbHy3TSn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730917AbfLPSNm (ORCPT + 27 others); Mon, 16 Dec 2019 13:13:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:59868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731109AbfLPSNb (ORCPT ); Mon, 16 Dec 2019 13:13:31 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 73E9D20CC7; Mon, 16 Dec 2019 18:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576520010; bh=pDM9YgV4ACQyf4D8/DQYrmhcjDCqeiLjgwAC5zEHwIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RbHy3TSnvJL/B/CN6nk36TF1v8ZXw0ssCthZmQyRlNAJ/U2z7uBnogG5MyQX0/g0k alHh5XAyiCVukj6VrleaGYzhEzGXQ8XkwZ7+L6hlbSVg8lRMKulAUQzhOn+4j4moFa AXHOz9R6xQuTjRA+bhGF6plpSa6lt0vfTCIZAcmU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 5.3 121/180] ppdev: fix PPGETTIME/PPSETTIME ioctls Date: Mon, 16 Dec 2019 18:49:21 +0100 Message-Id: <20191216174840.925017381@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174806.018988360@linuxfoundation.org> References: <20191216174806.018988360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 998174042da229e2cf5841f574aba4a743e69650 upstream. Going through the uses of timeval in the user space API, I noticed two bugs in ppdev that were introduced in the y2038 conversion: * The range check was accidentally moved from ppsettime to ppgettime * On sparc64, the microseconds are in the other half of the 64-bit word. Fix both, and mark the fix for stable backports. Cc: stable@vger.kernel.org Fixes: 3b9ab374a1e6 ("ppdev: convert to y2038 safe") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20191108203435.112759-8-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/char/ppdev.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -619,20 +619,27 @@ static int pp_do_ioctl(struct file *file if (copy_from_user(time32, argp, sizeof(time32))) return -EFAULT; + if ((time32[0] < 0) || (time32[1] < 0)) + return -EINVAL; + return pp_set_timeout(pp->pdev, time32[0], time32[1]); case PPSETTIME64: if (copy_from_user(time64, argp, sizeof(time64))) return -EFAULT; + if ((time64[0] < 0) || (time64[1] < 0)) + return -EINVAL; + + if (IS_ENABLED(CONFIG_SPARC64) && !in_compat_syscall()) + time64[1] >>= 32; + return pp_set_timeout(pp->pdev, time64[0], time64[1]); case PPGETTIME32: jiffies_to_timespec64(pp->pdev->timeout, &ts); time32[0] = ts.tv_sec; time32[1] = ts.tv_nsec / NSEC_PER_USEC; - if ((time32[0] < 0) || (time32[1] < 0)) - return -EINVAL; if (copy_to_user(argp, time32, sizeof(time32))) return -EFAULT; @@ -643,8 +650,9 @@ static int pp_do_ioctl(struct file *file jiffies_to_timespec64(pp->pdev->timeout, &ts); time64[0] = ts.tv_sec; time64[1] = ts.tv_nsec / NSEC_PER_USEC; - if ((time64[0] < 0) || (time64[1] < 0)) - return -EINVAL; + + if (IS_ENABLED(CONFIG_SPARC64) && !in_compat_syscall()) + time64[1] <<= 32; if (copy_to_user(argp, time64, sizeof(time64))) return -EFAULT;