From patchwork Sun Dec 29 17:17:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 182539 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5446844ild; Sun, 29 Dec 2019 09:30:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxBHF8WppP9U/1bs7EYRclhp4kDKBBOl/dmjbcGzr3XHXBos7TauDedCRcNbDDUFsM44eBU X-Received: by 2002:a05:6830:20c6:: with SMTP id z6mr65916567otq.272.1577640610059; Sun, 29 Dec 2019 09:30:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577640610; cv=none; d=google.com; s=arc-20160816; b=B8inI63RmwaAqo7TCHqq5lmTNiNhpMkXgUEeJnElWlI+XNBay1G53gpFXqHtU0vM2y ymNOLi9/kLcOrP6oekslfRwtt4d9I8Ml+fLR8H7uc1u6iKMHNxcXcYShDrsCcxB020YU Z4+21MGGrCrqxG5Z7e2bvqTqinZ8CaSKAOef/nMTjuXKbBSP+wvUH7zZhgHpcsh0/fD7 7tCKIHpyjehiYg8Kj8y2ZXIN3jFl7/DPqppjvuuJzrkxzsQTGTh9t9TvksfryVGzzoQs D7NhM3WrWeP8c8gNltOaiTIS0r80hEMaC+cDsAml5V9pKHoszFv4Eo59g3Er6KFbp3n3 Kn8A== 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=8nM4oPzBznc/E/NatSLtX8SMBKOgI+GfAqdaRe1xOeA=; b=UToJEXKdKdW+SCjw5Hk7AkwNwBoSIfXJ5Sw2LQ6uhk8SUxi6OpE+jXSG2l1iTdBsQh ESXBftEWl/URXv/ymaRjdPtUIgZvMHSK/rw9mIFNPSTRIC21J2pyveOddTXS9bOrUjLn xHymEsDzbuISVogwsBSIWQ1J+NxhoHdEg/mcij7gNEjqHCCWPzfd7BE9udFSfrptFmPa vaeAk9IIygbjgLKdhdkwQxZFw7eXeVe52GeVgt8bRqulHb4p0HGNun+VqqeuxIv0FCdO tDQ9SymGaqugHRBeRhFiEmJetFnBhlsFPDmKPcPClWLn+femU6rd7c2tjbMXUhdLM5Gw GqjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jZeUldcF; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si459222oie.74.2019.12.29.09.30.09; Sun, 29 Dec 2019 09:30:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jZeUldcF; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728913AbfL2RaJ (ORCPT + 14 others); Sun, 29 Dec 2019 12:30:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:55554 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728843AbfL2RaE (ORCPT ); Sun, 29 Dec 2019 12:30:04 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0821A20722; Sun, 29 Dec 2019 17:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640603; bh=2mELMA7+IYIye6ehOomFskH1dETTtE40+RJWTuQmDBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jZeUldcFHKiU12FPzu7N4yNWvwTqZ9ZJZMoXe7cKWycypChz8HsLc5oZhFbXGN0AD b5oCC5zzCgenkI7fG3ZowLkcUpM8EpxJ4Igg/V69D0gn5Kc9h2ve17BA6Fso2Y8gvz Onp9wVW6HwYyssStEhwK+eHMQSqNCjVJXzMNl2O8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Loic Poulain , Stanimir Varbanov , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.19 046/219] media: venus: core: Fix msm8996 frequency table Date: Sun, 29 Dec 2019 18:17:28 +0100 Message-Id: <20191229162514.740141876@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@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: Loic Poulain [ Upstream commit c690435ed07901737e5c007a65ec59f53b33eb71 ] In downstream driver, there are two frequency tables defined, one for the encoder and one for the decoder: /* Encoders / <972000 490000000 0x55555555>, / 4k UHD @ 30 / <489600 320000000 0x55555555>, / 1080p @ 60 / <244800 150000000 0x55555555>, / 1080p @ 30 / <108000 75000000 0x55555555>, / 720p @ 30 */ /* Decoders / <1944000 490000000 0xffffffff>, / 4k UHD @ 60 / < 972000 320000000 0xffffffff>, / 4k UHD @ 30 / < 489600 150000000 0xffffffff>, / 1080p @ 60 / < 244800 75000000 0xffffffff>; / 1080p @ 30 */ It shows that encoder always needs a higher clock than decoder. In current venus driver, the unified frequency table is aligned with the downstream decoder table which causes performance issues in encoding scenarios. Fix that by aligning frequency table on worst case (encoding). Signed-off-by: Loic Poulain Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/qcom/venus/core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 5b8350e87e75..60069869596c 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -430,10 +430,11 @@ static const struct venus_resources msm8916_res = { }; static const struct freq_tbl msm8996_freq_table[] = { - { 1944000, 490000000 }, /* 4k UHD @ 60 */ - { 972000, 320000000 }, /* 4k UHD @ 30 */ - { 489600, 150000000 }, /* 1080p @ 60 */ - { 244800, 75000000 }, /* 1080p @ 30 */ + { 1944000, 520000000 }, /* 4k UHD @ 60 (decode only) */ + { 972000, 520000000 }, /* 4k UHD @ 30 */ + { 489600, 346666667 }, /* 1080p @ 60 */ + { 244800, 150000000 }, /* 1080p @ 30 */ + { 108000, 75000000 }, /* 720p @ 30 */ }; static const struct reg_val msm8996_reg_preset[] = { From patchwork Sun Dec 29 17:17:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 182550 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5455929ild; Sun, 29 Dec 2019 09:41:08 -0800 (PST) X-Google-Smtp-Source: APXvYqyyskC8O/NTCWD3SfKXiFzNlmy/s3TCT04ZKBk8ljoJ3frOf29zoiGCOU5dmUjoEWHpbg5T X-Received: by 2002:a9d:6b12:: with SMTP id g18mr67329197otp.211.1577641268365; Sun, 29 Dec 2019 09:41:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641268; cv=none; d=google.com; s=arc-20160816; b=AwNxxaLXes4J0oDV73PcCa9mSTyHc4HXgA6bSBiOn1TfVXpSYvN/WH9qM/LhBMKIwh Ok45JBAON7PdTk5MpcTpJxylrCorFUz7khOr0rHtopeZcwQn/dplAAMZGSkR8rKcTfq7 lRiGlDYrIc33he6jjinhK4A+bmX7lh6vbh4EbecXdztz1Fv17s8r5P9gw+y6Yoa9jJLs mFHIr5lcyeSTTV8shj0q0HsldB8pBS0ry2B+o2iFgrp/Sud2x4DRsY39BvHgT/4gR+Aj Aq2iiyLLfCDw56K5lU6Fi9lrNDMCC2n41fjbEQyGkXF44bUJcpEe3b1XPdiJW/7ZxJ2T 0odA== 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=cUSWlA3Fz7HS92QT5Y8BIogA7yasF5TSxB+sT5vtuY8=; b=CijrHCJP2+qNczrGMLbq/vQAQMM/DmK0TDVX4XpoS8b0f6C01hKKjQ3VVvrO/MwUZJ YiFnnDchW0b3p679ej56h93Lf9LBtWiBdJIYxOnjbTJm3m3LGxF08brvn7yenN+aNH6t fOODjy2wNkemYdiKqYQIRTQQ/jJJ0OU9IFVOwm5XNV8iwTIkUOezpkLZ1AYZmADbWZJS nEQlRjsRHVszHHKkoEWnsrHt1VfwDll3b3gZp/63ZmbKAFL3xhO4fQATEBATh9VQoV1u WZOY9o0ZL5hqYKZCHB34yNKX3e9lHkPFpUvNrHnkvNGvW3LnEJ0JgZR2okk2UyOevf6j 0z5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZpMAJSwx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n139si20668398oig.121.2019.12.29.09.41.08; Sun, 29 Dec 2019 09:41:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZpMAJSwx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729999AbfL2RlG (ORCPT + 14 others); Sun, 29 Dec 2019 12:41:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:56858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728414AbfL2Rag (ORCPT ); Sun, 29 Dec 2019 12:30:36 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ECD3720722; Sun, 29 Dec 2019 17:30:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640635; bh=xgfG21dEu0LH+RzJCNRvuC1/quwx7EIbl/cBnZNiFUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZpMAJSwxAQmign0cLqI71T/2NzALDl+FhdJgiM3uzAjeoXLlVy5jTcml3/wznsAaV iwB7S7nbnOCFySDm6y0aG+Bnb6O54b751x1okVWt8F6Ja7yfQDiPNJj+okxfvCHtR2 5P+rf7Gyb5MyjnijoZjTsHljmsmhFjUlwVhHdQTw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Niklas Cassel , Bjorn Andersson , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 075/219] ath10k: Correct error handling of dma_map_single() Date: Sun, 29 Dec 2019 18:17:57 +0100 Message-Id: <20191229162517.375855022@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@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: Bjorn Andersson [ Upstream commit d43810b2c1808ac865aa1a2a2c291644bf95345c ] The return value of dma_map_single() should be checked for errors using dma_mapping_error() and the skb has been dequeued so it needs to be freed. This was found when enabling CONFIG_DMA_API_DEBUG and it warned about the missing dma_mapping_error() call. Fixes: 1807da49733e ("ath10k: wmi: add management tx by reference support over wmi") Reported-by: Niklas Cassel Signed-off-by: Bjorn Andersson Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/mac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 174e0ce31c42..448e3a8c33a6 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3844,8 +3844,10 @@ void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work) ar->running_fw->fw_file.fw_features)) { paddr = dma_map_single(ar->dev, skb->data, skb->len, DMA_TO_DEVICE); - if (!paddr) + if (dma_mapping_error(ar->dev, paddr)) { + ieee80211_free_txskb(ar->hw, skb); continue; + } ret = ath10k_wmi_mgmt_tx_send(ar, skb, paddr); if (ret) { ath10k_warn(ar, "failed to transmit management frame by ref via WMI: %d\n", From patchwork Sun Dec 29 17:17:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 182540 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5447354ild; Sun, 29 Dec 2019 09:30:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxlMR4bdVdLR4r27NrxzJjUs/ut8239AXFMDA5muYGRyQs9MYjr2lCh/zkeWyZD8q7K8h46 X-Received: by 2002:a05:6830:16d1:: with SMTP id l17mr48247431otr.21.1577640643559; Sun, 29 Dec 2019 09:30:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577640643; cv=none; d=google.com; s=arc-20160816; b=VTGHfXoIePGVUEHBF/Z9bAizQWP9yObxlwHFwG0W9/v02nndXdkVlAaFiqcFC5vh9K Fnz5eANXsmZ796AQ/3nSv6H/RcmQiNum0aTcm85ppLiuYHQ27GCdHuVrY2RK5UwC39h6 0jpmPXwGFgmxrqioogWcOnIHMGOQV3ID4NJA48Yxq3+H7IjRRsuF/CSEz2a3046doWmp eTueIqyQOJQNY+bLKVsAh5Ry3UtUgUIa66fxCyrszIvPO9OZ4GaLKR7Y0sn+8jZddEwz cVdVTieiSoIwkQcDlN9XMxXhdo8Y3Vy4cFJU56oZYgxaNTetXFbcMBJBN0UJvGD72PME ausQ== 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=b1lB0wMAGOVCnUxul7+oi3EAt/Nyma3wAqB8bS/o+U8=; b=RsjRTAk/D9cqYvtiwm1neIfOzRyt4t0UJWHkHVgMX7LJqPq1sAaGLf1hzg4mM8PkvR yjMJ8i8ZeyQibETRgl2Wve734XJpC8Dq+Vks47qPjhSgfFomyLcTu2TvAdZZvrDOiW8/ 9YMK8mY2rRBnxZmD57aXtoVZqapX9RXUH5vnePg+Y8GXZD48Jz6ck6u655eMGPutsKR7 v/9SVPd7ucfE1TVh9eRiUB+6u+1Nro/AkykiGsopLxY2rsWKsOUP0ZAiRIQpMDhTXg1q YMzuJC2Zpd9xYyjwGbgZhCTcmDOIKmVu09Sh9NlxtQ0Co8/GNDwSR88JK29p5hczve3U Ldwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TzX9LG70; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9si23398513otq.315.2019.12.29.09.30.43; Sun, 29 Dec 2019 09:30:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TzX9LG70; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728716AbfL2Ram (ORCPT + 14 others); Sun, 29 Dec 2019 12:30:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:57022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728740AbfL2Ral (ORCPT ); Sun, 29 Dec 2019 12:30:41 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EC7DC208E4; Sun, 29 Dec 2019 17:30:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640640; bh=F+RVtGEVmdod50DfTH1VyNi8CRxmTqjjFgd97kF6+zU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TzX9LG70BOjc+bcLzvQFQ+LU0OfSxHA/ahCXqiytZeYDR/H5o1iRjLmlzhxwHaLOf TD0RsPylpXwXuoqkxom5jQoxRgiu7fEctyHPlOks1tD+aVxl3YtrwC+2MAJTVSQMsz ga66bgOpuLKxkYXApWqR6rXV3peLt/ZeNsd1aGLw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leo Yan , Alexander Shishkin , Jiri Olsa , Mark Rutland , Namhyung Kim , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.19 077/219] perf test: Report failure for mmap events Date: Sun, 29 Dec 2019 18:17:59 +0100 Message-Id: <20191229162517.555116819@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@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: Leo Yan [ Upstream commit 6add129c5d9210ada25217abc130df0b7096ee02 ] When fail to mmap events in task exit case, it misses to set 'err' to -1; thus the testing will not report failure for it. This patch sets 'err' to -1 when fails to mmap events, thus Perf tool can report correct result. Fixes: d723a55096b8 ("perf test: Add test case for checking number of EXIT events") Signed-off-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20191011091942.29841-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/tests/task-exit.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index e92fa6029ac7..788b0805d2f1 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c @@ -105,6 +105,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused if (perf_evlist__mmap(evlist, 128) < 0) { pr_debug("failed to mmap events: %d (%s)\n", errno, str_error_r(errno, sbuf, sizeof(sbuf))); + err = -1; goto out_delete_evlist; } From patchwork Sun Dec 29 17:19:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 182545 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5450372ild; Sun, 29 Dec 2019 09:34:00 -0800 (PST) X-Google-Smtp-Source: APXvYqwW1vIzNOujLyI51IHAcv1qvQ8lEcxbuWfHEHZ/xuAUdkT487bT0+ZirjV731uPMI0McxGt X-Received: by 2002:a9d:2028:: with SMTP id n37mr72696374ota.127.1577640840345; Sun, 29 Dec 2019 09:34:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577640840; cv=none; d=google.com; s=arc-20160816; b=wSTrJbSeFbV+9mfN5F/ls6rjM7YmXVo2YD+0dKJr5UBpnNshTWwVz75CDxvpU7iAu3 CLD9hbOLgdZwpf8PJ8Z3GCbdiqIwgUvbItJr0l9gaFYv4oml3lXkfmC+mggr0WEzlAZ+ oIFbgl85qGfv1pHrZxHoqVzOmOje6+75UEQM7qRAjs2SUyDGepdA5Z2lnJOttz4SuE/7 XAKIdsX1m9+3Ncs3ys0NXYBM+9piMSPSjiNmITUtD4P7ipX5hSqjDr37yB7NkcahCuZ5 LDFRwXYSo0AFLL176AtNaN3omgg8lXTbmyqsgwlTAeplifXXLuwEW3YgGQkwvPYwHkKZ qK9A== 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=gHUeP7V+20e8CXvAcGlm3kqOdyllhfCOqD3P1h1Ol50=; b=DlbhRLNZ9GXWGV27zG/GiUpkUv7d/Iu3SlebKSSzEwfcf6YzOT2s9RYhmOcUbbBAxz gCdptEGjbqJmr+9xiLbfpuRSMkqp0ySIHRMHoOeKeXHm07+VTq7miRXemo7amgk+86s0 q1Ap25VbgbZnKEue1IcBJzmB1f9WLZSRGav6wtsLZHrNpZJs7AJNNpYCX4COAEUxnoyH APJr0Y2EQq/C1ivYFjjtJQR2LQP9MiL8tCF2otnqmFFSa8tthjL1WwC7L7ZOAcbzM7lg goQVCkLcGc8+fz2Hif34X729xNyqq2d7dtFnCCIe5UYN0rwnXfSxIMneq5GlJkBW0kma lddA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZeuWt3MX; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13si15011938otp.164.2019.12.29.09.34.00; Sun, 29 Dec 2019 09:34:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZeuWt3MX; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729552AbfL2Rd7 (ORCPT + 14 others); Sun, 29 Dec 2019 12:33:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:36416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729535AbfL2Rd6 (ORCPT ); Sun, 29 Dec 2019 12:33:58 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2F92520722; Sun, 29 Dec 2019 17:33:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640837; bh=lpKrn/z464txxM/CiCqCNfrmIYaLTF+arTlZnHGXzXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZeuWt3MXlpKOFg5O2eeQVYsTrk4Per7vayrFJscRDlZepxTqE/hYtp/4JN3F32nlN PRPtfzXUr7GyRJYXThqw0m+/uGU9Cy/erYYhZTA8gq9pUbl9m1CjMhnbniwsG+ZTIh j6fdtgtFrf5+r+Qr3FHPI4Ey2sUNfI8/CMApr3PI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Viresh Kumar , Amit Kucheria , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.19 158/219] cpufreq: Register drivers only after CPU devices have been registered Date: Sun, 29 Dec 2019 18:19:20 +0100 Message-Id: <20191229162532.386006575@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@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: Viresh Kumar [ Upstream commit 46770be0cf94149ca48be87719bda1d951066644 ] The cpufreq core heavily depends on the availability of the struct device for CPUs and if they aren't available at the time cpufreq driver is registered, we will never succeed in making cpufreq work. This happens due to following sequence of events: - cpufreq_register_driver() - subsys_interface_register() - return 0; //successful registration of driver ... at a later point of time - register_cpu(); - device_register(); - bus_probe_device(); - sif->add_dev(); - cpufreq_add_dev(); - get_cpu_device(); //FAILS - per_cpu(cpu_sys_devices, num) = &cpu->dev; //used by get_cpu_device() - return 0; //CPU registered successfully Because the per-cpu variable cpu_sys_devices is set only after the CPU device is regsitered, cpufreq will never be able to get it when cpufreq_add_dev() is called. This patch avoids this failure by making sure device structure of at least CPU0 is available when the cpufreq driver is registered, else return -EPROBE_DEFER. Reported-by: Bjorn Andersson Co-developed-by: Amit Kucheria Signed-off-by: Viresh Kumar Tested-by: Amit Kucheria Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/cpufreq/cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.20.1 diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 9d8d64f706e0..e35c397b1259 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2480,6 +2480,13 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) if (cpufreq_disabled()) return -ENODEV; + /* + * The cpufreq core depends heavily on the availability of device + * structure, make sure they are available before proceeding further. + */ + if (!get_cpu_device(0)) + return -EPROBE_DEFER; + if (!driver_data || !driver_data->verify || !driver_data->init || !(driver_data->setpolicy || driver_data->target_index || driver_data->target) || From patchwork Sun Dec 29 17:19:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 182546 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5452275ild; Sun, 29 Dec 2019 09:36:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwWU8/2bMWipaaUldlnFpeE8DFW+T6eTlVbWI52vDjUxIg5q4KQzoQIOePho1CzlmQhp59F X-Received: by 2002:a9d:60c4:: with SMTP id b4mr46480793otk.166.1577640982646; Sun, 29 Dec 2019 09:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577640982; cv=none; d=google.com; s=arc-20160816; b=YSfLoJo7vcsz3CLmet7I8PMrxFNBl+aM2Kd83RLLrRhWRYt34K1o9Ke5JPuifdu8n7 LZqLUGlsP0YshAitZcIfF0MW6/bgeJbmKhuTDrSlAnUKM0SavULODlAklZzYNxM+T55S yS9+hMvdJY5eLkgJ0K3feqkrsw7mpJGhNpbQ8SScN52v+DkFpbdtydUL+QRl9lC1Uc9I oqyy/7PtT2ciw23Ki8wAjwGKrmvjv3UQf0TiUgGFRvahz+9i7r0+hJkOZHMb+3sOdqEa aj08gGuuDDihorIOXnGuSSd5nkivUbUduWlMVj8vCYRc1ZHIuu3lTlAI7QXoX+nTzWGn NKnQ== 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=aAzjYgjBHME2ADS+J8dawMO+OExYroQMjWa9IYyQKlY=; b=du/3yPZ3Cs/eYMJaEdMU3LvoJtQar+hER7mtscqvRE3o6Qrkk2Cx4hJoRx0R9V5yN8 qOlZM2MKh0C4mz+3S9qs0TsKixacRezVUVE/ijZCHwyL4N/DshPzaWdboBL0yKK0UEhT 8BQdMXdcCNmgFXXFA5Y3MEVIgG7xsa6jPqg6qa71EALSKdYicM8Y2V88VsNXrJHJZYbf 4rZZyYGD0K5i4XjXU9kRGJ4U7S++zX0U4W28Jc9c9jrKL94guyHCwPiE+o9rFOGodSMc iFXz5KulxPNoc2BgOsC3GX8ViN0Es4o6cUsGFKtg3gtupm8KEamB3aroCwfrwOi/BYIb Bnfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BwUx2adC; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9si22251099otl.138.2019.12.29.09.36.22; Sun, 29 Dec 2019 09:36:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BwUx2adC; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729714AbfL2RgU (ORCPT + 14 others); Sun, 29 Dec 2019 12:36:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:41552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729783AbfL2RgU (ORCPT ); Sun, 29 Dec 2019 12:36:20 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 727B3206DB; Sun, 29 Dec 2019 17:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640979; bh=eT8nQbw1fEvyijJbgQGTWYfh/0VMvBoz56DGwb4sp+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BwUx2adCxuXe3QoXhq0IUo1qbemg05jg94VkFzkCC26lyBnRemjhW5KwIgAYRgYAb h7eVEoUX4hXsxlpFHclOjjHFbzbR5uNG8uOrJYrkcon/ChelgbLrN2oKf7w4HBfHjy dyHq/6eeQ7zgW5lmbr6+Hj80ov0cs6RjrFJr4Q5s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Grygorii Strashko , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 179/219] net: ethernet: ti: ale: clean ale tbl on init and intf restart Date: Sun, 29 Dec 2019 18:19:41 +0100 Message-Id: <20191229162536.004120213@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@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: Grygorii Strashko [ Upstream commit 7fe579dfb90fcdf0c7722f33c772d5f0d1bc7cb6 ] Clean CPSW ALE on init and intf restart (up/down) to avoid reading obsolete or garbage entries from ALE table. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ti/cpsw_ale.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.20.1 diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c index 5766225a4ce1..c245629a38c7 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.c +++ b/drivers/net/ethernet/ti/cpsw_ale.c @@ -793,6 +793,7 @@ EXPORT_SYMBOL_GPL(cpsw_ale_start); void cpsw_ale_stop(struct cpsw_ale *ale) { del_timer_sync(&ale->timer); + cpsw_ale_control_set(ale, 0, ALE_CLEAR, 1); cpsw_ale_control_set(ale, 0, ALE_ENABLE, 0); } EXPORT_SYMBOL_GPL(cpsw_ale_stop); @@ -877,6 +878,7 @@ struct cpsw_ale *cpsw_ale_create(struct cpsw_ale_params *params) ALE_UNKNOWNVLAN_FORCE_UNTAG_EGRESS; } + cpsw_ale_control_set(ale, 0, ALE_CLEAR, 1); return ale; } EXPORT_SYMBOL_GPL(cpsw_ale_create);