From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C8E528852E; Wed, 6 Aug 2025 09:00:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754470804; cv=none; b=i1sSXVSgaJc2RRsW+mB9eSJ5NNd4xi//Zzd7dN3/nSgd1sQe+sDYCNt3g2GooGqTsmpd3xFgl8XafEWRw1w4tjVQEfMi0EtxGv1XLcPEi3nCtRU+35SPRSkB2YcTy5CF7FPT4qspjTMMv2SziOW8jCX73CQTSPuG9ZOtHE4F0u8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754470804; c=relaxed/simple; bh=6l2zt5JRcU3QXeA8hRlKBIo/y7lzki20pwgmiJ9ag0w=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=HjkIUcUblpEJtqSgnKmb4uq8LK9kOCfCv7Sg/KMIjYbSPUaCeQoD1h2Q7gdmnVaRnQ4w/tQ5gQnQ3TZWZ9VqSPcmU/AaUnOo+JBM+qR73N5d+bwRmdY2epv7/HX+n25n8ZQKsKCelH6cnB6DW/YPBgIS465gAfKa8dXpBByTE0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=ahnJKbrn; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="ahnJKbrn" X-UUID: b837c2ea72a311f08871991801538c65-20250806 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=fECPVy3IuVBfNDIk74uuTR+IW83emNPZTN1XtAlaT68=; b=ahnJKbrn8RuVXZNguz7Kpi/sfjAh1+XPzODEIAeushiIJ5lv7NXOaI27DmNUG9SVT3YLUfXIy5EkRkaI5CvEs8Ihr5OJ2oc1S5l+2q5gmfrw5no43E0LGsjQz2j0Lm3jrcuMsxLo2SNLXJNC2gX7oQtVWlucRDQGHDUhEbk6OBM=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.2,REQID:f046b675-59f3-4d5c-9ca1-ef752aaa7585,IP:0,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION:r elease,TS:0 X-CID-META: VersionHash:9eb4ff7,CLOUDID:ce92910f-6968-429c-a74d-a1cce2b698bd,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:-5,Content:0|15|50,EDM:-3,IP: nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,L ES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: b837c2ea72a311f08871991801538c65-20250806 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1663746878; Wed, 06 Aug 2025 16:59:54 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.39; Wed, 6 Aug 2025 16:59:52 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1258.39 via Frontend Transport; Wed, 6 Aug 2025 16:59:51 +0800 From: Friday Yang To: Yong Wu , Krzysztof Kozlowski , Rob Herring , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Philipp Zabel CC: Friday Yang , , , , , Subject: [PATCH v10 0/2] Add SMI reset and clamp for MediaTek MT8188 SoC Date: Wed, 6 Aug 2025 16:59:34 +0800 Message-ID: <20250806085946.11383-1-friday.yang@mediatek.com> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Based on tag: next-20250805, linux-next/master On the MediaTek MT8188 SoC platform, we encountered power-off failures and SMI bus hang issues during camera stress tests. The issue arises because bus glitches are sometimes produced when MTCMOS powers on or off. While this is fairly normal, the software must handle these glitches to avoid mistaking them for transaction signals. What's more, this issue emerged only after the initial upstreaming of SMI driver. The software solutions can be summarized as follows: 1. Use CLAMP to disable the SMI sub-common port after turning off the LARB CG and before turning off the LARB MTCMOS. 2. Use CLAMP to disable/enable the SMI sub-common port. 3. Implement an AXI reset for SMI LARBs. --- Changes in v10: - Rename 'smi_comm_inport_id' to 'smi_comm_in_port_id'. - Return 0 when it fails to get 'larb_id' in 'mtk_smi_larb_parse_clamp_optional'. Changes in v9: - Add 'dev_pm_genpd_remove_notifier' in 'mtk_smi_larb_remove'. - Remove unused macros. - Rename 'sub_comm_syscon' to 'smi_comm_syscon'. - Rename 'sub_comm_inport_id' to 'smi_comm_inport_id'. - Add more detailed descriptions in change log. - Fix incorrect tags. Changes in v8: - Fix incorrect tags. Changes in v7: - We replaced 'pm_runtime_enable' with 'devm_pm_runtime_enable' in the v6 patch. This changed the order of cleanup, and reviewers expressed concerns that it could introduce unexpected issues. So v7 discard this change and continue using 'pm_runtime_enable'. We need to conduct further investigation to determine if there are any issues related to the cleanup order. This might be resolved in the future, but for now, we just maintain the current status. Changes in v6: - Fix coding style. - Add another patch to replace 'pm_runtime_enable' with 'devm_pm_runtime_enable'. Changes in v5: - Use 'devm_pm_runtime_enable' instead of 'pm_runtime_enable'. - Remove 'pm_runtime_disable' in 'mtk_smi_common_remove' and 'mtk_smi_larb_remove'. Changes in v4: - Use 'devm_reset_control_get_optional_exclusive' instead of 'devm_reset_control_get'. Changes in v3: - Remove redundant descriptions for 'resets' and 'reset-names'. - Modify the requirements for 'resets' and 'reset-names'. - Rename 'mtk_smi_larb_parse_clamp' to 'mtk_smi_larb_parse_clamp_optional'. - Rename 'mtk_smi_larb_parse_reset' to 'mtk_smi_larb_parse_reset_optional'. - Merge 'mtk_smi_larb_clamp_protect_enable' and 'mtk_smi_larb_clamp_protect_disble' into one function. - Modify the definition for mtk_smi_larb_clamp_port_mt8188, use 'larbid' as the index of the array. - Use 'syscon_regmap_lookup_by_phandle' instead of 'device_node_to_regmap'. - Do Not parse 'resets', just check the return value of 'devm_reset_control_get'. - Add 'has_gals' flag for 'mtk_smi_sub_common_mt8188'. Changes in v2: - According to previous discussions in v1, divided these four patches into two topic separately. - Modify the description for 'resets' in binding. - Add const value 'larb' for 'reset-names' in binding. - Modify requirement for 'resets' and 'reset-names' in binding. - Delete 'mediatek,smi-sub-comm' in binding. - Delete 'mediatek,smi-sub-comm-in-portid' in binding. - Modify the example in binding. - Add 'mtk_smi_larb_clamp_port_mt8188' definition in SMI driver. - Change the way to parse the 'resets' in driver. - Change label from 'err_pm_disable' to 'err_link_remove'. --- Friday Yang (2): dt-bindings: memory: mediatek: Add SMI reset and clamp for MT8188 memory: mtk-smi: mt8188: Add SMI reset and clamp for MT8188 .../mediatek,smi-common.yaml | 2 + .../memory-controllers/mediatek,smi-larb.yaml | 19 +++ drivers/memory/mtk-smi.c | 129 ++++++++++++++++++ 3 files changed, 150 insertions(+) -- 2.46.0