From patchwork Thu Oct 3 15:50:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175128 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp554168ill; Thu, 3 Oct 2019 09:27:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvfmRlNZTvS1rEoKuSV41qGsOZq9AIX9MwJU7i0G86cFRaMQT5a3E7Iv5G4JguOzLKarEI X-Received: by 2002:a50:9e26:: with SMTP id z35mr10399765ede.265.1570120066606; Thu, 03 Oct 2019 09:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120066; cv=none; d=google.com; s=arc-20160816; b=NRdmnu+qHzPSk5XsPc+Ax1KR6HFo5dQTuPrXXIqSN6DmkrJcRhaD2IVsrcN6VGnra5 wYtDlpTcHnBDAu+/f8z7nQMRO257gHb21mz7llFoZhAm1v2YRH2fmGi2qjQ0xfCJ9V+E Hmjmi8Q0jEhzzwIfHUNzjapwWRxcA1NX6P+ZWVb7vtwjUGHKwTVHYfFrWNfltJHln/yk Ryi0wkFS7+ZdyNhRTnjc/h2Pr83p8EMl7DzJKPDju0Fi5cmAmJgMVoTe04bgLghK+48u SW0Re1lCbKJvQZGW8lVTGyeeD6f98E8xKc/exJWv/zSKCa5DEQHcwFkv7iC6qf47413h zjZw== 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=QHVLwMC1p3AYP9xxLitC8cEk9nOs4UkOszNh6XmzQvo=; b=uXnJagvapnXgz/9jBpovezEBOOivtkh2sbjfDgAvDa/BkdZ9EadQRBVIFn7sViPugR eNXPmp9kYJMfkuRsm/s/GTvXw0NymrktrMlU988VidT1BMIEO4JtJFgR1kh1kJAhGIJQ i9xljCo16R8XlUK1U9l514y7XlM3Q67BSgICZN84in+5PXazya3pZsgrglmSvuQUd8My hnJLJZlACfEpgH8gwMxIYIL4QPmTOMCXsFxq2ZixVQfvsPpcKMF/eJzX/uSwKMosbHQA Vqi7PNEfx8fYyi3VpifNeI5dxd+AlLH/A3E6Z934ANtyAIRbLKzZypeB8+XkUAN6pHbP ajwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NbCNnMgp; 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 n2si1874661edq.264.2019.10.03.09.27.46; Thu, 03 Oct 2019 09:27:46 -0700 (PDT) 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=NbCNnMgp; 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 S1730176AbfJCQ1o (ORCPT + 27 others); Thu, 3 Oct 2019 12:27:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:59748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387971AbfJCQ1l (ORCPT ); Thu, 3 Oct 2019 12:27:41 -0400 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 1378721783; Thu, 3 Oct 2019 16:27:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120060; bh=48xQrCMOZWQY0GMUtiT7ORhyY7JKh36Uou8DfkPsZ14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NbCNnMgpoWdONlOZDrrypP2YnBsZQj3QwrdDa3VTaAHHYqHY4jLMOhE64J9w16nrZ ZvP3gVFCevdJwPXNRFiuhyzS/4VlvCDLL6JgK4QzyJ1F3NzC7wosgrBp3VRZUqP0TU PE+CIHpo185Rty7RjyioCcPSTxn5kWu1g6bcPTT0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Sean Young , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.2 044/313] media: dib0700: fix link error for dibx000_i2c_set_speed Date: Thu, 3 Oct 2019 17:50:22 +0200 Message-Id: <20191003154537.516567442@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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 [ Upstream commit 765bb8610d305ee488b35d07e2a04ae52fb2df9c ] When CONFIG_DVB_DIB9000 is disabled, we can still compile code that now fails to link against dibx000_i2c_set_speed: drivers/media/usb/dvb-usb/dib0700_devices.o: In function `dib01x0_pmu_update.constprop.7': dib0700_devices.c:(.text.unlikely+0x1c9c): undefined reference to `dibx000_i2c_set_speed' The call sites are both through dib01x0_pmu_update(), which gets passed an 'i2c' pointer from dib9000_get_i2c_master(), which has returned NULL. Checking this pointer seems to be a good idea anyway, and it avoids the link failure in most cases. Sean Young found another case that is not fixed by that, where certain gcc versions leave an unused function in place that causes the link error, but adding an explict IS_ENABLED() check also solves this. Fixes: b7f54910ce01 ("V4L/DVB (4647): Added module for DiB0700 based devices") Signed-off-by: Arnd Bergmann Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/dvb-usb/dib0700_devices.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.20.1 diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c index 66d685065e065..ab7a100ec84fe 100644 --- a/drivers/media/usb/dvb-usb/dib0700_devices.c +++ b/drivers/media/usb/dvb-usb/dib0700_devices.c @@ -2439,9 +2439,13 @@ static int dib9090_tuner_attach(struct dvb_usb_adapter *adap) 8, 0x0486, }; + if (!IS_ENABLED(CONFIG_DVB_DIB9000)) + return -ENODEV; if (dvb_attach(dib0090_fw_register, adap->fe_adap[0].fe, i2c, &dib9090_dib0090_config) == NULL) return -ENODEV; i2c = dib9000_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); + if (!i2c) + return -ENODEV; if (dib01x0_pmu_update(i2c, data_dib190, 10) != 0) return -ENODEV; dib0700_set_i2c_speed(adap->dev, 1500); @@ -2517,10 +2521,14 @@ static int nim9090md_tuner_attach(struct dvb_usb_adapter *adap) 0, 0x00ef, 8, 0x0406, }; + if (!IS_ENABLED(CONFIG_DVB_DIB9000)) + return -ENODEV; i2c = dib9000_get_tuner_interface(adap->fe_adap[0].fe); if (dvb_attach(dib0090_fw_register, adap->fe_adap[0].fe, i2c, &nim9090md_dib0090_config[0]) == NULL) return -ENODEV; i2c = dib9000_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); + if (!i2c) + return -ENODEV; if (dib01x0_pmu_update(i2c, data_dib190, 10) < 0) return -ENODEV; From patchwork Thu Oct 3 15:50:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175178 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp613382ill; Thu, 3 Oct 2019 10:15:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyp7PpeHw3sa4y/vcgyDT+HF+c1Or9r5tVBhe3LNndsj7hCoIMk0+d2UYjdCEBOehA4G41P X-Received: by 2002:a17:906:4bc3:: with SMTP id x3mr8578942ejv.200.1570122907651; Thu, 03 Oct 2019 10:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570122907; cv=none; d=google.com; s=arc-20160816; b=VruT4MuirLS6cIJ5AzfSetbz0OylEaH/0EA88OJyKvpKhQ67R+4GVz2Tqhkx6dF6as Ufrk8VWy/L4SPE4ClwBxZy/fkmN4zYP4DHT2qVTQk4Jr++i1Xjehuo3ecAIVIUREPZkl xzhN0NcZcSLxDT7hpJjgdeybJEcSMAib1ErjvEgGNgyZw9oB3vcQEsv/qX7IWIUEh6vI dtUtxWcqV3u8VKYXroHKWWgz6thNinJR1DaYAfbhFWaAGjODYhjYO9z2EL0ByiXMTDP9 w3TujtXrN5v6g+JpvpIs16/VnSxXIdADvBUp2TiY4Gd5wSmSuKSJzhqPfL2cbY6rfuRj 7SiA== 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=GmOVFWRQ7Ti+RLPvKg/a4KDhdjKsxhEafrdYXoqB/is=; b=KAS1EpyIOC32eTcUwtc7buUieC+Q9zJ4fSwwG0K3UDwaLuR/Ul/pEqe8Z5IyQ8XuY8 gwTed49CGmt22rGYbA9hA2yN8R4u/7TijmxzhFyT53HUVb+TethdE5yKJfBH7nZBRUgI tZr1rBD+/qDg2j8S5y/zRDQM4ZXrEXVZFjVsmvl7meDO/w2Q2dRuYIo/HkOW8GbaK8me YZHQGTKWw21Hie+Chs2vqlHgzRfo6yS1WnIpEVGakK7877/xC5Q7kQHOa+eDIpmVxq7D 6USo1BbOLQYpCFGYmOW+UzKxmKFtSWJc0TmDjFYL5q12Yo/G7xnu9TKsTk7DD3xq3JhY KH/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="U+//bAof"; 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 n19si1871942edo.172.2019.10.03.10.15.07; Thu, 03 Oct 2019 10:15:07 -0700 (PDT) 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="U+//bAof"; 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 S2404206AbfJCRPG (ORCPT + 27 others); Thu, 3 Oct 2019 13:15:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:57472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391063AbfJCQ0X (ORCPT ); Thu, 3 Oct 2019 12:26:23 -0400 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 0F2D120867; Thu, 3 Oct 2019 16:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119982; bh=VR7Qr2sSZDvvWUGGowSu7a6WGDqx1uqcGdlqRG8+qwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U+//bAofW5n3o0eTLRKEah11ljQrVsLxl+VtdIQz9T1sezcxCiM29VBU/2n6GSICN UHT6eGzZR4Zk0p2mj6y7eTKwV63T96QsMqerQu6HvCnRFcPwxC9sJ2IVVgzPnbhsrA QV1n2zsn9OFx5Kk2G1hpxBeJl/tJ9En/nfHhe3sg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Guittot , "Peter Zijlstra (Intel)" , Linus Torvalds , Thomas Gleixner , Ingo Molnar , Sasha Levin Subject: [PATCH 5.2 054/313] sched/fair: Fix imbalance due to CPU affinity Date: Thu, 3 Oct 2019 17:50:32 +0200 Message-Id: <20191003154538.389857532@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Vincent Guittot [ Upstream commit f6cad8df6b30a5d2bbbd2e698f74b4cafb9fb82b ] The load_balance() has a dedicated mecanism to detect when an imbalance is due to CPU affinity and must be handled at parent level. In this case, the imbalance field of the parent's sched_group is set. The description of sg_imbalanced() gives a typical example of two groups of 4 CPUs each and 4 tasks each with a cpumask covering 1 CPU of the first group and 3 CPUs of the second group. Something like: { 0 1 2 3 } { 4 5 6 7 } * * * * But the load_balance fails to fix this UC on my octo cores system made of 2 clusters of quad cores. Whereas the load_balance is able to detect that the imbalanced is due to CPU affinity, it fails to fix it because the imbalance field is cleared before letting parent level a chance to run. In fact, when the imbalance is detected, the load_balance reruns without the CPU with pinned tasks. But there is no other running tasks in the situation described above and everything looks balanced this time so the imbalance field is immediately cleared. The imbalance field should not be cleared if there is no other task to move when the imbalance is detected. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/1561996022-28829-1-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- kernel/sched/fair.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index b07672e793a81..f72bf8122fe4e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9319,9 +9319,10 @@ static int load_balance(int this_cpu, struct rq *this_rq, out_balanced: /* * We reach balance although we may have faced some affinity - * constraints. Clear the imbalance flag if it was set. + * constraints. Clear the imbalance flag only if other tasks got + * a chance to move and fix the imbalance. */ - if (sd_parent) { + if (sd_parent && !(env.flags & LBF_ALL_PINNED)) { int *group_imbalance = &sd_parent->groups->sgc->imbalance; if (*group_imbalance) From patchwork Thu Oct 3 15:50:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175126 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp553132ill; Thu, 3 Oct 2019 09:26:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzp2MRf7FXvZO9Ligbze1KfmWhmToDCVlM8HFWvcAgG/W4JhqSddxBY7yaLJEcilDthIvem X-Received: by 2002:a17:906:7752:: with SMTP id o18mr8245555ejn.227.1570120015992; Thu, 03 Oct 2019 09:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120015; cv=none; d=google.com; s=arc-20160816; b=U1yXsLQHw2PbiD4ThSZzEKVOiFJdQh1annwVvW9fRo03E9gQTv8JO5DXAmY384Mky/ n2pIVD7Ih5PXtNikwOMdYxG9qHH44bkeH6qKDI2NzsprJnbxs65vp2uO/ItQCtvJbYHV mwHP9dKt7vklWpG5cBoilAnUEwdqFhQDGlmAgOuxOc6vT6ptlRVtQH5FUdD89AmdHSzg zNJVrW0s+mnBw1acVko9aov8XTuib7IcaAYYMbv49uW2Ur0QBorIuZqDx1Yd5X3bPg8d iMQbuC0NDe4YqUq/ql8OS4C/0LDXqHxmG6GmLqZNi9r2p5FyOF89OSoP7PcnGb9U5mtU Vfyw== 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=zV6NLSZp31BqJog2/3djubuHBBwyDCWf+zdP/R/Ab8M=; b=oaTRxIkkz9koch9iApBrq4ZQxbEJW1cMlAIZ6tSAS+uhbHZQiRYc4plXjd/EMh4Tfx m6l9u3g5yD6vXAuRFcPnKuixoes5iZ4ijornEHhAJl2+xt0OEUe+vdWfd5oZY3uiQjBm 2l4R4Q+irc8llvA+Y4pLCyTVCy0dtXu4f1ggSHWXI2gGwbxfNQEqVvoV6tnCV+USqkuA z99R50yjo6NTYzaoU/Jgzzl0TPGC4afXVtcPwHoDK1MP/bJPOf96P8zZv558Rg+0ctfO Cb4xjo2nHcz9eSneT/FJYDR0bWRCYIrGbjtqogX33tXujMV0KxGJcSp5ElWDs540f2Bs WSQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="X/vzm5+V"; 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 w43si1867179edd.332.2019.10.03.09.26.55; Thu, 03 Oct 2019 09:26:55 -0700 (PDT) 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="X/vzm5+V"; 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 S2390452AbfJCQ0z (ORCPT + 27 others); Thu, 3 Oct 2019 12:26:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:58290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391139AbfJCQ0u (ORCPT ); Thu, 3 Oct 2019 12:26:50 -0400 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 EB9C2215EA; Thu, 3 Oct 2019 16:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120009; bh=5+4+EyeHu/Ui4dWZQbgh+L+4DfByRKwtCBXnWaSYN9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X/vzm5+VH/khK90B9bA8NrH9ssySOrudTpxeLlAwOIrJ4IjU0BvNauJW4sbze8QG7 8ISRSsF08Gk4AHUXOh/ab40LrN+UNIce6FzoePhITNPPlnw7H5bmA8oGK0F69LUaty uMeIKOilJcb2X4wazlLm+o1CSM0gQdD+vb3j6VME= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Richter , Borislav Petkov , "linux-edac@vger.kernel.org" , James Morse , Mauro Carvalho Chehab , Tony Luck , Sasha Levin Subject: [PATCH 5.2 063/313] EDAC/mc: Fix grain_bits calculation Date: Thu, 3 Oct 2019 17:50:41 +0200 Message-Id: <20191003154539.170143520@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Robert Richter [ Upstream commit 3724ace582d9f675134985727fd5e9811f23c059 ] The grain in EDAC is defined as "minimum granularity for an error report, in bytes". The following calculation of the grain_bits in edac_mc is wrong: grain_bits = fls_long(e->grain) + 1; Where grain_bits is defined as: grain = 1 << grain_bits Example: grain = 8 # 64 bit (8 bytes) grain_bits = fls_long(8) + 1 grain_bits = 4 + 1 = 5 grain = 1 << grain_bits grain = 1 << 5 = 32 Replace it with the correct calculation: grain_bits = fls_long(e->grain - 1); The example gives now: grain_bits = fls_long(8 - 1) grain_bits = fls_long(7) grain_bits = 3 grain = 1 << 3 = 8 Also, check if the hardware reports a reasonable grain != 0 and fallback with a warning to 1 byte granularity otherwise. [ bp: massage a bit. ] Signed-off-by: Robert Richter Signed-off-by: Borislav Petkov Cc: "linux-edac@vger.kernel.org" Cc: James Morse Cc: Mauro Carvalho Chehab Cc: Tony Luck Link: https://lkml.kernel.org/r/20190624150758.6695-2-rrichter@marvell.com Signed-off-by: Sasha Levin --- drivers/edac/edac_mc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 64922c8fa7e3b..d899d86897d06 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -1235,9 +1235,13 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type, if (p > e->location) *(p - 1) = '\0'; - /* Report the error via the trace interface */ - grain_bits = fls_long(e->grain) + 1; + /* Sanity-check driver-supplied grain value. */ + if (WARN_ON_ONCE(!e->grain)) + e->grain = 1; + + grain_bits = fls_long(e->grain - 1); + /* Report the error via the trace interface */ if (IS_ENABLED(CONFIG_RAS)) trace_mc_event(type, e->msg, e->label, e->error_count, mci->mc_idx, e->top_layer, e->mid_layer, From patchwork Thu Oct 3 15:50: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: 175127 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp553490ill; Thu, 3 Oct 2019 09:27:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqw45wC7Y66boZ7MmmQh122wohGtAPd7WcVTgxVuvnBrxalt91+k/+odeBRDciNY+EFq3y5z X-Received: by 2002:a17:906:e297:: with SMTP id gg23mr8339593ejb.47.1570120032746; Thu, 03 Oct 2019 09:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120032; cv=none; d=google.com; s=arc-20160816; b=m0S+F3f4EGFBH6MWE4C6qEpFhVEYoG67QIX2ji+ii8fFJh+Gji3QF5lVTPPZtdnG2G tQr+QNYoKgkPBKr2GMo8zlo7BuNuOz1eaq7vNpDeT0V3ni29uJYre+zjkgjhRJlorGt3 ZkX8qs6e11wMgn2oK1BaF0eywA+B5UEbAzM6KC2/zOhw3noKVPyhCvZO8bEXjQRH4b2x tc5T7drVkGU1TY5L+f9PKVDx37dRvmRNDykW8Djo8Fl/7YF83jWCNN5oK+bVVGCrraJz PCGFxudSdj6vxRzA85oIQtodpYYZIWzabRewwqgdYrepeDJ+XxeUnGXlA6Pm7+ihfWvM hIqQ== 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=z7SMPKqk6SPxfkVw6ffCpHp1FQu2jB4Ozv6D257BEjY=; b=JwGxqFsHNhwEeebu2Y2+06fCcWwuqSliSOPVVxD5AiDF9QbB0VmXoud9xG3uh4xlnc IDD/OW6nNZycWUUZiMYuyJvE+M1iKcr+mghKlPe85wX/vmcUQNUjL5tTtdc08DyBty5r DB63a37GdK4Avsfpfk8OrN7JSctl7Oz5My5jgX/LaNyG59C7LvylHXxj3nAeaO92fmIh XV8lxMd/cQVTI7zMAtOH4pCRGF7EO494hnHFfjqc7HGk2eiNAlDLqFvrQSzjfXwKUQBA w5K8WaqJYX1NKKQvufv5r41opi5OoTf6Fj1ak7Ro75W4JP358UPLZ//Gy0q2BjHUA3bA LHGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0mfvbSGv; 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 i16si1675867ejo.255.2019.10.03.09.27.12; Thu, 03 Oct 2019 09:27:12 -0700 (PDT) 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=0mfvbSGv; 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 S2391208AbfJCQ1K (ORCPT + 27 others); Thu, 3 Oct 2019 12:27:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:58732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391195AbfJCQ1G (ORCPT ); Thu, 3 Oct 2019 12:27:06 -0400 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 385BC20867; Thu, 3 Oct 2019 16:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120025; bh=xKTppu/GDfJLMQWpfzwwiblwXnUW9uwticGihbh1hF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0mfvbSGv5ZBdNojMeyVtyj3NU31gv6gztN0C2EZ2r6CQrJjYjH92r4YrErSxyHnRo vtjjSa5K42qKRhXf+5nwACSel+kEXruA3WEOSnfk7mzDl5V2SppkmWqT/HJ3nja2Hi wxJoN8E1VQ52/MlMn0BGmIZJ/KxfJzLFbNQ6lWPI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinod Koul , Vaishali Thakkar , Stephen Boyd , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.2 068/313] base: soc: Export soc_device_register/unregister APIs Date: Thu, 3 Oct 2019 17:50:46 +0200 Message-Id: <20191003154539.598967096@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Vinod Koul [ Upstream commit f7ccc7a397cf2ef64aebb2f726970b93203858d2 ] Qcom Socinfo driver can be built as a module, so export these two APIs. Tested-by: Vinod Koul Signed-off-by: Vinod Koul Signed-off-by: Vaishali Thakkar Reviewed-by: Greg Kroah-Hartman Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/base/soc.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.20.1 diff --git a/drivers/base/soc.c b/drivers/base/soc.c index 10b280f30217b..7e91894a380b5 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -157,6 +157,7 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr out1: return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(soc_device_register); /* Ensure soc_dev->attr is freed prior to calling soc_device_unregister. */ void soc_device_unregister(struct soc_device *soc_dev) @@ -166,6 +167,7 @@ void soc_device_unregister(struct soc_device *soc_dev) device_unregister(&soc_dev->dev); early_soc_dev_attr = NULL; } +EXPORT_SYMBOL_GPL(soc_device_unregister); static int __init soc_bus_register(void) { From patchwork Thu Oct 3 15:51:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175132 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp555901ill; Thu, 3 Oct 2019 09:29:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPrYJXi9/1t9/CZrq9T5TstGsqpXEFwsnbmaW+7+N+nVrwhYc2Bre5tnN3VcxMSohJPYaK X-Received: by 2002:a17:906:f204:: with SMTP id gt4mr8443563ejb.299.1570120149465; Thu, 03 Oct 2019 09:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120149; cv=none; d=google.com; s=arc-20160816; b=cEPCngAkwebi/gyM9B0mj/wXh+djvw3lVB01FBpw6SRLM8p8pnhc3MYu2PmUEfE3bf hgpAn9roQ9H8c4hnBgUiUrd9gm57oB1b8AZKDtAEoHTaNG6kbNXi1ie0ZzvcbZLHLoOM 9OVORXX7hQC5DJ1FekHs4ba3+yx1UFuGgQWTPfraWWDh+1jublQyvrqvBGVUkAXI0sCv FR3vVPIu6cv5GCsTxPapJ7/n2cxxxgp2JTZYk7yfz8tznJ9Pi7Lwx85npo00JqkTAm6e GtZ2UBtbDcntZb+p1vMXyRBP1W6k8XZzrkR2K2lWX+kuf8MoG8upvIDZ503KHKmtHw2b kxyw== 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=7W1j5fE1yCxFsUrDAmnz15kcEplGWj3vcXwORa9si/Y=; b=Mzujmql6nNmQS2xYdlQ6Pgvh5rwAoIaLpBvpCsPBpP8ZnyLSTC2uuUZgxViSGq+OE0 I2ZeQ0JasrOo3IqRp7uKfuNie5lpVmF5uQiMgdNHhJTy3OTocq+jqphtP8I9z/2mSNtZ 386WqY1LpnEOVBfBzZsASmv5IDh1kV7ei2qjrH+WgJl19qV2QQoFnZzulGuVNOkdWBbR VLh+pTu5oMaNRoghhMU9VS1Rw2fDJBhIg56y+dAa6UNdjZSgr19wHwbc7iP3ch83DnLV +U9cnE8uDz9hAank2KnapTUZAmQfko0AxhsjY1J4u0R8ArQRPIrdzek96gXc4w90hSie /Uvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eKcH2ppd; 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 c9si1788904eda.229.2019.10.03.09.29.09; Thu, 03 Oct 2019 09:29:09 -0700 (PDT) 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=eKcH2ppd; 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 S2391562AbfJCQ24 (ORCPT + 27 others); Thu, 3 Oct 2019 12:28:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:33702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389668AbfJCQ2x (ORCPT ); Thu, 3 Oct 2019 12:28:53 -0400 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 F35D520700; Thu, 3 Oct 2019 16:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120133; bh=ljyOOYLOrVHKPq0GoGX1yqA6Ygi+ssZEBM2nuLc3eP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eKcH2ppdomBg/WpZHDi3KGWzVtx4c6nagUovOpjMvmDfhNzyGJ6kUlVDGnQi4wZmb w+m4VC6Ynt7uJUrumQ4cGJ6/yeSFsaaAlqWvG6lsmC4ntip9xDrTPNResqYicYznqe oF1HxLpXxteF/c04sAH5Zt4Gf0/GmMmTQ01sR14w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kbuild test robot , Arnd Bergmann , Sasha Levin Subject: [PATCH 5.2 108/313] net: lpc-enet: fix printk format strings Date: Thu, 3 Oct 2019 17:51:26 +0200 Message-Id: <20191003154543.497387495@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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 [ Upstream commit de6f97b2bace0e2eb6c3a86e124d1e652a587b56 ] compile-testing this driver on other architectures showed multiple warnings: drivers/net/ethernet/nxp/lpc_eth.c: In function 'lpc_eth_drv_probe': drivers/net/ethernet/nxp/lpc_eth.c:1337:19: warning: format '%d' expects argument of type 'int', but argument 4 has type 'resource_size_t {aka long long unsigned int}' [-Wformat=] drivers/net/ethernet/nxp/lpc_eth.c:1342:19: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=] Use format strings that work on all architectures. Link: https://lore.kernel.org/r/20190809144043.476786-10-arnd@arndb.de Reported-by: kbuild test robot Signed-off-by: Arnd Bergmann Signed-off-by: Sasha Levin --- drivers/net/ethernet/nxp/lpc_eth.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index f7e11f1b0426c..b0c8be127bee1 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -1344,13 +1344,14 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) pldat->dma_buff_base_p = dma_handle; netdev_dbg(ndev, "IO address space :%pR\n", res); - netdev_dbg(ndev, "IO address size :%d\n", resource_size(res)); + netdev_dbg(ndev, "IO address size :%zd\n", + (size_t)resource_size(res)); netdev_dbg(ndev, "IO address (mapped) :0x%p\n", pldat->net_base); netdev_dbg(ndev, "IRQ number :%d\n", ndev->irq); - netdev_dbg(ndev, "DMA buffer size :%d\n", pldat->dma_buff_size); - netdev_dbg(ndev, "DMA buffer P address :0x%08x\n", - pldat->dma_buff_base_p); + netdev_dbg(ndev, "DMA buffer size :%zd\n", pldat->dma_buff_size); + netdev_dbg(ndev, "DMA buffer P address :%pad\n", + &pldat->dma_buff_base_p); netdev_dbg(ndev, "DMA buffer V address :0x%p\n", pldat->dma_buff_base_v); @@ -1397,8 +1398,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) if (ret) goto err_out_unregister_netdev; - netdev_info(ndev, "LPC mac at 0x%08x irq %d\n", - res->start, ndev->irq); + netdev_info(ndev, "LPC mac at 0x%08lx irq %d\n", + (unsigned long)res->start, ndev->irq); device_init_wakeup(dev, 1); device_set_wakeup_enable(dev, 0); From patchwork Thu Oct 3 15:51:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175176 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp610869ill; Thu, 3 Oct 2019 10:13:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwk13OZfkr8PGmJO/mKqaBkchNQQ7Dx1QW/KbagSvDsdyRljxeuyF3Jo3GIWVxKux43xaEh X-Received: by 2002:a17:906:cec3:: with SMTP id si3mr8617079ejb.145.1570122791588; Thu, 03 Oct 2019 10:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570122791; cv=none; d=google.com; s=arc-20160816; b=Q15DgWdtAMJfttMKUlY7npY6ig1uB5Bgb6zq0YXJzxNW17OZ48mMJmqhPLSAOZoYWt 4qBgBGapU24B+6Y0fwB7BYw2OZlJDCsJhhVThjIpLDm8B4+/4eu0EjcPX0+msFp8xHku isdzdzHnMo/T3Lz6wypZ29vXjaM5GN3HyUOU2lYnm9DCLEN8hja7X4ijJgrRvFVXuKF5 ywbI5sVBA+Vho5fLFcOfVGzCIGE1CtafTrVdwl3y+V/uj6Sus2pfMkFYvL7VT+i4eDBc HcoSbkQ3gG9dI/+7Hd6cLrahUzf0v92foMRRlGX9h4yFvEK+foiQYarkE0vdQBLUEXnq 4Vlw== 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=uS3omDC5fL9ZppJQ/5196azGZw/FtRHQ9ADljr0/fK8=; b=zyNImr4eQw3Q7/p6xVR4317Dlfoh4vVKQ0m6LOyoZDQEm9qVBONBuWx8nWJlWDlrFU wNXY6Vwo33sR1A1PAXnEfd8ak/psiqzUIOvKuYD3YqknbglI+r6YEEikETmMRrSGYjed 7vLLOUXj5yDIpCEE4k5J4bZMs7fpg7dxXIxRktEcQitTMwynS4iSO635fO92cT2NurwA aX/eRRy8d9TjJ5nfeveAErDoCHYa/GYTcztnzkE2Jnr1MNe8h/BEZ2oqeiS5Xc++yJZq E0BqzPWi02frkuTiQuZNHIbaiFEsCFOPaUV6yUJSxUCY3+S3od2mvjoxJZL97ZJ5z6H5 /9WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aHW5YTuc; 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 se14si1584952ejb.322.2019.10.03.10.13.11; Thu, 03 Oct 2019 10:13:11 -0700 (PDT) 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=aHW5YTuc; 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 S2392178AbfJCRNK (ORCPT + 27 others); Thu, 3 Oct 2019 13:13:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:34388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390021AbfJCQ3N (ORCPT ); Thu, 3 Oct 2019 12:29:13 -0400 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 A7B1B2054F; Thu, 3 Oct 2019 16:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120152; bh=izJSz9zwaSm5xge40Tyl2gKrXmgr/JkniLuCjKggVes=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aHW5YTuctuMvOAfWQga/eCXMRIMfjHYxmH6Y4/luSXjCTs+9dDgtfiYnuQe5Hc+Dh AW+tqbe7R6mMYGuQ80l82nihBGDIKhgkYpCN2DnWAedgILy7eqqkxCoeTq1SdRjAtK 4XSrJIm+9d47t0dmwmOiWkhoRtVLC40LnPhbVH4w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kunihiko Hayashi , Mark Brown , Sasha Levin Subject: [PATCH 5.2 115/313] ASoC: uniphier: Fix double reset assersion when transitioning to suspend state Date: Thu, 3 Oct 2019 17:51:33 +0200 Message-Id: <20191003154544.199923491@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Kunihiko Hayashi [ Upstream commit c372a35550c8d60f673b20210eea58a06d6d38cb ] When transitioning to supend state, uniphier_aio_dai_suspend() is called and asserts reset lines and disables clocks. However, if there are two or more DAIs, uniphier_aio_dai_suspend() are called multiple times, and double reset assersion will cause. This patch defines the counter that has the number of DAIs at first, and whenever uniphier_aio_dai_suspend() are called, it decrements the counter. And only if the counter is zero, it asserts reset lines and disables clocks. In the same way, uniphier_aio_dai_resume() are called, it increments the counter after deasserting reset lines and enabling clocks. Fixes: 139a34200233 ("ASoC: uniphier: add support for UniPhier AIO CPU DAI driver") Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1566281764-14059-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/uniphier/aio-cpu.c | 31 +++++++++++++++++++++---------- sound/soc/uniphier/aio.h | 1 + 2 files changed, 22 insertions(+), 10 deletions(-) -- 2.20.1 diff --git a/sound/soc/uniphier/aio-cpu.c b/sound/soc/uniphier/aio-cpu.c index ee90e6c3937ce..2ae582a99b636 100644 --- a/sound/soc/uniphier/aio-cpu.c +++ b/sound/soc/uniphier/aio-cpu.c @@ -424,8 +424,11 @@ int uniphier_aio_dai_suspend(struct snd_soc_dai *dai) { struct uniphier_aio *aio = uniphier_priv(dai); - reset_control_assert(aio->chip->rst); - clk_disable_unprepare(aio->chip->clk); + aio->chip->num_wup_aios--; + if (!aio->chip->num_wup_aios) { + reset_control_assert(aio->chip->rst); + clk_disable_unprepare(aio->chip->clk); + } return 0; } @@ -439,13 +442,15 @@ int uniphier_aio_dai_resume(struct snd_soc_dai *dai) if (!aio->chip->active) return 0; - ret = clk_prepare_enable(aio->chip->clk); - if (ret) - return ret; + if (!aio->chip->num_wup_aios) { + ret = clk_prepare_enable(aio->chip->clk); + if (ret) + return ret; - ret = reset_control_deassert(aio->chip->rst); - if (ret) - goto err_out_clock; + ret = reset_control_deassert(aio->chip->rst); + if (ret) + goto err_out_clock; + } aio_iecout_set_enable(aio->chip, true); aio_chip_init(aio->chip); @@ -458,7 +463,7 @@ int uniphier_aio_dai_resume(struct snd_soc_dai *dai) ret = aio_init(sub); if (ret) - goto err_out_clock; + goto err_out_reset; if (!sub->setting) continue; @@ -466,11 +471,16 @@ int uniphier_aio_dai_resume(struct snd_soc_dai *dai) aio_port_reset(sub); aio_src_reset(sub); } + aio->chip->num_wup_aios++; return 0; +err_out_reset: + if (!aio->chip->num_wup_aios) + reset_control_assert(aio->chip->rst); err_out_clock: - clk_disable_unprepare(aio->chip->clk); + if (!aio->chip->num_wup_aios) + clk_disable_unprepare(aio->chip->clk); return ret; } @@ -619,6 +629,7 @@ int uniphier_aio_probe(struct platform_device *pdev) return PTR_ERR(chip->rst); chip->num_aios = chip->chip_spec->num_dais; + chip->num_wup_aios = chip->num_aios; chip->aios = devm_kcalloc(dev, chip->num_aios, sizeof(struct uniphier_aio), GFP_KERNEL); diff --git a/sound/soc/uniphier/aio.h b/sound/soc/uniphier/aio.h index ca6ccbae0ee8c..a7ff7e556429b 100644 --- a/sound/soc/uniphier/aio.h +++ b/sound/soc/uniphier/aio.h @@ -285,6 +285,7 @@ struct uniphier_aio_chip { struct uniphier_aio *aios; int num_aios; + int num_wup_aios; struct uniphier_aio_pll *plls; int num_plls; From patchwork Thu Oct 3 15:51:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175175 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp610061ill; Thu, 3 Oct 2019 10:12:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzyhI+sFR1DFnLKJh83u/Ml0E4187O6qQ9FPAasrWJrHfAArUjaxvBFY0n16PC8zec71ZB X-Received: by 2002:a05:6402:1a4c:: with SMTP id bf12mr10705346edb.277.1570122755448; Thu, 03 Oct 2019 10:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570122755; cv=none; d=google.com; s=arc-20160816; b=LbPCiQ26s9pViSrQar2D3RPAAGH6m/eAcJ2Fqk19YqVX9Vx5YmHE4O3IRjjnq4Gyu6 PSYe7vww9gDPkaDsTP2y9GCHUMvFABCfr5IciBCshpJ9NvBzAKqc8ZPU2nM1C0mMI/of gvbXi/OTKseoZMiHL8cqeQq7y9sQ8Am7Q0n1smt/BGBPsOSE0j6JVJoTA8lkrg3tQYFq YZ64n5kRTQlvaIUl2Ry/r2Ro0VUP+28l0bLFOO6vnZQAurwy/3sOu6uONxHRjryR0Xkp VEKeCftp3IyoP4jq5oOlEXSrOw+ADTvDhp7cEBdMxeaBACjgVx9PbWZIzoHzy1zmU8Pk MFWw== 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=XRuxb4X1jQo7nDcDUC3bbHA38puoZW/ioYGdfGKJeHw=; b=gLCTIEJM10ywGEaKcZ81+rMITyz7Zoc0AmT91HZptZ63P1qNbZRQsdkWZ0JIC1jVDs Ew7MMaSQf04X7osbPHjNCSQ2ILUHvszClqVHT1ke554G5Qhnzs/h5T3f5Z/WbQMeMttJ rHdR65Y28E/vyVQd/+XmyC8nuPKnI4c6AzfGf8ewrSK+GX1axjoxC5+/AVQNctjCELxk R0pu//QztWgxzZCBeg+4kzJQaGWIAcGXUW9+l4lrmvPJ7izqeSbt3Pp5IUMTL5HEwBCc 9JfLjFW3cwRjb6YhsUq8Onw1nOAP6IYtPNMXxARFiia0JJZrqrwsK93JotXrMqSwBJaE g8Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SSDIbc5R; 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 b42si1902526eda.367.2019.10.03.10.12.35; Thu, 03 Oct 2019 10:12:35 -0700 (PDT) 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=SSDIbc5R; 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 S2390775AbfJCQaE (ORCPT + 27 others); Thu, 3 Oct 2019 12:30:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:35688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391639AbfJCQ37 (ORCPT ); Thu, 3 Oct 2019 12:29:59 -0400 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 9BB282133F; Thu, 3 Oct 2019 16:29:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120198; bh=9fwelzb4gaRs6F+woif6HxRJvfWAzWKdIXQYj+jKX5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SSDIbc5R11Ao02XVbyw8iJLfRijVhrzS4yrjUBQLehBlzV9hDcfcggbrKBG9QDFt4 oR7c9j3WKWPY1aX5bD30E+qZWa5L2+xfcsxOgap96QIYppbHQEN5It/q5RtOoEAhCd OA8wDQOLDtWZB+SdluSY4H23vVrkeluYpV9Pg6O4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Alexandre Belloni , Sasha Levin Subject: [PATCH 5.2 134/313] ARM: at91: move platform-specific asm-offset.h to arch/arm/mach-at91 Date: Thu, 3 Oct 2019 17:51:52 +0200 Message-Id: <20191003154546.094722616@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Masahiro Yamada [ Upstream commit 9fac85a6db8999922f2cd92dfe2e83e063b31a94 ] is only generated and included by arch/arm/mach-at91/, so it does not need to reside in the globally visible include/generated/. I renamed it to arch/arm/mach-at91/pm_data-offsets.h since the prefix 'at91_' is just redundant in mach-at91/. My main motivation of this change is to avoid the race condition for the parallel build (-j) when CONFIG_IKHEADERS is enabled. When it is enabled, all the headers under include/ are archived into kernel/kheaders_data.tar.xz and exposed in the sysfs. In the parallel build, we have no idea in which order files are built. - If at91_pm_data-offsets.h is built before kheaders_data.tar.xz, the header will be included in the archive. Probably nobody will use it, but it is harmless except that it will increase the archive size needlessly. - If kheaders_data.tar.xz is built before at91_pm_data-offsets.h, the header will not be included in the archive. However, in the next build, the archive will be re-generated to include the newly-found at91_pm_data-offsets.h. This is not nice from the build system point of view. - If at91_pm_data-offsets.h and kheaders_data.tar.xz are built at the same time, the corrupted header might be included in the archive, which does not look nice either. This commit fixes the race. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20190823024346.591-1-yamada.masahiro@socionext.com Signed-off-by: Alexandre Belloni Signed-off-by: Sasha Levin --- arch/arm/mach-at91/.gitignore | 1 + arch/arm/mach-at91/Makefile | 5 +++-- arch/arm/mach-at91/pm_suspend.S | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-at91/.gitignore -- 2.20.1 diff --git a/arch/arm/mach-at91/.gitignore b/arch/arm/mach-at91/.gitignore new file mode 100644 index 0000000000000..2ecd6f51c8a95 --- /dev/null +++ b/arch/arm/mach-at91/.gitignore @@ -0,0 +1 @@ +pm_data-offsets.h diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 31b61f0e1c077..de64301dcff25 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile @@ -19,9 +19,10 @@ ifeq ($(CONFIG_PM_DEBUG),y) CFLAGS_pm.o += -DDEBUG endif -include/generated/at91_pm_data-offsets.h: arch/arm/mach-at91/pm_data-offsets.s FORCE +$(obj)/pm_data-offsets.h: $(obj)/pm_data-offsets.s FORCE $(call filechk,offsets,__PM_DATA_OFFSETS_H__) -arch/arm/mach-at91/pm_suspend.o: include/generated/at91_pm_data-offsets.h +$(obj)/pm_suspend.o: $(obj)/pm_data-offsets.h targets += pm_data-offsets.s +clean-files += pm_data-offsets.h diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S index c751f047b1166..ed57c879d4e17 100644 --- a/arch/arm/mach-at91/pm_suspend.S +++ b/arch/arm/mach-at91/pm_suspend.S @@ -10,7 +10,7 @@ #include #include #include "pm.h" -#include "generated/at91_pm_data-offsets.h" +#include "pm_data-offsets.h" #define SRAMC_SELF_FRESH_ACTIVE 0x01 #define SRAMC_SELF_FRESH_EXIT 0x00 From patchwork Thu Oct 3 15:52:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175134 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp558225ill; Thu, 3 Oct 2019 09:30:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZt1cYYAj97xmz5tv91b4RhGyJf7jtQ4rOHkhFViv1pGh0C09WTvFlfPTxLsrE+meZTawA X-Received: by 2002:a17:906:82c1:: with SMTP id a1mr8670237ejy.187.1570120255857; Thu, 03 Oct 2019 09:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120255; cv=none; d=google.com; s=arc-20160816; b=R1eDgG9hbYdcd3F8EhLf2lIUm3pp73a9AHtGgjaNbp2TLpbLT754pLky4rl4v1rfLn Eb0EuJpP2iqtsa4WIL43ajoTzbqgvJ53knm7ZLaZj8IDL+Qo7RJ76/VITcbbXUIjrfsl xqUW8PQ4QW2FWiSx0uOtWjvoGJu+SUl8mmMsBG0RGneoW54wuSzpSzdG2awVYT1dYFKs N/MB+tYe7Gw0IgFzORSA6VJXvP4qhRnKkzyi9VsHgVtU7kchQ+Pbp58tjwmw0BOSPPqb kJlniYaLSaH2zl5+6dmeNB/T9qQS8MJPiLsi4vm4nZCg3qtAMHzPfEPchYhYa0XukNkn A+0Q== 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=2E8mRGBWHQ0p2iBQgTkN82G24aoQ+hEFi1cI1hH+PSI=; b=WJ3fXTGHvJXAv7Gzwbl/vsZXY9/SXUm403LH/TCtpumYYM20SsOZ3y+/goorPvODIw kvb2XvKUqeNxK35DzemBl+GigMZ8ePyY05Xjrbs3uvMOMbukTfmfv6hkSQDJUrmgtOt6 oPXluesb+bsQaHM+NfEx9cOGEEEMASaCj1oHXUuVlxJwThymdAp/MGu1eJEu81zQnrt6 8n1Hne1Ej/JEQwm6YlsDWg3Doc/W/RcMD2/+KaSxabLQL4A6KXgUZUYvUB8cNdRBps0u 8WYOKj2TOIsM+tYV3KpTm8/0JfNGldDeu9GwOEemAC+68I6RjyosezzgEVGt9vtui+gp ywXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0I2lh1P7; 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 ci22si1485121ejb.162.2019.10.03.09.30.55; Thu, 03 Oct 2019 09:30:55 -0700 (PDT) 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=0I2lh1P7; 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 S2391224AbfJCQay (ORCPT + 27 others); Thu, 3 Oct 2019 12:30:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:37198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388282AbfJCQar (ORCPT ); Thu, 3 Oct 2019 12:30:47 -0400 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 29C912054F; Thu, 3 Oct 2019 16:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120246; bh=aRnDWCac5Rp2zw7MueiQHhEBPV+CE2W1Bm3OSFT9eFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0I2lh1P7DFBtKcrUy/roZqP0zBLFoz06UsqW4XMdlGmUHuwPcnvG24cPD6BteGIaS zbMQDhHl0J3SsHIib1HIzXc8IoTkf6gGqApFN4wUsEjBrwGQqTjEdmbxKNuaQIzagy bphry6iV9qIgYiQDU7/urd84SUMEZjEejTsvJMyg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Machek , Dan Murphy , Jacek Anaszewski , Sasha Levin Subject: [PATCH 5.2 150/313] leds: lm3532: Fixes for the driver for stability Date: Thu, 3 Oct 2019 17:52:08 +0200 Message-Id: <20191003154547.709338957@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Dan Murphy [ Upstream commit 6559ac32998248182572e1ccae79dc2eb40ac7c6 ] Fixed misspelled words, added error check during probe on the init of the registers, and fixed ALS/I2C control mode. Fixes: bc1b8492c764 ("leds: lm3532: Introduce the lm3532 LED driver") Reported-by: Pavel Machek Signed-off-by: Dan Murphy Acked-by: Pavel Machek Signed-off-by: Jacek Anaszewski Signed-off-by: Sasha Levin --- drivers/leds/leds-lm3532.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/drivers/leds/leds-lm3532.c b/drivers/leds/leds-lm3532.c index 180895b83b888..e55a64847fe2f 100644 --- a/drivers/leds/leds-lm3532.c +++ b/drivers/leds/leds-lm3532.c @@ -40,7 +40,7 @@ #define LM3532_REG_ZN_3_LO 0x67 #define LM3532_REG_MAX 0x7e -/* Contorl Enable */ +/* Control Enable */ #define LM3532_CTRL_A_ENABLE BIT(0) #define LM3532_CTRL_B_ENABLE BIT(1) #define LM3532_CTRL_C_ENABLE BIT(2) @@ -302,7 +302,7 @@ static int lm3532_led_disable(struct lm3532_led *led_data) int ret; ret = regmap_update_bits(led_data->priv->regmap, LM3532_REG_ENABLE, - ctrl_en_val, ~ctrl_en_val); + ctrl_en_val, 0); if (ret) { dev_err(led_data->priv->dev, "Failed to set ctrl:%d\n", ret); return ret; @@ -321,7 +321,7 @@ static int lm3532_brightness_set(struct led_classdev *led_cdev, mutex_lock(&led->priv->lock); - if (led->mode == LM3532_BL_MODE_ALS) { + if (led->mode == LM3532_ALS_CTRL) { if (brt_val > LED_OFF) ret = lm3532_led_enable(led); else @@ -542,11 +542,14 @@ static int lm3532_parse_node(struct lm3532_data *priv) } if (led->mode == LM3532_BL_MODE_ALS) { + led->mode = LM3532_ALS_CTRL; ret = lm3532_parse_als(priv); if (ret) dev_err(&priv->client->dev, "Failed to parse als\n"); else lm3532_als_configure(priv, led); + } else { + led->mode = LM3532_I2C_CTRL; } led->num_leds = fwnode_property_read_u32_array(child, @@ -590,7 +593,13 @@ static int lm3532_parse_node(struct lm3532_data *priv) goto child_out; } - lm3532_init_registers(led); + ret = lm3532_init_registers(led); + if (ret) { + dev_err(&priv->client->dev, "register init err: %d\n", + ret); + fwnode_handle_put(child); + goto child_out; + } i++; } From patchwork Thu Oct 3 15:52:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175174 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp609222ill; Thu, 3 Oct 2019 10:11:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDCKBJsxRImWEsodcBWLG3x1i9zbPDDVuwlhl9W57UoC7TF0tK6r+fm3JdD/AajvIayb93 X-Received: by 2002:a50:f152:: with SMTP id z18mr10401788edl.141.1570122719215; Thu, 03 Oct 2019 10:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570122719; cv=none; d=google.com; s=arc-20160816; b=SXEy9am9TOczO2WWNoaLMJ83duocIvz5Q8/dyUXiVSesU4afC723B45+lKnareBHeN SdBxNYhgiOady6QtkWTxhqKguJP3UYLxQ92jOOUpCliDnhtTn+xSFnAt79Smc6M1zUU6 rlBLdTrQ8JxsYtmCkBdYTqNVvezyTYDF5UMpCzguwHKZC0vJ7yM2dWUrQcfkIT7z18Pk +NTXbJ38Rp5hIc+gIZU5aqG5pvtREsA23UD/LMnNGxrBnAryIDifg2LtyShwp5uEB57t 5615mx6eeVvreF0lzT98Ag5hhhO/xVFLgikiIrWRVMJaa4ajPC13uIFhq28Q8vffiLbr 5tIw== 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=DLqJJounhdfcftV6O9nHbeZhACqsm8NU7fqVE2mEU7g=; b=IOB2ovrHyrZ3Xrya7J1KHE/tf8WlIRE5M/NZo0lOM8HCef+wg/6RfshctntkZTF5UE zjKX0bvuRsETBl80ylIQWVskOydSg5ZZLkCrqXGJjoQqKes9MXFpakMCdGZsC5tJSXmd V0iPLwQw2bhX7UScHfGRmJ7Z2/CkkrQJB/5PpEwEuLdyEgRV3v22mPGSs0upfyJUfuRF lbPaR5OfX9XoLGXJdk5aooULcDa/V/08UNiAWvnRP7eVJ4BNstXs3uBrotfsJmlWkFbm iVQR9F27W4js4JzpIaqinw35twS51Vrcvxfggcm7JveTEGCHtbTB3ydJF4vt1nYzT08b 2FEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n3Yz1a8B; 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 o22si373087ejd.411.2019.10.03.10.11.58; Thu, 03 Oct 2019 10:11:59 -0700 (PDT) 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=n3Yz1a8B; 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 S2403806AbfJCQbD (ORCPT + 27 others); Thu, 3 Oct 2019 12:31:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:37568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403790AbfJCQbA (ORCPT ); Thu, 3 Oct 2019 12:31:00 -0400 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 9ADF12054F; Thu, 3 Oct 2019 16:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120260; bh=jFyrjGVt0cRFDQk6Fgliyx+XUAerjBChFSMocGjBCxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n3Yz1a8BZiugnHDVZHE0rszeDztU33YLZXM/oXP1CAe1AF4GSR3i0nC08Pr5FIzKl FdYJR3zsIuilOCb3matsxXapsEhu1YhdA9EkrZjvkbGZ06R56FqCSgQHxq8PRyk7eh WqdkS90kzLJshF+8AE0miV5F+k7Vma1g63Uapu8k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Rutland , Catalin Marinas , James Morse , Will Deacon , Sasha Levin Subject: [PATCH 5.2 155/313] arm64: kpti: ensure patched kernel text is fetched from PoU Date: Thu, 3 Oct 2019 17:52:13 +0200 Message-Id: <20191003154548.190098694@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Mark Rutland [ Upstream commit f32c7a8e45105bd0af76872bf6eef0438ff12fb2 ] While the MMUs is disabled, I-cache speculation can result in instructions being fetched from the PoC. During boot we may patch instructions (e.g. for alternatives and jump labels), and these may be dirty at the PoU (and stale at the PoC). Thus, while the MMU is disabled in the KPTI pagetable fixup code we may load stale instructions into the I-cache, potentially leading to subsequent crashes when executing regions of code which have been modified at runtime. Similarly to commit: 8ec41987436d566f ("arm64: mm: ensure patched kernel text is fetched from PoU") ... we can invalidate the I-cache after enabling the MMU to prevent such issues. The KPTI pagetable fixup code itself should be clean to the PoC per the boot protocol, so no maintenance is required for this code. Signed-off-by: Mark Rutland Cc: Catalin Marinas Reviewed-by: James Morse Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/mm/proc.S | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.20.1 diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 7dbf2be470f6c..28a8f7b87ff06 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -286,6 +286,15 @@ skip_pgd: msr sctlr_el1, x18 isb + /* + * Invalidate the local I-cache so that any instructions fetched + * speculatively from the PoC are discarded, since they may have + * been dynamically patched at the PoU. + */ + ic iallu + dsb nsh + isb + /* Set the flag to zero to indicate that we're all done */ str wzr, [flag_ptr] ret From patchwork Thu Oct 3 15:52:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175138 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp561297ill; Thu, 3 Oct 2019 09:33:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzw+o7sbUQIFAPxTM+OCuZF8zGxa75uvdum7XYy6LVTDiTfrRw0F7P7hDH7PMTsBs6vqR7B X-Received: by 2002:a50:c2c2:: with SMTP id u2mr10361584edf.220.1570120275750; Thu, 03 Oct 2019 09:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120275; cv=none; d=google.com; s=arc-20160816; b=J2Fy0y1c9i50cx3G9ygokUhCqNYpc1hkXJkfdncgvB/+Ct55YjRUS/xZNQuP11716u mad2OavIl57qNUnS6RlR+hn+T+0ei9lr/rmUzkkoCNQqH0IUcBJCri3dcU5bGzHWPMex 5zrhyGjGG81gB5E1kpJlU/e+e4vYXvdM2m44E9oqvXVjBV4N1Msx5CgooOxAa0YlIdCo 7f5hSlTuCc1Og9b/PoMBhIFhlgWjye/Mfe2bT6QMbYHM+HGX6Pih0T2m20dcyasJ1Aum q291JdOilSObGP9LywZJHVNe4jKxJ9CjqB+b8OVBArSyN7MxX58At3X5yQaof+HFLmbA P5nA== 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=YOWuqtAz6zfw5sLwjKHmhMjJpip81hPamPrzqU55Jaw=; b=LwLcnVrxJs2DycAuTiTHhmltFTKWEK7iq/S4myW0E9g5JN/2Zww6/+qBIGvfCGBVxz 3aOmhxHwXygTwh2nNfkhNm5B/a0xTwpxJ7JVjfoTtD4BvOhHZnW5Ro9lVEM0Wfey1Q83 /xoZDTVIebRANOaWclqOsrPbt4Mc1CI0kcSMgFBcuES3f4HOTtBDSR+mCDbYwqbtwfcn aPFAXNRjivG8R8vZP7LlS1DBRe7Oy1sAKXzFUC3yBNG56mwR/3d96gG2MFVRr5DQTiz9 CyznIek5ZgEP0AAk4jkjoDCm70/YcDyElpu3MBsy0fdy6SVM1EHte011XIcapqXECRHH iiUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q52m57zD; 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 u8si1535222ejt.219.2019.10.03.09.31.15; Thu, 03 Oct 2019 09:31:15 -0700 (PDT) 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=q52m57zD; 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 S2390517AbfJCQbO (ORCPT + 27 others); Thu, 3 Oct 2019 12:31:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:37876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403843AbfJCQbL (ORCPT ); Thu, 3 Oct 2019 12:31:11 -0400 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 892CC2054F; Thu, 3 Oct 2019 16:31:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120271; bh=kfvdiciDmqZ1VtqoBpuDh3Z6dlpATwLZE7GsvgO6uLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q52m57zDVzeQXtqe3c2MsByjW5NjEPsUOJTGq/5JF05lkTmG1OdhNQPsL461O3B2E rcFBANyLVVcutE5GNfW+imanZrbZnOXhHhx/2od1Puqn53ncboTtVi7REAfTjAXD/K laMZCxOHLENmorIb8swfmbtqwk59fshJxygZNxy0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.2 158/313] ASoC: fsl_ssi: Fix clock control issue in master mode Date: Thu, 3 Oct 2019 17:52:16 +0200 Message-Id: <20191003154548.494258620@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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 [ Upstream commit 696d05225cebffd172008d212657be90e823eac0 ] The test case is arecord -Dhw:0 -d 10 -f S16_LE -r 48000 -c 2 temp.wav & aplay -Dhw:0 -d 30 -f S16_LE -r 48000 -c 2 test.wav There will be error after end of arecord: aplay: pcm_write:2051: write error: Input/output error Capture and Playback work in parallel in master mode, one substream stops, the other substream is impacted, the reason is that clock is disabled wrongly. The clock's reference count is not increased when second substream starts, the hw_param() function returns in the beginning because first substream is enabled, then in end of first substream, the hw_free() disables the clock. This patch is to move the clock enablement to the place before checking of the device enablement in hw_param(). Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1567012817-12625-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_ssi.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.20.1 diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 09b2967befd96..d83be26d64467 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -799,15 +799,6 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream, u32 wl = SSI_SxCCR_WL(sample_size); int ret; - /* - * SSI is properly configured if it is enabled and running in - * the synchronous mode; Note that AC97 mode is an exception - * that should set separate configurations for STCCR and SRCCR - * despite running in the synchronous mode. - */ - if (ssi->streams && ssi->synchronous) - return 0; - if (fsl_ssi_is_i2s_master(ssi)) { ret = fsl_ssi_set_bclk(substream, dai, hw_params); if (ret) @@ -823,6 +814,15 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream, } } + /* + * SSI is properly configured if it is enabled and running in + * the synchronous mode; Note that AC97 mode is an exception + * that should set separate configurations for STCCR and SRCCR + * despite running in the synchronous mode. + */ + if (ssi->streams && ssi->synchronous) + return 0; + if (!fsl_ssi_is_ac97(ssi)) { /* * Keep the ssi->i2s_net intact while having a local variable From patchwork Thu Oct 3 15:52:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175140 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp562348ill; Thu, 3 Oct 2019 09:33:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5UlyD9VG2gQzC9T6yFDXpumSb5KrrH59jkdkNRvZdf2QW09rklAGAbqvlcADV8H1Vgg2C X-Received: by 2002:a05:6402:1ade:: with SMTP id ba30mr10679236edb.304.1570120345359; Thu, 03 Oct 2019 09:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120345; cv=none; d=google.com; s=arc-20160816; b=B5sgK/6YVbE8NQ+Mb4ePbjBPLB72x8BaoveAMa7nWyjes1mudB4kVBTSceGoFn14H/ 4aIooC1K9fDFy5wOElSKdvwvPJtXjiGXF6L92ZXKnlkf5SeGvUzTNYammngF/PLLW8A6 punNlTeibD20DT5dcB3wSiJ3Smtjd8PZd/rPmwYcmpZnWtdNqW9ZdXTIKdeAwiKE1imh 6M4qLsM8xLm44lIO/Vmggyld42y7xU2d2euwxYddSREjYA5Ar3zQ0M9vJiTFx7KZt03+ Y4HcEUc5ap9c/MyzA4Vd/cgWIef8qv9c5UpR4CbsRETpQ/L3tePR24ITRK3ZEIPQRVnX 3B3w== 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=O0sarBjX+FEYJUyNwY/bcxo5JxSF4Q5rmolAVKyREAY=; b=HwLExmMmyHF0MO0tqpd+RvEydFRmraG1qx+sWxxtIWCwS5thHDaLybjdXMDW+gPIS5 OzkL0LIFNBb9LgAwyTx9AXALQTM3zVJ0uCXrTbiDEEWL2TT4ACNZBjJC9CsqXQIOKXkk 3qKY0Z48sHPCCglt2m6PLNKjan+eapNCWzW8V0AuJYTO2lYpsqgszCb0aQ65RGQg1oWp NTSrROuR9iEBubZaIqmeQZ1vq8huCkjL2DGQSmnxkvRVB85JqBRPPNoSnEFZfzGMSuYI 1ya6V6jmAzBJU/uvtBylnHb3NsZPNbuvLnVIMmFO51Mrgtg3eTDTqMVL6tLmvjPCCIap dYHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PIYm7Qvo; 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 h15si1937032eda.284.2019.10.03.09.32.25; Thu, 03 Oct 2019 09:32:25 -0700 (PDT) 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=PIYm7Qvo; 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 S2403941AbfJCQcD (ORCPT + 27 others); Thu, 3 Oct 2019 12:32:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:39126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403916AbfJCQbw (ORCPT ); Thu, 3 Oct 2019 12:31:52 -0400 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 DC51C2070B; Thu, 3 Oct 2019 16:31:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120311; bh=LHr0zQNTuWMvB8KfJDg2lp4+b/SuKXqID+v+rc6sg8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PIYm7QvoAXK9cderBXH5f0Zm3oPGvSxQmgF+i2ALN6oqEhFrUJV5lmFldxmJU1Dv/ +9iZDBAS+oMrCkXSbHJSCMwa52XhpCwNfFURDwlyK+K8QgNfXLs1D8dRm3E7lGRmMg X7kEi9g6yWruYlBl9P0c9xqxoafaRyV4lOJBxZrU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Vinod Koul , Sasha Levin Subject: [PATCH 5.2 176/313] dmaengine: ti: edma: Do not reset reserved paRAM slots Date: Thu, 3 Oct 2019 17:52:34 +0200 Message-Id: <20191003154550.329779474@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Peter Ujfalusi [ Upstream commit c5dbe60664b3660f5ac5854e21273ea2e7ff698f ] Skip resetting paRAM slots marked as reserved as they might be used by other cores. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20190823125618.8133-2-peter.ujfalusi@ti.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/ti/edma.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c index ceabdea40ae0f..982631d4e1f8a 100644 --- a/drivers/dma/ti/edma.c +++ b/drivers/dma/ti/edma.c @@ -2273,9 +2273,6 @@ static int edma_probe(struct platform_device *pdev) ecc->default_queue = info->default_queue; - for (i = 0; i < ecc->num_slots; i++) - edma_write_slot(ecc, i, &dummy_paramset); - if (info->rsv) { /* Set the reserved slots in inuse list */ rsv_slots = info->rsv->rsv_slots; @@ -2288,6 +2285,12 @@ static int edma_probe(struct platform_device *pdev) } } + for (i = 0; i < ecc->num_slots; i++) { + /* Reset only unused - not reserved - paRAM slots */ + if (!test_bit(i, ecc->slot_inuse)) + edma_write_slot(ecc, i, &dummy_paramset); + } + /* Clear the xbar mapped channels in unused list */ xbar_chans = info->xbar_chans; if (xbar_chans) { From patchwork Thu Oct 3 15:52:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175135 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp560451ill; Thu, 3 Oct 2019 09:32:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4KayKVvKa1WWbbpuqBje13jjYNmZPrOQwB315NmvliOKQTge8TqcghATuY1WdgBjhHtbP X-Received: by 2002:a17:906:d92c:: with SMTP id rn12mr8494666ejb.16.1570120350295; Thu, 03 Oct 2019 09:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120350; cv=none; d=google.com; s=arc-20160816; b=ab6y87NoPCsgPIxTOutF3Xa1E5J80OuPT8Vi6ZGN/5YQm+3JoxxaZYX+BwktIIXx2x eD52X2jHh4SlwL+GQ/UYHQNyuoNDt9RtGUddpNpPNxDnkVLm0NcjoCklncElS26JPQxp YlSyq96iq51WPkT6Ws7kxc440SSvfZOvnj/k+jIleMkertraNbpXRgJjECQu28OJ5eoN YORKTASDW4uuHEiqlu20+Hi8/9vCTK0L7EqFSEkeKRCE9XpHaqRKi9PZXl78KAFf282P +01UDw4lzQ/zgyyAhjx1p90T4djnpWkEDM4k5RmYFVVn/XtS+LOcLD20EN98bm1+PNhy SsrA== 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=Pqcw339CMBrgFqnM2yiv3guprrWrgIh35kct79yMezU=; b=dQV0liiOreywECdW1UPCfE4P1M/RXRMYDgwOgxBdoryfez0K0H9j0thgPRBCgvc/Z3 GCRm488NDqiDUzF/Lon/6ATmuKN4FDuIwzh2501juqXJrp2XnZMOVsZLtciFh3PDeq1V DvKiUn9jUrVsxDHZs26cQ3mlx1tusz6dKx4Wmau3Cp3+IkypwyUsdcna4l/Rq0SuOHN4 yFJk9EkE5+GNDauhr8v+C366WvzuAaRp49QagFWvCq9e88W+niRuCBUskVNkhk4b0Z3m uJI6Jd7oE8K2/viahRYPWF0eB4v4MnatjbihPOpkKSCyNL3eeGcEBWDzzYFZgOEhMj6F L4AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="QcG+Bp2/"; 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 h15si1937032eda.284.2019.10.03.09.32.29; Thu, 03 Oct 2019 09:32:30 -0700 (PDT) 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="QcG+Bp2/"; 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 S2391911AbfJCQcW (ORCPT + 27 others); Thu, 3 Oct 2019 12:32:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:39788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391510AbfJCQcT (ORCPT ); Thu, 3 Oct 2019 12:32:19 -0400 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 E495B215EA; Thu, 3 Oct 2019 16:32:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120338; bh=5eDikgOSaSe6iEg5YcefwyC0Wju1DF4Oj1szVWREBus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QcG+Bp2/AcX0FSl/0lHaoqgzL8mPnbtZ+bjKe4P561yHNexuNJtqpIA7wIQbrCKf8 Eo4AW+2J5FwmfNq91/dF+gvacRyyYgSPM2OeAdon20rdNUve1YpO7ZC3C5ZTo+3iWq +ers22w2PPMPn5Uae3r2ki04tLkIz/olpimpOJbc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Arthur She , Mark Brown , Sasha Levin Subject: [PATCH 5.2 185/313] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set Date: Thu, 3 Oct 2019 17:52:43 +0200 Message-Id: <20191003154551.208360676@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Peter Ujfalusi [ Upstream commit 2ec42f3147e1610716f184b02e65d7f493eed925 ] Some tools use the snd_pcm_info_get_name() to try to identify PCMs or for other purposes. Currently it is left empty with the dmaengine-pcm, in this case copy the pcm->id string as pcm->name. For example IGT is using this to find the HDMI PCM for testing audio on it. Signed-off-by: Peter Ujfalusi Reported-by: Arthur She Link: https://lore.kernel.org/r/20190906055524.7393-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-generic-dmaengine-pcm.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 748f5f641002e..d93db2c2b5270 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -306,6 +306,12 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i])) pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE; + + if (rtd->pcm->streams[i].pcm->name[0] == '\0') { + strncpy(rtd->pcm->streams[i].pcm->name, + rtd->pcm->streams[i].pcm->id, + sizeof(rtd->pcm->streams[i].pcm->name)); + } } return 0; From patchwork Thu Oct 3 15:52:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175136 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp560632ill; Thu, 3 Oct 2019 09:32:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxH4DCqAoSpUjv4Ko+6jRXL/GDDZNRcsDnp4l1a4gbVtE6qEOIehBe3k7T+w9emfO+jevzs X-Received: by 2002:aa7:cf81:: with SMTP id z1mr10514742edx.224.1570120356736; Thu, 03 Oct 2019 09:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120356; cv=none; d=google.com; s=arc-20160816; b=l2SPXxh4iG444wzlsyXNzzRCMb/6bnBlgA7W6TZPo9bIQjuMGP8bTvkZOLZtTvIAaJ svbSMwyC/ip0MOQkj4wgbT3jlJ0QkOOiuxNCV3vcVZWl5FRRPi5OaEB58xJTO7Nwed66 +zsZDs/vVBmytEFVRHPU9fGdjxb4cKVXfsstpAot+BCkvOtwCgTg814nzCfPJgBvsKWK XF0LYpA0x5z8nOAP+K1M3QhJd/Nj+OoTc9KoidKkqV+8Mr99cP94V9g17Eg2+azXZXo8 JeV6v0faoCV/f8TZODUlv1It1HtiBfhPrDPAl7Z0Rf3SOJF/+cYh5Y2qHYJgaeEyWUlu PrnA== 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=mKDF4/IDSTYzmqsX0rxU0TV1RTgahsdAvW/TkZ4Yg3k=; b=BiO1aQ41YGVl5R4Wp+yUyZUFGGHwpYoRc00u7Npp0XHvR+f3gil9uKX4CHOFoPgv8j ipGkmSNLyeddTcaBfKrYhLhhc5bp05ljtSm5mdhyzEoLMMnMUZSpti68/STM7xt3hhHg GR1L5fUb3FS2AilPAcuYW/APFi9/E0u/6ZwiiBIcuG9MZ3Vq2J/bHCmn+Xz9Gs6oo5E9 2xaikmGaaOsI9TKjSGuSXRGQLRytCv7JIndt3u+OaYF1mPqVYJagbiXypOgyIlo/tznD ohnpfa3mctyxxAputQ17Xl10P3zB0x6OYGkwrA5354mP5DHZsYddtUO0uQc9cc0p/XGU GdbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yfdRg5Ui; 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 h15si1937032eda.284.2019.10.03.09.32.35; Thu, 03 Oct 2019 09:32:36 -0700 (PDT) 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=yfdRg5Ui; 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 S2403947AbfJCQce (ORCPT + 27 others); Thu, 3 Oct 2019 12:32:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:40128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391939AbfJCQcd (ORCPT ); Thu, 3 Oct 2019 12:32:33 -0400 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 642632070B; Thu, 3 Oct 2019 16:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120351; bh=fP7mtkBeozDd3ru7q/dWJl8QsplEw+feOxj/O/dCgDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yfdRg5Ui+Ww+HB2GCKVPd8+n/lJL7IN2s5TeiVIC/kPHR8zRIcWGuvHWwgfCyEpon QJkZOIxO/wKvBTPsTJKEyIXAm4wB4uKQlkVoYeYayQgn2F90UQSgkTnD3sVuWvbOYQ evsLOMB2/6caTdkODXlBdLU13DtbY/DmSqj7sOBU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Ulf Hansson , Douglas Anderson , Sasha Levin Subject: [PATCH 5.2 189/313] mmc: core: Clarify sdio_irq_pending flag for MMC_CAP2_SDIO_IRQ_NOTHREAD Date: Thu, 3 Oct 2019 17:52:47 +0200 Message-Id: <20191003154551.610578633@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Ulf Hansson [ Upstream commit 36d57efb4af534dd6b442ea0b9a04aa6dfa37abe ] The sdio_irq_pending flag is used to let host drivers indicate that it has signaled an IRQ. If that is the case and we only have a single SDIO func that have claimed an SDIO IRQ, our assumption is that we can avoid reading the SDIO_CCCR_INTx register and just call the SDIO func irq handler immediately. This makes sense, but the flag is set/cleared in a somewhat messy order, let's fix that up according to below. First, the flag is currently set in sdio_run_irqs(), which is executed as a work that was scheduled from sdio_signal_irq(). To make it more implicit that the host have signaled an IRQ, let's instead immediately set the flag in sdio_signal_irq(). This also makes the behavior consistent with host drivers that uses the legacy, mmc_signal_sdio_irq() API. This have no functional impact, because we don't expect host drivers to call sdio_signal_irq() until after the work (sdio_run_irqs()) have been executed anyways. Second, currently we never clears the flag when using the sdio_run_irqs() work, but only when using the sdio_irq_thread(). Let make the behavior consistent, by moving the flag to be cleared inside the common process_sdio_pending_irqs() function. Additionally, tweak the behavior of the flag slightly, by avoiding to clear it unless we processed the SDIO IRQ. The purpose with this at this point, is to keep the information about whether there have been an SDIO IRQ signaled by the host, so at system resume we can decide to process it without reading the SDIO_CCCR_INTx register. Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Signed-off-by: Ulf Hansson Reviewed-by: Douglas Anderson Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/core/sdio_irq.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c index 9f54a259a1b36..e4823ef0a0de9 100644 --- a/drivers/mmc/core/sdio_irq.c +++ b/drivers/mmc/core/sdio_irq.c @@ -31,6 +31,7 @@ static int process_sdio_pending_irqs(struct mmc_host *host) { struct mmc_card *card = host->card; int i, ret, count; + bool sdio_irq_pending = host->sdio_irq_pending; unsigned char pending; struct sdio_func *func; @@ -38,13 +39,16 @@ static int process_sdio_pending_irqs(struct mmc_host *host) if (mmc_card_suspended(card)) return 0; + /* Clear the flag to indicate that we have processed the IRQ. */ + host->sdio_irq_pending = false; + /* * Optimization, if there is only 1 function interrupt registered * and we know an IRQ was signaled then call irq handler directly. * Otherwise do the full probe. */ func = card->sdio_single_irq; - if (func && host->sdio_irq_pending) { + if (func && sdio_irq_pending) { func->irq_handler(func); return 1; } @@ -96,7 +100,6 @@ void sdio_run_irqs(struct mmc_host *host) { mmc_claim_host(host); if (host->sdio_irqs) { - host->sdio_irq_pending = true; process_sdio_pending_irqs(host); if (host->ops->ack_sdio_irq) host->ops->ack_sdio_irq(host); @@ -115,6 +118,7 @@ void sdio_irq_work(struct work_struct *work) void sdio_signal_irq(struct mmc_host *host) { + host->sdio_irq_pending = true; queue_delayed_work(system_wq, &host->sdio_irq_work, 0); } EXPORT_SYMBOL_GPL(sdio_signal_irq); @@ -160,7 +164,6 @@ static int sdio_irq_thread(void *_host) if (ret) break; ret = process_sdio_pending_irqs(host); - host->sdio_irq_pending = false; mmc_release_host(host); /* From patchwork Thu Oct 3 15:52:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175173 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp607637ill; Thu, 3 Oct 2019 10:10:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVpEGzqivBki++brCpCln+prIqlRnOWvEOM6bHnzQVqPNRZ+Wwl8Q9S9wrMyt1ogBaCuu6 X-Received: by 2002:a50:cd1a:: with SMTP id z26mr10447043edi.75.1570122647495; Thu, 03 Oct 2019 10:10:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570122647; cv=none; d=google.com; s=arc-20160816; b=zijVWIzpbw7SxevpcxxQgvy/OaaAm1Kzl/6EPDiVLj0t467UvX+yNDHj6Oqc93ZRlw oyBDm8Obv6XUZl29ZuopxYFW20X4VoBnfuzIYU7NPTddEONiabYYb3A8KIUKWOyD72iu rdP5MkXyh5U+CjEAHSAT43jamllQW9GfW4DyyvElvu1GYp6HXNrTxmSMUtdeg/4VOvZr wEz1VBR+i0GQ/2L6NLjIvSDqVosmxKj5FNh11H77g2SDlavm8lR0RlIks2NpAHMt+h3W TWCIXdliqBNCAVdM2EAxQzqAPhooQBtIEXcyHKvHnbE/gdAPwJDWFR+O7PRBQOsk8scG Ld6Q== 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=j9l5qnGwpBRszCflNXeG5KF20Sa8/C1O76Qf1LyNtek=; b=Y9PLdUfC39Je5tOWuUjFEjGNoq10SENgxsPJXzYwTDrwtOFkwjAzf/WGvnPr9N47ke WB2oES7qV3klTNVOURBjlWrC+Z5DUwgm71nTu/uTJYL2T6WcatTMVeWkliSD/XJgfxU4 xB4f27SWgQ4eVB3r149mVGsUHONdmgKUNjXr3g23h6X65hPjXxAT926sg2lNM6bR+OQn fnAlLpP5ppAtIMPkeAGwUpwNAsbwKDe2nuvXn4S602lZ9ACUoX5zuxbvIc4e4yfkpH+W xYaAXV5CPTRRjVt8RAxqH7V1G95ek2jKU4enNywo8t0s5DHJ7NwpgEX2O7dAPgwrW8H1 y3sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bM53Q1+p; 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 b4si2210109edk.331.2019.10.03.10.10.47; Thu, 03 Oct 2019 10:10:47 -0700 (PDT) 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=bM53Q1+p; 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 S2393441AbfJCRKp (ORCPT + 27 others); Thu, 3 Oct 2019 13:10:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:40382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403963AbfJCQck (ORCPT ); Thu, 3 Oct 2019 12:32:40 -0400 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 7789821783; Thu, 3 Oct 2019 16:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120360; bh=g187vndwyMzQFiDGPL8Bhd9t6/8cXzXzq/6xcOQIgj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bM53Q1+plmpAjz1vYRMkPOqSL52DxqptPRvp9XmP4hSazY1l7q+Ee4G5Gt61NsX8G 3HkccfH6KwWIEuRgygcguX7pDDHXwvp0rLWdGRUS8qKZz5IvVXrJsMwmuwxmWTqtfE m8uYrZG+u0lGA9yBn6sOvsV6HGHnGmJHIpWf4e3k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Ulf Hansson , Douglas Anderson , Sasha Levin Subject: [PATCH 5.2 192/313] mmc: core: Add helper function to indicate if SDIO IRQs is enabled Date: Thu, 3 Oct 2019 17:52:50 +0200 Message-Id: <20191003154551.890683592@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Ulf Hansson [ Upstream commit bd880b00697befb73eff7220ee20bdae4fdd487b ] To avoid each host driver supporting SDIO IRQs, from keeping track internally about if SDIO IRQs has been claimed, let's introduce a common helper function, sdio_irq_claimed(). The function returns true if SDIO IRQs are claimed, via using the information about the number of claimed irqs. This is safe, even without any locks, as long as the helper function is called only from runtime/system suspend callbacks of the host driver. Tested-by: Matthias Kaehlcke Signed-off-by: Ulf Hansson Reviewed-by: Douglas Anderson Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- include/linux/mmc/host.h | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.20.1 diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 7ac3755444d3d..56a8ad506072c 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -493,6 +493,15 @@ void mmc_command_done(struct mmc_host *host, struct mmc_request *mrq); void mmc_cqe_request_done(struct mmc_host *host, struct mmc_request *mrq); +/* + * May be called from host driver's system/runtime suspend/resume callbacks, + * to know if SDIO IRQs has been claimed. + */ +static inline bool sdio_irq_claimed(struct mmc_host *host) +{ + return host->sdio_irqs > 0; +} + static inline void mmc_signal_sdio_irq(struct mmc_host *host) { host->ops->enable_sdio_irq(host, 0); From patchwork Thu Oct 3 15:52:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175137 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp560847ill; Thu, 3 Oct 2019 09:32:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNGmu/TAM7OH8Om/ALN/o6i4pkdATwnrSiZP3pXX7WPq1hBXG9MfzUUW2yvi50FylBc8Sy X-Received: by 2002:a17:906:4e8f:: with SMTP id v15mr8794256eju.57.1570120368139; Thu, 03 Oct 2019 09:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120368; cv=none; d=google.com; s=arc-20160816; b=M52lcHk9PJrojdiY2ylaULzYL6jmKpaaqlASD865YjhLisBMoWK5yJ5tRflaXX71kO FLDh+qUeGOWHwHpyaOSeKehqzawfQuaQ6isdlht4680t+OLgvtAi727V/i6ZJdIapRgq 5eyeD9L/btvtYpXlvjOISnQuCDKa/ZxAP3rn+ehL1nKMGDFXa3Fx3ubrpxIY4IZMc0Xs R0hevlBSOX6WRiQpCYih0460GQdh/lRCv4HqNZmRHre5h82C4G2NuMKiIBiuW+GD0WYg D3U+kOLqkMwAOUEY+ojGg5HsLvCqBzsz2MNR3VmGSAPEg1KTXqwzhcXD1B6oP6tWH+UG gmqA== 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=twL0NtANoeCEZBipKUdYfJWrb9I+gusiWaczR/Q+l6w=; b=aGJ2JvQlqSMpJIBWlV11M6eesgkMDKROK9LabDC9cLZ2u5v1Av5lpXJoGU2AxCl0Fy GDuiieppKL1ipWYT4Ak/KsNOaJqupz0UXyxvplA3CG4zevtrn9vM5JxiPIT8oudngyhN +7uBtV8tLS/7k8TUubp0Cmn1GWlrm5s6SqG0xYKHWRYxEoBmqUQ85mIrZ0W3WV2UjHnn FqM+8M6g52GyDJIqCdnj6aGWzxYeJHz1Lw2W/CMoZbxWWDrX8ZfG8+i6DABqbMe2AoZH LN1NGAVIGHrQbzWhbpb72RoDcAcuzWcOQuv+f7QQleU7rz/WzP7vVwuqu05U7lcPKbig JE0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pJPdVEJ+; 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 h15si1937032eda.284.2019.10.03.09.32.47; Thu, 03 Oct 2019 09:32:48 -0700 (PDT) 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=pJPdVEJ+; 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 S2391954AbfJCQcr (ORCPT + 27 others); Thu, 3 Oct 2019 12:32:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:40420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391132AbfJCQco (ORCPT ); Thu, 3 Oct 2019 12:32:44 -0400 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 315872070B; Thu, 3 Oct 2019 16:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120362; bh=8zGTGHMcYcZ5vPDHzmRtC8gsvJEvulmKyj4ydCxN5i8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pJPdVEJ+fLf4XV3TRHQd4Y1q/js8wt2ElNWZstBC9gXOS5tfPibcJ5z0qrC0+3VcL 5CRQD+05wXUui5m3BvMiwBFUDTtUzQhr5Q0h2/GeIZPeDEOqJLoMYO/gzfAlEQXqzJ M8k1CztFsqayDFkeHaRKuQ89MypxQNt1RyVv2M9Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Ulf Hansson , Douglas Anderson , Sasha Levin Subject: [PATCH 5.2 193/313] mmc: dw_mmc: Re-store SDIO IRQs mask at system resume Date: Thu, 3 Oct 2019 17:52:51 +0200 Message-Id: <20191003154551.988411764@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Ulf Hansson [ Upstream commit 7c526608d5afb62cbc967225e2ccaacfdd142e9d ] In cases when SDIO IRQs have been enabled, runtime suspend is prevented by the driver. However, this still means dw_mci_runtime_suspend|resume() gets called during system suspend/resume, via pm_runtime_force_suspend|resume(). This means during system suspend/resume, the register context of the dw_mmc device most likely loses its register context, even in cases when SDIO IRQs have been enabled. To re-enable the SDIO IRQs during system resume, the dw_mmc driver currently relies on the mmc core to re-enable the SDIO IRQs when it resumes the SDIO card, but this isn't the recommended solution. Instead, it's better to deal with this locally in the dw_mmc driver, so let's do that. Tested-by: Matthias Kaehlcke Signed-off-by: Ulf Hansson Reviewed-by: Douglas Anderson Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/dw_mmc.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.20.1 diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 60c3a06e3469a..45c3490546839 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -3482,6 +3482,10 @@ int dw_mci_runtime_resume(struct device *dev) /* Force setup bus to guarantee available clock output */ dw_mci_setup_bus(host->slot, true); + /* Re-enable SDIO interrupts. */ + if (sdio_irq_claimed(host->slot->mmc)) + __dw_mci_enable_sdio_irq(host->slot, 1); + /* Now that slots are all setup, we can enable card detect */ dw_mci_enable_cd(host); From patchwork Thu Oct 3 15:53:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175141 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp564663ill; Thu, 3 Oct 2019 09:35:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRCNq2hFooDhXuoqU2dzfoIt6ru8WHCvvcWf9TqfpuRWFvIoAHPLNeowCbZoYcglvM8sSz X-Received: by 2002:a17:906:9381:: with SMTP id l1mr8457137ejx.93.1570120546761; Thu, 03 Oct 2019 09:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120546; cv=none; d=google.com; s=arc-20160816; b=OP79dPcTtefXeTq/FkknnV700dGUG64Ec8ONdiK/K2w5JqXX+TLm1w78KZ5yPFAp0z w/9FPPdJH0n6+rtoBAbdK9IQgGi7sXoVNNGK6shwgWFcebfun5IFfgHCS7ZdLt5lpVz/ xYKQt3JqBcuhKxhwXfrazFkbg/8TykEBgdjgyAv4G3IN1nsFrhx5doQb61tT3jkKatoM FjOPQ0afqzwTQmF5XFDcwxgjlLiUr7id/vu6+L6PHxT8ofg3jakhaG0KCV6StH2uRz4X PqV61n45UUZqY81wuGWZDRW6O7Znsgrttp82HW84pVBJ9++jS9ZO5c/z2RqVx7BljedZ DGGw== 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=sazEAL1/8yLJ1kGu/4m1vQbSsrZkJZANTvxg+H24kik=; b=czFl0j0MrYdZdj2vZwDWqz10q1p8RFkpDTOPyQFkgWRcj1dP+RtNeITrHNEKhp6Qws X9lEDk9JeUX6/YLBEH6clzx+IsYAeVzdfr/VsBm+G6Q5/uKHSt5IDXS/mts2uzKfjqFQ XtUls8MopX2L7fs+sP7RInb3AyXI+Ddp1hchv4/CAQp/AGYUSVuiAGyqLelPBu7AMSY0 sMJDAdzkSKNfZ2RVaYvQhnWQqc8pGmAc59U+LLH/uuEXBPj7LeqofoUN97a1Mcx910lp 7yupc3Yoy3MHCYgvDIiUQgprnabGPNM0apSetKtR3HVpqtq1gie9ze/FCLNiS0YBO6+y qtAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ttCRe3JO; 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 pg17si1554907ejb.288.2019.10.03.09.35.46; Thu, 03 Oct 2019 09:35:46 -0700 (PDT) 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=ttCRe3JO; 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 S2404307AbfJCQfo (ORCPT + 27 others); Thu, 3 Oct 2019 12:35:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:44652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404296AbfJCQfm (ORCPT ); Thu, 3 Oct 2019 12:35:42 -0400 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 1173220830; Thu, 3 Oct 2019 16:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120540; bh=Uph2YJu1QxiotIDjSDdeMb4eb9iuxxVBVTRCknHujQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ttCRe3JOvASHMG88ohUB8hIXkPrCKUGbO46OFa6kKOdr9yPQ2xjxmGA1zIKCt75c+ vUTAilqfsUs/grYQYBdT82+pPtD/Q/AMlomehwEr0K9KGX4n49YfnY0R/VQUO2u/Xv 7rAaYPhxVtVEVAraOBuNeHo3+ruwbS1HxQjjmqt8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , Lee Jones Subject: [PATCH 5.2 261/313] regulator: Defer init completion for a while after late_initcall Date: Thu, 3 Oct 2019 17:53:59 +0200 Message-Id: <20191003154558.747758307@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@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: Mark Brown commit 55576cf1853798e86f620766e23b604c9224c19c upstream. The kernel has no way of knowing when we have finished instantiating drivers, between deferred probe and systems that build key drivers as modules we might be doing this long after userspace has booted. This has always been a bit of an issue with regulator_init_complete since it can power off hardware that's not had it's driver loaded which can result in user visible effects, the main case is powering off displays. Practically speaking it's not been an issue in real systems since most systems that use the regulator API are embedded and build in key drivers anyway but with Arm laptops coming on the market it's becoming more of an issue so let's do something about it. In the absence of any better idea just defer the powering off for 30s after late_initcall(), this is obviously a hack but it should mask the issue for now and it's no more arbitrary than late_initcall() itself. Ideally we'd have some heuristics to detect if we're on an affected system and tune or skip the delay appropriately, and there may be some need for a command line option to be added. Link: https://lore.kernel.org/r/20190904124250.25844-1-broonie@kernel.org Signed-off-by: Mark Brown Tested-by: Lee Jones Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/regulator/core.c | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -5486,7 +5486,7 @@ static int __init regulator_init(void) /* init early to allow our consumers to complete system booting */ core_initcall(regulator_init); -static int __init regulator_late_cleanup(struct device *dev, void *data) +static int regulator_late_cleanup(struct device *dev, void *data) { struct regulator_dev *rdev = dev_to_rdev(dev); const struct regulator_ops *ops = rdev->desc->ops; @@ -5535,18 +5535,9 @@ unlock: return 0; } -static int __init regulator_init_complete(void) +static void regulator_init_complete_work_function(struct work_struct *work) { /* - * Since DT doesn't provide an idiomatic mechanism for - * enabling full constraints and since it's much more natural - * with DT to provide them just assume that a DT enabled - * system has full constraints. - */ - if (of_have_populated_dt()) - has_full_constraints = true; - - /* * Regulators may had failed to resolve their input supplies * when were registered, either because the input supply was * not registered yet or because its parent device was not @@ -5563,6 +5554,35 @@ static int __init regulator_init_complet */ class_for_each_device(®ulator_class, NULL, NULL, regulator_late_cleanup); +} + +static DECLARE_DELAYED_WORK(regulator_init_complete_work, + regulator_init_complete_work_function); + +static int __init regulator_init_complete(void) +{ + /* + * Since DT doesn't provide an idiomatic mechanism for + * enabling full constraints and since it's much more natural + * with DT to provide them just assume that a DT enabled + * system has full constraints. + */ + if (of_have_populated_dt()) + has_full_constraints = true; + + /* + * We punt completion for an arbitrary amount of time since + * systems like distros will load many drivers from userspace + * so consumers might not always be ready yet, this is + * particularly an issue with laptops where this might bounce + * the display off then on. Ideally we'd get a notification + * from userspace when this happens but we don't so just wait + * a bit and hope we waited long enough. It'd be better if + * we'd only do this on systems that need it, and a kernel + * command line option might be useful. + */ + schedule_delayed_work(®ulator_init_complete_work, + msecs_to_jiffies(30000)); return 0; }