From patchwork Tue Dec 3 22:31:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180769 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2173745ile; Tue, 3 Dec 2019 15:07:38 -0800 (PST) X-Google-Smtp-Source: APXvYqywAz6JAyy3LXtf+jkRirCABkrNPThUfsPOcjxLMYRnuITK73x9hPWif1JRrgJm/63RpZIj X-Received: by 2002:a9d:7b4e:: with SMTP id f14mr260082oto.355.1575414458065; Tue, 03 Dec 2019 15:07:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575414458; cv=none; d=google.com; s=arc-20160816; b=SpBHaYFENXxw3fT6NaSpuc55GUa/g1I7h6cNWnI41LhaV+FYoetNFG11k61zKhje2e E1dORzEMI7s5pLNVjBUn0O7f4fih1lw9PqQrdkYWpEC14taK4YhB2W0TZsOAdkaCN+d0 GLv/bJnub63/b7/YDs8uXRNYHvHSuH7m4nxBIskaPVmOMr2YkYsELLa3RTqXGIZHMV+r o0GeRboz9KqUcDe5T+1wtYabkonr2xtrcsCiqwsnefJ6hquk9sm1ezcIWbKfmEFx6Lku 60eKaCcUYGTUrueAwfhzfaoHeJJ2FpRLeC15JhIgs7bnMKo8lDmrSKcYsM+tb5uUP4IB YHfQ== 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=clfAz/CJYWHRz0FXg90Uh28DQ52lS0WR7TsSaSTce70=; b=Q2tJds08RpJlxTjGq5FYiXvGkOuVTNgXzbQjO3QbFGn1e6tQlCYk8AkjUXJoAlOCP6 nBUr8vlB/1Q4BZ2wm2LGNo6N+/JxP7YgFzHw6tMng8RLfu/EsoeZsZ4LfRYcciR2E1Ih SyAZv5ozx+58vsXRuDrcvPOR8U80uvZKHO9EwnZfsCTezCYZsqSw7XUjjHCxyCW2HMt4 +LzCSrFohXtCJwKppLyTNZUzs5UyPsiQpqvk2Rfes2/UhJJV6gnSEg7Qm2S7zkg9j5DL bxAFqjF6hgSjZmL3/jV7eQU+DvicJAD4Mcllq3h/2xIitgXDSzCF4qltdI+dXweNGtpT vxgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=druYHK3d; 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 y22si1645149oti.269.2019.12.03.15.07.37; Tue, 03 Dec 2019 15:07:38 -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=druYHK3d; 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 S1727842AbfLCXHg (ORCPT + 15 others); Tue, 3 Dec 2019 18:07:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:36924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727981AbfLCWq4 (ORCPT ); Tue, 3 Dec 2019 17:46:56 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 82BF020684; Tue, 3 Dec 2019 22:46:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413216; bh=L4XOYS3b/3flJVtxje65XySINl6P8L3mSzV9zxODNIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=druYHK3dwtZCEeZNwVZgAbHu9OPr8ifiCSyeq1Q6ppV2oAzQjHGdLZx+X5BNWqdl6 E/umfMO2CsFaiSanMS8XHwnoVz+97VVPrnxSpQoA0ctoHa9nlLZI4kN+4AHYm+9TAy K+kPhiTLskx2sGHiQcLwL3SWpKeQW9tBpMAAMLbM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Krzysztof Kozlowski , Chanwoo Choi , kbuild test robot , Sylwester Nawrocki , Sasha Levin Subject: [PATCH 4.19 006/321] clk: samsung: exynos5433: Fix error paths Date: Tue, 3 Dec 2019 23:31:12 +0100 Message-Id: <20191203223427.452305159@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203223427.103571230@linuxfoundation.org> References: <20191203223427.103571230@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: Marek Szyprowski [ Upstream commit faac3604d05e8015567124e5ee79edc3f1568a89 ] Add checking the value returned by samsung_clk_alloc_reg_dump() and devm_kcalloc(). While fixing this, also release all gathered clocks. Fixes: 523d3de41f02 ("clk: samsung: exynos5433: Add support for runtime PM") Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi [s.nawrocki: squashed patch from K. Kozlowski adding missing slab.h header] Reported-by: kbuild test robot Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sylwester Nawrocki Signed-off-by: Sasha Levin --- drivers/clk/samsung/clk-exynos5433.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c index 426980514e679..302596dc79a2c 100644 --- a/drivers/clk/samsung/clk-exynos5433.c +++ b/drivers/clk/samsung/clk-exynos5433.c @@ -16,6 +16,7 @@ #include #include #include +#include #include @@ -5527,6 +5528,8 @@ static int __init exynos5433_cmu_probe(struct platform_device *pdev) data->clk_save = samsung_clk_alloc_reg_dump(info->clk_regs, info->nr_clk_regs); + if (!data->clk_save) + return -ENOMEM; data->nr_clk_save = info->nr_clk_regs; data->clk_suspend = info->suspend_regs; data->nr_clk_suspend = info->nr_suspend_regs; @@ -5535,12 +5538,19 @@ static int __init exynos5433_cmu_probe(struct platform_device *pdev) if (data->nr_pclks > 0) { data->pclks = devm_kcalloc(dev, sizeof(struct clk *), data->nr_pclks, GFP_KERNEL); - + if (!data->pclks) { + kfree(data->clk_save); + return -ENOMEM; + } for (i = 0; i < data->nr_pclks; i++) { struct clk *clk = of_clk_get(dev->of_node, i); - if (IS_ERR(clk)) + if (IS_ERR(clk)) { + kfree(data->clk_save); + while (--i >= 0) + clk_put(data->pclks[i]); return PTR_ERR(clk); + } data->pclks[i] = clk; } } From patchwork Tue Dec 3 22:31:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180747 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2151981ile; Tue, 3 Dec 2019 14:46:04 -0800 (PST) X-Google-Smtp-Source: APXvYqyBE/fjGI5VZIY+RcpEG3Lsj60vBggX3W9hRYOvNH7hyF2q8WxEZIMts0gjci+I1Hrgju6R X-Received: by 2002:a05:6830:95:: with SMTP id a21mr182595oto.167.1575413164630; Tue, 03 Dec 2019 14:46:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575413164; cv=none; d=google.com; s=arc-20160816; b=obNOQNFYclk37wfEz0MamKNgX7hoIgfs9Z/KPCRYM+ER8dDZReOnQmVdyQrNf7Tzf5 UMvl9Xq33SPJ8IjMU4vpFS9XPaDw98ZqLgJaDla5UUTJw7nMsYLtE1DO75AxFTThbmv8 NIkqFGzEr6q2DiS8PwoitttNztwMPxiDd/NyePWKbzM5fdNFX8dFs1K+CdDRbo7/qUKh M2DAU5/K0ZSD6WKxMtxxJmQeVeUzJ7582eu3rK8x3STN/DM7VBHeIVtQbV434h1mXplF AwuWiYUSBRUHd9XeF2RehSHtI7z2rn0/8UAtqV9IOcpdvXldZCNP2BdHpiBZA2kg6KmC bukQ== 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=W1ZNZJdpdMNI2SyKPxx0YdSGKUSIJ4df8B7RjpO7JJObRSO8L/S7mb8x/ITlKzqPK5 Kb0nDU+QKADj1hh6n3QB/SSL+VXvq5gK37fqV9QY/GI1PoXwvU4G2C99V4ECDJkyTPy1 aBm0KAiZvAE0z/qfLulZ8woOHmwT0j+ykJDfm7z9c+VH4uBPtnYXpnZWomyudIRVF5LV 3xqlv3wCUR+kIvpm4DsNCOPgwUQH/Z5YK6NV+mgnfKRKWQkA+w5mCgwZkDm7GX+mzx+U Ll9awVi3OzbbDTQcuy3xg5lvlmnb28OOHrC4RMn7258tAmUlSIbFX/U3kNx0csts+Brs hlLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yLHyZoC3; 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 t138si2302484oif.189.2019.12.03.14.46.04; Tue, 03 Dec 2019 14:46:04 -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=yLHyZoC3; 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 S1727973AbfLCWqD (ORCPT + 15 others); Tue, 3 Dec 2019 17:46:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:35242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728985AbfLCWqC (ORCPT ); Tue, 3 Dec 2019 17:46:02 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AEC9120656; Tue, 3 Dec 2019 22:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413162; bh=HzwGEnNtDZVMMu7FAHSRHg9PbEd0qAwU8A/e3PfjkaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yLHyZoC3nAbejHiwWh3696CCxlzhbx/I6vmKmZ04tYwbsDRqC4ezKQFNISDS7kj6y xu+VVHP+ahc/VkCKChNzKfdmcTxhYKPkQYpIdBlhLMUHsCQlQYZApOIfDp303h6EEc G6Gm2IZRNoTW17nK+AdEbR2Coz1kU1tsJqOWDCGE= 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.19 022/321] clk: ti: dra7-atl-clock: Remove ti_clk_add_alias call Date: Tue, 3 Dec 2019 23:31:28 +0100 Message-Id: <20191203223428.273818476@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203223427.103571230@linuxfoundation.org> References: <20191203223427.103571230@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 Tue Dec 3 22:32:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180751 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2153995ile; Tue, 3 Dec 2019 14:48:18 -0800 (PST) X-Google-Smtp-Source: APXvYqwcGGoRxmvd4004Y7pdIjDKI2VpuAYh23N3JydjFfl11R/djEStMUW+15ZiSco6Ge1TPw98 X-Received: by 2002:aca:1817:: with SMTP id h23mr301578oih.167.1575413298702; Tue, 03 Dec 2019 14:48:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575413298; cv=none; d=google.com; s=arc-20160816; b=qJYKNafBuhbuLE8SUHDQRSEBjsPLz17BjFezO1Ar8e/X+13FBs3IsGdO995SzKYDqL hUx1h0aD8saJUd0akE/ceX/B/ziKfMvXNOKUCqsVuysveZx6eK2PmQROAbdCL5zGhsH9 gBr9/l2k8WpBF6Xkc6N70AKLLEkpVedXmm/2wvAoJ9DbbBmd5lggJA1KAZf7Hgb1LpNa xjdiUTga6sej6G0ygdTp0rGoYwRnCwFjOUY6xagrOmwhFYB1x3PHIMDx7Gly/wjWiLYt frDsvwkYQlkSxLOUIuQZCl02f42rcdy2d6b3MEexiq4NhiziJG9mK19NoNdy9CZ2A+3r EcGg== 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=c/5fLGJT6a3VukeP0fN0nL+Ik77eZ7D7bqOtrbxUgkM=; b=VSAWZzML5aQq652rQY4HFFhPru2almhA0zZS3bjgmZQLnr/QCtw4eppv8EMeJXB1Eb 9+vjtDi4aKH4ya6tDMPAejD3iMSFAs3r3D0GJVmgIuE0EQn8BIdbOm4Tttak+3H/WBh+ 98YlZMZVPZalUkf7DwdedzRLhNy+9o1HilvE0BZsdqTOlX5L+jCvdoYj2/slRaGf+PZI kBkTABOjfuqwAknnqzbxMfJOkC+ONTgNsU19kmWGkOJlskFj4uPsmOXCusws0btGMK1J bw8mnOj7rDoKq/ybPCR0/spDmUpS1+TUMCn+/3OxuQy1+zXKJzwx2qrs8Z0pPNfgU3Ug vVjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rKULnxd0; 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 y130si2266553oiy.28.2019.12.03.14.48.18; Tue, 03 Dec 2019 14:48:18 -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=rKULnxd0; 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 S1729283AbfLCWsR (ORCPT + 15 others); Tue, 3 Dec 2019 17:48:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:38788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729412AbfLCWsO (ORCPT ); Tue, 3 Dec 2019 17:48:14 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 70A422080F; Tue, 3 Dec 2019 22:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413293; bh=mlWxuW4QaOp/nmQEFoM+4MUVtpTnW56Eknmzh6voCTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rKULnxd0zd3XF0tBQJpGb6u5yaaTzNxbbAe71kb5WgNNoi63qc71cWtlHRolyF5UX 7kZte0SZ9TixMrXWN0nwNj4IrWQEGnPX3fYnZAN3F6ajPALHP3qFnUMdt60kek8TtQ OHd5+Gq01CisHBDF038f8wJgypJS3m58/VXRstpQ= 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.19 072/321] arm64: smp: Handle errors reported by the firmware Date: Tue, 3 Dec 2019 23:32:18 +0100 Message-Id: <20191203223430.910289672@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203223427.103571230@linuxfoundation.org> References: <20191203223427.103571230@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 2c31d65bc541b..52aa51f6310b0 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -146,6 +146,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 Tue Dec 3 22:32:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180752 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2154346ile; Tue, 3 Dec 2019 14:48:44 -0800 (PST) X-Google-Smtp-Source: APXvYqy60OE1wc+YZkBo83/N2s6QWI0H5LPtFkd47ZOFF7AjA/iiMv5d5UOyIjGK2y0BEN7yP3Fy X-Received: by 2002:a9d:7a8a:: with SMTP id l10mr189568otn.309.1575413324251; Tue, 03 Dec 2019 14:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575413324; cv=none; d=google.com; s=arc-20160816; b=gu2Z9eoWz58qBiFj0a6GHvJ4Po8dlqIqOHtguxk6uwdDnYfxf1ubQiW0IgEGNvQzVU 8WK7lsOxTLoYkTYTh8lM+FEi300/Xg6WLJBZEZQrhM/yAJhjzXlXqB49QJiVmnA7S06i dufwuaxtEtwwjyMse6KGhzKPSq1xHy/yY18D2h6g0rO3b+7CyqI+0fguVQUh/TvKqry3 XEz3eTLAc0ciktZFrL0i9H8g8d3q9Jt9AjOVyfveZ6z6E9YC3v9QBUwWkOVTULc80o3H JbPYF/QdBYg6KQVmIGsdE+6L9T36qve0i2G9jXvKnYMgnzLf4Hc3zBg9BbCEELqtAIMd MMKg== 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=YDZiTYd01hP36wxTWIlvy1YnZudtTas1g5SbFeV680E=; b=Qr43ncf9pRB56O16fGsFPfTHU7LIXMV8w35H0sW6brHCBxrkb61HOa6KoN1EULttV+ BQtzxu/AEwzOfbLFROBbHiZC0yp3tEId9AxogJfiF2htpQDLiPtnqq4GLgcF+pKNM8QH MldWmuOomu2s4ZfuzS8mxc+z6YLqx6CeO6p3/j4UYUzAW60CiJnkgoyLEym7nJ61OYZT y5R4VcgEvzdHHseuIQlBRVCA/uWakBoOwXDbnwynh7R68D7ObpQoq4vQmdNwlPjYY9L3 fZdNoSiqIzV+LY/bbb5C20QQW17oULCYyf5fowwD5FYvd7qyhgm1D9b/3uivRCHdp73C 1Dtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fX1+2bZk; 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 t189si1281207oie.13.2019.12.03.14.48.44; Tue, 03 Dec 2019 14:48:44 -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=fX1+2bZk; 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 S1729472AbfLCWsm (ORCPT + 15 others); Tue, 3 Dec 2019 17:48:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:39370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729155AbfLCWsl (ORCPT ); Tue, 3 Dec 2019 17:48:41 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F79320848; Tue, 3 Dec 2019 22:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413320; bh=NISoBMVF0NpWM66kbTqoeWdT27uAFHKgPtyG9pJJ1sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fX1+2bZkPq76PZ7GZFpszGrRSPgYJEH26CNhf5rpf+z5fA5JCYb5fGiPfA+Edpskk IXuZssQuykoRMO/6nlQh1IYHK1TLFf0Rou+1Dx5M98Wuxk3GAWHjY6+8FKW5k74vsx XXeuiqPlRpwyb1WJiBBI/6VQBYFK0sERC9Ng0B9o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Olof Johansson , Sasha Levin Subject: [PATCH 4.19 081/321] ARM: ks8695: fix section mismatch warning Date: Tue, 3 Dec 2019 23:32:27 +0100 Message-Id: <20191203223431.373128527@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203223427.103571230@linuxfoundation.org> References: <20191203223427.103571230@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: Arnd Bergmann [ Upstream commit 4aa64677330beeeed721b4b122884dabad845d66 ] WARNING: vmlinux.o(.text+0x13250): Section mismatch in reference from the function acs5k_i2c_init() to the (unknown reference) .init.data:(unknown) The function acs5k_i2c_init() references the (unknown reference) __initdata (unknown). This is often because acs5k_i2c_init lacks a __initdata annotation or the annotation of (unknown) is wrong. Signed-off-by: Arnd Bergmann Signed-off-by: Olof Johansson Signed-off-by: Sasha Levin --- arch/arm/mach-ks8695/board-acs5k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c index ef835d82cdb95..5783062224c39 100644 --- a/arch/arm/mach-ks8695/board-acs5k.c +++ b/arch/arm/mach-ks8695/board-acs5k.c @@ -100,7 +100,7 @@ static struct i2c_board_info acs5k_i2c_devs[] __initdata = { }, }; -static void acs5k_i2c_init(void) +static void __init acs5k_i2c_init(void) { /* The gpio interface */ gpiod_add_lookup_table(&acs5k_i2c_gpiod_table); From patchwork Tue Dec 3 22:33: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: 180756 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2157583ile; Tue, 3 Dec 2019 14:52:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyLlu+ipcWGQlgn5/WnUoBX0F5SVXSfyCosZru97ekpZ4FKncQJ80Tj7ZiMBQtK4QJlgMFO X-Received: by 2002:a9d:7a88:: with SMTP id l8mr214679otn.187.1575413543528; Tue, 03 Dec 2019 14:52:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575413543; cv=none; d=google.com; s=arc-20160816; b=fn+Yli+Q32jH+cjTqbuzou0+FcOMZJ1oAC6xGBscfMnVY5jJFd9HXdIfO3IiP6zGfj PmJkCUOnByBb2N1lMO1eAXSx50HBwpbZ6Gi4P8GfYqgLcAstSm0n7xlCwQ0jgFy1mN7+ x8PLcQDOan8rHJtuPtDyhtjwKD13rsBVUO1DTQcH4s3xkiyYv3yuTGqTYs0pN0HiN0Ou UEn/nsz64wpc2tsgAnPpdoxQOlek3lrj3Lt3LzPKACRoB3bc8TsY1DC+L6Ufw97YmadH pUc4Kt3o12rxpZxjT0PGETT4zOAefuAFmsbkNJMLO0r79e9FiWr5Z4O+0eMHr/vqmfkz vwVw== 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=hv99ZPkbPHYXDMKF1iJv2I4lWRpnTTyd+Ih/liTrp4E=; b=bk3QT0JZpgMgN6FiMmMieJqYTWMsBuf+lqjUELSR8SIzDUKYgNvyCYNrG5nEc0BzBD mXUJmsuwK4ASm1wO66gTtB3CaiwJk0ZlS+GkIKm8aYMnV4MDIqqYZGKeJgmH0VajRqYX uz47y5AnCTllHMf8bPvuPfamHzGkZoY07y9wHRprqf98zTtDcDUx3m1r0ZWcLf/pq5ps iirJ7BhbmZRL3zmeE/Yt7darjGOiQaGtxFV7nH1ilo/WF6UqDRU9zjwspmhcSzKY+ger YiQGaccTJSDzzwGE0IQaIxtEEphNDRSwk4jr8+E40EztryetqCysmbe0lypK+AzJErh5 Wp7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f5c5hUHT; 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 p5si2298832oto.116.2019.12.03.14.52.22; Tue, 03 Dec 2019 14:52:23 -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=f5c5hUHT; 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 S1729735AbfLCWwV (ORCPT + 15 others); Tue, 3 Dec 2019 17:52:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:45022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730009AbfLCWwU (ORCPT ); Tue, 3 Dec 2019 17:52:20 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE62A2084B; Tue, 3 Dec 2019 22:52:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413539; bh=0BKgJK0ru3iRADVaPyo5g95TkJZb3iLxgNnyE9BBUxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f5c5hUHTp7Gq0seKtv8ZuU7FjoDUKrWxhKBxE5Yqx6UUT43eCexhEOFJg/rntZh44 y1gvuEXvo6GLAC0MBXvU/vgW3I9UJEH8HvChY21ZyGVHJ8COwTJs5g6LQEq270M9su F03hlnZuY7Zq1po2NKd2v3paXysdnyJUiGigibTQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joel Stanley , Nick Desaulniers , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 165/321] powerpc/32: Avoid unsupported flags with clang Date: Tue, 3 Dec 2019 23:33:51 +0100 Message-Id: <20191203223435.722372817@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203223427.103571230@linuxfoundation.org> References: <20191203223427.103571230@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: Joel Stanley [ Upstream commit 72e7bcc2cdf82bf03caaa5e6c9b0134c2fc2ee7d ] When building for ppc32 with clang these flags are unsupported: -ffixed-r2 and -mmultiple llvm's lib/Target/PowerPC/PPCRegisterInfo.cpp marks r2 as reserved on when building for SVR4ABI and !ppc64: // The SVR4 ABI reserves r2 and r13 if (Subtarget.isSVR4ABI()) { // We only reserve r2 if we need to use the TOC pointer. If we have no // explicit uses of the TOC pointer (meaning we're a leaf function with // no constant-pool loads, etc.) and we have no potential uses inside an // inline asm block, then we can treat r2 has an ordinary callee-saved // register. const PPCFunctionInfo *FuncInfo = MF.getInfo(); if (!TM.isPPC64() || FuncInfo->usesTOCBasePtr() || MF.hasInlineAsm()) markSuperRegs(Reserved, PPC::R2); // System-reserved register markSuperRegs(Reserved, PPC::R13); // Small Data Area pointer register } This means we can safely omit -ffixed-r2 when building for 32-bit targets. The -mmultiple/-mno-multiple flags are not supported by clang, so platforms that might support multiple miss out on using multiple word instructions. We wrap these flags in cc-option so that when Clang gains support the kernel will be able use these flags. Clang 8 can then build a ppc44x_defconfig which boots in Qemu: make CC=clang-8 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- ppc44x_defconfig ./scripts/config -e CONFIG_DEVTMPFS -d DEVTMPFS_MOUNT make CC=clang-8 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- qemu-system-ppc -M bamboo \ -kernel arch/powerpc/boot/zImage \ -dtb arch/powerpc/boot/dts/bamboo.dtb \ -initrd ~/ppc32-440-rootfs.cpio \ -nographic -serial stdio -monitor pty -append "console=ttyS0" Link: https://github.com/ClangBuiltLinux/linux/issues/261 Link: https://bugs.llvm.org/show_bug.cgi?id=39556 Link: https://bugs.llvm.org/show_bug.cgi?id=39555 Signed-off-by: Joel Stanley Reviewed-by: Nick Desaulniers Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index c4c03992ee828..dfcb698ec8f3b 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -145,7 +145,14 @@ endif CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc)) CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions) -CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD) +# Clang unconditionally reserves r2 on ppc32 and does not support the flag +# https://bugs.llvm.org/show_bug.cgi?id=39555 +CFLAGS-$(CONFIG_PPC32) := $(call cc-option, -ffixed-r2) + +# Clang doesn't support -mmultiple / -mno-multiple +# https://bugs.llvm.org/show_bug.cgi?id=39556 +CFLAGS-$(CONFIG_PPC32) += $(call cc-option, $(MULTIPLEWORD)) + CFLAGS-$(CONFIG_PPC32) += $(call cc-option,-mno-readonly-in-sdata) ifdef CONFIG_PPC_BOOK3S_64 From patchwork Tue Dec 3 22:35:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180757 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2160597ile; Tue, 3 Dec 2019 14:56:03 -0800 (PST) X-Google-Smtp-Source: APXvYqy3taQug6Qn9fsRUVIMjKi4I+w5QeXhFKbuEdyrfbZ/owdn8mwUrK2/2xBKu9BufaEo3uDQ X-Received: by 2002:a05:6830:1cc4:: with SMTP id p4mr198381otg.349.1575413763003; Tue, 03 Dec 2019 14:56:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575413762; cv=none; d=google.com; s=arc-20160816; b=Ucn1Abp6xTSt0+7E6hJMwjTRNdSWOvhT6B1SEBXhPEkAipEz+mpxtRS9TM8sXIMdpx 9Ttedlhhf50o5JhGlWGaQvVX1znn6LaEP5BDyBXgLfOd2z0vOBJTpeGbAFuZM/VF4SlR 1WfMg4t0IlrZxRThm8L0G33WvQ/Ntnb2cQzZofb+2tCVdd9U6r9VwGkos/bNAX+uZt9F jVY87YVLQnSy7PTk1r0hONnni+ubjLCWSXcoRuW0wYjWGeNJq2Ip8/aX7Xa12RjIF1yq olA7iUaUT9CKRO0rUwBJBGmxXIRnkeaF9Je+Wk+fivM5QSmU8T+vHfD3NU3FUmwnJ/MD oDGQ== 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=aBu2FnkTqSqmf1q206GJmCoa8fmwJ4efufiPvXw/oEA=; b=QP3kEgVzw1HKpsMqZmwRYn+Iza7dI94g8r0BdLUxQovmeOrQlstEi+3kTjLyMalR6/ FkawbKSh82H5Q2T5mpWchhyndCNkYmmsN3wAEMUlHvwmqSL3xObkp10wWTtjovBSr4fZ NbO5i+0Re+SuzEdfOq/vXf9c0VDUboZO31zSmxc9hjPOyCjvVlNlDIfjxCSC1lk2e6t1 nSB3zDCJ5o7bVen031rHXZBN+gM5rLxa03jZqRSqZ8FeAmBZIea3SVkiGxNRHeY82J8i nZYppzW9S6vYjA0PqkQrZ2SiJwRDZ9xfKBjQiQjUh0TlV1/iY5lciJZ8mgIbESQQCUgx ks5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Frz5Pfy0; 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 x131si1018414oig.124.2019.12.03.14.56.02; Tue, 03 Dec 2019 14:56:02 -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=Frz5Pfy0; 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 S1730049AbfLCW4B (ORCPT + 15 others); Tue, 3 Dec 2019 17:56:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:50686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730070AbfLCW4A (ORCPT ); Tue, 3 Dec 2019 17:56:00 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 124032053B; Tue, 3 Dec 2019 22:55:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413759; bh=iPY+9EdkFVSlXDqWAJJ7coSysi2IA3A8A7kRWdUzco8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Frz5Pfy0IGUam04DHZNn6j8bvUYfmEjjlmQQQrZ0NqWyuW7tcnUrIS0Fr3go81yXw A32iw3xTK5GDBTemNk37U5Mz59ylq3KKwedmZimXYZmArvbyLoMei1GXCs1sm3wFqQ wZaeRlM1Vy2aFWuuC/JRz3bMLQwtiLB7OtvQk/9U= 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.19 250/321] scsi: libsas: Support SATA PHY connection rate unmatch fixing during discovery Date: Tue, 3 Dec 2019 23:35:16 +0100 Message-Id: <20191203223440.143470977@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203223427.103571230@linuxfoundation.org> References: <20191203223427.103571230@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 2ee9c4ec7a541..f9d4a24c14b5a 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 Tue Dec 3 22:35:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180758 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2160986ile; Tue, 3 Dec 2019 14:56:28 -0800 (PST) X-Google-Smtp-Source: APXvYqw4+5iF5ZDrjp+F7SBoXyC5Bv8WffBV8WbQitRPq3w+aCDg7AJ/YVsFt2tCUX1Pn4ZL0HWE X-Received: by 2002:a05:6830:551:: with SMTP id l17mr245994otb.282.1575413788496; Tue, 03 Dec 2019 14:56:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575413788; cv=none; d=google.com; s=arc-20160816; b=k/ykkEJcRAWyWvqaoccv6i2I7oYOsnUgqZghbk6yfEhC535KTT0d5BMBQ6xkBWcK+d JhWKf/u4cXHRKoMmoLduLIauo2+M9C/Wzz22RthxfzbJ2JAlqoIiZIpF0Y/tbhwhyr36 cwCj8WKHGlZcDurtz0arC6+UQxosoRI0dV31VsdBogriNqhN2hz22U1n6zsfkvxa4o2P IUnXdGE15Bf4dYEKNb3SOKaC/8Qk2IDWvaUjf3InvGp0pRAvaVbLB9WY0R0JGS/R5/YP +Pyys9Ms2bTiByGu832FCtV1G8tOSvuM7dVVfj5xQT3WPmgkSJIQUE/5eefgPn9r6a24 7tDg== 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=2+5TWvjupbRiJ86fX3hoMXgoppGyLSAQmxQhYRXNzxg=; b=fFbYzYbJojfHyI+qX992jCA3pahwYWXG2sICJKrLE/xtii8Pl1tT5E8pausOydIuco /m8H0b91l6qg6gUliqu7AW5+vEsczT+tB/YbjSGUeSZTSvxaf3NOzfPgcaa0cwIbwQZf TS+tpKgf8IT7ZqJ5dHkUuEVZRskgN7ydxPL4PjqH2py8HNtzzzyYNR5iBLIjQYHSfz39 aKwObRbbNklqbf0+wQO2Cc186gCcwsOv487UkL/0lBjOWN9LHnzIquoivWJREWwZjBFe /BTjLuMEJMLjXtk3SWvtoIVSWe2ukYlY14/2z7ycJnEU6E2ld0OWMgsS//OXi+xvBF/N 4yyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=outDsUzG; 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 63si2275605oih.74.2019.12.03.14.56.28; Tue, 03 Dec 2019 14:56:28 -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=outDsUzG; 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 S1730143AbfLCW41 (ORCPT + 15 others); Tue, 3 Dec 2019 17:56:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:51468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730428AbfLCW40 (ORCPT ); Tue, 3 Dec 2019 17:56:26 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 16891214AF; Tue, 3 Dec 2019 22:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413785; bh=HtPp8zOK5oiK3coHwNOGOpHkANIkVBWdeaQA0EEL6+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=outDsUzGTYMv0XytU2Cd2TEzdY5+wKzm4IiH8qTjQ7d5jNXrZU8RW1+eVWl+tagHl IUPizMQtdd6mWAKybJWeg/RWYT953hsWn9rGAFpiG91M1Em1efpsUrvceqxTer6Dsd N+PRLkEECUATgKVKveNW+pVpoSWSwylepvGoGZIY= 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.19 254/321] scsi: libsas: Check SMP PHY control function result Date: Tue, 3 Dec 2019 23:35:20 +0100 Message-Id: <20191203223440.349454536@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203223427.103571230@linuxfoundation.org> References: <20191203223427.103571230@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 f9d4a24c14b5a..3e74fe9257617 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;