From patchwork Wed Dec 4 17:53:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180826 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp931455ile; Wed, 4 Dec 2019 10:02:34 -0800 (PST) X-Google-Smtp-Source: APXvYqyZ0GT5Ld4ygAsGmR7x5Slz5pLDSk6+z840IGJbBy5HJPsA0VNA7sADcVKx1oKsAYvxspc2 X-Received: by 2002:a9d:7ad9:: with SMTP id m25mr3353817otn.13.1575482554151; Wed, 04 Dec 2019 10:02:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482554; cv=none; d=google.com; s=arc-20160816; b=TsC1SpuuCXUShuWOjK+QC/8Y5Fv7SmK7HLmRiFLfUWwWCMG0SE7gWoWUdYGuVUek8Y QmUmbfO//KbbVuXyWDCPU9cgn5bx48W028j3aD+J4XbxFxhucqA5Gr0DuLc/f3wSJaL9 UUfVunEcZysLBOqNbQEBRdyEp1R70mePpQD0wFxuhu5fIquhLgYdUNI+4Ki2XerbSntH 4pisVVh8c5lEd3BsH0UkKRTSYMdhMEz4SHM5tQoy7qxEABrdY0nt2eR/K6EPdoLre36w TBp8brSd9uMJHUy9wLIJ+YmVszJrE/lvzGR4iIVqMedgdRT20GHHaPSF2DEtKtfplAUC U1sw== 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=7apfMWc7+iBPXflcnbpPV1gMYb1u9HMD73LN9kKs2H8=; b=TgJC5xVjRTMSHvDydd1pVKVSBh+Sp1PuTEkOsTL4ZdP87tbSrk77Zfmc4zWG8ZCqV1 pL8nho6qm6+En9/qTehWy8hfYriwziVHP8cPFKiW7eSPx2HDuRnLI9sC3OAf+AmE/dVU qElOV8FDyorlB2xMUOIiFvnuhoWgx3NJ3DTONd9M9NfWbAKUYX42uBoHaf687sx/DRED Z83kfCU2OuTTUVB0IINtud3UY+W8dgpVZ8J1eF2a0P6MimlXxcxEIKfcbLu5bq5GzPsy sA1dY0l3g877iRGCNVveViVSl+LFzXqbAhqkwkTzQzCnvfyfWu4On6C8mmla8D6ElrBB f9Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IRtJ2oxY; 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 v141si3660202oif.161.2019.12.04.10.02.33; Wed, 04 Dec 2019 10:02:34 -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=IRtJ2oxY; 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 S1729420AbfLDSCc (ORCPT + 15 others); Wed, 4 Dec 2019 13:02:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:44660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729863AbfLDSCb (ORCPT ); Wed, 4 Dec 2019 13:02:31 -0500 Received: from localhost (unknown [217.68.49.72]) (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 7790120866; Wed, 4 Dec 2019 18:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482550; bh=J8YqXj3SwtR7lM9NynpzL7p4eJ8MbvZczN68aP0uE04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IRtJ2oxYxdZ9XFsI/eHSk7yG/A0E4euJUnMCWt1LWebTyRKwJ1vtfeWN6kDPJYInL +AalqjCZVT8KwMr6YPUTDF9BLvODvZqIbUCK8WxrGZNF8aya7KMMEQQG8nwLGDPRfa SH2xvum2s0xU13n4RYxvNn2vHldLkzilJQT5mhlc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kishon Vijay Abraham I , Philipp Zabel , Sasha Levin Subject: [PATCH 4.14 004/209] reset: Fix memory leak in reset_control_array_put() Date: Wed, 4 Dec 2019 18:53:36 +0100 Message-Id: <20191204175321.893517687@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@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: Kishon Vijay Abraham I [ Upstream commit 532f9cd6ee994ed10403e856ca27501428048597 ] Memory allocated for 'struct reset_control_array' in of_reset_control_array_get() is never freed in reset_control_array_put() resulting in kmemleak showing the following backtrace. backtrace: [<00000000c5f17595>] __kmalloc+0x1b0/0x2b0 [<00000000bd499e13>] of_reset_control_array_get+0xa4/0x180 [<000000004cc02754>] 0xffff800008c669e4 [<0000000050a83b24>] platform_drv_probe+0x50/0xa0 [<00000000d3a0b0bc>] really_probe+0x108/0x348 [<000000005aa458ac>] driver_probe_device+0x58/0x100 [<000000008853626c>] device_driver_attach+0x6c/0x90 [<0000000085308d19>] __driver_attach+0x84/0xc8 [<00000000080d35f2>] bus_for_each_dev+0x74/0xc8 [<00000000dd7f015b>] driver_attach+0x20/0x28 [<00000000923ba6e6>] bus_add_driver+0x148/0x1f0 [<0000000061473b66>] driver_register+0x60/0x110 [<00000000c5bec167>] __platform_driver_register+0x40/0x48 [<000000007c764b4f>] 0xffff800008c6c020 [<0000000047ec2e8c>] do_one_initcall+0x5c/0x1b0 [<0000000093d4b50d>] do_init_module+0x54/0x1d0 Fixes: 17c82e206d2a ("reset: Add APIs to manage array of resets") Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin --- drivers/reset/core.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/drivers/reset/core.c b/drivers/reset/core.c index 72b96b5c75a8f..7e0a14211c88a 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -513,6 +513,7 @@ static void reset_control_array_put(struct reset_control_array *resets) for (i = 0; i < resets->num_rstcs; i++) __reset_control_put_internal(resets->rstc[i]); mutex_unlock(&reset_list_mutex); + kfree(resets); } /** From patchwork Wed Dec 4 17:53:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180823 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp929313ile; Wed, 4 Dec 2019 10:01:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxo6VbiqKrAjkc7bNc2GxQ7mEAiSKdkEwj9J1kYspCx5x1kj7N4ncqXEw5CUIjHj8NOnMbV X-Received: by 2002:aca:5487:: with SMTP id i129mr3517231oib.167.1575482479551; Wed, 04 Dec 2019 10:01:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482479; cv=none; d=google.com; s=arc-20160816; b=oHr9aqW2FkPowk5sES4eQsAF5MkUfdcC8fLUNNS1VM7xpfe0N7Saqceh0DtnN6daK0 4AFohjy76dHqbAqBqOGJB4dotXrGqSfvRUS4nquEyStTDSQm3ivVSXWEjiOAFTLowOJd cWbU8Q9KwayUDK9REm+k2jFo0oGMVHw5w3egt5RIldMC+jKRYTblAH8AKk0iL3kG3Hax 328VHoyzXYMzpWgoULKhLi5D8blRoNJ7pGPNKSy70iS5JtIB3BzLgn35AeJXRSQctDzu f7RV63hXCAXRarbUqLe2diS8KnJrNqC+MUdGotF39ec+/Tq5bY3aUsscN6Wymtkdi181 db7Q== 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=RmCOXhAWOXW7IG2Dkt84WGjV+8EqG6mMIpWORJGHeBk=; b=jdz+A4otLilwaP9KQkUE2y2WNF1SaxtsIiRISGtKorTZ0D8lUsVD1WL4usVgGq+OyP jF5UyqSpN/KzL+le3/neK+8L85ONKPf1H9o1mAohzF5I/cOjdDkSBAccRpEguMhLq9RC P5MdayWY1pPLacU4wYwKTA5Or/iomvMrvVaSjzpsFxcR8TmcwFcxXthB6g0dCLCq6BMd Gg82EShBvLRYangj9J8LqHY+UF47XZclJ2fnQQvJRinrmTj+uhbz3G9MmbVuYOIiVCXu vr4quDyArK37c+FEPlz9Y/wgZpQOA22RUGU9LqjCRPT4V832IcleLw9D98vG8yQVWBWk lplw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kMYWVfrf; 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 u130si3633966oif.94.2019.12.04.10.01.19; Wed, 04 Dec 2019 10:01:19 -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=kMYWVfrf; 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 S1729152AbfLDSBR (ORCPT + 15 others); Wed, 4 Dec 2019 13:01:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:41400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729160AbfLDSBR (ORCPT ); Wed, 4 Dec 2019 13:01:17 -0500 Received: from localhost (unknown [217.68.49.72]) (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 6FE4920659; Wed, 4 Dec 2019 18:01:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482476; bh=HzwGEnNtDZVMMu7FAHSRHg9PbEd0qAwU8A/e3PfjkaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kMYWVfrfBedMM6rCGlMomcNQJunUCJptlE1CRFAx0FcHFhDI5EgaCIW1v6FpuaJ+7 1GtRdfTDYYvA2hurfUa9Z31qLSQGxOGMO4dwzaD/OaCteIj6/AAjuLXKT98Q1vvP0Z LZtM1IdKUpu+pNkMoqJWJfxZOWsURX9vQRUzqtCA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Stephen Boyd , Sasha Levin Subject: [PATCH 4.14 012/209] clk: ti: dra7-atl-clock: Remove ti_clk_add_alias call Date: Wed, 4 Dec 2019 18:53:44 +0100 Message-Id: <20191204175322.412048835@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@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: Peter Ujfalusi [ Upstream commit 9982b0f69b49931b652d35f86f519be2ccfc7027 ] ti_clk_register() calls it already so the driver should not create duplicated alias. Signed-off-by: Peter Ujfalusi Link: https://lkml.kernel.org/r/20191002083436.10194-1-peter.ujfalusi@ti.com Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/ti/clk-dra7-atl.c | 6 ------ 1 file changed, 6 deletions(-) -- 2.20.1 diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c index 1488154704313..beb672a215b6c 100644 --- a/drivers/clk/ti/clk-dra7-atl.c +++ b/drivers/clk/ti/clk-dra7-atl.c @@ -174,7 +174,6 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node) struct clk_init_data init = { NULL }; const char **parent_names = NULL; struct clk *clk; - int ret; clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); if (!clk_hw) { @@ -207,11 +206,6 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node) clk = ti_clk_register(NULL, &clk_hw->hw, node->name); if (!IS_ERR(clk)) { - ret = ti_clk_add_alias(NULL, clk, node->name); - if (ret) { - clk_unregister(clk); - goto cleanup; - } of_clk_add_provider(node, of_clk_src_simple_get, clk); kfree(parent_names); return; From patchwork Wed Dec 4 17:54:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180825 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp931350ile; Wed, 4 Dec 2019 10:02:29 -0800 (PST) X-Google-Smtp-Source: APXvYqw73jlYfjUGygCDKQo1qnsBnCiv2rNxWSMNu1ml9aZlGtL6V6xLfkcZ5KQcp9hngSj5OiN3 X-Received: by 2002:aca:503:: with SMTP id 3mr3565109oif.24.1575482549758; Wed, 04 Dec 2019 10:02:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482549; cv=none; d=google.com; s=arc-20160816; b=wrLmkC2nkR3B8yCZbyYAgRm/cVAtDVEIelCLuN6vrufqu7T+bs9Gc0f0nE1BCAtHtE 6oFVH2rnjI0MEpHD2Q0Zo/ZTwIDf5R0C+UFbT0DdLOYGwVFocqAI8G2ttxU/kMj16GA7 eA9nQ7+F++Lmf225LRCHjvbjdnoYoiCp143tzTFzCBydnXeJEqGBlX+fauFl7ZJ80hWm t78a5K3wOMe/fkLQNPpxUjNSLhupo5UDCVE03rE60Dx/yWc0yWhNSPq7Wrj3rKnYnUvn ESVWbxMiZY/4TERAjHiFPuxKm+zN3k0W1yQbWKK6vCncFr9nYUXHxl+6OHHGBp7OlE0/ ADEw== 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=LVrgQHZvT+o7zYOcstxfFuQGkt4Jaj+bjz8pK6/SoCo=; b=fcBtVA7Pr7SnLI4D5eX6mRwcUvps5VMcW+LSYT/h9zI9Ppy6zEhb8wCv7Bmy12vW3Y xrCO1ogX8Luop9v9lWH8eSY4f+uzudMzg0TtSMJtpuik8r0yYpvRSiteBR1tWNAxBFBv DPdPJuKjG2bM9fyykjp+hCLvSOHsamjXM09g8iWDfpw6I9Dd6TSfAjmTEsso9ryeWvOc EA891dyFj47IjMdM93j17Mn6m2nzb2BDECNNOmD6UkZWzHlx6RSds09n33PNkTRE+aZb SYDUlV/twRYu0Hr3A0WDqEP5oMNJX1Uf63RctmZA2b25WoSLsMqwpA2cmktKVlvZRxeT 4zdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WUWtpkdC; 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 r6si3554919otq.95.2019.12.04.10.02.29; Wed, 04 Dec 2019 10:02:29 -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=WUWtpkdC; 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 S1728738AbfLDSC1 (ORCPT + 15 others); Wed, 4 Dec 2019 13:02:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:44416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729838AbfLDSC0 (ORCPT ); Wed, 4 Dec 2019 13:02:26 -0500 Received: from localhost (unknown [217.68.49.72]) (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 9A67620659; Wed, 4 Dec 2019 18:02:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482546; bh=cmKGOHgM7wHlc5kYMfA4o8dgcIF1tniR9eks2UIjlII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WUWtpkdCWGBRHVp76LG18vcHKm5kMugsxcmgYTsoKFzUkW85jNumL9NTTu+JKXTYb KZ6EKYeAHYmRZKvYYFnnYzyYuLSp5JDpFqsI47zPh7WgT7ViVBtcO3XGKl3imjqaFd K4gbkpss+/4dE+uu/onbzazhHjhynwixz9tMzV5o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steve Capper , Will Deacon , Suzuki K Poulose , Sasha Levin Subject: [PATCH 4.14 038/209] arm64: smp: Handle errors reported by the firmware Date: Wed, 4 Dec 2019 18:54:10 +0100 Message-Id: <20191204175324.047182044@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@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: Suzuki K Poulose [ Upstream commit f357b3a7e17af7736d67d8267edc1ed3d1dd9391 ] The __cpu_up() routine ignores the errors reported by the firmware for a CPU bringup operation and looks for the error status set by the booting CPU. If the CPU never entered the kernel, we could end up in assuming stale error status, which otherwise would have been set/cleared appropriately by the booting CPU. Reported-by: Steve Capper Cc: Will Deacon Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/kernel/smp.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 0881dfab10f8f..909bf3926fd23 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -144,6 +144,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) } } else { pr_err("CPU%u: failed to boot: %d\n", cpu, ret); + return ret; } secondary_data.task = NULL; From patchwork Wed Dec 4 17:54:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180830 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp934630ile; Wed, 4 Dec 2019 10:04:52 -0800 (PST) X-Google-Smtp-Source: APXvYqznAq4Upa8aQ0XOfImBnb2UY15hL7+2MY6FNHlgZV5BjD+XGCTHtfxX6UhihNBrUBdHOFMP X-Received: by 2002:aca:1e02:: with SMTP id m2mr3736110oic.81.1575482692600; Wed, 04 Dec 2019 10:04:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482692; cv=none; d=google.com; s=arc-20160816; b=YDiPAeIs/O2SkFeSrOI9cv/9Vum3U+UWaj7qZe1L8MqRX+MmxXTC8BLavAFrjt7BE6 QKTXtD0Nq1mV8X+IpCz163knARKIwOmgxn3+K5o9xoyR3R7r1lFGFgQ+il+c9FAgO0Ls 5y6D5TW4cfTYp+27J12JZ9/jsLsI4vXfcwdlhSGxkGKX6DhSCA8g2XyJbM1cRm0TU1mq r+OuSccTePozNq79+IfPQBKC0smcqA1YX4xOik8qOTzsBEy8KBAyj38ilrOG8dp63ECQ 9s95AzzZBp/Hz5ih5+8AA9YI6UbYLqwrWI+R2YqxJRqKKj9ryZUb4GUB29wvLLpNkcgd u5hQ== 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=vCndiyMoS+uI7Gsi5ws3CWsybosDsbZVn7bJ/KpMVUc=; b=SNq2z7iLmFcl5fl5NAlF3XuiEn+wbC7gqweFrJk6P+Vz3G+FPMvABbQvdb0rZL24zf FRIIy0NuPM+prHSjgp+Lx6SWSZwYlYuvC71PTlsSPfmPxSCdzDOIOB3gSdulj+S0BZ/G CEAgkzoaigSaxTMd/PjWI6VcjV6qEw7nE0PY/ws1YP7wXzJpxZ8a+LkmftsUQmghx4tx S/tmn2GzeekpW6Yqi1v5s4CuiolShnZnVqP3h0ydmgKIObHXF7nciedAWcMe8sCv31jL nZlSP+A2dCKY0tqZOFabhZksxrwVDv231DlZASs9t9gHdEV5ibeSrVDe0qY9KiL5l8fk w6gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OIFoYkeI; 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 t3si3675684otj.109.2019.12.04.10.04.52; Wed, 04 Dec 2019 10:04:52 -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=OIFoYkeI; 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 S1728982AbfLDSEv (ORCPT + 15 others); Wed, 4 Dec 2019 13:04:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:50550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730265AbfLDSEt (ORCPT ); Wed, 4 Dec 2019 13:04:49 -0500 Received: from localhost (unknown [217.68.49.72]) (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 12F0D20659; Wed, 4 Dec 2019 18:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482688; bh=BN0DhflK9aTP7pbgnOI1FtlaLz5PDG30I11spKOXY7I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OIFoYkeINDmg7MbCaOa6A6L5kT+596L5LLEhRrY4ml3Ql6gV6WYZub9opgnDxH0OO WBXmetjBzEueQu71WloNcEOC6zCGW6rs+++KP/80tXE63hZZr0HnCofiN5lWZ+f5vn Tz+HK10yYSEMlOSeVT5AqZB1MTsrjktkPFdN5jjk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Michal Simek , Sasha Levin Subject: [PATCH 4.14 052/209] microblaze: adjust the help to the real behavior Date: Wed, 4 Dec 2019 18:54:24 +0100 Message-Id: <20191204175324.959353887@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@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: Masahiro Yamada [ Upstream commit bafcc61d998c1ca18f556d92a0e95335ac68c7da ] "make ARCH=microblaze help" mentions simpleImage.
.unstrip, but it is not a real Make target. It does not work because Makefile assumes "system.unstrip" is the name of DT. $ make ARCH=microblaze CROSS_COMPILE=microblaze-linux- simpleImage.system.unstrip [ snip ] make[1]: *** No rule to make target 'arch/microblaze/boot/dts/system.unstrip.dtb', needed by 'arch/microblaze/boot/dts/system.dtb'. Stop. make: *** [Makefile;1060: arch/microblaze/boot/dts] Error 2 make: *** Waiting for unfinished jobs.... simpleImage.
works like a phony target that generates multiple images. Reflect the real behavior. I removed the DT directory path information because it is already explained a few lines below. While I am here, I deleted the redundant *_defconfig explanation. The top-level Makefile caters to list available defconfig files: mmu_defconfig - Build for mmu nommu_defconfig - Build for nommu Signed-off-by: Masahiro Yamada Signed-off-by: Michal Simek Signed-off-by: Sasha Levin --- arch/microblaze/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index d269dd4b82795..188f07bba0959 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile @@ -91,11 +91,11 @@ define archhelp echo '* linux.bin - Create raw binary' echo ' linux.bin.gz - Create compressed raw binary' echo ' linux.bin.ub - Create U-Boot wrapped raw binary' - echo ' simpleImage.
- ELF image with $(arch)/boot/dts/
.dts linked in' - echo ' - stripped elf with fdt blob' - echo ' simpleImage.
.unstrip - full ELF image with fdt blob' - echo ' *_defconfig - Select default config from arch/microblaze/configs' - echo '' + echo ' simpleImage.
- Create the following images with
.dtb linked in' + echo ' simpleImage.
: raw image' + echo ' simpleImage.
.ub : raw image with U-Boot header' + echo ' simpleImage.
.unstrip: ELF (identical to vmlinux)' + echo ' simpleImage.
.strip : stripped ELF' echo ' Targets with
embed a device tree blob inside the image' echo ' These targets support board with firmware that does not' echo ' support passing a device tree directly. Replace
with the' From patchwork Wed Dec 4 17:54:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180829 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp932430ile; Wed, 4 Dec 2019 10:03:13 -0800 (PST) X-Google-Smtp-Source: APXvYqznY/LPlA15JyZAzTKjZfGCYuW/Ld5EOAfFr4EBgK4ai2IT3rOcDk7jaqsPEPT22BxO8DB3 X-Received: by 2002:a9d:5543:: with SMTP id h3mr3611436oti.33.1575482593402; Wed, 04 Dec 2019 10:03:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482593; cv=none; d=google.com; s=arc-20160816; b=hUurHsJ8Phe1M0tRlWSOh+miI09ys+TF0abWv89CsPxQTd8DafsvDhBpPAE/ygeyd6 Bma/MwEIdHbE42drVQBkbwqWS4YVu+aLY+ufVC2gicMhEFQ2uQoB9N9aVLKvlvTvLhiS unOX9e6ROy2J8x3RTdp8EdmZurSlkns/FMaPqTcxQB+eeQIZcNTvGZs7l6yZiWiP07s9 EYz824HS2ipbWIdWtn3RQmgo84tTkMMU1A+611HyPwIbbnc1eE+jXt4vW44n/YFF08+D MyxXwxseWJGcrjCLNZfIOhk3qhVJJxr8NuVxBj024/eHD6gh1VqiARRC9GMUID4av9Er CLDg== 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=jRomIa/TSsge/KS4Z1a0XgPaf/4SuYaARWPnqn21xx4=; b=i4bJFeUN+kQAwNvgytieSjHXMb7GhC2c+EdWagRY/h7W2V04b4lOYQpL1mCDP+rAKX hXiI2jSL5WZn3AI/2e0uU9D2gbGJtQ+NcVDDtudcFDFv05C5Gm7n2zKBCzDIPchzVJ7J WCzUtD6tXXCkHR32BhCghHO//FwfVTXSdsiOQDDLfOnlJePfDHH4HgbxZfOk+yCmC95g BJP1lZgqWiGKFFlTYK7Ci3nrqcaBtXR/JXTsULXrk0bKxyAu43XUi+4uRA+q9YnjkUGJ 19+ldQnz7QxlEl9F86YSAcb2r2L0JVzpFy+hL5NS2oMe5sTdBz8NwZciXv/v+DsmdP8w WpJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v9uG1mE1; 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 w26si3592522oih.179.2019.12.04.10.03.13; Wed, 04 Dec 2019 10:03:13 -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=v9uG1mE1; 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 S1729223AbfLDSDM (ORCPT + 15 others); Wed, 4 Dec 2019 13:03:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:46506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729980AbfLDSDL (ORCPT ); Wed, 4 Dec 2019 13:03:11 -0500 Received: from localhost (unknown [217.68.49.72]) (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 8B92D20862; Wed, 4 Dec 2019 18:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482591; bh=zsuiNmBv/Haul+mcg+RTs02b5duidR9hhS+owPdewdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v9uG1mE1TeZEs+YWQolnOnH/1qSr0eoeLXxVb2VIPnlqrTxi12eCIR1AFddjqehBz 1GGGlDHqFrvi1RQkF2Q/CHaL+tl5AMEaOGsWHsOreTjEgOd6T2uRDR/ZNOGAMvgpTs lYu5sFoBb/V4TJwHkLU/tFp1ZlHnYJD08EqexQIo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jerome Brunet , Ulf Hansson , Sasha Levin Subject: [PATCH 4.14 058/209] mmc: meson-gx: make sure the descriptor is stopped on errors Date: Wed, 4 Dec 2019 18:54:30 +0100 Message-Id: <20191204175325.342559319@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@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: Jerome Brunet [ Upstream commit 18f92bc02f1739b5c4d5b70009fbb7eada45bca3 ] On errors, if we don't stop the descriptor chain, it may continue to run and raise IRQ after we have called mmc_request_done(). This is bad because we won't be able to get cmd anymore and properly deal with the IRQ. This patch makes sure the descriptor chain is stopped before calling mmc_request_done() Fixes: 79ed05e329c3 ("mmc: meson-gx: add support for descriptor chain mode") Signed-off-by: Jerome Brunet Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/meson-gx-mmc.c | 73 ++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 10 deletions(-) -- 2.20.1 diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 08a55c2e96e1b..53ce1bb83d2c5 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -74,9 +75,11 @@ #define CFG_CLK_ALWAYS_ON BIT(18) #define CFG_CHK_DS BIT(20) #define CFG_AUTO_CLK BIT(23) +#define CFG_ERR_ABORT BIT(27) #define SD_EMMC_STATUS 0x48 #define STATUS_BUSY BIT(31) +#define STATUS_DESC_BUSY BIT(30) #define STATUS_DATI GENMASK(23, 16) #define SD_EMMC_IRQ_EN 0x4c @@ -905,6 +908,7 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) cmd_cfg |= FIELD_PREP(CMD_CFG_CMD_INDEX_MASK, cmd->opcode); cmd_cfg |= CMD_CFG_OWNER; /* owned by CPU */ + cmd_cfg |= CMD_CFG_ERROR; /* stop in case of error */ meson_mmc_set_response_bits(cmd, &cmd_cfg); @@ -999,6 +1003,17 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) u32 irq_en, status, raw_status; irqreturn_t ret = IRQ_NONE; + irq_en = readl(host->regs + SD_EMMC_IRQ_EN); + raw_status = readl(host->regs + SD_EMMC_STATUS); + status = raw_status & irq_en; + + if (!status) { + dev_dbg(host->dev, + "Unexpected IRQ! irq_en 0x%08x - status 0x%08x\n", + irq_en, raw_status); + return IRQ_NONE; + } + if (WARN_ON(!host) || WARN_ON(!host->cmd)) return IRQ_NONE; @@ -1006,22 +1021,18 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) cmd = host->cmd; data = cmd->data; - irq_en = readl(host->regs + SD_EMMC_IRQ_EN); - raw_status = readl(host->regs + SD_EMMC_STATUS); - status = raw_status & irq_en; - cmd->error = 0; if (status & IRQ_CRC_ERR) { dev_dbg(host->dev, "CRC Error - status 0x%08x\n", status); cmd->error = -EILSEQ; - ret = IRQ_HANDLED; + ret = IRQ_WAKE_THREAD; goto out; } if (status & IRQ_TIMEOUTS) { dev_dbg(host->dev, "Timeout - status 0x%08x\n", status); cmd->error = -ETIMEDOUT; - ret = IRQ_HANDLED; + ret = IRQ_WAKE_THREAD; goto out; } @@ -1046,17 +1057,49 @@ out: /* ack all enabled interrupts */ writel(irq_en, host->regs + SD_EMMC_STATUS); + if (cmd->error) { + /* Stop desc in case of errors */ + u32 start = readl(host->regs + SD_EMMC_START); + + start &= ~START_DESC_BUSY; + writel(start, host->regs + SD_EMMC_START); + } + if (ret == IRQ_HANDLED) meson_mmc_request_done(host->mmc, cmd->mrq); - else if (ret == IRQ_NONE) - dev_warn(host->dev, - "Unexpected IRQ! status=0x%08x, irq_en=0x%08x\n", - raw_status, irq_en); spin_unlock(&host->lock); return ret; } +static int meson_mmc_wait_desc_stop(struct meson_host *host) +{ + int loop; + u32 status; + + /* + * It may sometimes take a while for it to actually halt. Here, we + * are giving it 5ms to comply + * + * If we don't confirm the descriptor is stopped, it might raise new + * IRQs after we have called mmc_request_done() which is bad. + */ + for (loop = 50; loop; loop--) { + status = readl(host->regs + SD_EMMC_STATUS); + if (status & (STATUS_BUSY | STATUS_DESC_BUSY)) + udelay(100); + else + break; + } + + if (status & (STATUS_BUSY | STATUS_DESC_BUSY)) { + dev_err(host->dev, "Timed out waiting for host to stop\n"); + return -ETIMEDOUT; + } + + return 0; +} + static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id) { struct meson_host *host = dev_id; @@ -1067,6 +1110,13 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id) if (WARN_ON(!cmd)) return IRQ_NONE; + if (cmd->error) { + meson_mmc_wait_desc_stop(host); + meson_mmc_request_done(host->mmc, cmd->mrq); + + return IRQ_HANDLED; + } + data = cmd->data; if (meson_mmc_bounce_buf_read(data)) { xfer_bytes = data->blksz * data->blocks; @@ -1107,6 +1157,9 @@ static void meson_mmc_cfg_init(struct meson_host *host) cfg |= FIELD_PREP(CFG_RC_CC_MASK, ilog2(SD_EMMC_CFG_CMD_GAP)); cfg |= FIELD_PREP(CFG_BLK_LEN_MASK, ilog2(SD_EMMC_CFG_BLK_SIZE)); + /* abort chain on R/W errors */ + cfg |= CFG_ERR_ABORT; + writel(cfg, host->regs + SD_EMMC_CFG); } From patchwork Wed Dec 4 17:56:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180831 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp939612ile; Wed, 4 Dec 2019 10:08:36 -0800 (PST) X-Google-Smtp-Source: APXvYqzbSxgydURHJ6B7RiFNfYZGR+BuzyzrN2Hjh4VFIKQrgX85uvwoVOggGJrAPNVWu/6+O0Mo X-Received: by 2002:a9d:6357:: with SMTP id y23mr3567211otk.91.1575482827013; Wed, 04 Dec 2019 10:07:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482827; cv=none; d=google.com; s=arc-20160816; b=iLaqafwd1ysY9v3Ed7sdvfFsc4PauQROfubVIDc+TSYuwoZ+ZYTWpE47BusjzA+o7X AbG8YE5ghGEaFwDYFplc9ndpXB8InCoNn15pFUKa9jnLWKBMvPkzs6Kq7ZAehTDu7kvJ MlMQmSpTew8jp6XwkJ4w8QlMtDiVL9WyjAW/luEWApclqHtyDKzSS5N+RMrhCm8MyXc3 YuTBH98PTj3eeRJos/JKoDPHr9rhCiVwRJqdMWjgJJiOEEpOaxVNmLHwjtXVovvVCfXS NgQvrtA7SM5ggJfyOIWiYxGseOAI7qGCAD53w4R5Ixn9lxqJPDjBP1/x89AaNzZhQlru DnDg== 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=7dn/4tFIfyzAFIzOhDgpwGG2qzT+KinLAV9GTbqFwH4=; b=E2k2GTvditBLUEwzwKMyIGeIhFXBNeOJpWIgT667NFVm/WvzgtlpibF1eQvZBOnL2/ QSHtTd7ByPNX+T+eGtq+aj8wa+OMPvjuDPe/k7xzRoSagCRORLKhF9korhBZcQy8fMlm FhdqInvXU8nKCFIOCOl1J7v2vTx6/z8Ap4oGHWNRncfoUVvfGWfgIlIGLv0SbyxbZ8uB tkXhJc/6HoYUeNTZRmMHI5G3TSsnZmCATSPn4FgyFI8maOou/f2TiiCJAbRSdJm0Hszw hI9eVswFIUrESMeAprhtEeXFdApW7BqOxnh+I8QE+1VtyKPrNXX4zDB5/MAm60fn0nLF rriw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y5Wu+QM6; 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 a64si778395oif.202.2019.12.04.10.07.06; Wed, 04 Dec 2019 10:07:07 -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=Y5Wu+QM6; 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 S1730084AbfLDSHF (ORCPT + 15 others); Wed, 4 Dec 2019 13:07:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:56216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730691AbfLDSHD (ORCPT ); Wed, 4 Dec 2019 13:07:03 -0500 Received: from localhost (unknown [217.68.49.72]) (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 C56F420675; Wed, 4 Dec 2019 18:07:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482822; bh=sh0v4/QS4yXDf8nsPhpABgTaRIB6/vBbFmDq+bER7xI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y5Wu+QM6ztDAgeKTjRCCpUNmv39fGK/3xHB1gW51SkeLq95cq7eZYNYw29CXd5/VQ qkXFmFaT2iw3LWpF2peR6PVkAYdm48FPBogO9h8c+YqPs/LggWwCM8TuZS16uG2kFj MfZ0PDNEVEXoc5TeKcuha9rwDz2Wjc+2nmBVhy7M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Luo , John Garry , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 149/209] scsi: libsas: Support SATA PHY connection rate unmatch fixing during discovery Date: Wed, 4 Dec 2019 18:56:01 +0100 Message-Id: <20191204175333.764334004@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@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: John Garry [ Upstream commit cec9771d2e954650095aa37a6a97722c8194e7d2 ] +----------+ +----------+ | | | | | |--- 3.0 G ---| |--- 6.0 G --- SAS disk | | | | | |--- 3.0 G ---| |--- 6.0 G --- SAS disk |initiator | | | | device |--- 3.0 G ---| Expander |--- 6.0 G --- SAS disk | | | | | |--- 3.0 G ---| |--- 6.0 G --- SATA disk -->failed to connect | | | | | | | |--- 6.0 G --- SATA disk -->failed to connect | | | | +----------+ +----------+ According to Serial Attached SCSI - 1.1 (SAS-1.1): If an expander PHY attached to a SATA PHY is using a physical link rate greater than the maximum connection rate supported by the pathway from an STP initiator port, a management application client should use the SMP PHY CONTROL function (see 10.4.3.10) to set the PROGRAMMED MAXIMUM PHYSICAL LINK RATE field of the expander PHY to the maximum connection rate supported by the pathway from that STP initiator port. Currently libsas does not support checking if this condition occurs, nor rectifying when it does. Such a condition is not at all common, however it has been seen on some pre-silicon environments where the initiator PHY only supports a 1.5 Gbit maximum linkrate, mated with 12G expander PHYs and 3/6G SATA phy. This patch adds support for checking and rectifying this condition during initial device discovery only. We do support checking min pathway connection rate during revalidation phase, when new devices can be detected in the topology. However we do not support in the case of the the user reprogramming PHY linkrates, such that min pathway condition is not met/maintained. A note on root port PHY rates: The libsas root port PHY rates calculation is broken. Libsas sets the rates (min, max, and current linkrate) of a root port to the same linkrate of the first PHY member of that same port. In doing so, it assumes that all other PHYs which subsequently join the port to have the same negotiated linkrate, when they could actually be different. In practice this doesn't happen, as initiator and expander PHYs are normally initialised with consistent min/max linkrates. This has not caused an issue so far, so leave alone for now. Tested-by: Jian Luo Signed-off-by: John Garry Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/libsas/sas_expander.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.20.1 diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 7f2d00354a850..63c44eaabf69e 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -817,6 +817,26 @@ static struct domain_device *sas_ex_discover_end_dev( #ifdef CONFIG_SCSI_SAS_ATA if ((phy->attached_tproto & SAS_PROTOCOL_STP) || phy->attached_sata_dev) { + if (child->linkrate > parent->min_linkrate) { + struct sas_phy_linkrates rates = { + .maximum_linkrate = parent->min_linkrate, + .minimum_linkrate = parent->min_linkrate, + }; + int ret; + + pr_notice("ex %016llx phy%02d SATA device linkrate > min pathway connection rate, attempting to lower device linkrate\n", + SAS_ADDR(child->sas_addr), phy_id); + ret = sas_smp_phy_control(parent, phy_id, + PHY_FUNC_LINK_RESET, &rates); + if (ret) { + pr_err("ex %016llx phy%02d SATA device could not set linkrate (%d)\n", + SAS_ADDR(child->sas_addr), phy_id, ret); + goto out_free; + } + pr_notice("ex %016llx phy%02d SATA device set linkrate successfully\n", + SAS_ADDR(child->sas_addr), phy_id); + child->linkrate = child->min_linkrate; + } res = sas_get_ata_info(child, phy); if (res) goto out_free; From patchwork Wed Dec 4 17:56:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180844 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp957433ile; Wed, 4 Dec 2019 10:23:12 -0800 (PST) X-Google-Smtp-Source: APXvYqy5kCpu+IngaY76X+/y2VtwMxRBtKaCZ6wlrFfE/KT7Ffz/dONcxETYp/FGCkq3tqb9r8Bo X-Received: by 2002:aca:d5d3:: with SMTP id m202mr3619150oig.161.1575483676670; Wed, 04 Dec 2019 10:21:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575483676; cv=none; d=google.com; s=arc-20160816; b=MhTjlnH3YnWlSQOOM4FHPy8ka5xiAeJLbGXYAhC08SRDZrCq1lgut+l0acWg6ANw5f /ATsLg+b0nI9jHss1yiFAL2KjxO3IKrhH8TRIBLs+GC4MM8BJHdO+Xu2FoSrDzbCd93N Ay9UkO3orIFrmY8EwE9iI68FnEbAklJfv9+3lAEBsCibfkfq0xQIPcMYZ2wSfqCLFGEG Zap4CPasU+KVqcPr9yFpm7E2+5/G8B9OqIvApOcsqGZHAJp8CkpAMJQXg872zKHL7ULg nt6SfsV48mEQFA6sTTW2fraB3sHtJ02qk75AUQTehmrrprDzk1eUt/b7vmsTerIBHBge H0fw== 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=028m8Hb6ehXnVkEEifGcBTFbCqpvAgp0x6bs8s8r2rE=; b=nvIidE0gworyZh2vy1u3+GLyExGrtf2pjmyHVRN26537GrjXlauX431U7MCRT5JiIL +KFLhHoFp3iBCBFeM5iS9r2X1ELCWQ5n4YpkLjSKAAx4SulP+sQCBlfOlWT9maZEMZt4 LayuWw8KmbNbje7Z3nJKLbeeD3s6NZRW2CE0j9/TP1owWpWaIWbNoZDaNu6Qev7dWtn7 aohCxqCVhSAxrYyzyXnA/shrerSar+DEK9r1ZMy2NNDq1eVxhJWhKMOizU7r7XJhfaix Mt5CeRt7GwnxFFsP8nsCpjGWR65ZrqmKeadjlOTllipp1AH+J1Un1mddodQAq/ud5jgA wtuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rQui2GjL; 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 v2si4376907otf.58.2019.12.04.10.21.14; Wed, 04 Dec 2019 10:21:16 -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=rQui2GjL; 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 S1730162AbfLDSVM (ORCPT + 15 others); Wed, 4 Dec 2019 13:21:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:56578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729039AbfLDSHK (ORCPT ); Wed, 4 Dec 2019 13:07:10 -0500 Received: from localhost (unknown [217.68.49.72]) (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 72A8120675; Wed, 4 Dec 2019 18:07:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482829; bh=2m71RfjpJMhsE/hnMO23RQYRMaw/9glv4FzCsCZ4loM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rQui2GjLfDTqEpVBBhzrgtYOMQXY0oWUKYTxO7pgJRQONBdQ1T5EMfKWVhQjuCO3v LAgnuihfW0EnFNmhmZ9RPU0dSTEtx2OhcgNfNRb7B3/lC8vB/S4Rcxbu3xfn6icHsU UdyC7lKI+s3JMaixBbEY94DBgCuF5ZHQWI+0o1j4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Luo , John Garry , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 152/209] scsi: libsas: Check SMP PHY control function result Date: Wed, 4 Dec 2019 18:56:04 +0100 Message-Id: <20191204175333.958242641@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@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: John Garry [ Upstream commit 01929a65dfa13e18d89264ab1378854a91857e59 ] Currently the SMP PHY control execution result is checked, however the function result for the command is not. As such, we may be missing all potential errors, like SMP FUNCTION FAILED, INVALID REQUEST FRAME LENGTH, etc., meaning the PHY control request has failed. In some scenarios we need to ensure the function result is accepted, so add a check for this. Tested-by: Jian Luo Signed-off-by: John Garry Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/libsas/sas_expander.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 63c44eaabf69e..f77d72f01da91 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -614,7 +614,14 @@ int sas_smp_phy_control(struct domain_device *dev, int phy_id, } res = smp_execute_task(dev, pc_req, PC_REQ_SIZE, pc_resp,PC_RESP_SIZE); - + if (res) { + pr_err("ex %016llx phy%02d PHY control failed: %d\n", + SAS_ADDR(dev->sas_addr), phy_id, res); + } else if (pc_resp[2] != SMP_RESP_FUNC_ACC) { + pr_err("ex %016llx phy%02d PHY control failed: function result 0x%x\n", + SAS_ADDR(dev->sas_addr), phy_id, pc_resp[2]); + res = pc_resp[2]; + } kfree(pc_resp); kfree(pc_req); return res; From patchwork Wed Dec 4 17:56:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180832 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp940328ile; Wed, 4 Dec 2019 10:09:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzUxOi0mroz89Cquub/xTDl1FKe8PdxGRWWhBIru9zWqM5AmHc4DgIy0WUcScTyHx+FuiLH X-Received: by 2002:a54:4788:: with SMTP id o8mr3836463oic.32.1575482949711; Wed, 04 Dec 2019 10:09:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575482949; cv=none; d=google.com; s=arc-20160816; b=liWIU56Dl1Ewk8IqTsvwuZtMeVVFADzIsdhAU5bqkISO4pi9urtq5MgyqftlewJYcM uQLDF7faJ7taWFU/l80niMjm2n+hASYhjwRsomDFvdb5u1lJXtd4U+PrrJz90H+m1ZVa Py9R1ebvrQryNkUvYQB/B5oQWzM/7CCXHWisOb/NbnqZXzYbKgrgk0D5MUnNHjnqgtkd JhuVlJgMZlc6Cdb7QFyRGyX4wp+PmLoSVJ1oJ6RfTN3sHH5bGDX7oUNbXWL9iEYgZQOZ 9sRHp5Zx4uyqLnMginRctxWjcALFC2+g4BEwV5X26fSACDI50udC3PiOnNddD9qrm/sQ iJbg== 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=AiicBYpvpa06yC7avYYD25GfI6z68tBgsqYkHpArztM=; b=YwZXfjRPDUqgi/uVHZLiFyUc5aC0NnJrY/HuLVjbJ+YNOGPxOiLU4SeFn2tuHSC3hW s4WPYHIurMdVXfa6Eeottiof/T19M2ZrZ6WMqrSCKRHgSI/f1MmkoG2XE9CEkutvua+Y HfwtqjJrm8RXtcfeqpzicOuSK7nRWL5K4Db+ZCrph6fREuvOcUoDHZ8lKbDJmFXtKRZN HcLak2UaqA85TU/V5avg5HAqiYg7NpqrDoqn+jR71qE13AqwEKYos5KzUAKsr9MJY6l1 z51vl5C7sS2AkbP1LNbP/BYFjZj9/RNsvRwxtP/YGONYEDTQXpuvbVmc/dig1J4xr9hB fW3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Nz7sap94; 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 o11si3560798otl.286.2019.12.04.10.09.08; Wed, 04 Dec 2019 10:09:09 -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=Nz7sap94; 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 S1731009AbfLDSJG (ORCPT + 15 others); Wed, 4 Dec 2019 13:09:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:34178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730997AbfLDSJF (ORCPT ); Wed, 4 Dec 2019 13:09:05 -0500 Received: from localhost (unknown [217.68.49.72]) (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 B0D8920675; Wed, 4 Dec 2019 18:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482945; bh=2HhXux3UgyzTgTzC9CWGxVny0zbkSdgUsNwkVpdPeZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nz7sap94DqMNhzcfEZVt+03Rt/HFHE0YitYDO69KD4rLVttNvjax1V2puBVVlceM2 HR8CD6BpgISqQIvggOI4D0JoVhrqFA8sfOuDR9q/iyzToRYviNgcHriNr3df0vmRsb QeCkCSN8fMzDCTpnE5z8KpuSkChKnYYhMg++pGcM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lionel Debieve , Herbert Xu , Mathieu Poirier Subject: [PATCH 4.14 199/209] crypto: stm32/hash - Fix hmac issue more than 256 bytes Date: Wed, 4 Dec 2019 18:56:51 +0100 Message-Id: <20191204175337.184460827@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@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: Lionel Debieve commit 0acabecebc912b3ba06289e4ef40476acc499a37 upstream. Correct condition for the second hmac loop. Key must be only set in the first loop. Initial condition was wrong, HMAC_KEY flag was not properly checked. Signed-off-by: Lionel Debieve Signed-off-by: Herbert Xu Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/stm32/stm32-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -361,7 +361,7 @@ static int stm32_hash_xmit_cpu(struct st return -ETIMEDOUT; if ((hdev->flags & HASH_FLAGS_HMAC) && - (hdev->flags & ~HASH_FLAGS_HMAC_KEY)) { + (!(hdev->flags & HASH_FLAGS_HMAC_KEY))) { hdev->flags |= HASH_FLAGS_HMAC_KEY; stm32_hash_write_key(hdev); if (stm32_hash_wait_busy(hdev))