Skip to content

Add SMI reset and clamp for MediaTek MT8188 SoC

Friday Yang linux-arm-kernel linux-devicetree linux-mediatek lkml 11 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v12 Latest2 patches 1 replyIn review
  2. v112 patches 7 repliesSuperseded
  3. v102 patches 4 repliesSuperseded
Earlier versions · 8
VersionPostedPatchesRepliesStatus
v92 patches3 repliesSuperseded
v82 patches11 repliesSuperseded
v72 patches4 repliesSuperseded
v63 patches6 repliesSuperseded
v52 patches5 repliesSuperseded
v4 posting 2/22 patches5 repliesApplied
v4 posting 1/22 patches11 repliesSuperseded
v32 patches6 repliesSuperseded

Changes in v12 from the cover letter

- We used to parse 'mediatek,smi' property in 'mtk_smi_larb_parse_syscon' to get smi sub common regmap. The property has already been parsed in 'mtk_smi_device_link_common'. To remove redundant code, we remove 'mtk_smi_larb_parse_syscon' function and get the smi sub common regmap in 'mtk_smi_device_link_common'.
- We need to get driver data in 'mtk_smi_device_link_common', so move 'platform_set_drvdata' before 'mtk_smi_device_link_common' in 'mtk_smi_larb_probe'.

Patches in v12 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2dt-bindings: memory: mediatek: Add SMI reset and clamp for MT8188Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml+21 -00 replies
2/2memory: mtk-smi: mt8188: Add SMI reset and clampdrivers/memory/mtk-smi.c+167 -101 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAngeloGioacchino Del RegnoRob Herring
1/2R-b A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v12 thread

Cover letter [PATCH v12 0/2] Add SMI reset and clamp for MediaTek MT8188 SoC

Based on tag: next-20260116, 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 v12:
- We used to parse 'mediatek,smi' property in 'mtk_smi_larb_parse_syscon' to get smi sub common regmap. The property has already been parsed in 'mtk_smi_device_link_common'. To remove redundant code, we remove 'mtk_smi_larb_parse_syscon' function and get the smi sub common regmap in 'mtk_smi_device_link_common'.
- We need to get driver data in 'mtk_smi_device_link_common', so move 'platform_set_drvdata' before 'mtk_smi_device_link_common' in 'mtk_smi_larb_probe'.

Changes in v11:
- Add error checking in the 'mtk_smi_genpd_callback' function and use 'switch-case' statement instead of 'if-else'.
- Use 'larb->larb_gen->clamp_port[larb->larbid]' to determine whether smi larb requires clamp and reset operations or not in 'mtk_smi_larb_probe'. Remove the '_optional' suffix from the function name.
- Replace 'devm_reset_control_get_optional_exclusive' with 'devm_reset_control_get_exclusive' in 'mtk_smi_larb_parse_reset', return the error code if it fails to get the reset controller.
- Remove genpd callback when smi larb probe fails.
- Link to v11:
https://lore.kernel.org/lkml/[email protected]/

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'.
- Link to v10:
https://lore.kernel.org/lkml/[email protected]/

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.
- Link to v9:
https://lore.kernel.org/lkml/[email protected]/

Changes in v8:
- Fix incorrect tags.
- Link to v8:
https://lore.kernel.org/lkml/[email protected]/

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.
- Link to v7:
https://lore.kernel.org/lkml/[email protected]/

Changes in v6:
- Fix coding style.
- Add another patch to replace 'pm_runtime_enable' with 'devm_pm_runtime_enable'.
- Link to v6:
https://lore.kernel.org/lkml/[email protected]/

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'.
- Link to v5:
https://lore.kernel.org/lkml/[email protected]/

Changes in v4:
- Use 'devm_reset_control_get_optional_exclusive' instead of 'devm_reset_control_get'.
- Link to v4:
https://lore.kernel.org/lkml/[email protected]/

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'.
- Link to v3:
https://lore.kernel.org/lkml/[email protected]/

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'.
- Link to v2:
https://lore.kernel.org/lkml/[email protected]/

Friday Yang (2):
dt-bindings: memory: mediatek: Add SMI reset and clamp for MT8188
memory: mtk-smi: mt8188: Add SMI reset and clamp

 .../mediatek,smi-common.yaml                  |   2 +
 .../memory-controllers/mediatek,smi-larb.yaml |  19 ++
 drivers/memory/mtk-smi.c                      | 177 +++++++++++++++++-
 3 files changed, 188 insertions(+), 10 deletions(-)

--
2.46.0