From patchwork Fri May 8 12:35:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226167 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLACK, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E9DFC38A2A for ; Fri, 8 May 2020 13:01:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2559820720 for ; Fri, 8 May 2020 13:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942904; bh=dH39vX1jFQ/TFkb+BTCWZyIAmD9Vcg+f2I8YszPGVZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iLNN6dSJg2NgJveJPhhTSf8OYZsJPIhobKcNTJ5sRC881mV3WJH+O+4CjXLCFQ63L KtWn1iXkMmK4WiT3FjJWvZvmuiEbecpmPHJJx2+MluWlQuArL8AvILuRHhqcyvtCaS dHQYJn9sTvBWMSNDsPbW7rRB77JjT+OnobF0Fd5c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729918AbgEHMvh (ORCPT ); Fri, 8 May 2020 08:51:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:60678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729913AbgEHMvd (ORCPT ); Fri, 8 May 2020 08:51: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 2B0DA2495C; Fri, 8 May 2020 12:51:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942292; bh=dH39vX1jFQ/TFkb+BTCWZyIAmD9Vcg+f2I8YszPGVZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tJ0UbMLp4w0W8nxnb8DgP/Hw4AeTWe9eoJMp1e+5AJA9/1xpKJ13p1tATkf86FvDl /cTMQBL7ctS5h5rc9QjTTNj+1NrkA1vmcR5ubT8ksfbZAggzkk9T3fMyEsd/j7J+pY D5acG+zto95hpE0Y+BAjwznp7/GMGBMH5lb0OCB0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Kardashevskiy , Michael Ellerman , Guenter Roeck Subject: [PATCH 4.19 02/32] powerpc/pci/of: Parse unassigned resources Date: Fri, 8 May 2020 14:35:15 +0200 Message-Id: <20200508123035.139795603@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Alexey Kardashevskiy commit dead1c845dbe97e0061dae2017eaf3bd8f8f06ee upstream. The pseries platform uses the PCI_PROBE_DEVTREE method of PCI probing which reads "assigned-addresses" of every PCI device and initializes the device resources. However if the property is missing or zero sized, then there is no fallback of any kind and the PCI resources remain undiscovered, i.e. pdev->resource[] array remains empty. This adds a fallback which parses the "reg" property in pretty much same way except it marks resources as "unset" which later make Linux assign those resources proper addresses. This has an effect when: 1. a hypervisor failed to assign any resource for a device; 2. /chosen/linux,pci-probe-only=0 is in the DT so the system may try assigning a resource. Neither is likely to happen under PowerVM. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Cc: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/pci_of_scan.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) --- a/arch/powerpc/kernel/pci_of_scan.c +++ b/arch/powerpc/kernel/pci_of_scan.c @@ -82,10 +82,16 @@ static void of_pci_parse_addrs(struct de const __be32 *addrs; u32 i; int proplen; + bool mark_unset = false; addrs = of_get_property(node, "assigned-addresses", &proplen); - if (!addrs) - return; + if (!addrs || !proplen) { + addrs = of_get_property(node, "reg", &proplen); + if (!addrs || !proplen) + return; + mark_unset = true; + } + pr_debug(" parse addresses (%d bytes) @ %p\n", proplen, addrs); for (; proplen >= 20; proplen -= 20, addrs += 5) { flags = pci_parse_of_flags(of_read_number(addrs, 1), 0); @@ -110,6 +116,8 @@ static void of_pci_parse_addrs(struct de continue; } res->flags = flags; + if (mark_unset) + res->flags |= IORESOURCE_UNSET; res->name = pci_name(dev); region.start = base; region.end = base + size - 1; From patchwork Fri May 8 12:35:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226168 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 794B5C47247 for ; Fri, 8 May 2020 13:01:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B7A120870 for ; Fri, 8 May 2020 13:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942903; bh=G+XhWuodZsxbLJtlCk/40wVd2/t6S+dPVSqrfZJM3wY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dExAQzLzyiYebG2eFaAwalh80c29GqPGw5qBixU+OiTfTwnSC6fP6zoUn+Ka/w6uU UzhyT/hyuZlXJgKbuwlAIJfjWZWw79TS8kKRTFw2D50w7gVc5UNz+k8mQiFnol5OYI tAxg6HzoTBxvph92YfFLhM40hrFLnNQjPQ5aF4TQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727838AbgEHNBi (ORCPT ); Fri, 8 May 2020 09:01:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:32786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729928AbgEHMvr (ORCPT ); Fri, 8 May 2020 08:51: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 EB41724953; Fri, 8 May 2020 12:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942307; bh=G+XhWuodZsxbLJtlCk/40wVd2/t6S+dPVSqrfZJM3wY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jd0x0rb3IySeW5YMtM5NP7ZhJQaHB5j9tT+NB/v17sJLdT4xPgD/Lx8o31lCCP4mU FIERpiUXWQC+pWJGQh7UTuZxQe0cp1lgZ5rfHb9YlgKkJJWp6u2vfxvBaBNtrj7NL6 AIjdFzzh9+EuKEiWtHhy8k0O3QQIfrnSI/jnGeo0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Ranjani Sridharan , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 4.19 03/32] ASoC: topology: Check return value of pcm_new_ver Date: Fri, 8 May 2020 14:35:16 +0200 Message-Id: <20200508123035.259081294@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Amadeusz Sławiński [ Upstream commit b3677fc3d68dd942c92de52f0bd9dd8b472a40e6 ] Function pcm_new_ver can fail, so we should check it's return value and handle possible error. Signed-off-by: Amadeusz Sławiński Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200327204729.397-6-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-topology.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 756dd23031063..2c6598e07dde3 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1923,7 +1923,9 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg, _pcm = pcm; } else { abi_match = false; - pcm_new_ver(tplg, pcm, &_pcm); + ret = pcm_new_ver(tplg, pcm, &_pcm); + if (ret < 0) + return ret; } /* create the FE DAIs and DAI links */ From patchwork Fri May 8 12:35:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F34E0C38A2A for ; Fri, 8 May 2020 13:01:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDA6D20720 for ; Fri, 8 May 2020 13:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942894; bh=/pCLZHYr2OmVi2mS3ZUGZ80/NyMpK1+qw2ThEw/BWPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LNPNUaTyRHbWWENs5i1Wb17yMDyXsWJJw/BhehBnwOuD9W7CLo5U3kqu+q5KtpPcp VGtn32r3fecxuU0A7EqnbGdK3ZUh2iUuS7xYAhPMVdfdussVZ3NeyVsKSFQXpoREBf bt2NIbF/xnafBltWJ3UyDU8VRyrfpDL33KKPKQmE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729434AbgEHMvu (ORCPT ); Fri, 8 May 2020 08:51:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:32876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729921AbgEHMvu (ORCPT ); Fri, 8 May 2020 08:51: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 5F96024964; Fri, 8 May 2020 12:51:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942309; bh=/pCLZHYr2OmVi2mS3ZUGZ80/NyMpK1+qw2ThEw/BWPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tA42iEqhjWArKnA9r7VDCNHKfuEqVbaU8kqlOnG2FHbC3Yy27TLkoaIGMIQUaGeZH mfLQVkToaOHYiF4SGcKfReW3lT1ZuztTJqGxiHaotG69KwXYgcIkGlDJRuoopDSpZL XgJILUSF/JDuW2owwYGNcKQPKAFLl6Tt5rTpcV2U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tyler Hicks , Shuah Khan , Sasha Levin Subject: [PATCH 4.19 04/32] selftests/ipc: Fix test failure seen after initial test run Date: Fri, 8 May 2020 14:35:17 +0200 Message-Id: <20200508123035.369367672@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tyler Hicks [ Upstream commit b87080eab4c1377706c113fc9c0157f19ea8fed1 ] After successfully running the IPC msgque test once, subsequent runs result in a test failure: $ sudo ./run_kselftest.sh TAP version 13 1..1 # selftests: ipc: msgque # Failed to get stats for IPC queue with id 0 # Failed to dump queue: -22 # Bail out! # # Pass 0 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0 not ok 1 selftests: ipc: msgque # exit=1 The dump_queue() function loops through the possible message queue index values using calls to msgctl(kern_id, MSG_STAT, ...) where kern_id represents the index value. The first time the test is ran, the initial index value of 0 is valid and the test is able to complete. The index value of 0 is not valid in subsequent test runs and the loop attempts to try index values of 1, 2, 3, and so on until a valid index value is found that corresponds to the message queue created earlier in the test. The msgctl() syscall returns -1 and sets errno to EINVAL when invalid index values are used. The test failure is caused by incorrectly comparing errno to -EINVAL when cycling through possible index values. Fix invalid test failures on subsequent runs of the msgque test by correctly comparing errno values to a non-negated EINVAL. Fixes: 3a665531a3b7 ("selftests: IPC message queue copy feature test") Signed-off-by: Tyler Hicks Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/ipc/msgque.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c index 4c156aeab6b80..5ec4d9e18806c 100644 --- a/tools/testing/selftests/ipc/msgque.c +++ b/tools/testing/selftests/ipc/msgque.c @@ -137,7 +137,7 @@ int dump_queue(struct msgque_data *msgque) for (kern_id = 0; kern_id < 256; kern_id++) { ret = msgctl(kern_id, MSG_STAT, &ds); if (ret < 0) { - if (errno == -EINVAL) + if (errno == EINVAL) continue; printf("Failed to get stats for IPC queue with id %d\n", kern_id); From patchwork Fri May 8 12:35:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226172 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4A10C47257 for ; Fri, 8 May 2020 13:00:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B6D712054F for ; Fri, 8 May 2020 13:00:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942839; bh=jLd/m6vXXjMduVePN9+R0gj6Wj03nfzM/HiOjiE5sA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=x1u5KCMNZNM4NrZ/enDhX+QZTiZpekfsdM2R/zNni4v/5MMxH2GB6EoUKzqPkqNwL vMC1k8Mpg5w3QHY8Y/jdPE7NeNVveLgoe9OOk+i05cLnVTw+13ReAaijBrUT0e3ARQ 0j7o/u05gZ7yk7sYA2s+0OqrsggnbLdGrzoLnQuQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbgEHMwR (ORCPT ); Fri, 8 May 2020 08:52:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:33144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729005AbgEHMwG (ORCPT ); Fri, 8 May 2020 08:52: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 6489224964; Fri, 8 May 2020 12:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942322; bh=jLd/m6vXXjMduVePN9+R0gj6Wj03nfzM/HiOjiE5sA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wfBj2IjdnY7fhj71tzvhObOrt7dijjQTTTBNixynbLY0C2+1XnkDvTX1Gye4EbI1U /VADLPZUco1jHELPmnfhM4UR/xvEMJUUuimCt5BbY26nmCteTwMVXOyAgR3RyrS4Cy sQlx9y5zpXySnSuHqIMo2WJxqLdp2eB8QTx5gETQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Mark Brown , Sasha Levin Subject: [PATCH 4.19 09/32] ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry Date: Fri, 8 May 2020 14:35:22 +0200 Message-Id: <20200508123036.041556222@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Amadeusz Sławiński [ Upstream commit 326b509238171d37402dbe308e154cc234ed1960 ] If we don't find any pcm, pcm will point at address at an offset from the the list head and not a meaningful structure. Fix this by returning correct pcm if found and NULL if not. Found with coccinelle. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20200415162849.308-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/hdac_hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index be2473166bfaf..4594b1447900a 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -148,14 +148,14 @@ static struct hdac_hdmi_pcm * hdac_hdmi_get_pcm_from_cvt(struct hdac_hdmi_priv *hdmi, struct hdac_hdmi_cvt *cvt) { - struct hdac_hdmi_pcm *pcm = NULL; + struct hdac_hdmi_pcm *pcm; list_for_each_entry(pcm, &hdmi->pcm_list, head) { if (pcm->cvt == cvt) - break; + return pcm; } - return pcm; + return NULL; } static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm, From patchwork Fri May 8 12:35:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226165 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E861EC38A2A for ; Fri, 8 May 2020 13:02:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF62F20870 for ; Fri, 8 May 2020 13:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942930; bh=MVj9UZhM0DjTLdw9ouaGd2g02wNy/NokxdpMwsfgbjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=h99DnM7L7qRdjh9c4MDwGE/jx67Tf2h9PM5DFke5HJ4+5TR+xLVE9Tq1y4NA1JXSm 0emg/3r9Ia+Fxj5a1311eQDy/Ns63m2OOc+BQon/RbA2ZtgzpUnNcPAQG3iLhXGWBP KU6P6fq/j905pzQuy2K97N8xJi8PfWs9yX27d3b8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728501AbgEHNCJ (ORCPT ); Fri, 8 May 2020 09:02:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:60098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729418AbgEHMvN (ORCPT ); Fri, 8 May 2020 08:51: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 E344E24969; Fri, 8 May 2020 12:51:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942272; bh=MVj9UZhM0DjTLdw9ouaGd2g02wNy/NokxdpMwsfgbjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xEfC66F+62BTOi1LSOOxxDas6r25RxISPnW7KYTnitkqFxCzR2Fq1avSHcvESxVng SW9NRvnq2znAIGpntsdGZOdtNrpq058XR/b7NHC24JnvOLU7adcAEYXtLhBc9f2XAf 5PaWRjMkNqkvauB42fT1Iw9wYAeoSLSt6lTSoSEc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julien Beraud , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 12/32] net: stmmac: fix enabling socfpgas ptp_ref_clock Date: Fri, 8 May 2020 14:35:25 +0200 Message-Id: <20200508123036.422506887@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Julien Beraud [ Upstream commit 15ce30609d1e88d42fb1cd948f453e6d5f188249 ] There are 2 registers to write to enable a ptp ref clock coming from the fpga. One that enables the usage of the clock from the fpga for emac0 and emac1 as a ptp ref clock, and the other to allow signals from the fpga to reach emac0 and emac1. Currently, if the dwmac-socfpga has phymode set to PHY_INTERFACE_MODE_MII, PHY_INTERFACE_MODE_GMII, or PHY_INTERFACE_MODE_SGMII, both registers will be written and the ptp ref clock will be set as coming from the fpga. Separate the 2 register writes to only enable signals from the fpga to reach emac0 or emac1 when ptp ref clock is not coming from the fpga. Signed-off-by: Julien Beraud Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index 5b3b06a0a3bf5..33407df6bea69 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c @@ -274,16 +274,19 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac) phymode == PHY_INTERFACE_MODE_MII || phymode == PHY_INTERFACE_MODE_GMII || phymode == PHY_INTERFACE_MODE_SGMII) { - ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2); regmap_read(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG, &module); module |= (SYSMGR_FPGAGRP_MODULE_EMAC << (reg_shift / 2)); regmap_write(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG, module); - } else { - ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2)); } + if (dwmac->f2h_ptp_ref_clk) + ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2); + else + ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << + (reg_shift / 2)); + regmap_write(sys_mgr_base_addr, reg_offset, ctrl); /* Deassert reset for the phy configuration to be sampled by From patchwork Fri May 8 12:35:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226227 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37735C47247 for ; Fri, 8 May 2020 12:51:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19B5724958 for ; Fri, 8 May 2020 12:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942278; bh=N5kQtHnfbZR6ujyLKKZvN4ndgmsr8nvsHRD5vWXj018=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mGWb0jivvrjhRuuibtMG2p8zhlpqp151hOrKo8uJ3ItO2+BWu3rEjkY0Z1yL2ZPoD F65WmTRvrIFkqSugfq4ikuAUriMKLiPxpTWQlCwXIiG9PlhGAgd79Hc7MoxOT3owDh rxBNST929SP03F2jMdubjwnpQ1lE848QG8HCjPsM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729201AbgEHMvR (ORCPT ); Fri, 8 May 2020 08:51:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:60174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727802AbgEHMvQ (ORCPT ); Fri, 8 May 2020 08:51:16 -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 9591A24958; Fri, 8 May 2020 12:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942275; bh=N5kQtHnfbZR6ujyLKKZvN4ndgmsr8nvsHRD5vWXj018=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YY417y/qbrOKVCAgtNxVSm2UNh9GCFPWCSGliCLSiEcEMZ3CL3IvI0yMMV0KpmrHR YM10IhT6kNHU9ChcMuxN9R3eDOMGnQb2EM22JxBSV9gzEJabcW8L3Cy1gkh7tyY1yi qXxiZ8J2elHNxF1ejhF+3EGChhpmYJzyBaT5AfqM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julien Beraud , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 13/32] net: stmmac: Fix sub-second increment Date: Fri, 8 May 2020 14:35:26 +0200 Message-Id: <20200508123036.534210963@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Julien Beraud [ Upstream commit 91a2559c1dc5b0f7e1256d42b1508935e8eabfbf ] In fine adjustement mode, which is the current default, the sub-second increment register is the number of nanoseconds that will be added to the clock when the accumulator overflows. At each clock cycle, the value of the addend register is added to the accumulator. Currently, we use 20ns = 1e09ns / 50MHz as this value whatever the frequency of the ptp clock actually is. The adjustment is then done on the addend register, only incrementing every X clock cycles X being the ratio between 50MHz and ptp_clock_rate (addend = 2^32 * 50MHz/ptp_clock_rate). This causes the following issues : - In case the frequency of the ptp clock is inferior or equal to 50MHz, the addend value calculation will overflow and the default addend value will be set to 0, causing the clock to not work at all. (For instance, for ptp_clock_rate = 50MHz, addend = 2^32). - The resolution of the timestamping clock is limited to 20ns while it is not needed, thus limiting the accuracy of the timestamping to 20ns. Fix this by setting sub-second increment to 2e09ns / ptp_clock_rate. It will allow to reach the minimum possible frequency for ptp_clk_ref, which is 5MHz for GMII 1000Mps Full-Duplex by setting the sub-second-increment to a higher value. For instance, for 25MHz, it gives ssinc = 80ns and default_addend = 2^31. It will also allow to use a lower value for sub-second-increment, thus improving the timestamping accuracy with frequencies higher than 100MHz, for instance, for 200MHz, ssinc = 10ns and default_addend = 2^31. v1->v2: - Remove modifications to the calculation of default addend, which broke compatibility with clock frequencies for which 2000000000 / ptp_clk_freq is not an integer. - Modify description according to discussions. Signed-off-by: Julien Beraud Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- .../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c index 7423262ce5907..e1fbd7c81bfa9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c @@ -36,12 +36,16 @@ static void config_sub_second_increment(void __iomem *ioaddr, unsigned long data; u32 reg_value; - /* For GMAC3.x, 4.x versions, convert the ptp_clock to nano second - * formula = (1/ptp_clock) * 1000000000 - * where ptp_clock is 50MHz if fine method is used to update system + /* For GMAC3.x, 4.x versions, in "fine adjustement mode" set sub-second + * increment to twice the number of nanoseconds of a clock cycle. + * The calculation of the default_addend value by the caller will set it + * to mid-range = 2^31 when the remainder of this division is zero, + * which will make the accumulator overflow once every 2 ptp_clock + * cycles, adding twice the number of nanoseconds of a clock cycle : + * 2000000000ULL / ptp_clock. */ if (value & PTP_TCR_TSCFUPDT) - data = (1000000000ULL / 50000000); + data = (2000000000ULL / ptp_clock); else data = (1000000000ULL / ptp_clock); From patchwork Fri May 8 12:35:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226226 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8222AC38A2A for ; Fri, 8 May 2020 12:51:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5604D24958 for ; Fri, 8 May 2020 12:51:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942282; bh=2aLTZKLe+wSFrXeOLh7dOkpeYDowF5ZnL0QybDV3ROM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bkbW+TmKL98eFAEz/wfkoKgU+Z37dM37qPnKaRL4CLtzrBZJHQyfGe9ZO5JM/wpZy kyA5XUILW6eVkMaDFRZqeWycjQ4oT/jAmMK2VZbmniqaQhWpwEM7QwxSFBNLkHQfTA /Xs3z3qVINP1f0klTmddeBKPRcqawxbaPLgvWqW4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729897AbgEHMvV (ORCPT ); Fri, 8 May 2020 08:51:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:60340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729891AbgEHMvU (ORCPT ); Fri, 8 May 2020 08:51:20 -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 C046C24963; Fri, 8 May 2020 12:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942280; bh=2aLTZKLe+wSFrXeOLh7dOkpeYDowF5ZnL0QybDV3ROM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=liQY0kpQZsLXbL5UlXZZoMxx8F2EvVFytMRWVLycZ1BKjaocSBCizQ+kPDcOf4RtY KYVPobsPD8un/xsnjfmEFhvGJWuZFIZmaQzMOPsZla/3TiLbdXn4dFvtAEXUYP8Gyf 03FhPOx3Cxx/znvMdCWn4X0MKmDDV0HeGlYeZ+1E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Blankertz , Kuninori Morimoto , Mark Brown , Sasha Levin Subject: [PATCH 4.19 15/32] ASoC: rsnd: Fix "status check failed" spam for multi-SSI Date: Fri, 8 May 2020 14:35:28 +0200 Message-Id: <20200508123036.783836165@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Matthias Blankertz [ Upstream commit 54cb6221688660670a2e430892d7f4e6370263b8 ] Fix the rsnd_ssi_stop function to skip disabling the individual SSIs of a multi-SSI setup, as the actual stop is performed by rsnd_ssiu_stop_gen2 - the same logic as in rsnd_ssi_start. The attempt to disable these SSIs was harmless, but caused a "status check failed" message to be printed for every SSI in the multi-SSI setup. The disabling of interrupts is still performed, as they are enabled for all SSIs in rsnd_ssi_init, but care is taken to not accidentally set the EN bit for an SSI where it was not set by rsnd_ssi_start. Signed-off-by: Matthias Blankertz Acked-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20200417153017.1744454-3-matthias.blankertz@cetitec.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sh/rcar/ssi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index d5f663bb965f1..a6cf2ac223e42 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -566,10 +566,16 @@ static int rsnd_ssi_stop(struct rsnd_mod *mod, * Capture: It might not receave data. Do nothing */ if (rsnd_io_is_play(io)) { - rsnd_mod_write(mod, SSICR, cr | EN); + rsnd_mod_write(mod, SSICR, cr | ssi->cr_en); rsnd_ssi_status_check(mod, DIRQ); } + /* In multi-SSI mode, stop is performed by setting ssi0129 in + * SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here. + */ + if (rsnd_ssi_multi_slaves_runtime(io)) + return 0; + /* * disable SSI, * and, wait idle state From patchwork Fri May 8 12:35:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226166 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 241C7C38A2A for ; Fri, 8 May 2020 13:01:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED64E20870 for ; Fri, 8 May 2020 13:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942917; bh=5UUaHL/T+MNhOlEAM9Bbtuz7oEuaCC3NVlwW6aTI8t4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ijkLVTER5AZOWO5w+lBOb+8kAupCSkyrJ730pg2EC4I7HCPw5J/yYFNsIkUOp2aMe vJE6xQJ5Hh5gLnU+4/G/27s1CGDiBJmgF+tltAId85u+rhZaUMnm+XUPirQdpb7F2b v1B2HZHTGPvYRGSdOTFo0i84EEt1+kaWzXpPtlIQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbgEHMv2 (ORCPT ); Fri, 8 May 2020 08:51:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:60408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729900AbgEHMvX (ORCPT ); Fri, 8 May 2020 08:51: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 4536F24953; Fri, 8 May 2020 12:51:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942282; bh=5UUaHL/T+MNhOlEAM9Bbtuz7oEuaCC3NVlwW6aTI8t4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vbzVeR19TGNBOup/y7cAJLCfh1To+yLZuF5qUC6c4SCYRdnKxQDen3EMeFiV2//gZ ER3WlYoaVicltjeMRt+guBDgtoXpVgi9sd96lot5BMt2734vfiwihxeZSAPWxPyW5z BNOE95xOw7lGhWP1h/TAX7dOwLCtSYuUd5Qknx5Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ronnie Sahlberg , Jeff Layton , Steve French , Sasha Levin Subject: [PATCH 4.19 16/32] cifs: protect updating server->dstaddr with a spinlock Date: Fri, 8 May 2020 14:35:29 +0200 Message-Id: <20200508123036.981881820@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ronnie Sahlberg [ Upstream commit fada37f6f62995cc449b36ebba1220594bfe55fe ] We use a spinlock while we are reading and accessing the destination address for a server. We need to also use this spinlock to protect when we are modifying this address from reconn_set_ipaddr(). Signed-off-by: Ronnie Sahlberg Reviewed-by: Jeff Layton Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/connect.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 975f800b9dd4d..9e569d60c636b 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -353,8 +353,10 @@ static int reconn_set_ipaddr(struct TCP_Server_Info *server) return rc; } + spin_lock(&cifs_tcp_ses_lock); rc = cifs_convert_address((struct sockaddr *)&server->dstaddr, ipaddr, strlen(ipaddr)); + spin_unlock(&cifs_tcp_ses_lock); kfree(ipaddr); return !rc ? -1 : 0; From patchwork Fri May 8 12:35:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68BFAC38A2A for ; Fri, 8 May 2020 12:51:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43C2224953 for ; Fri, 8 May 2020 12:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942294; bh=FUdsD2vebhAd1eNJ+Evte29+cETCgh/IN/PwJdEDKaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Uthbx4nffOG9n079hSs7I925uxIGL5uv0qhjIanW071Z+TMz/Dacr6nHxuuEWNcjs 4gkJSkOCnGJCavK0NlgE7fV3nzbLoPV9448nOsHZUesHJtA31cm6EcOse+VeKX+kyZ m1Zl+tc8MZ623mcLjdYAfbO+B6q3WaZudcpuNsiI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729709AbgEHMvb (ORCPT ); Fri, 8 May 2020 08:51:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:60612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728823AbgEHMvb (ORCPT ); Fri, 8 May 2020 08:51:31 -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 AC03624958; Fri, 8 May 2020 12:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942290; bh=FUdsD2vebhAd1eNJ+Evte29+cETCgh/IN/PwJdEDKaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X9iQO2lYdr+zQZc3r2IdliC1EaZ5Dg4E0pnj1n6f9omon50XoM2cp1I4zlkbn9i+d z63KNlVbnd180nl4frv9ZF+bFnIs4XepO591uo2BGmMkA11DsYHQXvlqWMYOEI4sCG xk8n+KuxcKL39iZf39VGUoDTd7LwZyBnmaJ8O9ZI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kbuild test robot , Nathan Chancellor , Herbert Xu , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 19/32] lib/mpi: Fix building for powerpc with clang Date: Fri, 8 May 2020 14:35:32 +0200 Message-Id: <20200508123037.476030370@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nathan Chancellor [ Upstream commit 5990cdee689c6885b27c6d969a3d58b09002b0bc ] 0day reports over and over on an powerpc randconfig with clang: lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions Remove the superfluous casts, which have been done previously for x86 and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit x86"). Reported-by: kbuild test robot Signed-off-by: Nathan Chancellor Acked-by: Herbert Xu Signed-off-by: Michael Ellerman Link: https://github.com/ClangBuiltLinux/linux/issues/991 Link: https://lore.kernel.org/r/20200413195041.24064-1-natechancellor@gmail.com Signed-off-by: Sasha Levin --- lib/mpi/longlong.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h index 08c60d10747fd..e01b705556aa6 100644 --- a/lib/mpi/longlong.h +++ b/lib/mpi/longlong.h @@ -756,22 +756,22 @@ do { \ do { \ if (__builtin_constant_p(bh) && (bh) == 0) \ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "%r" ((USItype)(ah)), \ "%r" ((USItype)(al)), \ "rI" ((USItype)(bl))); \ else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "%r" ((USItype)(ah)), \ "%r" ((USItype)(al)), \ "rI" ((USItype)(bl))); \ else \ __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "%r" ((USItype)(ah)), \ "r" ((USItype)(bh)), \ "%r" ((USItype)(al)), \ @@ -781,36 +781,36 @@ do { \ do { \ if (__builtin_constant_p(ah) && (ah) == 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "r" ((USItype)(bh)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else if (__builtin_constant_p(ah) && (ah) == ~(USItype) 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "r" ((USItype)(bh)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else if (__builtin_constant_p(bh) && (bh) == 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "r" ((USItype)(ah)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "r" ((USItype)(ah)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else \ __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "r" ((USItype)(ah)), \ "r" ((USItype)(bh)), \ "rI" ((USItype)(al)), \ @@ -821,7 +821,7 @@ do { \ do { \ USItype __m0 = (m0), __m1 = (m1); \ __asm__ ("mulhwu %0,%1,%2" \ - : "=r" ((USItype) ph) \ + : "=r" (ph) \ : "%r" (__m0), \ "r" (__m1)); \ (pl) = __m0 * __m1; \ From patchwork Fri May 8 12:35:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226224 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7E13C38A2A for ; Fri, 8 May 2020 12:51:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88F39218AC for ; Fri, 8 May 2020 12:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942308; bh=TaSAlepga7wgrNkHC4AjuXBRxZZGYlc93f7nVyV/E2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QCi/BDgphLYn48UT2G84vDYrluEbTn19gL1zlS0l5pKxPO09SRHcwkyZXPQy9rMQR 8IEi1s9RMM3pJEJUwgbpIr3uZBTs3YqsoP/s3GVKXJ7mSxnuhlA1uXH+Yp3/9W2/m7 VN6a/31Oqsy2KHDDtA5wofafT8q/B4otUu4OBeWI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729587AbgEHMvp (ORCPT ); Fri, 8 May 2020 08:51:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:60894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729924AbgEHMvm (ORCPT ); Fri, 8 May 2020 08:51: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 E6E5624953; Fri, 8 May 2020 12:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942302; bh=TaSAlepga7wgrNkHC4AjuXBRxZZGYlc93f7nVyV/E2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qLKiYcQhLjtybTDspzygiHrc5OjpROF+U+K80uYlF6p3ZP7rw0CxbGPDlc4+DZorp QLN8VKqxy2Iam2XXrEnNpnng9Z2rsb8bDkQzH3FqiBAt7nBMtF8GbJsSzQdal/z7xD 4GZrupnmqmDX25w74mPqBJ1OkrwimNWLzaOTSZWI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaron Ma , Alex Deucher Subject: [PATCH 4.19 23/32] drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event Date: Fri, 8 May 2020 14:35:36 +0200 Message-Id: <20200508123038.123624374@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Aaron Ma commit 5932d260a8d85a103bd6c504fbb85ff58b156bf9 upstream. On ARCTURUS and RENOIR, powerplay is not supported yet. When plug in or unplug power jack, ACPI event will issue. Then kernel NULL pointer BUG will be triggered. Check for NULL pointers before calling. Signed-off-by: Aaron Ma Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c @@ -71,7 +71,8 @@ void amdgpu_pm_acpi_event_handler(struct adev->pm.ac_power = true; else adev->pm.ac_power = false; - if (adev->powerplay.pp_funcs->enable_bapm) + if (adev->powerplay.pp_funcs && + adev->powerplay.pp_funcs->enable_bapm) amdgpu_dpm_enable_bapm(adev, adev->pm.ac_power); mutex_unlock(&adev->pm.mutex); } From patchwork Fri May 8 12:35:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226170 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C987C47247 for ; Fri, 8 May 2020 13:01:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34DDB21582 for ; Fri, 8 May 2020 13:01:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942865; bh=6MhnXnbtNfLJ0jlaUPyyoCpxL8tqSH1IEalC6dOkG0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ez39M2G63DgfkgGOPMFqC4ElvryFnVJHosdh6a4E63NWAXkzhWqQDFSfTFs6NvMAZ 9Geh8n2MCKTHb/rl9ci+L3CbFOqVMYpBgtsczCPQ7DRzEfHe0smCRDzkUe29auVyR3 Qm44gMVJKWupWkDRuMlQDWWEHkDp5ZcNA/fdI40o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728892AbgEHNBD (ORCPT ); Fri, 8 May 2020 09:01:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:33106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729924AbgEHMwI (ORCPT ); Fri, 8 May 2020 08:52:08 -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 4467524959; Fri, 8 May 2020 12:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942327; bh=6MhnXnbtNfLJ0jlaUPyyoCpxL8tqSH1IEalC6dOkG0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J73+g/+JmFmgqxlLUbJUjTUkVovbjr9u3h3Nn+Y9YUZijysZxeMY/cAG7FYOJ2KB4 sAQ2BjXvvMNirGjISheZWW+cUY6hFcE7rkHs4EtIFP9LFTnPASzV/7htxJ+p1q1tvj 2zqLE2paHdSNn4i2vAxCOHmWbftXNePzxgiRd7AM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig Subject: [PATCH 4.19 26/32] hexagon: clean up ioremap Date: Fri, 8 May 2020 14:35:39 +0200 Message-Id: <20200508123038.724700825@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christoph Hellwig commit ac32292c8552f7e8517be184e65dd09786e991f9 upstream. Use ioremap as the main implemented function, and defined ioremap_nocache to it as a deprecated alias. Signed-off-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman --- arch/hexagon/include/asm/io.h | 11 ++--------- arch/hexagon/kernel/hexagon_ksyms.c | 2 +- arch/hexagon/mm/ioremap.c | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) --- a/arch/hexagon/include/asm/io.h +++ b/arch/hexagon/include/asm/io.h @@ -186,16 +186,9 @@ static inline void writel(u32 data, vola #define mmiowb() -/* - * Need an mtype somewhere in here, for cache type deals? - * This is probably too long for an inline. - */ -void __iomem *ioremap_nocache(unsigned long phys_addr, unsigned long size); +void __iomem *ioremap(unsigned long phys_addr, unsigned long size); +#define ioremap_nocache ioremap -static inline void __iomem *ioremap(unsigned long phys_addr, unsigned long size) -{ - return ioremap_nocache(phys_addr, size); -} static inline void iounmap(volatile void __iomem *addr) { --- a/arch/hexagon/kernel/hexagon_ksyms.c +++ b/arch/hexagon/kernel/hexagon_ksyms.c @@ -33,7 +33,7 @@ EXPORT_SYMBOL(__vmgetie); EXPORT_SYMBOL(__vmsetie); EXPORT_SYMBOL(__vmyield); EXPORT_SYMBOL(empty_zero_page); -EXPORT_SYMBOL(ioremap_nocache); +EXPORT_SYMBOL(ioremap); EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memset); --- a/arch/hexagon/mm/ioremap.c +++ b/arch/hexagon/mm/ioremap.c @@ -22,7 +22,7 @@ #include #include -void __iomem *ioremap_nocache(unsigned long phys_addr, unsigned long size) +void __iomem *ioremap(unsigned long phys_addr, unsigned long size) { unsigned long last_addr, addr; unsigned long offset = phys_addr & ~PAGE_MASK; From patchwork Fri May 8 12:35:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226171 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCE7EC47254 for ; Fri, 8 May 2020 13:00:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E135206D6 for ; Fri, 8 May 2020 13:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942841; bh=W3z8GpEqUg7Gwz4mNu6eXk9h4W8cmjS7GxG53neu7o8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MeeP6lnh6dzTv7HBu0oO6ODaf6wbBOrMqeBW4cjfFJ791WkVdvyH7oJZpZlx6JIRH 4SHmzA7zSNjdi7qRpGXuIZJ2Ph9bV3sUfgVJd/2CL48VSCmfyfo3uSYoqS2cDIXuOt OGQ0QgKD70besvGy2BHc1RSf9c/RpJSWMx6OHkWg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727779AbgEHNAk (ORCPT ); Fri, 8 May 2020 09:00:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:33312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729943AbgEHMwP (ORCPT ); Fri, 8 May 2020 08:52:15 -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 64D2624966; Fri, 8 May 2020 12:52:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942334; bh=W3z8GpEqUg7Gwz4mNu6eXk9h4W8cmjS7GxG53neu7o8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1+AOw3Xjl34z/0z5+m6UmnhHXmlBWWGoVf7PgSQ/Sae2odwNLvJzl/2wWtf3uVLE7 sbgoDiivF+walwIyks3v4oG8Q+6AYfsJFyWHSNZNxgT4VoQ4b+w2aI+19Tw1/egiDL gW0d4OJicSkDLaAmfHfzEnXgkF1dXSOhAhB00c7A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Machek , Hans de Goede , Andy Shevchenko Subject: [PATCH 4.19 29/32] platform/x86: GPD pocket fan: Fix error message when temp-limits are out of range Date: Fri, 8 May 2020 14:35:42 +0200 Message-Id: <20200508123039.219831478@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Hans de Goede commit 1d6f8c5bac93cceb2d4ac8e6331050652004d802 upstream. Commit 1f27dbd8265d ("platform/x86: GPD pocket fan: Allow somewhat lower/higher temperature limits") changed the module-param sanity check to accept temperature limits between 20 and 90 degrees celcius. But the error message printed when the module params are outside this range was not updated. This commit updates the error message to match the new min and max value for the temp-limits. Reported-by: Pavel Machek Signed-off-by: Hans de Goede Acked-by: Pavel Machek Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/gpd-pocket-fan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/platform/x86/gpd-pocket-fan.c +++ b/drivers/platform/x86/gpd-pocket-fan.c @@ -128,7 +128,7 @@ static int gpd_pocket_fan_probe(struct p for (i = 0; i < ARRAY_SIZE(temp_limits); i++) { if (temp_limits[i] < 20000 || temp_limits[i] > 90000) { - dev_err(&pdev->dev, "Invalid temp-limit %d (must be between 40000 and 70000)\n", + dev_err(&pdev->dev, "Invalid temp-limit %d (must be between 20000 and 90000)\n", temp_limits[i]); temp_limits[0] = TEMP_LIMIT0_DEFAULT; temp_limits[1] = TEMP_LIMIT1_DEFAULT; From patchwork Fri May 8 12:35:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6520C47254 for ; Fri, 8 May 2020 13:00:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C449E2054F for ; Fri, 8 May 2020 13:00:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942838; bh=JHAyR1rXewyMOi4+Su+aR4P3GSO/D2yYLZmakxJMl5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tQWKxi1l1G9iEGaBWSvaiMWJysf8r4kF/H09ORTRIQowpJzK/kI04lWxWaGjWnX3R BxCmQlZ2IjquV2/gk+XBAarBA3tlCRGNKCi/zZHRNUUWbJezX1ERz+M8MvXOzsfQ10 m5gDyChWIt169e184u3VjaNqEP3Aq/idy36nF5LE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728436AbgEHNAd (ORCPT ); Fri, 8 May 2020 09:00:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:33344 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728311AbgEHMwR (ORCPT ); Fri, 8 May 2020 08:52:17 -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 CC77524959; Fri, 8 May 2020 12:52:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942337; bh=JHAyR1rXewyMOi4+Su+aR4P3GSO/D2yYLZmakxJMl5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fu/qfTUTLs54uI9fbvMlr+LVZj4myJLhQqbqDSomrs/FhtjWvnFs/FCVQtFs2YiOG EiBFtbMOGfx+/Khf3BHuNH0smceIHsd3muM066wseklHh3WXl9H46NZFMCMGTrMHgO 9jlVz+XUSXiyb+Z10JpsU/qsuEU9s7NG2tyyQWVw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Pedersen , Johannes Berg Subject: [PATCH 4.19 30/32] mac80211: add ieee80211_is_any_nullfunc() Date: Fri, 8 May 2020 14:35:43 +0200 Message-Id: <20200508123039.379703489@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Thomas Pedersen commit 30b2f0be23fb40e58d0ad2caf8702c2a44cda2e1 upstream. commit 08a5bdde3812 ("mac80211: consider QoS Null frames for STA_NULLFUNC_ACKED") Fixed a bug where we failed to take into account a nullfunc frame can be either non-QoS or QoS. It turns out there is at least one more bug in ieee80211_sta_tx_notify(), introduced in commit 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing"), where we forgot to check for the QoS variant and so assumed the QoS nullfunc frame never went out Fix this by adding a helper ieee80211_is_any_nullfunc() which consolidates the check for non-QoS and QoS nullfunc frames. Replace existing compound conditionals and add a couple more missing checks for QoS variant. Signed-off-by: Thomas Pedersen Link: https://lore.kernel.org/r/20200114055940.18502-3-thomas@adapt-ip.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- include/linux/ieee80211.h | 9 +++++++++ net/mac80211/mlme.c | 2 +- net/mac80211/rx.c | 8 +++----- net/mac80211/status.c | 5 ++--- net/mac80211/tx.c | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -623,6 +623,15 @@ static inline bool ieee80211_is_qos_null } /** + * ieee80211_is_any_nullfunc - check if frame is regular or QoS nullfunc frame + * @fc: frame control bytes in little-endian byteorder + */ +static inline bool ieee80211_is_any_nullfunc(__le16 fc) +{ + return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)); +} + +/** * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU * @fc: frame control field in little-endian byteorder */ --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -2384,7 +2384,7 @@ void ieee80211_sta_tx_notify(struct ieee if (!ieee80211_is_data(hdr->frame_control)) return; - if (ieee80211_is_nullfunc(hdr->frame_control) && + if (ieee80211_is_any_nullfunc(hdr->frame_control) && sdata->u.mgd.probe_send_count > 0) { if (ack) ieee80211_sta_reset_conn_monitor(sdata); --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1373,8 +1373,7 @@ ieee80211_rx_h_check_dup(struct ieee8021 return RX_CONTINUE; if (ieee80211_is_ctl(hdr->frame_control) || - ieee80211_is_nullfunc(hdr->frame_control) || - ieee80211_is_qos_nullfunc(hdr->frame_control) || + ieee80211_is_any_nullfunc(hdr->frame_control) || is_multicast_ether_addr(hdr->addr1)) return RX_CONTINUE; @@ -1753,8 +1752,7 @@ ieee80211_rx_h_sta_process(struct ieee80 * Drop (qos-)data::nullfunc frames silently, since they * are used only to control station power saving mode. */ - if (ieee80211_is_nullfunc(hdr->frame_control) || - ieee80211_is_qos_nullfunc(hdr->frame_control)) { + if (ieee80211_is_any_nullfunc(hdr->frame_control)) { I802_DEBUG_INC(rx->local->rx_handlers_drop_nullfunc); /* @@ -2244,7 +2242,7 @@ static int ieee80211_drop_unencrypted(st /* Drop unencrypted frames if key is set. */ if (unlikely(!ieee80211_has_protected(fc) && - !ieee80211_is_nullfunc(fc) && + !ieee80211_is_any_nullfunc(fc) && ieee80211_is_data(fc) && rx->key)) return -EACCES; --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -487,8 +487,7 @@ static void ieee80211_report_ack_skb(str rcu_read_lock(); sdata = ieee80211_sdata_from_skb(local, skb); if (sdata) { - if (ieee80211_is_nullfunc(hdr->frame_control) || - ieee80211_is_qos_nullfunc(hdr->frame_control)) + if (ieee80211_is_any_nullfunc(hdr->frame_control)) cfg80211_probe_status(sdata->dev, hdr->addr1, cookie, acked, info->status.ack_signal, @@ -867,7 +866,7 @@ static void __ieee80211_tx_status(struct I802_DEBUG_INC(local->dot11FailedCount); } - if ((ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)) && + if (ieee80211_is_any_nullfunc(fc) && ieee80211_has_pm(fc) && ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS) && !(info->flags & IEEE80211_TX_CTL_INJECTED) && --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -300,7 +300,7 @@ ieee80211_tx_h_check_assoc(struct ieee80 if (unlikely(test_bit(SCAN_SW_SCANNING, &tx->local->scanning)) && test_bit(SDATA_STATE_OFFCHANNEL, &tx->sdata->state) && !ieee80211_is_probe_req(hdr->frame_control) && - !ieee80211_is_nullfunc(hdr->frame_control)) + !ieee80211_is_any_nullfunc(hdr->frame_control)) /* * When software scanning only nullfunc frames (to notify * the sleep state to the AP) and probe requests (for the From patchwork Fri May 8 12:35:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 226223 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBF3AC47257 for ; Fri, 8 May 2020 12:52:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 945432495C for ; Fri, 8 May 2020 12:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942341; bh=0JdQPdHvUAwfNehrZPdJ0HV1zrRmpMt3IIEHaznFoDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mAJvAK/QkJDQ3dtElRvc+Je+3UA7Xkl1m8s27+iNt95Kd+zMZJO6A/txYtOSmJjNi hACTBbUpn7m1pA6GPj8FUo9AwdR398WfGAnYrc/mD64nrLDqD9W8uRHmi46D9nSw5L 6mgUngtMyxJWIhIctKu3Vv07vZ0SbQj/nUHYCUrg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729945AbgEHMwU (ORCPT ); Fri, 8 May 2020 08:52:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:33406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729941AbgEHMwU (ORCPT ); Fri, 8 May 2020 08:52:20 -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 4B2E924959; Fri, 8 May 2020 12:52:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942339; bh=0JdQPdHvUAwfNehrZPdJ0HV1zrRmpMt3IIEHaznFoDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GOIgViViyWd2V/yeI1BZdAdcK5G+LktczA8lcUG5LFx70Z1yN4WqQFSAg4yYL5ToP rVJ7qCA4lzPMrdybpSoyv9b9NpEypPHiifA7pEXkoI5twdi5l+c1UoT1wfOojl6/sC KDg7useG/F0mxhcViwuAcqCDWVm15GmVyEZD0TTc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Slaby , Dmitry Yakunin , Konstantin Khlebnikov , "David S. Miller" Subject: [PATCH 4.19 31/32] cgroup, netclassid: remove double cond_resched Date: Fri, 8 May 2020 14:35:44 +0200 Message-Id: <20200508123039.570048930@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123034.886699170@linuxfoundation.org> References: <20200508123034.886699170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jiri Slaby commit 526f3d96b8f83b1b13d73bd0b5c79cc2c487ec8e upstream. Commit 018d26fcd12a ("cgroup, netclassid: periodically release file_lock on classid") added a second cond_resched to write_classid indirectly by update_classid_task. Remove the one in write_classid. Signed-off-by: Jiri Slaby Cc: Dmitry Yakunin Cc: Konstantin Khlebnikov Cc: David S. Miller Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/netclassid_cgroup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/net/core/netclassid_cgroup.c +++ b/net/core/netclassid_cgroup.c @@ -131,10 +131,8 @@ static int write_classid(struct cgroup_s cs->classid = (u32)value; css_task_iter_start(css, 0, &it); - while ((p = css_task_iter_next(&it))) { + while ((p = css_task_iter_next(&it))) update_classid_task(p, cs->classid); - cond_resched(); - } css_task_iter_end(&it); return 0;