From patchwork Wed Jun 12 07:43:02 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: 13694571 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 A9C76C27C53 for ; Wed, 12 Jun 2024 07:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7rgvK6tvAwEac4inpFacUSnKukUEOa7RqQhbKlC0FOA=; b=ShY9HwwcnwRW1x10wrc7pEXEF9 0UlmTKCSWQqcev22lJnKCwHtKYy7kAHWzfYWLuBL1z++bZMPjiFrgP7a0eyGpn+WXN8r3mL6rhmbL OmVGM7Zu/F42xztbQidAKKhykl9zZYBf6T939y1uq1CSlUSX+W5gBNzV/wvQwNMIyn2kHgTtBIWl0 aJfy6ODsaHwD0SFneK4N2eTT3O3HwbO9TFWO1HKa/qLpSJk0rKUqzcAhttHSaV1Gv5VNaQLrlRLPv p2Ag45e4oxI3shAojnNB772ablhr3kr26A37irvhUCpWoequ6JLtrnxJlsTgZ8DGZGOAq7iFBNPLe TStKJW3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHIdm-0000000BU3m-3lGB; Wed, 12 Jun 2024 07:43:30 +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 1sHIdg-0000000BU0o-3W3W; Wed, 12 Jun 2024 07:43:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178203; bh=2rsptygWifRO/c0OTQta4XS0LqTtMDZVNSsQpMH8z8A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2D5ReFgCJ0rNdPab1qhWShJZEjGyFXubQVbypSqm26hV10K6fOnoNldYMD6Ir5B4l dhCMjArm9ltXzjdeHpguPw2v2UyAy76xgyegFOSHz/rdRkH8suCc5jghYAHa8w1ao6 ESRPhlV+Zt5W+60sq1HDzpbHxXor5LAsKO7NdV4F5zvlFqUvGdZ4VfqAqHi2aH8W6Y cbjJKL3Ft2B5QnPEaNz38u0AdIr6vNnW/0/sgY4+wg+aT9mbcPIWDWwJPsYg1+adMa LorIwLHrd+g4dbAxr+Kf6b35R4UPipa2nxO8g63zgDEsBdQjihbFcLpgOprtotdaao OF7sbDCP+beAQ== 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 4E45437820A9; Wed, 12 Jun 2024 07:43:22 +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, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc Subject: [PATCH v5 1/8] scsi: ufs: ufs-mediatek: Remove useless mediatek,ufs-support-va09 property Date: Wed, 12 Jun 2024 09:43:02 +0200 Message-ID: <20240612074309.50278-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-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-20240612_004325_155132_D751A538 X-CRM114-Status: GOOD ( 16.57 ) 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 c7a0ab9b1f59..47c7d34b9be9 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -623,27 +623,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; @@ -664,6 +675,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) @@ -986,7 +998,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 Wed Jun 12 07:43:03 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: 13694572 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 CFD74C27C75 for ; Wed, 12 Jun 2024 07:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TD3+RsWf3MsLhUMrRb4RsEzRQoOCBBF8D1SVSH55h5Q=; b=owwxUaA33DWcquLs4KHIr8VypP wPBFPhIiKrIMNX2Fob212NA9CvGqbrvt1axOmQLa8RhT8UbZvqAdiW+aLb4B0ZHKopW6xjpCk9v0c +Gwh4a+tyQyNhOotBLQ/2UXdIjJvBXiVNOZXLzCOAjCNhuaNodmAlR7AIAEBF4K8gpxLycvtRAdwe GjBEno4yEeH5PAOQxBCaSShUC8OXwdTxDH4DtrFE8IXhNZn3WRqq+EmE0yzZhvZLGPxaI+9KDBkKV ksRMqMZrzB3tt6WangvCPKTX3pXn6Vju+y4Y+xdsLgRRx3omcNsDhXA5iCN4V712PHsfMEUov+vEm BILG/3ug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHIds-0000000BUAD-3PFR; Wed, 12 Jun 2024 07:43: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 1sHIdi-0000000BU1N-1CbS; Wed, 12 Jun 2024 07:43:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178204; bh=6lsXc7rT10Ac9XA0NZVkBiPzRFq97QkmLLktkh5oOi4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=geZhYr5QvEFA+deCcJn5kv2L7dxx0xl4Q7/ztkSlnQc0OfrjoCcsFonA6YuWE6uC+ 01wxJsriWa8BtIwB+C0XAjCAaOa5yXuS4+wCcZWtq3b9ssXcnlJkXPZL8snyl1B9i4 /GtFfo9kitkIiQje2NSd+PuFYuf66Jl/ybbFkdXnW5g+eHTcXnnYdJQmRzVaHYenkU o+/oTnJFlgSBrTbCnA2eJyGsd2agQW2uIBP2g+51zUHi970XMA8vLG6tfV1rhY11aP tcTQG6LOZFSwxebLj08iOZUpdVtBjgajo68Mmg57HPhAKDxQt9+JVlh6WUfzEAh/b5 U6ACclK17pNzA== 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 A811C378216D; Wed, 12 Jun 2024 07:43:23 +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, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc Subject: [PATCH v5 2/8] scsi: ufs: ufs-mediatek: Fix property name for crypt boost voltage Date: Wed, 12 Jun 2024 09:43:03 +0200 Message-ID: <20240612074309.50278-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-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-20240612_004326_479574_BDCD94DB X-CRM114-Status: GOOD ( 12.48 ) 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 47c7d34b9be9..23271eb1a244 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -596,9 +596,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 Wed Jun 12 07:43:04 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: 13694573 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 10606C27C77 for ; Wed, 12 Jun 2024 07:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AxX1WvVi8hQ1FzyMJfrdnQ3n7jzAa25FHyvMlJDB6W0=; b=ZkcZI2gYUwpA+JKVjLG/Wc9az/ BtYT0iHvZ7LmBNRMDAio8Cwk3yLVm/oQZwHtHyisawDWGrdVCAVcYOdhl9lz0HY0/B1Pgk//uM/7K X1sYS0K+IK4gjdj431Pr0EsdYox5G53362iAsVc/ArojIUJ+fwktyvguYyfNdb+c3imacDFsxLwTD mzEdwoQiiegx/ZpIYm7B2SL3RRcmOrLZaDmWmkwK3J7CIcI/anXETwnoD2NDfYGY09IiBzY8xDJXg lAP/QgqvtUz1nDKtStnHt34SGJdOnFbi25zENfgXVFYqOPrpx5HY8euZESsr89l3Xm3xENk5HLVf4 Ix3ts3Cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHIdy-0000000BUDh-3VR3; Wed, 12 Jun 2024 07:43:42 +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 1sHIdj-0000000BU1o-1XLV; Wed, 12 Jun 2024 07:43:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178206; bh=XTxdq7yH2tRPSNAKGFLMAQfypYpTrjvxDfqFeM7tqxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P64NqKUrOcVq8coM8pIRjnqWlRA1bH6e2k9eoFmEXtl9mxjWsCe86QTzUbCfoJZ/E FAMmjlSCeKlz09ggH9hgfJ3SASzr79ABe+Y8YD2t0cSZDHwtZGrGDgk/RUPVASa4yR rizTeMkgmSt7Mrf0/V1hDctVcCR8T61oA88lePsFzdLuz5Wai/qb7JJPq2uS/AF87W F81bJwdRQjb3JdTteRZV+q7osXRZ/aQiOi90Cp4WZ7xKg86hugUJwepcDCHakruuaI 8ag4Ttilq88EwFTgz9QT37tpvge10n3IuckBlYnuTsnFfG7PPq2NvMCNv55UJDxgxu IvFxRVDpzmJiw== 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 0C8A7378219A; Wed, 12 Jun 2024 07:43:24 +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, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc Subject: [PATCH v5 3/8] scsi: ufs: ufs-mediatek: Remove useless mediatek,ufs-boost-crypt property Date: Wed, 12 Jun 2024 09:43:04 +0200 Message-ID: <20240612074309.50278-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-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-20240612_004327_590025_1A148608 X-CRM114-Status: GOOD ( 16.42 ) 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 23271eb1a244..8d0e7ea52541 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -576,51 +576,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) @@ -649,8 +653,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 Wed Jun 12 07:43:05 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: 13694574 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 2FD61C27C53 for ; Wed, 12 Jun 2024 07:44:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2fH0br5JcXYsbmFDlAsAWBJ8NI5SRzEUCudG3/89ick=; b=sasyvxZEBYv1RCayA6TTxCMeZM UhLBOY1tYesPFU+Y5nePaR6Fa8RdTxJ00l0YjSwScO59JQr2SGemF+j23H+rYW+COCnpQw3+mPjU2 /80Y+fHu5DzZzM8/DxKwYYzVCLnoQcfxmTpCDqP1JfJUnsIKSGDo1u5YJ5BUluP0hxjgi1nQFFPMn hqkNRrqbhtulTt73HxYV78o03y+wLdGXTq6jv3ZW1TRHPB+HDnMuOSpeX2O/SaKfPE3+NJ9QPZC6N 2oBBBmnsSXGxeVnxpvF07WbAqYfjQgC4GAe/nc2ovIbUakUKWRSSuP/8qQLYioZrxNzxTZ8V1Ol1M APkGKMiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHIe6-0000000BUKJ-1R01; Wed, 12 Jun 2024 07:43:50 +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 1sHIdk-0000000BU2E-2oD0; Wed, 12 Jun 2024 07:43:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178207; bh=K9MBVzw8pOo1gyqCI5gTzX5FvDaBQEiToN0XXU2CLjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eoHZXYncZyQl8K7MWDaJC1sFeWZxHXStMI1HqUfD1Va/32VVj+OxGTeEStnJTIcDS mJLX9np5dQ0zn74aPE9fs6p0BJAz7I8fomj99yIVCEZzZdo7WInMOZ2eNRpEPXZbmG gjaZ66SQehY8Qw24C1Ho5EZwfzYrpryfHrtiXov4hIFYK9Gofvw8GruUGyLa2B4wOp FPqrmFrUpiuH4NntZgI50fnAMnunJOkXq9FbKXiIv8nmVPa7Sy2267ELCXDZykVYJg ZnLQBkvtge9Qemf+TwEzXFRFFIj6KzFmc0Khitl75Zjg7a5U2mYJtBSNxyycBm3Kz5 GhLzEyB5dd0Dg== 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 677DB378219B; Wed, 12 Jun 2024 07:43:26 +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, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc Subject: [PATCH v5 4/8] scsi: ufs: ufs-mediatek: Avoid underscores in crypt clock names Date: Wed, 12 Jun 2024 09:43:05 +0200 Message-ID: <20240612074309.50278-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-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-20240612_004328_862666_EAA8A477 X-CRM114-Status: GOOD ( 10.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 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 8d0e7ea52541..10a550e7e628 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -605,15 +605,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 Wed Jun 12 07:43:06 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: 13694575 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 B948EC27C53 for ; Wed, 12 Jun 2024 07: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KbIo9HssMu+yUe/xltp9FPZYMI6FrG4gHjrXTq4Rqzc=; b=3I1ir9DUgODC6fl/vXn0+X/Ctf NIbYSwnBfAlNlZks/PnewmYl5vSTUPNoAOVw5hfkilsIdAwqfBTBE/+i19B/WXXautrq6o7eMIsna NPTUQbSWSV/QmMlpvebgMDQyxiYAkml/UvMYqwDLpDNMPzl0WMikCVkwBFAjPi2pn78wWrq9IUKP9 6Pmjr4do0elPQedW/HhpUOh2OBYfZ0kK35m0HQutqNXm0tDGYS+7zAyhTSD3hNJcIgBRGxA8McPaw EySJ1tIKzoahg72ik1TAqUTVuss+G8EIwvqm0zn3MPZr9W60eOhyws1ca//f+Ocx0fLh/XoReCv9r 3HY3qwzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHIeE-0000000BUSj-2ryd; Wed, 12 Jun 2024 07: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 1sHIdm-0000000BU37-0J8m; Wed, 12 Jun 2024 07:43:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178208; bh=K3rrJEbp/p/hbKG0ZLHrE2fpo1wxhHU8XVuRFaDmjOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I3OdBZ2w/fBbDobKQTv1ae1lqa+mQz8L/SUhkySAJAy8RsWFdCKI8pDAAsDfsRaws rXgNa69ya52w59XML8sVH5uCNkN3Fa+aCa4JxiCZD0quikLsXqfsb8wTGseHgltn63 2biAdVUJxNfAVSAEOYDFi9afgOwJeGsHAYFnsyR0tgyQK4Vnc2MvCw3ddeROsyrLdz sRU5anUYuzeNzLmMpvjnK3QY9u9dB0h90uHjMuQ3NqwII+oQz3n2/J5o2uwB57Ibgx O7+lH+icpWBTMwa5zg+K8ZKacs/kxF0ER3kOL48FazOTtHivXhgJYETjkY6LXeb/FN N3Y/Agoe/sI8A== 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 B2D3B378219E; Wed, 12 Jun 2024 07:43:27 +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, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc, Conor Dooley Subject: [PATCH v5 5/8] dt-bindings: ufs: mediatek,ufs: Document MT8192 compatible with MT8183 Date: Wed, 12 Jun 2024 09:43:06 +0200 Message-ID: <20240612074309.50278-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-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-20240612_004330_360155_99EB0E29 X-CRM114-Status: UNSURE ( 8.96 ) 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. Moreover, since no MT8192 devicetree ever declared any UFSHCI node, disallow specifying only the MT8192 compatible. In preparation for adding MT8195 to the mix, the MT8192 compatible was added as enum instead of const. Also, while at it, replace Stanley Chu with me in the maintainers field, as he is unreachable and his email isn't active anymore. Acked-by: Conor Dooley Signed-off-by: AngeloGioacchino Del Regno --- .../devicetree/bindings/ufs/mediatek,ufs.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index 32fd535a514a..f14887ea6fdc 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -7,16 +7,19 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Mediatek Universal Flash Storage (UFS) Controller maintainers: - - Stanley Chu + - AngeloGioacchino Del Regno allOf: - $ref: ufs-common.yaml properties: compatible: - enum: - - mediatek,mt8183-ufshci - - mediatek,mt8192-ufshci + oneOf: + - const: mediatek,mt8183-ufshci + - items: + - enum: + - mediatek,mt8192-ufshci + - const: mediatek,mt8183-ufshci clocks: maxItems: 1 From patchwork Wed Jun 12 07:43:07 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: 13694576 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 7999AC27C53 for ; Wed, 12 Jun 2024 07:44:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jzcd7If3SCeuauwwlCdOOqvfS/Xb+tfBbSnKxqgSwgM=; b=wYVSQwcXnpGSqhBMnEhBpZKfpv Hc/R1NHvGj17bFhM+hbIDg1RN49s8VCDmxYSX/pDHoglkNs7iGARMYxIb4B93lDmxlsVpn1zYpWjL NHRZcSA4PiU8tGJwdZBA3BzfrPJAb7XX93ydPQ4KptuGzLYmZglE16OIILLOXr6JYNqqCGAnf78aA /mvZjCo82cMMHUI3MZr6NoOfyy5RDaZolAo2Ok0t7w47vEqyfj8iSXC5ATzIr7Pay+JCucUFXd0BC 8rCtSxhFCnGMAbRLVVBcVce78+BVtp6sexLpz6qpkg1AVPglQlT2r9haELP2WcsWf+SexGwiefcVD fZPx94zQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHIeO-0000000BUZ3-0r8G; Wed, 12 Jun 2024 07:44:08 +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 1sHIdn-0000000BU3n-2Uao; Wed, 12 Jun 2024 07:43:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178210; bh=wZcU/FXZehoC+lJtazGBLsIeGgfB53r6HFIFrqTzF24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SShfAm4CoYKyVm0t5LhyWvvmUPhukqX1sldqdTI1lFe29jLgV/c7TpAOANcGlHWUg qqMpau0QIPMm4MODw3DRvOMM5KWam0GZaj7l69gwcR9hpdJ6tQ5RojT+ErAiXo5Zgf Ji/DEJl2XkRArxNhoCQibwydpfiZpLJ+2ulw1FpqI9IuZRYvkTmaFlzNzTNHWmZms7 JFo1W3tCLd+pV9EjIcopi0d9lVZl4YcBj/oAE2LZB7fMuc/Qr/zLPOzf80feYe2aki I+D+If4y1qt9g4zkbY01Wsy5bZob9XtWapAkEF6jcojJxmvP5hRHStHhxGQHEWYAUo nm7ow5+awGg2w== 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 2420D378219F; Wed, 12 Jun 2024 07:43:29 +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, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc, Conor Dooley Subject: [PATCH v5 6/8] dt-bindings: ufs: mediatek,ufs: Document MT8195 compatible Date: Wed, 12 Jun 2024 09:43:07 +0200 Message-ID: <20240612074309.50278-7-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-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-20240612_004331_795263_B9D1B7F5 X-CRM114-Status: UNSURE ( 7.34 ) 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. Acked-by: Conor Dooley Signed-off-by: AngeloGioacchino Del Regno --- 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 f14887ea6fdc..5728e750761f 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -19,6 +19,7 @@ properties: - items: - enum: - mediatek,mt8192-ufshci + - mediatek,mt8195-ufshci - const: mediatek,mt8183-ufshci clocks: From patchwork Wed Jun 12 07:43:08 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: 13694577 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 48E5CC27C53 for ; Wed, 12 Jun 2024 07:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=u4XsAzG/QsINJ8mY4nVfgLpP7/ClA+cSHc5b8w1sojE=; b=d+ZFPt3yrgzzqGHSrpbvPVGZ1l ZSi32UbHAY8rPsoPgO6MmFOjhu9VE6ogyt/1bMfmfhnol9uhAStrvShKckXWoIpNaMin/Cp0wRGEq veABkPTmjwT8IpQFXB3UJQNrBbIzZ7uY7ZyagxSoKWKhn2r+qsg687g5txDy3/sS6QcgMAJK6cnAv ettmJUxOpNUnp9ON/apufC8EJ7S7KbMzENMfCBDyXQlCCVOpqg+c3FjlRSk/K5hPmBjQr9/AyzhOb GDMD3GpcdIp0gIHJF4MKEUUxUF90KYpIdWTcW20MMFPFLDoxMNV+fYF4ignmDlUpP4tZ4viDy72Ox ryzMmGOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHIeZ-0000000BUhL-1fIz; Wed, 12 Jun 2024 07: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 1sHIdo-0000000BU74-3oWO; Wed, 12 Jun 2024 07:43:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178211; bh=TLELbug1XiDukFE3ghBiM2MHhoU3imk1/7ngSSox3e8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=crdOBphHW1I1MSSEvItDPGKYnqKmhVSresrVQRvPCzFKRubdocG1dgao4P/A2ny1k vXepq99nP+SEGpD7u4Qe6ULgbJ65lPxx2kzIiwzlSeOLggycIyHHKIm60x9R2oN+8l Y1LIUyK4x1gK1VfoaS9C+BwpymsXZLDQdsqc55muwpFMjDJLhhflA9wbUCZgtbV9ch tUX/fiR9oCg4OeDMxloh6NL4bJ0Y5Dd3Wv2WjoaHfMHYEeFgSjvH11Z/fOrLPwcBqy RMGjrvraJLszwuX+cpDJzGtMon/AnmNN4Edi1x0sjUlYFo+RBGrQ4XZS9zjrk5IzyG 3pYC5M9LxIMew== 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 878EF37821A0; Wed, 12 Jun 2024 07:43:30 +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, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc, Conor Dooley Subject: [PATCH v5 7/8] dt-bindings: ufs: mediatek,ufs: Document additional clocks Date: Wed, 12 Jun 2024 09:43:08 +0200 Message-ID: <20240612074309.50278-8-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-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-20240612_004333_107269_9C28D74C X-CRM114-Status: UNSURE ( 8.65 ) 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. Acked-by: Conor Dooley Signed-off-by: AngeloGioacchino Del Regno --- .../devicetree/bindings/ufs/mediatek,ufs.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index 5728e750761f..1df8779ee902 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -23,11 +23,24 @@ properties: - const: mediatek,mt8183-ufshci clocks: - maxItems: 1 + minItems: 1 + maxItems: 12 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 Wed Jun 12 07:43:09 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: 13694578 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 09924C27C75 for ; Wed, 12 Jun 2024 07:44:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hw+kxJCCvx5a39LkBUzYc1g2DSK+tBA3dkxoYssYtvc=; b=HrOuxlVROgQ52U6p6ododnJcgp RhKd9Vn1eAyU5y1EFuWxi4L6RtzfE2JTN9YTcyVp4jtZVtm5LtKDDc7kHs667XS6fHu8i5OaaJ2q9 kg1gTZYxAKAQj3dRdbxFGBr8s/QCQ1jTq9J0cDF4Bg3CSXLST8nrJEwOMNljsFLAFepsoeBZhIUN1 Xe4zylw9ybUrlWFVoWqUXlFjttz204oqxfO2cld03TE9ehwtlnmIS559KGrXPmVJcP40zScYHOeCV /ysxjmCgCqAVxA9UaSNECPw8BCy8ZyHFNOgqq+TkoWTR0HrvVZaXH3Rp73s6TFYYD3/fWqGzq7n1n GnLWy36Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHIef-0000000BUlj-3Zy5; Wed, 12 Jun 2024 07:44:25 +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 1sHIdq-0000000BU82-1zih; Wed, 12 Jun 2024 07:43:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178213; bh=06ggiwhMyGPpOHXWaG3DQjMS63EfxHCPMMxtiCYkegg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MzKAVqVwijk6mkNDVISGI0yOnt+0W/Gauxmgj64UBq12mPbsLQrt2lKDe+eey6KAF 4UZBr1kAdNv2VItZowPljl2vf3G8WxVZ3N1jFB3LZG/a2Dz0jS1c8kEcgDn00wDm6x /TU9l1hinejjFoYGockEY7byW1MLeKsPFJxltG5y5lJKdiqbyp7Qkg6sy0WU8/arjF 6FknBeVwH+/5s2FInK9Qe+80nTOJbk3RPwR4fLkOSkuZtr9sRcX0AY639NgAVdmZxs lfymeH25kLKEDoL6hlOl+2+3k0G51Ph3rydvNHFtuF2TwZXVfx2oKkPWATWFlxVIUZ 8wWlbiWeoK3Xw== 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 EBF2F37821A3; Wed, 12 Jun 2024 07:43:31 +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, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc, Conor Dooley Subject: [PATCH v5 8/8] dt-bindings: ufs: mediatek,ufs: Document optional dvfsrc/va09 regulators Date: Wed, 12 Jun 2024 09:43:09 +0200 Message-ID: <20240612074309.50278-9-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-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-20240612_004334_706297_E2CFD2D7 X-CRM114-Status: UNSURE ( 7.98 ) 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. Acked-by: Conor Dooley Signed-off-by: AngeloGioacchino Del Regno --- 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 1df8779ee902..b74a2464196d 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -48,6 +48,8 @@ properties: reg: maxItems: 1 + dvfsrc-vcore-supply: true + va09-supply: true vcc-supply: true required: