From patchwork Thu Apr 11 11:42:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13625798 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 EDFA0CD1284 for ; Thu, 11 Apr 2024 11:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FtfuUxjovZtxa/OMnFY4fY+ePKj0oAZILtR/NhGsOjk=; b=fw5kOYj80yPmot F/su+u5s8+ZxHYpQ2AVOdzY/IjfxFVCJUeVfopbKhJ/jw2eZSHrcp5oJ4pqc+6uIB13GH6nAYjVEp JVa/btRAlRbpKWUb5rU3kZ1WfLBIkPXnMUS0iTomN3LwS2gsIokEfnbEjo+qxZIOc1IN0PYviOQtG 8YIsZwMRLgGevk1fdcJEN3Ih4z8CtmBBd1dOrxiD+hT1FnX1JXSUsh5/yjdWpltbgyW5udn8tnQ7D 1Mz/RjMhw6mJY4QtoPk+LkxrrkqAmg4yTFMqGWqMvOhoX+dTXf1SBJNYAv+GlSimutIXzVpAIjcm4 FrdHD1nLuDa3muZFP5GA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rusq5-0000000Bm8O-3d0C; Thu, 11 Apr 2024 11:43:33 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruspg-0000000Blxn-0PX7; Thu, 11 Apr 2024 11:43:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712835786; bh=GYrCUPwSvlfdLE3J9cAWMICwrZAfevrC39qq1M3MwBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s1EdeL4B5cOSHif/ZFFdTpG9TouVl498pjChgSA0FUVlM2B3gN0TMHvZ4wrQEu91o zLPVI5dibN2mRzaR5RQyl7IstTiTcwsOkmmhawK3fFlsmw/NRsosn3n40Gi7J64soA AMtVorjiFPd2gL6fqrAMgsxakW+/+V+Cbtq3xpENBn083MlJ+aIHtaRawZzUT8gtPI WMXAEhc10dwe9wh+bFIQ3yXMaAemh9yY8FCwlyjIdYQ4eKNI+A+mmG3t19Ktap6Ue7 0weB6tQW3bWIzEnVVbGkslSqqUIlTHhrWzmLduYeCw0tZsyBkHt5glMeb73nSdycr4 gafZx8zrVHIMg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id A169237820A1; Thu, 11 Apr 2024 11:43:05 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/8] scsi: ufs: ufs-mediatek: Remove useless mediatek,ufs-support-va09 property Date: Thu, 11 Apr 2024 13:42:53 +0200 Message-ID: <20240411114300.169055-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> References: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_044308_290303_200095AB X-CRM114-Status: GOOD ( 16.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove checking the mediatek,ufs-support-va09 property to decide whether to try to support the VA09 regulator handling and change the ufs_mtk_init_va09_pwr_ctrl() function to make it call devm_regulator_get_optional(): if the regulator is present, then we set the UFS_MTK_CAP_VA09_PWR_CTRL, effectively enabling the handling of the VA09 regulator based on that. Also, make sure to pass the return value of the call to devm_regulator_get_optional() to the probe function, so that if it returns a probe deferral, the appropriate action will be taken. While at it, remove the error print (disguised as info...) when the va09 regulator was not found. Fixes: ac8c2459091c ("scsi: ufs-mediatek: Decouple features from platform bindings") Signed-off-by: AngeloGioacchino Del Regno --- drivers/ufs/host/ufs-mediatek.c | 34 +++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index 0b0c923b1d7b..e4643ac49033 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -622,27 +622,38 @@ static void ufs_mtk_init_boost_crypt(struct ufs_hba *hba) return; } -static void ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba) +static int ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba) { struct ufs_mtk_host *host = ufshcd_get_variant(hba); + int ret; - host->reg_va09 = regulator_get(hba->dev, "va09"); - if (IS_ERR(host->reg_va09)) - dev_info(hba->dev, "failed to get va09"); - else - host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL; + host->reg_va09 = devm_regulator_get_optional(hba->dev, "va09"); + if (IS_ERR(host->reg_va09)) { + ret = PTR_ERR(host->reg_va09); + + /* Return an error only if this is a deferral */ + if (ret == -EPROBE_DEFER) + return ret; + + return 0; + } + + host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL; + return 0; } -static void ufs_mtk_init_host_caps(struct ufs_hba *hba) +static int ufs_mtk_init_host_caps(struct ufs_hba *hba) { struct ufs_mtk_host *host = ufshcd_get_variant(hba); struct device_node *np = hba->dev->of_node; + int ret; if (of_property_read_bool(np, "mediatek,ufs-boost-crypt")) ufs_mtk_init_boost_crypt(hba); - if (of_property_read_bool(np, "mediatek,ufs-support-va09")) - ufs_mtk_init_va09_pwr_ctrl(hba); + ret = ufs_mtk_init_va09_pwr_ctrl(hba); + if (ret) + return ret; if (of_property_read_bool(np, "mediatek,ufs-disable-ah8")) host->caps |= UFS_MTK_CAP_DISABLE_AH8; @@ -663,6 +674,7 @@ static void ufs_mtk_init_host_caps(struct ufs_hba *hba) host->caps |= UFS_MTK_CAP_RTFF_MTCMOS; dev_info(hba->dev, "caps: 0x%x", host->caps); + return 0; } static void ufs_mtk_scale_perf(struct ufs_hba *hba, bool scale_up) @@ -985,7 +997,9 @@ static int ufs_mtk_init(struct ufs_hba *hba) } /* Initialize host capability */ - ufs_mtk_init_host_caps(hba); + err = ufs_mtk_init_host_caps(hba); + if (err) + goto out; ufs_mtk_init_mcq_irq(hba); From patchwork Thu Apr 11 11:42:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13625799 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 ADC09CD1299 for ; Thu, 11 Apr 2024 11:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hFD8uowyNR8rlgpDdttCFx0tLAYsQU7nkuCrK+wdkTg=; b=NPdZibVcNlq2ay dQUKbQlzYYV8Q4L69aR1rDiCMQV6dVwCIHPWEgGEcCP8dH1KjZIZ5xPGdj+Ea9AMr90bsxh60pzjZ eEsuC+MyMoEGudmXTV9/AxuVs6isxvz8Os1q/X8hWpbMai/7YL2VutTXupCRzMgJDSK5Z3dqwiRW/ YafQv22ql6CuTYOFxX997dGWnZkM9sYvMygXP1vfrh3U6n6qJmWBCJzb443NHGMMoK1UaudmFsQ6P SiUn9vIXu7b9166dMrwQ5qL1oIVQ1PdSN287bwp1kiVgBLoNy7aBsFsUHDnMNj8F7alTnbJwH3MEh k29rlL3/LgDfFmcnK1kA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rusqJ-0000000BmGl-2yUo; Thu, 11 Apr 2024 11:43:47 +0000 Received: from madrid.collaboradmins.com ([2a00:1098:ed:100::25]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruspi-0000000Blyn-0pQo; Thu, 11 Apr 2024 11:43:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712835788; bh=WY8EthFDmZfJZmt27wVTY3epf3S/NvCwlH2R04NWsW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kxHDWBg6kMZ/hmakMBcUJO5B+plR1FtTqjl+jJoXt/I9+WRe/r4HuV5xZzwmHcG1+ N0ZieA87gA7dd6tL0vj2dJKY/j71zA2BO9kcQSm9RkcjpIOokasWMS4Zku/3VNCRY1 l1I0+GU/51yL88+4v6Tli4T6WH8kGV0DhRzzaDypvBgAVwf6sZSgLbxE9E2MpNkweJ wyMH/JbkG1YiWCuHny9Nyd3lQEKyXgmzz2Vc6BU5YR4dqj9jzqxVnO6304telWxIA/ 4IIDEgmQvbghXdFoozQKN5sDGjEes0MmgoDsi4B4vqQQPx97XuV2jCr2uvnMgoIYVC +A88O46bfQzUg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 0C08F37820FD; Thu, 11 Apr 2024 11:43:06 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/8] scsi: ufs: ufs-mediatek: Fix property name for crypt boost voltage Date: Thu, 11 Apr 2024 13:42:54 +0200 Message-ID: <20240411114300.169055-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> References: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_044310_417297_BC48A018 X-CRM114-Status: GOOD ( 12.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Rename "boost-crypt-vcore-min" to "mediatek,boost-crypt-microvolt": this is a vendor specific property and needs the "mediatek," prefix, moreover, this is not defining a minimum voltage per-se; Even if technically a call to regulator_set_voltage() does indeed internally set a VMIN for a regulator, the API also supports other calls to set VMIN-VMAX constraints, so this "vcore-min"->"microvolt" rename is performed in order to avoid confusion, other than adding the "microvolt" suffix to it (as this does take microvolts!). Fixes: 590b0d2372fe ("scsi: ufs-mediatek: Support performance mode for inline encryption engine") Signed-off-by: AngeloGioacchino Del Regno --- drivers/ufs/host/ufs-mediatek.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index e4643ac49033..688d85909ad6 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -595,9 +595,9 @@ static void ufs_mtk_init_boost_crypt(struct ufs_hba *hba) goto disable_caps; } - if (of_property_read_u32(dev->of_node, "boost-crypt-vcore-min", + if (of_property_read_u32(dev->of_node, "mediatek,boost-crypt-microvolt", &volt)) { - dev_info(dev, "failed to get boost-crypt-vcore-min"); + dev_info(dev, "failed to get mediatek,boost-crypt-microvolt"); goto disable_caps; } From patchwork Thu Apr 11 11:42:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13625801 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CE696CD1292 for ; Thu, 11 Apr 2024 11:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Rz+yA/tKhXFSX5hsB1fhgkNJwxJBPjsHwcWgSerVykg=; b=KvbJBfBMos8lTI L1iG1cf+RcVngYuuHIh/L7JneRR8y5EOXvArgly2deppMPOPSM7QqB/h+ItXRBbdElakQB7YSprYB bdIKFjp/e6ORBQQSZ44S2PLm45TIjHD7ctsFezBPnEAAohgIO4EVr645G9IW3LbfQPUwiquxRu2C3 aawxV2G0eQ8R6bJ3Z5XGhiMReceJIAhzsqlaf803aNTqcqdloVP0EVE4+DXQ7TkJWqJBwr5Po3UnI LHrwrmkMJOs/SMewtCGQ4qY9LOjUHA+9y5CRdQZKeHaXJ9MmhA7FpBfaf6fncc9OYljSmjXGiI8j1 JaaMApK/GTkbPGVeQ0cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rusqU-0000000BmOl-0ZHH; Thu, 11 Apr 2024 11:43:58 +0000 Received: from madrid.collaboradmins.com ([2a00:1098:ed:100::25]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruspi-0000000Blzr-3ItG; Thu, 11 Apr 2024 11:43:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712835789; bh=oAmHrFWJ0AgBwXeTr9PuBA8AXz2vtp9jcoIAQcxeovA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j9XVPWIjQPk/W+/nYel0ynUdz6j1CWueMboBNJKgLGJpjT1JEdWyM4/rBGWpqJ7kR 2sWg609GC7imQ15b8IglcRSJr51G/KexJrlLQnNb/XkXyR4D/co2UglmLFgb9FJgzI BWP259Il3E179TgSePdra1DH1J4t2CGcvVbKRUYvC2oCxk83bPxmxfTw6WxmGF44Ua RIPt8E4G/GgRgpTjqAXl5nrBLFQ5Ub4TG+PGOQ6r/sGpe/sUaXsL7I9HADnV4zcEvh ND3J5dF029veBHwD1jc1WwNrYXI62YUy351pPuejCO9T5ao2KcxLBxykrqxBAeyMpy WudB93kezAUuQ== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 6990B3782117; Thu, 11 Apr 2024 11:43:08 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/8] scsi: ufs: ufs-mediatek: Remove useless mediatek,ufs-boost-crypt property Date: Thu, 11 Apr 2024 13:42:55 +0200 Message-ID: <20240411114300.169055-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> References: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_044327_330482_ED1BC969 X-CRM114-Status: GOOD ( 16.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is no need to have a property that activates the inline crypto boost feature, as this needs many things: a regulator, three clocks, and the mediatek,boost-crypt-microvolt property to be set. If any one of these is missing, the feature won't be activated, hence, it is useless to have yet one more property to enable that. While at it, also address another two issues: 1. Give back the return value to the caller and make sure to fail probing if we get an -EPROBE_DEFER or -ENOMEM; and 2. Free the ufs_mtk_crypt_cfg structure allocated in the crypto boost function if said functionality could not be enabled because it's not supported, as that'd be only wasted memory. Last but not least, move the devm_kzalloc() call for ufs_mtk_crypt_cfg to after getting the dvfsrc-vcore regulator and the boost microvolt property, as if those fail there's no reason to even allocate that. Fixes: ac8c2459091c ("scsi: ufs-mediatek: Decouple features from platform bindings") Signed-off-by: AngeloGioacchino Del Regno --- drivers/ufs/host/ufs-mediatek.c | 55 ++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index 688d85909ad6..47f16e6720f4 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -575,51 +575,55 @@ static int ufs_mtk_init_host_clk(struct ufs_hba *hba, const char *name, return ret; } -static void ufs_mtk_init_boost_crypt(struct ufs_hba *hba) +static int ufs_mtk_init_boost_crypt(struct ufs_hba *hba) { struct ufs_mtk_host *host = ufshcd_get_variant(hba); struct ufs_mtk_crypt_cfg *cfg; struct device *dev = hba->dev; struct regulator *reg; u32 volt; - - host->crypt = devm_kzalloc(dev, sizeof(*(host->crypt)), - GFP_KERNEL); - if (!host->crypt) - goto disable_caps; + int ret; reg = devm_regulator_get_optional(dev, "dvfsrc-vcore"); if (IS_ERR(reg)) { - dev_info(dev, "failed to get dvfsrc-vcore: %ld", - PTR_ERR(reg)); - goto disable_caps; + ret = PTR_ERR(reg); + if (ret == -EPROBE_DEFER) + return ret; + + return 0; } - if (of_property_read_u32(dev->of_node, "mediatek,boost-crypt-microvolt", - &volt)) { + ret = of_property_read_u32(dev->of_node, "mediatek,boost-crypt-microvolt", &volt); + if (ret) { dev_info(dev, "failed to get mediatek,boost-crypt-microvolt"); - goto disable_caps; + return 0; } + host->crypt = devm_kzalloc(dev, sizeof(*host->crypt), GFP_KERNEL); + if (!host->crypt) + return -ENOMEM; + cfg = host->crypt; - if (ufs_mtk_init_host_clk(hba, "crypt_mux", - &cfg->clk_crypt_mux)) - goto disable_caps; + ret = ufs_mtk_init_host_clk(hba, "crypt_mux", &cfg->clk_crypt_mux); + if (ret) + goto out; - if (ufs_mtk_init_host_clk(hba, "crypt_lp", - &cfg->clk_crypt_lp)) - goto disable_caps; + ret = ufs_mtk_init_host_clk(hba, "crypt_lp", &cfg->clk_crypt_lp); + if (ret) + goto out; - if (ufs_mtk_init_host_clk(hba, "crypt_perf", - &cfg->clk_crypt_perf)) - goto disable_caps; + ret = ufs_mtk_init_host_clk(hba, "crypt_perf", &cfg->clk_crypt_perf); + if (ret) + goto out; cfg->reg_vcore = reg; cfg->vcore_volt = volt; host->caps |= UFS_MTK_CAP_BOOST_CRYPT_ENGINE; -disable_caps: - return; +out: + if (ret) + devm_kfree(dev, host->crypt); + return 0; } static int ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba) @@ -648,8 +652,9 @@ static int ufs_mtk_init_host_caps(struct ufs_hba *hba) struct device_node *np = hba->dev->of_node; int ret; - if (of_property_read_bool(np, "mediatek,ufs-boost-crypt")) - ufs_mtk_init_boost_crypt(hba); + ret = ufs_mtk_init_boost_crypt(hba); + if (ret) + return ret; ret = ufs_mtk_init_va09_pwr_ctrl(hba); if (ret) From patchwork Thu Apr 11 11:42:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13625803 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 3FA0ACD1292 for ; Thu, 11 Apr 2024 11:44:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oWQTOhWRUiqasSJZ7RDI+P2Tyk7agddj7vMk2O71Hp0=; b=cXiJoy/AX3T3Bh CNSVA3CJW6j4AD37zi4RAISM80Eu8z55E01Io8cPvhA45TfgWDJIObOKRyuKxKd8qmJTsE80kMVsB JmczxNdQlhewTHT1uKqF8Ooi/ZAtOnVRuKDrGhc/XKysE3ULI+6pEB34ls57fxJXH/GRS7O0+qeg0 zOjIAg+rfnXdoT2n7y1e33Vd9bbu+u2LwexTQep6Ftu8ehVbzB18zvr9onDTGLpMiD7UIJaG3vyF0 rnV2KhqfIHj7HpwZeimdskl/NUwYBG8vZZOGr3TvyGHebPu11AjW3zvX5cEIv8uC0JpdrqxqRBJhK eXf6VkicG75CNKXAS62Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rusqp-0000000BmfS-3Czd; Thu, 11 Apr 2024 11:44:19 +0000 Received: from madrid.collaboradmins.com ([2a00:1098:ed:100::25]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruspy-0000000Bm0a-0BJA; Thu, 11 Apr 2024 11:43:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712835791; bh=mtHtsXrLALzqGVSNLxyK9tAZfpbHED2YLsLqlHv6qkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SBDjKEoLeJSByICvxlK6kzllOYSILJpwhl4ZaEm2KJtP3jP3wf5/ozfZZXfaEX6TV +IkerdfQsszv24/ZPKDYG1mFTyDFvdjdVcFDGBSY8PhapVdIjjZJzbNGFG3J3PCTbe +hx8bN8kUqXh6Rje6uI83K6oH1XgA/tqJSs5mUjStfafXxgLbT/+Dl/ElhceHBksa5 MVZrNsNNBPvmJL1npnJ+hnOfmjLZV0PLSWpJjDNiQS2DxVD9CnbceijXGsalWxqNjB WELW8FXzc2wA+VGulzbj5mT+qsVMcqKHP/NKRuz0MEqNHZYLklETNFyv0pzPYUysPe dtgbGWqETWYPg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id C85B4378212C; Thu, 11 Apr 2024 11:43:09 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 4/8] scsi: ufs: ufs-mediatek: Avoid underscores in crypt clock names Date: Thu, 11 Apr 2024 13:42:56 +0200 Message-ID: <20240411114300.169055-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> References: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_044327_735916_23443091 X-CRM114-Status: GOOD ( 10.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Change all of crypt_{mux,lp,perf} clock names to crypt-{mux,lp-perf}: retaining compatibility with the old names is ignored as there is no user of this driver declaring any of those clocks, and the binding also doesn't allow these ones at all. Fixes: 590b0d2372fe ("scsi: ufs-mediatek: Support performance mode for inline encryption engine") Signed-off-by: AngeloGioacchino Del Regno --- drivers/ufs/host/ufs-mediatek.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index 47f16e6720f4..5db6d27f75af 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -604,15 +604,15 @@ static int ufs_mtk_init_boost_crypt(struct ufs_hba *hba) return -ENOMEM; cfg = host->crypt; - ret = ufs_mtk_init_host_clk(hba, "crypt_mux", &cfg->clk_crypt_mux); + ret = ufs_mtk_init_host_clk(hba, "crypt-mux", &cfg->clk_crypt_mux); if (ret) goto out; - ret = ufs_mtk_init_host_clk(hba, "crypt_lp", &cfg->clk_crypt_lp); + ret = ufs_mtk_init_host_clk(hba, "crypt-lp", &cfg->clk_crypt_lp); if (ret) goto out; - ret = ufs_mtk_init_host_clk(hba, "crypt_perf", &cfg->clk_crypt_perf); + ret = ufs_mtk_init_host_clk(hba, "crypt-perf", &cfg->clk_crypt_perf); if (ret) goto out; From patchwork Thu Apr 11 11:42:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13625800 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 82B3ACD128A for ; Thu, 11 Apr 2024 11:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ybMn1qLUUr6Sc30oi8VX9DdNfpKnCDzmHBsl2y4lB9c=; b=M5Q/jkX/JIWyr9 HulfNW7qMmGDT34QDeGTI/cOQ7cp5QK8HlIdqv7ctNHMC2AOde0kfDW9h44U/RiyCrTBZz50uIjxJ pCK08gkgGVArE/od0UzqtWBKltM3lBOY4OJNONZVg4Spen8PLEImb4DdGH+a7KoqddIdpX1wXRo06 h1NfYe+Rxs530BojysI8yddLw/8p4NWP85Rh1XILi9KYzOGbroOEyG+WmpLHJ5HpnVTSo4erSZz+8 L59bAbpOgX/wEn6wjd9c0u1ZBWT9b9PSmxZbLDqWra1f41WDLrru5pJKQ6tNVjDjyVgENihWWZM+e F9Tlb9aHtcJUIS+667cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rusqS-0000000BmNb-2f4L; Thu, 11 Apr 2024 11:43:56 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruspx-0000000Bm0i-3dLp; Thu, 11 Apr 2024 11:43:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712835792; bh=qvwukQ63ru7c/su/YXR6zlEYXzSPY/kzv1TeqWamDO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VAqYmma0GspQtIe1m5Adref3Nhp7/ZUqOfqoew3DXbikfj6o7ArlgIBdvGhdTyLfe JhfmmyMywVH3rWvW1zZYsdslxnfF2tAm6jspQ9BIFL01HDN8BYMm1i/jT+SUYPMNLK AQKcng6DeS9ixBhy3wCeAyu0dYTfOxz/6iNcHgOz7YSyrIP2bAL7nSoZLlNErkBbq4 eXIYMea/lkzEsI3WGC7OQX22EHlMy++hWJd0eyd9HxfhBoQuxdJsz3MVqkTMlPsrjl wOrQqTcE5Bk2OuvDsgyXzGtUWCN5zh4wLy7p9NJtPERteBt2GTCTolUJJI6YQdEwYt GL+/x4+EkD3Bg== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 32FE7378212D; Thu, 11 Apr 2024 11:43:11 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 5/8] dt-bindings: ufs: mediatek,ufs: Document MT8192 compatible with MT8183 Date: Thu, 11 Apr 2024 13:42:57 +0200 Message-ID: <20240411114300.169055-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> References: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_044327_692232_DC76F741 X-CRM114-Status: UNSURE ( 9.15 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The MT8192 UFS controller is compatible with the MT8183 one: document this by allowing to assign both compatible strings "mediatek,mt8192-ufshci", "mediatek,mt8183-ufshci" to the UFSHCI node. In preparation for adding MT8195 to the mix, the MT8192 compatible was added as enum instead of const. Signed-off-by: AngeloGioacchino Del Regno --- .../devicetree/bindings/ufs/mediatek,ufs.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index 32fd535a514a..adcd13023866 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -14,9 +14,15 @@ allOf: properties: compatible: - enum: - - mediatek,mt8183-ufshci - - mediatek,mt8192-ufshci + oneOf: + - items: + - enum: + - mediatek,mt8183-ufshci + - mediatek,mt8192-ufshci + - items: + - enum: + - mediatek,mt8192-ufshci + - const: mediatek,mt8183-ufshci clocks: maxItems: 1 From patchwork Thu Apr 11 11:42:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13625805 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E1CE9CD128A for ; Thu, 11 Apr 2024 11:44:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v6ctVb+64VeYfqsi6boLXuENYvjSJt8cvs47+mO61lQ=; b=rAkcYsk/mXHI9U dxLF6UbbfsBWKZWynwnyOAmrE5UWfz9TsBBUu4fkDH3apo+n6YVy0/SLQWfX3AbiYJzKvcSwXtqer SpzZ4R6IuWlnDGLZmsvyN2bmlBvAJmkuRBpdHBRq5tIsfYORYZInUj155D7OxJqfM5u8/8qWZHyER bKlzWOwOzNACTXzvzFb+TJQ56iymznFiaCs/vzMiqaLS4NaELLLxeRkRvZQlgjOBOghAu4+brBWHt /zswT+P88jATQa7Hjblmd6YpliLDDzKafaM/yC6aKncOgNT+Js+a9sPtwzN3jcPCIMwiTp00DYVxY oMF7Iggn9FAeyPrYJuvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rusr6-0000000Bmro-1V5X; Thu, 11 Apr 2024 11:44:36 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruspx-0000000Bm0o-3dqD; Thu, 11 Apr 2024 11:43:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712835793; bh=XK+I2rHX8gkIddpwg379tC6deWLfihQGpL9it+LQ4dA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gQwnAfHF0KS/oa6i2PPDzESXcAwD9eRMsGZUYtWIPXIg1KsDOslk2o2zgchV5v+2H j+ULGrUDmHGFcoCq8FCTgeC6pBwVo1At2zXU2g6nkt4k8930bRQ1KKlaW45TKZWdmQ ddZEztSEpPtmJAtPKnSNmJmvt+2e9wsgsAkPemBdJKQ0A0jWwsw0ic60ukWub9D6O9 JYfHzWfUcrCKBQiuCYZ/kX+UPDnmFrs1vzC2GnKppMg2pCxPupGV402oFVtMoR79MS pyPscqiwAwif/AwglRt2DLwV0GiNShuq+5DW/RScwf+ggtrPZvHk436hqIHc4ctSAB oL/M5dDgDsp7g== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 909373782133; Thu, 11 Apr 2024 11:43:12 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 6/8] dt-bindings: ufs: mediatek,ufs: Document MT8195 compatible Date: Thu, 11 Apr 2024 13:42:58 +0200 Message-ID: <20240411114300.169055-7-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> References: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_044327_710552_934E0540 X-CRM114-Status: UNSURE ( 7.37 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add the new mediatek,mt8195-ufshci string. This SoC's UFSHCI controller is compatible with MT8183. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Conor Dooley --- Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index adcd13023866..e2c276da3f2c 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -22,6 +22,7 @@ properties: - items: - enum: - mediatek,mt8192-ufshci + - mediatek,mt8195-ufshci - const: mediatek,mt8183-ufshci clocks: From patchwork Thu Apr 11 11:42:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13625802 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 030E0CD1284 for ; Thu, 11 Apr 2024 11:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PHXFZb8lrsvcgf///21yhrO2pPvp90Ek63aMSBBU7kg=; b=0LDn9GG8YCxvQM UoI6wnhOf/enoUNKqLEFLppZLyo68rkJzfM+WRcTVyyz2Wj2vLp30C9aamRWSEOiCCLTWRB9AeMZP /Z1ibzaxzn8DeaxXlfhE4ac3jgS6YpPgnHEBM3IMXCmEddpp6wtQb2jrbdTTbCr1dmOWzRCqNB5dJ b5V3Yfr6BG6P0Kt2cQyIcZ0xgeEFHE12qqiBNavYL3+EH2USwuzzu0atEhrpST9i3UUi6I9OPSXMi 27mNeozAMKxvW0NbBzcYDH6sp6jwgluTqS1SsC4/hcclhzL1ZEso6FpPsvmSe3U8lt7+0un8+t062 X4YVY6NHC2J0RKErBlxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rusqf-0000000BmXB-1fkg; Thu, 11 Apr 2024 11:44:09 +0000 Received: from madrid.collaboradmins.com ([46.235.227.194]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruspx-0000000Bm0r-3dGj; Thu, 11 Apr 2024 11:43:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712835795; bh=GuvA/DRMxI0WIit88vBOOF9cxqJqFuEuz4b3EKsPftc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QuKlKOR7aMM+sLqdhb/WMLya6mDI7djcoX1wqAT9KwAhyBJ1kxGVxoQGW2WlCkkv4 h65DYklhQ7zWhIltlIrQxEZVTFKUdK/C91dP3NHQvpmF/7i+lPz/pa0oF07nBke2wi 2UiQRUzzWqQSc3/I+0fCipRiHR5NUjLoVe9hL2ciKGnnB152YincNhLiH0KAfYMEeX 1q1MYJBoWGfumqOq+Fwl9Z7U0jMqL6fIDKHqW53bEPHYDP+YOanNOKM78qoFyOUY3f 9DhUCSyse16hlGLotr20rZXp5fj69tYkSRCAWmGHF5/G5CBFTyGop+6X+CTlYCN4MY sVTpDtefpUI8g== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id EE5F23782132; Thu, 11 Apr 2024 11:43:13 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 7/8] dt-bindings: ufs: mediatek,ufs: Document additional clocks Date: Thu, 11 Apr 2024 13:42:59 +0200 Message-ID: <20240411114300.169055-8-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> References: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_044327_811942_6C1A3E00 X-CRM114-Status: UNSURE ( 8.71 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add additional clocks, used on all MediaTek SoCs' UFSHCI controllers: some of these clocks are optional and used only for scaling purposes to save power, or to improve performance in the case of the crypt clocks. Signed-off-by: AngeloGioacchino Del Regno --- .../devicetree/bindings/ufs/mediatek,ufs.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index e2c276da3f2c..21b038db100c 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -26,11 +26,23 @@ properties: - const: mediatek,mt8183-ufshci clocks: - maxItems: 1 + minItems: 1 clock-names: + minItems: 1 items: - const: ufs + - const: ufs-aes + - const: ufs-tick + - const: unipro-sys + - const: unipro-tick + - const: ufs-sap + - const: ufs-tx-symbol + - const: ufs-rx-symbol + - const: ufs-mem + - const: crypt-mux + - const: crypt-lp + - const: crypt-perf phys: maxItems: 1 From patchwork Thu Apr 11 11:43:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13625804 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C6CC2CD128A for ; Thu, 11 Apr 2024 11:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CRt4BU27PiN84tjLLGEYUSHO/6PD8uIH6rQw1u5Lu4w=; b=CPM2A0aaVBHGfu lqCtXHbMQsLYk3VkcfN2//3WPTeh9dUj8CzvvMLk4S0XX1xWASIpvsPfNkCFpksr1/dPp8OO/5yAN 6YuPCBefI86UkSlwjLnekBsHo+cMO/O7N7+c5hTNyeevrXG95kWk0FBhqY8f4TelNsKXBTGe9Epnk AQ/PnGPlrushQzlrRXjKvemeppmV40aAPPVytj4CLXgGzypH5PbAdxmCsYWiIUkO8U00v0qg6NV8n VM5S4KM/LwHqYoEEYt/+yuFsp+FNQl4lNbQSFVZ4Bh+cSfYf2MXNyWGzWvAoErHJjLPEtR9lfxzP+ 7xSw3pDWw+04Q81/Q8nA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rusqy-0000000Bmlm-3j1a; Thu, 11 Apr 2024 11:44:28 +0000 Received: from madrid.collaboradmins.com ([2a00:1098:ed:100::25]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruspx-0000000Bm10-3cEQ; Thu, 11 Apr 2024 11:43:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712835796; bh=sY1R1NA7jkwBIAVzv78scvrc0A647hsvQsRji2DzXiM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NTU/yLSRChU1zIhnZbUUml0WZdVLgoejrrSVR3AU0ddhtd/S9/YcYop24AImmyCBT CYe6xH1a9bfKr75uwRS2wj8QZElrX3vRCrbnjTpXXPiQ8fzR+2nwcwcxJ5SzjlA6LE oMyV6N9SxCJWRvOq/mqkpjvM1I/oSFcH8ZRiQcaFoJBdPTzoem42DWzsLQagXWZZvt YSZwAYfkDiEZSrffIsCTn6SKVDGzeQleQUxyPTraenVcVyOpS6N37k7NywzrIQDChC GQBnPlTK9HZ949+QHTPTfIpljhcyOm5LLDhJ3TVuP66LeJW5Rv3l6cjQx58ykdlh8H vttgvk/q3N9Ig== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 5525E3782134; Thu, 11 Apr 2024 11:43:15 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, chu.stanley@gmail.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, stanley.chu@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 8/8] dt-bindings: ufs: mediatek,ufs: Document optional dvfsrc/va09 regulators Date: Thu, 11 Apr 2024 13:43:00 +0200 Message-ID: <20240411114300.169055-9-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> References: <20240411114300.169055-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_044327_850755_4678C57E X-CRM114-Status: UNSURE ( 7.52 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Document the optional dvfsrc-vcore and va09 regulators used for, respectively, crypt boost and internal MPHY power management in when powering on/off the (external) MediaTek UFS PHY. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Conor Dooley --- Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index 21b038db100c..2ee8bb7d5aac 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -50,6 +50,8 @@ properties: reg: maxItems: 1 + dvfsrc-vcore-supply: true + va09-supply: true vcc-supply: true required: