From patchwork Mon Sep 20 16:42:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514358 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2320349jao; Mon, 20 Sep 2021 11:26:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5PLci6FsVKfIXqblHmFN1p05vWJfbUBLZBDHxBH96xU8obPRc0xk5dmVhnPghNiOjIJCn X-Received: by 2002:aa7:db4d:: with SMTP id n13mr30901576edt.398.1632162365191; Mon, 20 Sep 2021 11:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162365; cv=none; d=google.com; s=arc-20160816; b=MmMiJ2nlWRyiHYN3nhMXsOXj2ARAB1dUCoFUAxMWojA4TRef3RjteoQSxDL3OX5A9+ GVBkeoXk14XfS4E25lRiBqNqsPFEVCUmTZcYZ/TzwL2bFUZPXjukPWZTzY93wLislL1K p64YSyTJdOFd9uIGfdFduSXpACeP0COVHtVKVKxe2aPiC6hZ0j4jmk7ubKjZWhszPb6G jOHR7n1VHwpVheqwDIZBqKXJK+30sVaHsAZL3gBPTBWBDSJuhPao4melAsCn08NwL4rX /xv96Lkp8H/pTVjrG/UbmZcqwPMZzHCPSl0/y8pG0kmCTADVq0pLJi94JuF7FAPO175C S6yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=I0nsZvzF7GS9kPDI8KYOE3I53YFH1dwe06OH3GBoch8=; b=OhLAQ7gDXh22QKepFvMF229IVgS6HQ/DIicSzUWN0iDZHBicrRhtVzpC5k1gCgxmqK 2fREgF3XfTb2tZVPbCxUiOr5Mdbi3UkYXPTznr1V4ahUcYcJILjUVXlJmPX9OCxyBz2w 6UhxYq2/QS6HzBtXOb2YF0G1zWzsbjqYdUTEmvr7mrR1sKyX8LiE/7gBsjq2XtuLe440 QnltlDPiGo2DeGL3VaA6NHP2mpJTBEtskEwzJy/pvVeXkRTxMrLo9GZ7kXDMsRQ4jEa4 QU9xZ/3IqCTpdS5MMzwUmnOhkgzdc+b3EVWlU7Mjux2Hu1NrCdv8qh/HUo9dfn6SFtxi O1AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ChnCeAT5; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q5si19421526edh.492.2021.09.20.11.26.04; Mon, 20 Sep 2021 11:26:05 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ChnCeAT5; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378973AbhITS12 (ORCPT + 11 others); Mon, 20 Sep 2021 14:27:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:43766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348137AbhITSZ1 (ORCPT ); Mon, 20 Sep 2021 14:25:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 25F5D632D0; Mon, 20 Sep 2021 17:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158723; bh=Rzk16eFGZCHkcQPmr+mLyNt0vij5JEP7qj3OXPPf9mQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ChnCeAT5dTQbw0u8rW4gq5XR/FIxBsaD+r4VD4WuWxErWyTUb4Yp0dC8Pvl2pCtID Y96oiIkKM2jwBVnqQRl9E0OOyZW+x09puCyF1xIEicbWBBNX5ri07daw9igjqcoS0N BhSTz8lvs4kPg5vSQWJivAMowDxlr4eWk3zwRE5Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , Catalin Marinas Subject: [PATCH 5.10 006/122] arm64/sve: Use correct size when reinitialising SVE state Date: Mon, 20 Sep 2021 18:42:58 +0200 Message-Id: <20210920163915.970625637@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mark Brown commit e35ac9d0b56e9efefaeeb84b635ea26c2839ea86 upstream. When we need a buffer for SVE register state we call sve_alloc() to make sure that one is there. In order to avoid repeated allocations and frees we keep the buffer around unless we change vector length and just memset() it to ensure a clean register state. The function that deals with this takes the task to operate on as an argument, however in the case where we do a memset() we initialise using the SVE state size for the current task rather than the task passed as an argument. This is only an issue in the case where we are setting the register state for a task via ptrace and the task being configured has a different vector length to the task tracing it. In the case where the buffer is larger in the traced process we will leak old state from the traced process to itself, in the case where the buffer is smaller in the traced process we will overflow the buffer and corrupt memory. Fixes: bc0ee4760364 ("arm64/sve: Core task context handling") Cc: # 4.15.x Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210909165356.10675-1-broonie@kernel.org Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/fpsimd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -510,7 +510,7 @@ size_t sve_state_size(struct task_struct void sve_alloc(struct task_struct *task) { if (task->thread.sve_state) { - memset(task->thread.sve_state, 0, sve_state_size(current)); + memset(task->thread.sve_state, 0, sve_state_size(task)); return; } From patchwork Mon Sep 20 16:43:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514361 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2323276jao; Mon, 20 Sep 2021 11:29:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0ooULQWnRGTRU2NvQkTOrfYL7PZlGEB71lvnWfF3dA8JCPD9nyLiFwc0u/tSK1ogzLC4d X-Received: by 2002:a17:906:bcf5:: with SMTP id op21mr30574341ejb.114.1632162578437; Mon, 20 Sep 2021 11:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162578; cv=none; d=google.com; s=arc-20160816; b=opwFJLxPRLRnuJn156bKrEwP/RcsmmkM2JbvrnWJU1b6LEnyI18gd2863wqMjHBBY1 HMhgMme3/0E/TEMtS/i7SdaYTConQhC/cCGBLu5YoOJbwu1zK98vUdRjOn0mGl4yI0oj YlP7xGsUIY9HVz/QzoJ4b1CNrbbsP4rvK0cvfusBkC/hLByK8MycM3S/KSrlFasdc1F0 8PZV9JTZ+a3TQ5VNdtSg1SfLSUZw28USvhSJKzwsZB0K7kJ+DsDblLw99gFstOU/go20 1eZKKI8PxwTSSLjFvI7QW+mbrKEohVpLmxDMDiBKC1KMBGIFjTWH1fhljBRYuDLi9uuS P70w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dJk8dw5BWXHJ+5uyYzptV4DdzBM5KK9pDpBNPFhzraM=; b=Tbkourvj0rMjVMBlO57L+CiilKLSrc8gs/MUg78wpoWsRjUUKRitKlxAEexehTriqV cIrvmiwKbIfogeWNdTDowIm9k7bshAOp7S9r2jNc8wDQhEO25FgNSeTa8Vl+HwZG8iA4 J6UgZFCGg8x/VNoAO+3ikph4mBzLLSQFvWl2wBV6qQL1cvqWwhCjZJZvWih47vUWn7q9 WWrIwlrrEv1XEsCB9y0K2v8SbaDjypLVIIM1JwrYmGBjeUKgfsHAWBs17ZJ1rawvlLdw 4tq1YrohdGNFb96v22JZLZ0jgyFTU54G1bWYIXn9P2Tt17rFLSFko7hz6C/eWsSTj17/ 9HqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zbGmKqr3; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si16911255edi.356.2021.09.20.11.29.38; Mon, 20 Sep 2021 11:29:38 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zbGmKqr3; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348519AbhITSbD (ORCPT + 11 others); Mon, 20 Sep 2021 14:31:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:48138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379306AbhITS26 (ORCPT ); Mon, 20 Sep 2021 14:28:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C2BEE61362; Mon, 20 Sep 2021 17:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158802; bh=8drDd3EAJ6H/8qs3pR5E3EP4p+gz4fhSiFbxHOCXAKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zbGmKqr3k8d40AOi1djLAwRAhyGWYSEO0s+t6pRMf6IA07ko2SGvZ9XGWPTqY7yhp SxQTRN1WZiQkC0ziAsuts+jOEm98i59RkKHwkK7dpZT+E9ZBUpDComvwJtwpm3lqAV 6Q8yQN49tGWmGKorMXdn7mb4TznLhb8/XMPqFFHI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Enric Balletbo i Serra , Linus Torvalds Subject: [PATCH 5.10 030/122] drm/rockchip: cdn-dp-core: Make cdn_dp_core_resume __maybe_unused Date: Mon, 20 Sep 2021 18:43:22 +0200 Message-Id: <20210920163916.789275673@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann commit 040b8907ccf1c78d020aca29800036565d761d73 upstream. With the new static annotation, the compiler warns when the functions are actually unused: drivers/gpu/drm/rockchip/cdn-dp-core.c:1123:12: error: 'cdn_dp_resume' defined but not used [-Werror=unused-function] 1123 | static int cdn_dp_resume(struct device *dev) | ^~~~~~~~~~~~~ Mark them __maybe_unused to suppress that warning as well. [ Not so 'new' static annotations any more, and I removed the part of the patch that added __maybe_unused to cdn_dp_suspend(), because it's used by the shutdown/remove code. So only the resume function ends up possibly unused if CONFIG_PM isn't set - Linus ] Fixes: 7c49abb4c2f8 ("drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume static") Signed-off-by: Arnd Bergmann Reviewed-by: Enric Balletbo i Serra Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/rockchip/cdn-dp-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -1122,7 +1122,7 @@ static int cdn_dp_suspend(struct device return ret; } -static int cdn_dp_resume(struct device *dev) +static __maybe_unused int cdn_dp_resume(struct device *dev) { struct cdn_dp_device *dp = dev_get_drvdata(dev); From patchwork Mon Sep 20 16:43:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514359 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2321364jao; Mon, 20 Sep 2021 11:27:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF+VgWG9YrAKniSlByKIfz7QaFcOy4QajcQ8lAN8/KgZNKgX1m28C1vVEvjoaWvBi+7/1q X-Received: by 2002:a17:906:4452:: with SMTP id i18mr28317507ejp.374.1632162442499; Mon, 20 Sep 2021 11:27:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162442; cv=none; d=google.com; s=arc-20160816; b=UKKMqBYo7mwx1yHJpG/XjGaf0d4PWfxbmSCz76JcijeQTvaCvskXuJC57Le4GgItxb amlcclkkY8qTzKWDY8pzhVYd1bJPQQzAErJeEC8nTzNyVwbzFSPHWsiLp/aiFcjoLUzf 1g2L2qdmzM2f9W5uzgXfeOvISq9euNrGuOFw4nytyBBpDwvL1KMH01kG8P0TsCPM7pbE 6I1E5suJCL/ARxG0FO4oIbC0SPDcljcW2P6ow0PPXWEQPS7cQ2wnDd1ojnki2JlnBKMJ 37Vag4wQJAl745diCZO6ChGK3LkvRF9r1DE+mN/Y0slu/oqEMP6VFtRCqQb7+gjbnZDQ 5+EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aSJ3NakeTddxgF1apn1CcY1VQ/Hpe63ga6sVzynDOBw=; b=suBHAACY2jI6QOgIhVC96Xap1eBBQAPLkMvDu0rvjtldRzqHVBEGAcy2PP0dwKPEpe j1UfJ+xVxNj4BgMAvxVuwkFmwfzm8lolqF36pRZjhRNO7KxChftDIVgEAi49JXqECjyd XY/dZit5SKO+dhEKTcVwis5N00BtmmoAxCYdKFetFQkPKVhGCoUUQUeY5MtPjXvnNpDg 28pZrNhr5R5lEa5cxR8PvGwyLLl07K4sVLOWLw+B4F9kHS71YWAVRwZYzEwQND7vfKwV 4DTb/SY/Hqerryn5+Un2xsxrsPtaDkfcl6JeeEpxkI/RNKC6pAD9n6loPjt09EshwmKF VMCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FCpB672a; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n6si2303844eda.103.2021.09.20.11.27.22; Mon, 20 Sep 2021 11:27:22 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FCpB672a; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348660AbhITS2r (ORCPT + 11 others); Mon, 20 Sep 2021 14:28:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:44432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378765AbhITS0W (ORCPT ); Mon, 20 Sep 2021 14:26:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB8DB6126A; Mon, 20 Sep 2021 17:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158743; bh=T6bfA4lJXrzJMqxed6cF3AHuqdBRgfj7i1mn/NlkoqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FCpB672a7YyyitjttkBem9uvfSCAmYDHK2JohTODJFYia858+XeMcCPy/6jYKu1Vh Cw8TuQbBqp4Bg2MPBIfi6gJ/VLtHpqu1/DDJWOk4vv3fkg880o1FE8eXPVoJKIFciy 8mGUjroBav2tXItX6goMUKY3gqWHNEUhaDY6bBc4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Elder , "David S. Miller" Subject: [PATCH 5.10 036/122] net: ipa: initialize all filter table slots Date: Mon, 20 Sep 2021 18:43:28 +0200 Message-Id: <20210920163916.975682498@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Alex Elder commit b5c102238cea985d8126b173d06b9e1de88037ee upstream. There is an off-by-one problem in ipa_table_init_add(), when initializing filter tables. In that function, the number of filter table entries is determined based on the number of set bits in the filter map. However that count does *not* include the extra "slot" in the filter table that holds the filter map itself. Meanwhile, ipa_table_addr() *does* include the filter map in the memory it returns, but because the count it's provided doesn't include it, it includes one too few table entries. Fix this by including the extra slot for the filter map in the count computed in ipa_table_init_add(). Note: ipa_filter_reset_table() does not have this problem; it resets filter table entries one by one, but does not overwrite the filter bitmap. Fixes: 2b9feef2b6c2 ("soc: qcom: ipa: filter and routing tables") Signed-off-by: Alex Elder Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ipa/ipa_table.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ipa/ipa_table.c +++ b/drivers/net/ipa/ipa_table.c @@ -451,7 +451,8 @@ static void ipa_table_init_add(struct gs * table region determines the number of entries it has. */ if (filter) { - count = hweight32(ipa->filter_map); + /* Include one extra "slot" to hold the filter map itself */ + count = 1 + hweight32(ipa->filter_map); hash_count = hash_mem->size ? count : 0; } else { count = mem->size / IPA_TABLE_ENTRY_SIZE; From patchwork Mon Sep 20 16:43:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514360 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2322875jao; Mon, 20 Sep 2021 11:29:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAIgYLQ2xPlp8fTQ4jlhxGvcEPFE2roUJ+rcsqF593R/ZE0NgnOYZuGAtpocbGUdJ84DnG X-Received: by 2002:a05:6402:1057:: with SMTP id e23mr31386186edu.352.1632162550330; Mon, 20 Sep 2021 11:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162550; cv=none; d=google.com; s=arc-20160816; b=QmrQRvEr5+6qoSPOQVfAsYRnBzB1No7rALzjaMXlosYTGWbCeDEK+X/e0CwSg7V87l JSFAbKPXtWQieRUeklbw0vTp+H8MEOw1iYNh1qDEd17+olA+aNfgdUz+DSg4QXTBFRkh oXVSlApu20aVukhI9x3kl6O5hIMNVVuH8IB9vX4c0rbXIs8P18HvKHkimGG2cqWmutwT t58QHkSLCfRaHPBhDtnSoDCEmoJlgbHvjk7qp9qjxh2X8nWJYfZ8g10a8nmsNhrYNI/b PlYp1geyG5zzUAC2LUc8Wt/207OF7lUKpyYk7VdCKaGDCgu6KQsbn4Wz9Llk8cPqIstZ Ip1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+8tQVupKpvNSqZejxizFVtDknoj4X0Fymbv4FxvxIXk=; b=cS5/IvfAiazLaIOVwaG5has/p9KjL9IunRpRMqq2d2qG87BBndIejIDkYgVS+2BXfp EqcdTOtxuhvG6yWMYe84tQjJ+MQ0RxzEL2dM5OCWULrXGUEBpTj9SqktoKIRTgR3qTFr CNWPuBG51czHUITbUDnCaDTUmF7lxvOAP4ywL2+zGQbyr0fmjgPsUty4EJVmAkPvoe8U Y8GI0YchRzQroLHkKNT/iyjKHwIQoY1XxIOCtdjnQp7rf+lGBEPTVyE/W281tkSQN6iM 0DvKNwDFFcZ0ghQF9N4BFf8iFCEv+1LT8VTDPH+IlfKQrZk1xZTKGg7Phfr4lBiyOiKm uFSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hM5jwCxu; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si10842996edf.22.2021.09.20.11.29.10; Mon, 20 Sep 2021 11:29:10 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hM5jwCxu; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379800AbhITSac (ORCPT + 11 others); Mon, 20 Sep 2021 14:30:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:49302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379165AbhITS21 (ORCPT ); Mon, 20 Sep 2021 14:28:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E231C632E2; Mon, 20 Sep 2021 17:26:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158791; bh=GzxPKoFSUPqjQDPedCrh21+0h4qkVoTJdFaYoAVuqa8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hM5jwCxuGgXiijLhd0g2Iq4aeZOQvHmXtBJLef9le4YqDdWGlsVHDPcqSd7/r0bBG sLr3N23Ooh4Ze0x58fBbObi+kHoN/eQFx2jw559zXuYvQ7xG1KIW/5b9fQNQGoxcxx tOI/zGsLXyim/7I2j8FBgGx4+bQBdmW2XB5FhD1g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, phone-devel@vger.kernel.org, Linus Walleij , Lee Jones , Sasha Levin Subject: [PATCH 5.10 056/122] mfd: db8500-prcmu: Adjust map to reality Date: Mon, 20 Sep 2021 18:43:48 +0200 Message-Id: <20210920163917.622342639@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij [ Upstream commit ec343111c056ec3847800302f6dbc57281f833fa ] These are the actual frequencies reported by the PLL, so let's report these. The roundoffs are inappropriate, we should round to the frequency that the clock will later report. Drop some whitespace at the same time. Cc: phone-devel@vger.kernel.org Signed-off-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/db8500-prcmu.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) -- 2.30.2 diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index a5983d515db0..8d5f8f07d8a6 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -1622,22 +1622,20 @@ static long round_clock_rate(u8 clock, unsigned long rate) } static const unsigned long db8500_armss_freqs[] = { - 200000000, - 400000000, - 800000000, + 199680000, + 399360000, + 798720000, 998400000 }; /* The DB8520 has slightly higher ARMSS max frequency */ static const unsigned long db8520_armss_freqs[] = { - 200000000, - 400000000, - 800000000, + 199680000, + 399360000, + 798720000, 1152000000 }; - - static long round_armss_rate(unsigned long rate) { unsigned long freq = 0; From patchwork Mon Sep 20 16:43:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514366 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2328442jao; Mon, 20 Sep 2021 11:35:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaPZMxMYAADQCcn64YclGatzmJCuPbJveFhtovQKECAVU8b3floFhCwYxAaS0m4EkjLb6V X-Received: by 2002:a05:6402:1241:: with SMTP id l1mr30123502edw.123.1632162957532; Mon, 20 Sep 2021 11:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162957; cv=none; d=google.com; s=arc-20160816; b=IVFDRGateEo03qb+rbrKDIgzNAq7jFO3QKQfZx6wac4AR6ezv93L8YkE6TDkTLULie AyUCDP6vUOJuXyn+BdhY3NoCVb4Tbh77AipM91g1TQ64W9spnL/jmk41BnOG26fM6JPv 0RbBKqQdQi+iG7n7W+XXNpNYxBZ2PYh6BzB1fUDe5o7mQB6KjXJtrbQ4pNOY2wnPh32f JbeJd3k13UYQPjVE6a+c2x7/1CMwjv1rSS/uJCmDnoHr4lJW3GZmvutEZ8f4AODHsHsc TzsB+7oblPWh8gZZWtOb5Qu3aK80NoFP/ihEXrSsOr7xtQnjtov+u4ermXQIR5JO5DPL OY2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=awaGI3bddXuTeYVkWtQV7zAYElVWqNzaLTk3bnaW08Y=; b=hGgepGj1yjOh1uUQwr6GzwCKzWhWVvbrKEOiDNYT2GNwrmnG5rBBM5txRL8pvrzQsm BlfHACc4SYk2qYVi4h/VP/Q4tBVPCJy36twshSKNAflDOCwah6rurDDcr/tx4Yrl14Od cP2pd3xXSml6L0f8On7gHv9OFrjWdUrVTCeMzNrijmXpxQlyiX0wTQu9pJapnnmMBb40 17inThXOfYp9Jx4Ifa1+kJiBKs0YZufF4vQSft8cfRbjKK3JDZF9xTcbgA2+DZJkeDME QEG17z48DtLW+bZua38dtVS2/wCm3PkbtT3JCcW+JunAvJrGSdmvrQPxExKjQqd/hL/F I+SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=keQ0D1LH; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si21572484ejb.600.2021.09.20.11.35.57; Mon, 20 Sep 2021 11:35:57 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=keQ0D1LH; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379167AbhITSgQ (ORCPT + 11 others); Mon, 20 Sep 2021 14:36:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:49304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380111AbhITSce (ORCPT ); Mon, 20 Sep 2021 14:32:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B0C6461AA7; Mon, 20 Sep 2021 17:27:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158878; bh=LFNy3iIa87mVaeGgL4yMp5NJGuXQztt4Sr4cbRdUIVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=keQ0D1LHzM/hjj4bZ0BiSktKF/0eX+olGaZzDeOKCLM6xPmpdePexwOB6XvDwyPeh y6mOrkN0kbO6prSoa5z53beuxpUhnW/UYk0XXPHsoUyubuaIbCqwDOgZdYSitdtClL VT/DQJ7mxCvuRkJ7GNsedFfGkyYz/HC8MUd71AdA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 5.10 064/122] tracing/probes: Reject events which have the same name of existing one Date: Mon, 20 Sep 2021 18:43:56 +0200 Message-Id: <20210920163917.876178732@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masami Hiramatsu [ Upstream commit 8e242060c6a4947e8ae7d29794af6a581db08841 ] Since kprobe_events and uprobe_events only check whether the other same-type probe event has the same name or not, if the user gives the same name of the existing tracepoint event (or the other type of probe events), it silently fails to create the tracefs entry (but registered.) as below. /sys/kernel/tracing # ls events/task/task_rename enable filter format hist id trigger /sys/kernel/tracing # echo p:task/task_rename vfs_read >> kprobe_events [ 113.048508] Could not create tracefs 'task_rename' directory /sys/kernel/tracing # cat kprobe_events p:task/task_rename vfs_read To fix this issue, check whether the existing events have the same name or not in trace_probe_register_event_call(). If exists, it rejects to register the new event. Link: https://lkml.kernel.org/r/162936876189.187130.17558311387542061930.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin --- kernel/trace/trace_kprobe.c | 6 +++++- kernel/trace/trace_probe.c | 25 +++++++++++++++++++++++++ kernel/trace/trace_probe.h | 1 + kernel/trace/trace_uprobe.c | 6 +++++- 4 files changed, 36 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 68150b9cbde9..552dbc9d5226 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -647,7 +647,11 @@ static int register_trace_kprobe(struct trace_kprobe *tk) /* Register new event */ ret = register_kprobe_event(tk); if (ret) { - pr_warn("Failed to register probe event(%d)\n", ret); + if (ret == -EEXIST) { + trace_probe_log_set_index(0); + trace_probe_log_err(0, EVENT_EXIST); + } else + pr_warn("Failed to register probe event(%d)\n", ret); goto end; } diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c index d2867ccc6aca..1d31bc4acf7a 100644 --- a/kernel/trace/trace_probe.c +++ b/kernel/trace/trace_probe.c @@ -1029,11 +1029,36 @@ error: return ret; } +static struct trace_event_call * +find_trace_event_call(const char *system, const char *event_name) +{ + struct trace_event_call *tp_event; + const char *name; + + list_for_each_entry(tp_event, &ftrace_events, list) { + if (!tp_event->class->system || + strcmp(system, tp_event->class->system)) + continue; + name = trace_event_name(tp_event); + if (!name || strcmp(event_name, name)) + continue; + return tp_event; + } + + return NULL; +} + int trace_probe_register_event_call(struct trace_probe *tp) { struct trace_event_call *call = trace_probe_event_call(tp); int ret; + lockdep_assert_held(&event_mutex); + + if (find_trace_event_call(trace_probe_group_name(tp), + trace_probe_name(tp))) + return -EEXIST; + ret = register_trace_event(&call->event); if (!ret) return -ENODEV; diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h index 2f703a20c724..6d41e20c47ce 100644 --- a/kernel/trace/trace_probe.h +++ b/kernel/trace/trace_probe.h @@ -398,6 +398,7 @@ extern int traceprobe_define_arg_fields(struct trace_event_call *event_call, C(NO_EVENT_NAME, "Event name is not specified"), \ C(EVENT_TOO_LONG, "Event name is too long"), \ C(BAD_EVENT_NAME, "Event name must follow the same rules as C identifiers"), \ + C(EVENT_EXIST, "Given group/event name is already used by another event"), \ C(RETVAL_ON_PROBE, "$retval is not available on probe"), \ C(BAD_STACK_NUM, "Invalid stack number"), \ C(BAD_ARG_NUM, "Invalid argument number"), \ diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 3cf7128e1ad3..0dd6e286e519 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c @@ -514,7 +514,11 @@ static int register_trace_uprobe(struct trace_uprobe *tu) ret = register_uprobe_event(tu); if (ret) { - pr_warn("Failed to register probe event(%d)\n", ret); + if (ret == -EEXIST) { + trace_probe_log_set_index(0); + trace_probe_log_err(0, EVENT_EXIST); + } else + pr_warn("Failed to register probe event(%d)\n", ret); goto end; } From patchwork Mon Sep 20 16:44:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514365 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2328433jao; Mon, 20 Sep 2021 11:35:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz746tFZ2sK1NE9G+apHysvlXlivV+w00vuS9PWQ64IrE920vzFYEVvwrwl/VgGwW4T8TNU X-Received: by 2002:a17:906:3c56:: with SMTP id i22mr30385079ejg.287.1632162956773; Mon, 20 Sep 2021 11:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162956; cv=none; d=google.com; s=arc-20160816; b=lk7T53o0c1gDLJhbGv5/Sk82lygahQi4KOhqDCnsjH7xcnuumXWPG9gX8UDSuFIEUF 7ADdm7+6H3sXOIU8unHiFMOx/JcePtX9bmUr4d28zuBrXtB5Br8YUJbXhYFvc2C+GGtm dmmv34bszdy9PvDvnwDXC/x5kemFQDYOcPv57VGtQZE3V2XZyH+QzC8m4v1d06eaba5w dPpdzYxPXFPRqnOtxUp4ifUYa93bARt7SsyVWth0ZuyHDCgPrlEQ2u36ODX1KRoMGbuz k4Zrp29/5c0pFGzbLRsHOHINCCxU6qPUZe/l+wiIrz2rRqTpxq1b+d85MR/0r8Cebwx/ c4ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nyNVLbiZKAu6RAxHoarNxRKb3YmrKDKcKwh8LbxB8eg=; b=G8RJV5NaRw84ExxU+KD2mjr/aG6LZvQm1PYmC6fYFkvc9mMB/wsc/Na8BBGgreAk+I VPJGTkr38wjPuetCWSTuHQOZM6V6vnnmTCfUu8TzOsBmgvDMkpa/MAm4TjoM3Pd8XVjb JLxYjX4de+SVSfFf6Q4sb8UkDtRs2uRUf7b2EajB+0Vs0PuUUdaXHAzJGk+6tdTmPYzJ mOEYGg6TfGvfoxMBhh25bms+NitX5w9awqvlxbJ+f/uzHEQrMFsWLAjSbRdkokuf+7xf KNSs23iKNA1fgQ2GW5oveTLANE9EzHFCoGWiAPb02R/zxe/CeEk3gfk9r5eZnxFLuxEA Fd2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ba112xSa; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si21572484ejb.600.2021.09.20.11.35.56; Mon, 20 Sep 2021 11:35:56 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ba112xSa; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353493AbhITSgP (ORCPT + 11 others); Mon, 20 Sep 2021 14:36:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:47572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379745AbhITSaY (ORCPT ); Mon, 20 Sep 2021 14:30:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BE64D632F0; Mon, 20 Sep 2021 17:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158826; bh=y2nuunIIMi0E1RT2BGyKCFUaFsmSdL3/puRBt2mdno0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ba112xSaJdkQ9o/ssqd4MNtqQLiJRfjwMk3q9JBIbIRLuuIm6XJ4SoZdAieIezJO4 rgBO91tS/gh0Rg6J9WwJY8OLS/XBPNCyVFlVXpmq42VPgM0m0AbaN9qPv+hCx+QjaK jCeDmAAQjKm0zF0qWT39SvjwTVZXytJaEfdVqnv8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Davide Zini , Paolo Valente , Jens Axboe , Sasha Levin Subject: [PATCH 5.10 074/122] block, bfq: honor already-setup queue merges Date: Mon, 20 Sep 2021 18:44:06 +0200 Message-Id: <20210920163918.200238472@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Paolo Valente [ Upstream commit 2d52c58b9c9bdae0ca3df6a1eab5745ab3f7d80b ] The function bfq_setup_merge prepares the merging between two bfq_queues, say bfqq and new_bfqq. To this goal, it assigns bfqq->new_bfqq = new_bfqq. Then, each time some I/O for bfqq arrives, the process that generated that I/O is disassociated from bfqq and associated with new_bfqq (merging is actually a redirection). In this respect, bfq_setup_merge increases new_bfqq->ref in advance, adding the number of processes that are expected to be associated with new_bfqq. Unfortunately, the stable-merging mechanism interferes with this setup. After bfqq->new_bfqq has been set by bfq_setup_merge, and before all the expected processes have been associated with bfqq->new_bfqq, bfqq may happen to be stably merged with a different queue than the current bfqq->new_bfqq. In this case, bfqq->new_bfqq gets changed. So, some of the processes that have been already accounted for in the ref counter of the previous new_bfqq will not be associated with that queue. This creates an unbalance, because those references will never be decremented. This commit fixes this issue by reestablishing the previous, natural behaviour: once bfqq->new_bfqq has been set, it will not be changed until all expected redirections have occurred. Signed-off-by: Davide Zini Signed-off-by: Paolo Valente Link: https://lore.kernel.org/r/20210802141352.74353-2-paolo.valente@linaro.org Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/bfq-iosched.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) -- 2.30.2 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index b8c2ddc01aec..65c200e0ecb5 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -2526,6 +2526,15 @@ bfq_setup_merge(struct bfq_queue *bfqq, struct bfq_queue *new_bfqq) * are likely to increase the throughput. */ bfqq->new_bfqq = new_bfqq; + /* + * The above assignment schedules the following redirections: + * each time some I/O for bfqq arrives, the process that + * generated that I/O is disassociated from bfqq and + * associated with new_bfqq. Here we increases new_bfqq->ref + * in advance, adding the number of processes that are + * expected to be associated with new_bfqq as they happen to + * issue I/O. + */ new_bfqq->ref += process_refs; return new_bfqq; } @@ -2585,6 +2594,10 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, { struct bfq_queue *in_service_bfqq, *new_bfqq; + /* if a merge has already been setup, then proceed with that first */ + if (bfqq->new_bfqq) + return bfqq->new_bfqq; + /* * Do not perform queue merging if the device is non * rotational and performs internal queueing. In fact, such a @@ -2639,9 +2652,6 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, if (bfq_too_late_for_merging(bfqq)) return NULL; - if (bfqq->new_bfqq) - return bfqq->new_bfqq; - if (!io_struct || unlikely(bfqq == &bfqd->oom_bfqq)) return NULL; From patchwork Mon Sep 20 16:44:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514363 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2325105jao; Mon, 20 Sep 2021 11:31:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDPKT3ok8RIlBzINpS4t7swm5WkK7Y2gVNUXPvrSBE8YluDhtRlvzydjwsPl1YptaXVIXh X-Received: by 2002:a17:906:cc0e:: with SMTP id ml14mr28804929ejb.395.1632162700923; Mon, 20 Sep 2021 11:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162700; cv=none; d=google.com; s=arc-20160816; b=bSqo8FL/ZpnyrS1iBqRzXtZvzOGmS9StzJz729/YQ5SmlmnubwAuB0sAAqtoEF2U07 ILtoQJXPxR6MEHluRjPW3R3IPPz07WNGIW1T6NbfW0hPuI7CSQ6SEXJbw0qgX1tdXI1N C9zF7frKhkgVDQ6y5smR07GuEMDp35xSTIqj3ushzmHgXiq1dDqRh5AOOMgGJj4G+k0H pIx8Twi6zenCTiN5F+DxaZisxKB4x0TLlFZy0NUjqohPudfCohH1hqWIJHPjgNqZgfk+ TP0ZfvVGPC/h6142HjUXUiI+zjgjUocFhKP73JtMggSpzFW27BpOmhWr3pkJnA35EqDj utkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JT9qYwHNaDzRdCeDRfgqJS0pUX0lXiLbjIqSyySafJk=; b=OaI05bJ3idpvzUxUoWrcb+iG3e2S1P+Tu9w6DtyT7V0eaNVHiyAa9oYADuf5GqEsuQ sdkmWvLsTBTTjlp1IHWHTQXPAYYgVK1jLEYZjMxKARkC1cZbxRpgPVbc2OL2U14Op4DT s6KeHIqcU1yvtuq7Jhq57NyffbmnCvk8rbvBB1AM142RZAxAoowPCq2SiQslKwBCaKBh tiyJtHmwzgT6yDgorNY8JeCfjR+Ery6zw9+1KfkAX+hLLmnX0UqYjtDERnAzxuKTbPgp B86BDY+zQCQCq3RZh0pEM22cKOdqrziCD/pLIq9I7apZPRulQdGaOT9yAlg09BlOZVqt xpjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=e2eg84Sp; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q1si16538474ejr.43.2021.09.20.11.31.40; Mon, 20 Sep 2021 11:31:40 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=e2eg84Sp; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348760AbhITSdE (ORCPT + 11 others); Mon, 20 Sep 2021 14:33:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:49712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379868AbhITSbA (ORCPT ); Mon, 20 Sep 2021 14:31:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2229361439; Mon, 20 Sep 2021 17:27:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158843; bh=EEmGaJ5ungMBEXkvbcXKWJw49M4x0i3FnVbZiARRQgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e2eg84SpKPQLrmtTjbP5xI1uD61nD8xTm5RTjL/7rPNYed2e+pTcCkwIZM/TqRYz4 gpKWGKG7MI0B8dEUABnYj4ZFjnQJOwgiWHsi4gpvUo+tC9Fa91FFClFVa0uIFhJTJr j+cvZK/0yFqZnBRo8xpWMXexbC6jdjCb7LTtQ0uY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephan Gerhold , newbyte@disroot.org, Daniel Thompson , Linus Walleij , Lee Jones , Sasha Levin Subject: [PATCH 5.10 081/122] backlight: ktd253: Stabilize backlight Date: Mon, 20 Sep 2021 18:44:13 +0200 Message-Id: <20210920163918.439257788@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij [ Upstream commit daa37361518bf2d1f591bbdaa7c68b2a43d7af48 ] Remove interrupt disablement during backlight setting. It is way to dangerous and makes platforms instable by having it miss vblank IRQs leading to the graphics derailing. The code is using ndelay() which is not available on platforms such as ARM and will result in 32 * udelay(1) which is substantial. Add some code to detect if an interrupt occurs during the tight loop and in that case just redo it from the top. Fixes: 5317f37e48b9 ("backlight: Add Kinetic KTD253 backlight driver") Cc: Stephan Gerhold Reported-by: newbyte@disroot.org Reviewed-by: Daniel Thompson Signed-off-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/video/backlight/ktd253-backlight.c | 75 ++++++++++++++++------ 1 file changed, 55 insertions(+), 20 deletions(-) -- 2.30.2 diff --git a/drivers/video/backlight/ktd253-backlight.c b/drivers/video/backlight/ktd253-backlight.c index e3fee3f1f582..9d355fd989d8 100644 --- a/drivers/video/backlight/ktd253-backlight.c +++ b/drivers/video/backlight/ktd253-backlight.c @@ -25,6 +25,7 @@ #define KTD253_T_LOW_NS (200 + 10) /* Additional 10ns as safety factor */ #define KTD253_T_HIGH_NS (200 + 10) /* Additional 10ns as safety factor */ +#define KTD253_T_OFF_CRIT_NS 100000 /* 100 us, now it doesn't look good */ #define KTD253_T_OFF_MS 3 struct ktd253_backlight { @@ -34,13 +35,50 @@ struct ktd253_backlight { u16 ratio; }; +static void ktd253_backlight_set_max_ratio(struct ktd253_backlight *ktd253) +{ + gpiod_set_value_cansleep(ktd253->gpiod, 1); + ndelay(KTD253_T_HIGH_NS); + /* We always fall back to this when we power on */ +} + +static int ktd253_backlight_stepdown(struct ktd253_backlight *ktd253) +{ + /* + * These GPIO operations absolutely can NOT sleep so no _cansleep + * suffixes, and no using GPIO expanders on slow buses for this! + * + * The maximum number of cycles of the loop is 32 so the time taken + * should nominally be: + * (T_LOW_NS + T_HIGH_NS + loop_time) * 32 + * + * Architectures do not always support ndelay() and we will get a few us + * instead. If we get to a critical time limit an interrupt has likely + * occured in the low part of the loop and we need to restart from the + * top so we have the backlight in a known state. + */ + u64 ns; + + ns = ktime_get_ns(); + gpiod_set_value(ktd253->gpiod, 0); + ndelay(KTD253_T_LOW_NS); + gpiod_set_value(ktd253->gpiod, 1); + ns = ktime_get_ns() - ns; + if (ns >= KTD253_T_OFF_CRIT_NS) { + dev_err(ktd253->dev, "PCM on backlight took too long (%llu ns)\n", ns); + return -EAGAIN; + } + ndelay(KTD253_T_HIGH_NS); + return 0; +} + static int ktd253_backlight_update_status(struct backlight_device *bl) { struct ktd253_backlight *ktd253 = bl_get_data(bl); int brightness = backlight_get_brightness(bl); u16 target_ratio; u16 current_ratio = ktd253->ratio; - unsigned long flags; + int ret; dev_dbg(ktd253->dev, "new brightness/ratio: %d/32\n", brightness); @@ -62,37 +100,34 @@ static int ktd253_backlight_update_status(struct backlight_device *bl) } if (current_ratio == 0) { - gpiod_set_value_cansleep(ktd253->gpiod, 1); - ndelay(KTD253_T_HIGH_NS); - /* We always fall back to this when we power on */ + ktd253_backlight_set_max_ratio(ktd253); current_ratio = KTD253_MAX_RATIO; } - /* - * WARNING: - * The loop to set the correct current level is performed - * with interrupts disabled as it is timing critical. - * The maximum number of cycles of the loop is 32 - * so the time taken will be (T_LOW_NS + T_HIGH_NS + loop_time) * 32, - */ - local_irq_save(flags); while (current_ratio != target_ratio) { /* * These GPIO operations absolutely can NOT sleep so no * _cansleep suffixes, and no using GPIO expanders on * slow buses for this! */ - gpiod_set_value(ktd253->gpiod, 0); - ndelay(KTD253_T_LOW_NS); - gpiod_set_value(ktd253->gpiod, 1); - ndelay(KTD253_T_HIGH_NS); - /* After 1/32 we loop back to 32/32 */ - if (current_ratio == KTD253_MIN_RATIO) + ret = ktd253_backlight_stepdown(ktd253); + if (ret == -EAGAIN) { + /* + * Something disturbed the backlight setting code when + * running so we need to bring the PWM back to a known + * state. This shouldn't happen too much. + */ + gpiod_set_value_cansleep(ktd253->gpiod, 0); + msleep(KTD253_T_OFF_MS); + ktd253_backlight_set_max_ratio(ktd253); + current_ratio = KTD253_MAX_RATIO; + } else if (current_ratio == KTD253_MIN_RATIO) { + /* After 1/32 we loop back to 32/32 */ current_ratio = KTD253_MAX_RATIO; - else + } else { current_ratio--; + } } - local_irq_restore(flags); ktd253->ratio = current_ratio; dev_dbg(ktd253->dev, "new ratio set to %d/32\n", target_ratio); From patchwork Mon Sep 20 16:44:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514364 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2325126jao; Mon, 20 Sep 2021 11:31:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzh2drBIekDnhNtTUaX/GJPwLEKTDn3qy5lbeWyGAYTINf2zikBVAJVTyv5NnpVvwIvT6St X-Received: by 2002:a17:906:6011:: with SMTP id o17mr29192740ejj.157.1632162701995; Mon, 20 Sep 2021 11:31:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162701; cv=none; d=google.com; s=arc-20160816; b=BRSWz/Hxgh/boxzB7jtIXxz9CfH+MtjgnqfG77XnjeRcnjWtpgYoh/pb5Ad8WpwNuX Dvn62Bkgg2xxDVTcfnWa5vkn0/MXGwmhtB+5Ky2d8ZeS+LnrkqRl6tnbE/fABCL1nfd6 wv6WZh2QTK2S3q6AhEF4sFZrcPaJnuyAWokKxGP4ljQwctncXonkRU5sb+opPKe4oMP/ JaBucTunlkx4gSNZ7ov2prZkb8frsMWeBSG6MzymQjigVE6ewWa6MRoXxg/TO7GJ/dO6 d6jjVk/vrTpBIT1RHWpAdY5x0HXGwB4tPHlnLlB6A2a3vtXnSWT7h27sK+lksiaHMaLK bIAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0tkbOnL+zg8mAXUb4Nqbiy+IvCdc8z2qhJvpgjBoTMs=; b=xvOt0Noy2WwS/k83EzmuFfKDwUXEi3Lw6wEn5LnZysIF0VdKtDiDbBorRA32MB4tGT kg02DgFT0QMAeQqHQL7IfNqHMSLqgInkGjwgfWMqf57ccbK94XFOu/g7WEtR+geZTJc9 gAgq5g/JIOL7/ACPTgmeg2dbTbgC93q70mCA1l4w99/cEPOpQyhPdEkJrb29KO5r10tM TK+R1YlKIkNqat6/g7pAOtTT7VrXXMAOIvg4uKQ4yWcdglwRqv+vEoJ+Xhi4iA63lUtf mdVWqj+NcWusV0DkYASmAJTXmCr58w6iO3K1d6SpXKOQEe0aqMWNwUTaOJmVaTgjvWgW rLXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jA+j6nZC; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q1si16538474ejr.43.2021.09.20.11.31.41; Mon, 20 Sep 2021 11:31:41 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jA+j6nZC; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352814AbhITSdF (ORCPT + 11 others); Mon, 20 Sep 2021 14:33:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:49714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379871AbhITSbA (ORCPT ); Mon, 20 Sep 2021 14:31:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2C443632EF; Mon, 20 Sep 2021 17:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158845; bh=YgWcVjKHiquDq7uBBsRRXjk9RqqgHeuE4K7c+7hoAZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jA+j6nZCSRzT1zbzNBF4+U+26VckEswpMzAmEnFhf+jNLCLbdUkNU7ML2snJWoiim G4i2ixwDWn4pO0M5QVnDANVLRempFqfkhOy+Aud7b+JlkDJbs7qHbWttFKGphvlbTy zTTimwagMUK2dg8UhrwKzvUBxMjseLoaOJ7lLoYc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Rob Herring , Lorenzo Pieralisi , Bjorn Helgaas , Srinath Mannam , Roman Bacik , Bharat Gooty , Abhishek Shah , Jitendra Bhivare , Ray Jui , Florian Fainelli , BCM Kernel Feedback , Scott Branden , Sasha Levin Subject: [PATCH 5.10 082/122] PCI: of: Dont fail devm_pci_alloc_host_bridge() on missing ranges Date: Mon, 20 Sep 2021 18:44:14 +0200 Message-Id: <20210920163918.481485606@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rob Herring [ Upstream commit d277f6e88c88729b1d57d40bbfb00d0bfc961972 ] Commit 669cbc708122 ("PCI: Move DT resource setup into devm_pci_alloc_host_bridge()") made devm_pci_alloc_host_bridge() fail on any DT resource parsing errors, but Broadcom iProc uses devm_pci_alloc_host_bridge() on BCMA bus devices that don't have DT resources. In particular, there is no 'ranges' property. Fix iProc by making 'ranges' optional. If 'ranges' is required by a platform, there's going to be more errors latter on if it is missing. Link: https://lore.kernel.org/r/20210803215656.3803204-1-robh@kernel.org Fixes: 669cbc708122 ("PCI: Move DT resource setup into devm_pci_alloc_host_bridge()") Reported-by: Rafał Miłecki Tested-by: Rafał Miłecki Signed-off-by: Rob Herring Signed-off-by: Lorenzo Pieralisi Acked-by: Bjorn Helgaas Cc: Srinath Mannam Cc: Roman Bacik Cc: Bharat Gooty Cc: Abhishek Shah Cc: Jitendra Bhivare Cc: Ray Jui Cc: Florian Fainelli Cc: BCM Kernel Feedback Cc: Scott Branden Cc: Bjorn Helgaas Cc: Lorenzo Pieralisi Signed-off-by: Sasha Levin --- drivers/pci/of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/pci/of.c b/drivers/pci/of.c index ac24cd5439a9..3f6ef2f45e57 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -295,7 +295,7 @@ static int devm_of_pci_get_host_bridge_resources(struct device *dev, /* Check for ranges property */ err = of_pci_range_parser_init(&parser, dev_node); if (err) - goto failed; + return 0; dev_dbg(dev, "Parsing ranges property...\n"); for_each_of_pci_range(&parser, &range) { From patchwork Mon Sep 20 16:44:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514362 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2325074jao; Mon, 20 Sep 2021 11:31:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySKagq5UYYc8gY89Ku1HUAWZtMebnpsTt8LulMNjXvpNgPDA6yHGwTR3HXqOqs6tx4xnf6 X-Received: by 2002:a05:6402:742:: with SMTP id p2mr31104819edy.347.1632162699064; Mon, 20 Sep 2021 11:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162699; cv=none; d=google.com; s=arc-20160816; b=qf1COpJ5j3KsbiK9mINqTtpVzVeP3AzWg+N05siSRg8x623GvXIjaSyhb+VfwX5oob VvxY2uq5mqbm2gGAe+us1up3Nsx9WWeSm51iTRftMuTcWzMyv7g/CVXHvgblYEzN9/jb BnqND5IMPusP42bdtcHoQpmzKSAz3KITgSacT7bXSCBfDSk9pHXbIBCA4nk64hqUtkQl f/XxGkVfs4qnv8EyigpX4YX3vIQ2O0tKQt/x0g2guqOGjwyXCZnOTrwtNlj7mx5Ze0XJ JQTgKA1tqghbsz+NYoCzV2nMcrIFapDCDqGk1+CqKT2KdQVfOdFhOaih3ZAa8htE6vcy yWXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KchsrLwXX54Dvfldy/gP/UtblKXwOYw58PaYddA0PXs=; b=0ln8uUM+cB4guI4qHK+bK7Jhwy0P4brDqZ9hgLcwzUNm2j66t8V2Tnb/LqyKsHCnPC 9jxGdW9S6K1Ho+/VrcgXBHnK5Gj7cRSuWJ6Qu0moh8KUxoasDL6heWePPZVrmrXKZuUk A/MI1sFwb/TcnB4NMkRi7t3EuD3+hJ1uJCY9I1lqq6qML5CsHDA62uxEtqxgdOW0lcgp cJrptKntqk2Efi2z/SH3VRfD4tUhurfpIizyOjAV4JqPIRB9W7+ZJR5bd63olxCD492E NZm3/7mIu+BVL/fY0vUWqVpAbQkZVFBrs8X9CpEGF/cRzeG7liS+6xk4C1w3p2bEdMPC QeSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d0+dJ3nC; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q1si16538474ejr.43.2021.09.20.11.31.38; Mon, 20 Sep 2021 11:31:39 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d0+dJ3nC; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352842AbhITSdE (ORCPT + 11 others); Mon, 20 Sep 2021 14:33:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:48136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379869AbhITSbA (ORCPT ); Mon, 20 Sep 2021 14:31:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3839761AA3; Mon, 20 Sep 2021 17:27:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158847; bh=12eTKTrgXoNsliTpBIj9AqdcGCF3gdeRnknu9J4fK+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d0+dJ3nCCM/kC8UNxzArfd32OIufVYAm1ocwe3LhzHVP48KYmIO1CPH91na/ijbO9 RWfXs4tC/LWtdkZ881aG9lcpWx09FRo8k0uJfZk+jXKm90hSxPwAFqY0fCgUfU0T0g Xw8O/z2yyOYN6NFgsrqYcr9l/y0myEb8nyn9t5n4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Rob Herring , Lorenzo Pieralisi , Srinath Mannam , Roman Bacik , Bharat Gooty , Abhishek Shah , Jitendra Bhivare , Ray Jui , Florian Fainelli , BCM Kernel Feedback , Scott Branden , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Sasha Levin Subject: [PATCH 5.10 083/122] PCI: iproc: Fix BCMA probe resource handling Date: Mon, 20 Sep 2021 18:44:15 +0200 Message-Id: <20210920163918.512725820@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rob Herring [ Upstream commit aeaea8969b402e0081210cc9144404d13996efed ] In commit 7ef1c871da16 ("PCI: iproc: Use pci_parse_request_of_pci_ranges()"), calling devm_request_pci_bus_resources() was dropped from the common iProc probe code, but is still needed for BCMA bus probing. Without it, there will be lots of warnings like this: pci 0000:00:00.0: BAR 8: no space for [mem size 0x00c00000] pci 0000:00:00.0: BAR 8: failed to assign [mem size 0x00c00000] Add back calling devm_request_pci_bus_resources() and adding the resources to pci_host_bridge.windows for BCMA bus probe. Link: https://lore.kernel.org/r/20210803215656.3803204-2-robh@kernel.org Fixes: 7ef1c871da16 ("PCI: iproc: Use pci_parse_request_of_pci_ranges()") Reported-by: Rafał Miłecki Tested-by: Rafał Miłecki Signed-off-by: Rob Herring Signed-off-by: Lorenzo Pieralisi Cc: Srinath Mannam Cc: Roman Bacik Cc: Bharat Gooty Cc: Abhishek Shah Cc: Jitendra Bhivare Cc: Ray Jui Cc: Florian Fainelli Cc: BCM Kernel Feedback Cc: Scott Branden Cc: Lorenzo Pieralisi Cc: "Krzysztof Wilczyński" Cc: Bjorn Helgaas Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-iproc-bcma.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) -- 2.30.2 diff --git a/drivers/pci/controller/pcie-iproc-bcma.c b/drivers/pci/controller/pcie-iproc-bcma.c index 56b8ee7bf330..f918c713afb0 100644 --- a/drivers/pci/controller/pcie-iproc-bcma.c +++ b/drivers/pci/controller/pcie-iproc-bcma.c @@ -35,7 +35,6 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev) { struct device *dev = &bdev->dev; struct iproc_pcie *pcie; - LIST_HEAD(resources); struct pci_host_bridge *bridge; int ret; @@ -60,19 +59,16 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev) pcie->mem.end = bdev->addr_s[0] + SZ_128M - 1; pcie->mem.name = "PCIe MEM space"; pcie->mem.flags = IORESOURCE_MEM; - pci_add_resource(&resources, &pcie->mem); + pci_add_resource(&bridge->windows, &pcie->mem); + ret = devm_request_pci_bus_resources(dev, &bridge->windows); + if (ret) + return ret; pcie->map_irq = iproc_pcie_bcma_map_irq; - ret = iproc_pcie_setup(pcie, &resources); - if (ret) { - dev_err(dev, "PCIe controller setup failed\n"); - pci_free_resource_list(&resources); - return ret; - } - bcma_set_drvdata(bdev, pcie); - return 0; + + return iproc_pcie_setup(pcie, &bridge->windows); } static void iproc_pcie_bcma_remove(struct bcma_device *bdev) From patchwork Mon Sep 20 16:44:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514367 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2328450jao; Mon, 20 Sep 2021 11:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpICZSLde6gpFAOFD21NLrj0Kugz8CXz7gicBk9hMtfxiJ5IKZitqDT2R1j/YPfqs92+pc X-Received: by 2002:a17:906:341b:: with SMTP id c27mr31016147ejb.61.1632162957969; Mon, 20 Sep 2021 11:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162957; cv=none; d=google.com; s=arc-20160816; b=vvX7XN/Bs2url3BRteZF+3TBjqh9SeGc+mfi7bPL20mZ9zrQUeCSRa/whSzTSEsZl+ x6g6nQzip4SFBY5AoIGOTSGdQVl0TrKggLEySci9c6YujWoUnE4yBEIQG43CHCJZUYRn bSapdCBlB/llG/QL7X2EX7j+JDnV8pOurUuz1w/HQuX1M8tRf6Nq8ZDabKxwMWa1YPUM 6XNMjksJqV+9K0SXV1Jm5L3iEtdNnPa5FUjEbLRqyLNIyI8yo7URoWUvrebwiY8HoZe2 Gw/ZYpT4cgwG1Gi2w/+/EcrhOMZ+Egrcr+XH+EfqScQtpB/UWeDeazMmTyMkiUMJ25kc 8Ygg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DFCSBzxeRoDsYXnFduO2jdlyhC1dUT0U8VkrW9QnCgU=; b=kjCqy3T8MhKHcG//7k77PQDJPpCumcyb5TyZy+KzSIPlO7lgFznDuIYcVSC95lKcYC ti5r+nF0Le8vxz5W1me40ICT13GxtTGT/Takyu3s6Al/Ir+kw6FzmipmjSVPK2nW0G0A TY31HUtNC3bKahSpi6CWSNNe7E0PlV3VtZTUZnc+Xo7v9GR7WnBqGantpRq336bh11te GGbo/QB6ozEnSoYfG7ocFE+XKblfN8q93Yk7TeupEP/IezgIGDjl7Tp7ApuMUrH+fAQk sXkmfFcXJjLIr/soxoJi2ZEDo0KlQC5fC+WpgjZeVsfSfjkqOzCJq9oWc36kZSq7pDTE B7og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zrt+k51G; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si21572484ejb.600.2021.09.20.11.35.57; Mon, 20 Sep 2021 11:35:57 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zrt+k51G; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379142AbhITSgP (ORCPT + 11 others); Mon, 20 Sep 2021 14:36:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:52012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380085AbhITSc1 (ORCPT ); Mon, 20 Sep 2021 14:32:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7400461AA4; Mon, 20 Sep 2021 17:27:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158862; bh=uJUTMTu1vO5waaucqVJrvfx6ghghdNY2kgLhBdfGwQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zrt+k51Gck+c3r0K892E0m1hsy9oBLX3aRspip/oishJd0e12i+am/r9wC2Flvzek wXm4DgtHqOUNLz2Xxvbpdu8KPkO+WlknwcefK037jwLbGrE/CkPhC7SxHO9FehVh98 rzlyyPYNeiTGt1r6tWdUV2M99TBi1646yqRs+IvY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 5.10 089/122] tracing/boot: Fix a hist trigger dependency for boot time tracing Date: Mon, 20 Sep 2021 18:44:21 +0200 Message-Id: <20210920163918.710277100@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masami Hiramatsu [ Upstream commit 6fe7c745f2acb73e4cc961d7f91125eef5a8861f ] Fixes a build error when CONFIG_HIST_TRIGGERS=n with boot-time tracing. Since the trigger_process_regex() is defined only when CONFIG_HIST_TRIGGERS=y, if it is disabled, the 'actions' event option also must be disabled. Link: https://lkml.kernel.org/r/162856123376.203126.582144262622247352.stgit@devnote2 Fixes: 81a59555ff15 ("tracing/boot: Add per-event settings") Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin --- kernel/trace/trace_boot.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 2.30.2 diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c index a82f03f385f8..0996d59750ff 100644 --- a/kernel/trace/trace_boot.c +++ b/kernel/trace/trace_boot.c @@ -205,12 +205,15 @@ trace_boot_init_one_event(struct trace_array *tr, struct xbc_node *gnode, pr_err("Failed to apply filter: %s\n", buf); } - xbc_node_for_each_array_value(enode, "actions", anode, p) { - if (strlcpy(buf, p, ARRAY_SIZE(buf)) >= ARRAY_SIZE(buf)) - pr_err("action string is too long: %s\n", p); - else if (trigger_process_regex(file, buf) < 0) - pr_err("Failed to apply an action: %s\n", buf); - } + if (IS_ENABLED(CONFIG_HIST_TRIGGERS)) { + xbc_node_for_each_array_value(enode, "actions", anode, p) { + if (strlcpy(buf, p, ARRAY_SIZE(buf)) >= ARRAY_SIZE(buf)) + pr_err("action string is too long: %s\n", p); + else if (trigger_process_regex(file, buf) < 0) + pr_err("Failed to apply an action: %s\n", buf); + } + } else if (xbc_node_find_value(enode, "actions", NULL)) + pr_err("Failed to apply event actions because CONFIG_HIST_TRIGGERS is not set.\n"); if (xbc_node_find_value(enode, "enable", NULL)) { if (trace_event_enable_disable(file, 1, 0) < 0) From patchwork Mon Sep 20 16:44:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 514368 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2329344jao; Mon, 20 Sep 2021 11:36:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDOQ+BYJCxy+23Av2cfYMcycRN+PlaTAr8fGrXES35JoW1gwz1LFUAg9SdKXfdNvv74Mt9 X-Received: by 2002:a05:6e02:1a8d:: with SMTP id k13mr17389204ilv.70.1632163016749; Mon, 20 Sep 2021 11:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632163016; cv=none; d=google.com; s=arc-20160816; b=g8Ggm2WuHcSkViyz98CPRqfvnvmfiYD6XWtEm0XR+Y2jDT2wur0XeHqWQCgBMvME9v ZHAW7b72SHSUX3Sqezd2KoapxpEKirAnUhmZlzlJ+fUvTa1BVCIX+3GqVWuEE0Kq9eo8 JAWEgTsZkNuDaJxWz148L32Tysp9qGWV0xbwi63X+rDLfMEkNYidPQRt/IT3y4YaH8PE ghxlTnDw+bOcF8ftwH5AurgI3Q4akujp4lgCPPtYFDh6j4oAaoT+XgNTiV5QBHqFmMSZ 6RdyXSc4O+u8f5E15OGN3z3NUuS85pCUUarj2H77NqWjeZTja7GJWFcHukzn0kGp1O5P BXhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wzWrOWLi28UQqEhs/bv5M4nqfCWrxE++tQtz+7BFwOI=; b=DEke7ySS6MrhSbNUEk+yABZPp8CdS+ly9O04st0O+CY6aqXuY5lfRS2vf784PX4Dxy 54fGipMw5MpHN+Dzfme8kqDynkSfLm2taT0A0I+xAyW1gUwHQ6VFAxJQXpaUpr/wtSk1 kLkJ+0lkBmlNiz1epwiT4vXK3NwLtqKDS2WARHRCSQ4+vUNCRPReK+/tPIEWMvdcEYl+ BcF+ZBb9v5knL9CegughEazClD2QhDgUln0VCLwXE7aw4MIgNgs4+hyr0t23RwiwM0qY kO4QrrDxq2C2VyMVngLtdoonZD96Yx4gDlgvOOfntdPKpv0o36egklPaukFyKor0O78/ l1PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qeufLGqB; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t11si9811956ilu.179.2021.09.20.11.36.56; Mon, 20 Sep 2021 11:36:56 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qeufLGqB; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381475AbhITSiR (ORCPT + 11 others); Mon, 20 Sep 2021 14:38:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:52010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379307AbhITSgQ (ORCPT ); Mon, 20 Sep 2021 14:36:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D811F61ABD; Mon, 20 Sep 2021 17:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158946; bh=bJW8nCMqEq7PQUJwPZa0hP+gqBaIsHjbiGqYKiTIwlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qeufLGqBxr9yNEdC9yaH7TkQAy+WO9PvK8v7EzwDyHXK1LCAkJBxHBbikQj3423Bn B9qVZAa8l45HApB/QTBPbhH4RGZAgF2J++CJsVCM2CqfNNJr8M90ErnC40+nLEm+/d dK5OeypocAeE8ipIi2p0wG9WD2c1YJiq8Y6vXcJk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, DENG Qingfang , Mauri Sandberg , Linus Walleij , Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 102/122] net: dsa: tag_rtl4_a: Fix egress tags Date: Mon, 20 Sep 2021 18:44:34 +0200 Message-Id: <20210920163919.140386125@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij [ Upstream commit 0e90dfa7a8d817db755c7b5d89d77b9c485e4180 ] I noticed that only port 0 worked on the RTL8366RB since we started to use custom tags. It turns out that the format of egress custom tags is actually different from ingress custom tags. While the lower bits just contain the port number in ingress tags, egress tags need to indicate destination port by setting the bit for the corresponding port. It was working on port 0 because port 0 added 0x00 as port number in the lower bits, and if you do this the packet appears at all ports, including the intended port. Ooops. Fix this and all ports work again. Use the define for shifting the "type A" into place while we're at it. Tested on the D-Link DIR-685 by sending traffic to each of the ports in turn. It works. Fixes: 86dd9868b878 ("net: dsa: tag_rtl4_a: Support also egress tags") Cc: DENG Qingfang Cc: Mauri Sandberg Signed-off-by: Linus Walleij Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/dsa/tag_rtl4_a.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.30.2 diff --git a/net/dsa/tag_rtl4_a.c b/net/dsa/tag_rtl4_a.c index e9176475bac8..24375ebd684e 100644 --- a/net/dsa/tag_rtl4_a.c +++ b/net/dsa/tag_rtl4_a.c @@ -54,9 +54,10 @@ static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb, p = (__be16 *)tag; *p = htons(RTL4_A_ETHERTYPE); - out = (RTL4_A_PROTOCOL_RTL8366RB << 12) | (2 << 8); - /* The lower bits is the port number */ - out |= (u8)dp->index; + out = (RTL4_A_PROTOCOL_RTL8366RB << RTL4_A_PROTOCOL_SHIFT) | (2 << 8); + /* The lower bits indicate the port number */ + out |= BIT(dp->index); + p = (__be16 *)(tag + 2); *p = htons(out);