From patchwork Wed Nov 24 08:50:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12636397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A3A1C433F5 for ; Wed, 24 Nov 2021 08:51:05 +0000 (UTC) Received: by mail.kernel.org (Postfix) id 703416101A; Wed, 24 Nov 2021 08:51:05 +0000 (UTC) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D62060FE6 for ; Wed, 24 Nov 2021 08:51:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0D62060FE6 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=canonical.com Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 609EB3F1AC for ; Wed, 24 Nov 2021 08:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1637743863; bh=3ZoUW9jdN7IytTzxTuRgqOAoWQMVQDOL0U9ecy5BDjQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JgI0T//Unt1K5y1UUSnSpUZ6zPZYL+7NpFVajTvcLbiGJX7NAojTznOC49yXcnQXp 86e9xgxT5VTUmkBsxaX5iXTr6BImVHXflT+E6dTbbNWYaXcWl0WfI4VFFc52Pjd5No QHIrU8Dk5za+oiKltRkSF0Bg3uTIw940sFUryvQaJvDkQtKclF87UJ/uCT3wPqKvy/ +/3vnfwyVag9IePrK/wfi9csIuAVzUIycRzfJhZ6VJ5g1945iAUfLuh3CULJWIcIaw ABlMtnB5xJVMcXeTjWqkcYVX8d4nH6CAFCCHkHi16X9Idpzgo0LabOqGZmj6m80Oew SV7t+qIgwxUHw== Received: by mail-lf1-f71.google.com with SMTP id bi30-20020a0565120e9e00b00415d0e471e0so1052210lfb.19 for ; Wed, 24 Nov 2021 00:51:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3ZoUW9jdN7IytTzxTuRgqOAoWQMVQDOL0U9ecy5BDjQ=; b=BiHHbSW6FqY2c2E2ChSdJVGzUi6lf5WreFF0sCDCW7LkhtO/Y8RLsdTxnHUmx31kn7 hg1x20yc8EO0FBP28NtJ/Gsj5OG8wmSLcFHbBO2V2xK0rEMk5tJMueGVlaqGBjpwi/fP eBfKCkjGU4p9VBCQKcL+u/+WdT2g2L8P3YQbkteF9e+hB5Meqyk1Gds9kuVnAect6UAi dmgr+T6Jwm9sXQVeRRGaTOfF20GJjtMis39I3IezR6H6rVqx6ti50N+DwHOkyBsOwmwR AwWO3CyI7xCPJKb0qTS9SDuZ63A3jSVEyfQ+zlvNbxuQ807Z0KWd6/HUWkAGv+gRfBel LWWA== X-Gm-Message-State: AOAM532jWbw2trTiVsUYtcE268zMWNAQBnSPq158212I03hiSKNIqu2X SZHUNmLfGzesbOW0vvMaz7AJNTLTREj8DU+wuQz9KcMRvLi57VvJJLj1IhbFTJbiclv/DWvwqcC FtytzCgk/Du2YZicOU1Shung= X-Received: by 2002:a05:6512:1113:: with SMTP id l19mr12895902lfg.184.1637743861867; Wed, 24 Nov 2021 00:51:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHas2DajMvWAwkxoga5XBtzlcLdJgRnPR660dVckM/cTVuIGH3bM2z5YbQG4vuU+UHTv5tWA== X-Received: by 2002:a05:6512:1113:: with SMTP id l19mr12895886lfg.184.1637743861703; Wed, 24 Nov 2021 00:51:01 -0800 (PST) Received: from krzk-bin.lan (89-77-68-124.dynamic.chello.pl. [89.77.68.124]) by smtp.gmail.com with ESMTPSA id t12sm1742952ljg.63.2021.11.24.00.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 00:51:01 -0800 (PST) From: Krzysztof Kozlowski List-Id: To: arm@kernel.org, soc@kernel.org, Arnd Bergmann , Olof Johansson Cc: Chanho Park , Krzysztof Kozlowski Subject: [PATCH 1/2] arm64: dts: exynos: drop samsung,ufs-shareability-reg-offset in ExynosAutov9 Date: Wed, 24 Nov 2021 09:50:41 +0100 Message-Id: <20211124085042.9649-2-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211124085042.9649-1-krzysztof.kozlowski@canonical.com> References: <20211124085042.9649-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 From: Chanho Park samsung,ufs-shareability-reg-offset is not necessary anymore since it was integrated into the second argument of samsung,sysreg. Fixes: 31bbac5263aa ("arm64: dts: exynos: add initial support for exynosautov9 SoC") Signed-off-by: Chanho Park Link: https://lore.kernel.org/r/20211102064826.15796-1-chanho61.park@samsung.com Signed-off-by: Krzysztof Kozlowski --- arch/arm64/boot/dts/exynos/exynosautov9.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/exynos/exynosautov9.dtsi b/arch/arm64/boot/dts/exynos/exynosautov9.dtsi index 3e4727344b4a..a960c0bc2dba 100644 --- a/arch/arm64/boot/dts/exynos/exynosautov9.dtsi +++ b/arch/arm64/boot/dts/exynos/exynosautov9.dtsi @@ -296,8 +296,7 @@ ufs_0: ufs0@17e00000 { pinctrl-0 = <&ufs_rst_n &ufs_refclk_out>; phys = <&ufs_0_phy>; phy-names = "ufs-phy"; - samsung,sysreg = <&syscon_fsys2>; - samsung,ufs-shareability-reg-offset = <0x710>; + samsung,sysreg = <&syscon_fsys2 0x710>; status = "disabled"; }; }; From patchwork Wed Nov 24 08:50:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12636399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE304C433EF for ; Wed, 24 Nov 2021 08:51:06 +0000 (UTC) Received: by mail.kernel.org (Postfix) id 9C2A760FE7; Wed, 24 Nov 2021 08:51:06 +0000 (UTC) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 354B060F5D for ; Wed, 24 Nov 2021 08:51:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 354B060F5D Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=canonical.com Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id C6F913F1B1 for ; Wed, 24 Nov 2021 08:51:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1637743864; bh=IXinLogaH0u1DX/MAjR5ojuUpkEsw0tpGb+3hWRZxcw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gSGI6t3lrPvjAqsba21ctCa6NDJ3r903oeZ8MIBJ1eTOfsohYRR63D5pj0P4XbYer BssX9aCkCPvc5DLG82BSZQyVSEf1bzMnyg9x42q5tUFkHGIqfANhZjQzsY53s87eI0 jQBWPZthlP680IIH+zBbtbsfIpZc5iN8CX8X7CVE2DmqnZeobsOtG/ceXnzulPBA8z VIDFbhKnG2KkczWNddazvQtN/uhg2KecaD48Ha/xOS1MZ9+gfTVfNzb5qgtUxXekL9 ih1dKEivWOjzpoIkyVvNHYBawukJXL6XfS/weHfUo4kDO1rmX8ZOhTyuymSdunhd+n 4z7xY45WpOYhw== Received: by mail-lj1-f198.google.com with SMTP id g19-20020a2eb5d3000000b00219f21cb32bso573918ljn.7 for ; Wed, 24 Nov 2021 00:51:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IXinLogaH0u1DX/MAjR5ojuUpkEsw0tpGb+3hWRZxcw=; b=lT+0nziqozKjBOXhbTzQYJnr6OQSnP3D7fcv7PcueRf0afHBailhJtohHbzYERguH4 q9tdvhDGFQgX/0RlqpGnoVS4yZVx+KYXQLqJgplUAE43IWfZ/MS6ptK5n8tVLP4YW8Xq KARDRX3vKJGLX7GZ3I0LKsZc/6bqisVUVcNQkY+4inN4N1W1bAy8yw+Qtcsk7Fv/2o8C g7ojsmha7tgPCxAShckvHqaPH3tdiFidiNYJpyjXtJFJuikJFSz/HZKXSWVfQnXmkXEv wkt9Us7pfu5JUP1T1/0gr2xUewWz17LOnwNHRkzqfVTs+pmaSW+24R9ExNWl8wc/f7+J U4eg== X-Gm-Message-State: AOAM533OMW6kJ8Urv0LoClVlMrnzM6c0Ecr770VkKUJxHTJXsIJP4J/X JO9Ue7OF0J4cWe7etDcIXb44Pt3BeduoQg6MnUgeVPZHc8BngF5tVV7C/pfLvlJQVmSInawFPSn 29wf2ZL36e0kheFe0n/N4sVY= X-Received: by 2002:a19:5018:: with SMTP id e24mr12493284lfb.294.1637743864225; Wed, 24 Nov 2021 00:51:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXEk834OYNTakbq2t8yQJPiO44BP83bvEbOwY0t0xKku5DDVL6muuc/Ul3tDSO2G0drp+3Sg== X-Received: by 2002:a19:5018:: with SMTP id e24mr12493261lfb.294.1637743864029; Wed, 24 Nov 2021 00:51:04 -0800 (PST) Received: from krzk-bin.lan (89-77-68-124.dynamic.chello.pl. [89.77.68.124]) by smtp.gmail.com with ESMTPSA id t12sm1742952ljg.63.2021.11.24.00.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 00:51:03 -0800 (PST) From: Krzysztof Kozlowski List-Id: To: arm@kernel.org, soc@kernel.org, Arnd Bergmann , Olof Johansson Cc: Yong Wu , Krzysztof Kozlowski Subject: [PATCH 2/2] memory: mtk-smi: Fix a null dereference for the ostd Date: Wed, 24 Nov 2021 09:50:42 +0100 Message-Id: <20211124085042.9649-3-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211124085042.9649-1-krzysztof.kozlowski@canonical.com> References: <20211124085042.9649-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 From: Yong Wu We add the ostd setting for mt8195. It introduces a KE for the previous SoC which doesn't have ostd setting. This is the log: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000080 ... pc : mtk_smi_larb_config_port_gen2_general+0x64/0x130 lr : mtk_smi_larb_resume+0x54/0x98 ... Call trace: mtk_smi_larb_config_port_gen2_general+0x64/0x130 pm_generic_runtime_resume+0x2c/0x48 __genpd_runtime_resume+0x30/0xa8 genpd_runtime_resume+0x94/0x2c8 __rpm_callback+0x44/0x150 rpm_callback+0x6c/0x78 rpm_resume+0x310/0x558 __pm_runtime_resume+0x3c/0x88 In the code: larbostd = larb->larb_gen->ostd[larb->larbid], if "larb->larb_gen->ostd" is null, the "larbostd" is the offset(e.g. 0x80 above), it's also a valid value, then accessing "larbostd[i]" in the "for" loop will cause the KE above. To avoid this issue, initialize "larbostd" to NULL when the SoC doesn't have ostd setting. Fixes: fe6dd2a4017d ("memory: mtk-smi: mt8195: Add initial setting for smi-larb") Signed-off-by: Yong Wu Link: https://lore.kernel.org/r/20211108082429.15080-1-yong.wu@mediatek.com Signed-off-by: Krzysztof Kozlowski --- drivers/memory/mtk-smi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index b883dcc0bbfa..e201e5976f34 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -241,7 +241,7 @@ static void mtk_smi_larb_config_port_gen2_general(struct device *dev) { struct mtk_smi_larb *larb = dev_get_drvdata(dev); u32 reg, flags_general = larb->larb_gen->flags_general; - const u8 *larbostd = larb->larb_gen->ostd[larb->larbid]; + const u8 *larbostd = larb->larb_gen->ostd ? larb->larb_gen->ostd[larb->larbid] : NULL; int i; if (BIT(larb->larbid) & larb->larb_gen->larb_direct_to_common_mask)