From patchwork Thu Apr 11 08:31:42 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: 13625578 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 775A0CD1292 for ; Thu, 11 Apr 2024 08:32: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: 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=0SGnU+wtFJJwYdXDIZzORNnDGjPUWXV009oSOMy/Skw=; b=HLT+GOZdDR9JuX tAhH3mh9qtPxOpkFfllDIYw+FBpIcqFwoGroR4nMrbxZ5MQ4F/x1Oe9/e4OdWlFXNaeLzP5+Hxa6o qHjhq25xHv/Y0lndMg2SNlY735KuRrF2x2Bfsd8TQE4MSxnYHVYRbtLuxa8902KsNhPvpMnYhGgqc J90WFPFjzOcBCRZKdbWuTDgLNU4dYIrFTnr8BduLXIPFArsThEtBjPkQxQOnkcahh9PG7alFlW+6A LHN+Bm6QTw7SS5ywwgex+x9dA0KWMo2sOWDX0nGewIacgyzAssf2/eox1FDd77fxbEUX8DbeiuySX IeOeWz0ta9V+FLnApxTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rupqn-0000000B5lw-3vUQ; Thu, 11 Apr 2024 08:32:05 +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 1rupqf-0000000B5h0-1H4d; Thu, 11 Apr 2024 08:31:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712824315; bh=ZnatujJdMMwMTVdvN0wAmZ4cirs7z1jcVCjXcMmD3Gk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S2Now3tEmXtiPdOcoxNIN/c++J1S4uL9zyfqvvNVNk4M9OCcXTEbjik71Eh6WSz38 St97s9Y8uL/n37WRX6CcuLwcxKI0i1xwAP4uBndFP7xRkc0hXAetalWqzwVso84amI 4P7xh4CIkagCMcGcrQGH180SEoBETmUgPDuLlY0wq8mrDK7tAtBsxO9SLkWgpTkf13 TsW01z/5YS6FRJF+8RBkttLGg6omr09khtY5n6VK0qQHQ44PixdOuy+EbVC/xc+QbN p2CcQRQ/Os0CjUrkPJnLYmVqexgRT895OVct5ZUAYKsad3ZNqhtYiS16fDW7cBTj5B IcdBZaL9N+bgQ== 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 02FBE378212B; Thu, 11 Apr 2024 08:31:53 +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, kernel@collabora.com Subject: [PATCH v1 1/8] scsi: ufs-mediatek: Remove useless mediatek,ufs-support-va09 property Date: Thu, 11 Apr 2024 10:31:42 +0200 Message-ID: <20240411083149.78537-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411083149.78537-1-angelogioacchino.delregno@collabora.com> References: <20240411083149.78537-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_013158_029615_93141DB4 X-CRM114-Status: GOOD ( 16.74 ) 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 b8a8801322e2..5186ad99ad8b 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -591,27 +591,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; @@ -623,6 +634,7 @@ static void ufs_mtk_init_host_caps(struct ufs_hba *hba) host->caps |= UFS_MTK_CAP_PMC_VIA_FASTAUTO; dev_info(hba->dev, "caps: 0x%x", host->caps); + return 0; } static void ufs_mtk_scale_perf(struct ufs_hba *hba, bool scale_up) @@ -941,7 +953,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 08:31:43 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: 13625579 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 CDBE3CD1299 for ; Thu, 11 Apr 2024 08:32:22 +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=6n3Ed5WyuVrRhh2jA/6RX9196fF1SXWoqstwJpwPEWQ=; b=YY06CACLe5NooQ y02BEoAJozcwRYOJA5wDgcaDVXZFQrAw0sfga1T3YinxS2T/1BIQ8aKowIjlmYoGAgnaATe+psBle /+qD/e1UWpvE2MpSrZISTFiAjZSjD5h6Mb450Tbn+wrk8JhB5/yrdJWoz+qh1qFAbA7Lys7/cgWku J4toc4UJAJ/GP7WjB4+LPYx+WeFKrH692In62Q3G9osszLtF7X934tQPPtquMPRjsGLQbT2MrgzmF /n9+auKzbR0h/rP09JR+DvsN2VytHKmVGt4ohbizvXPrEQbetmeCrDAwsaELeKz1oCNpRxLVrcqdr YULiOHSX16o14M38cBag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rupqq-0000000B5ng-3kaK; Thu, 11 Apr 2024 08:32:08 +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 1rupqg-0000000B5hH-0Atj; Thu, 11 Apr 2024 08:31:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712824316; bh=6l72IQpDXHhr8j3mG8r2TihhpBbmFrvrFd/CtXYdp6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P5MXL+2wSbrrcb45TYS01vVPET6xr4CrQ4soPFEXO1ZTCmFrMbhzovXk70/FYY4kq 4rdX3caGR8xs2wzE0NVF/Z887zvzazPNKZc6/TCFiqLyX00L3uchJ5Xtr0LXfFApBG tyiSVsBDs8BVTBBHMh5aZNz0z9Bnz9a8xmxLjXULmdrMRDn2ybVN1dOTdOvhGf4/bG vaqF0iTXBCHJFY/gJ43PkOqH+gOkrPeIim1TE9RGdtAVvFHNEvipBBz0JusxnsOPIP PF5bvfKzRjKxaUKYmuHadut2sRV0V7TaJoArwuy0giJhAo3CLruTdW+E/nOayT3uGh IteN46wSwIl5g== 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 719A5378212C; Thu, 11 Apr 2024 08:31:55 +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, kernel@collabora.com Subject: [PATCH v1 2/8] scsi: ufs: ufs-mediatek: Fix property name for crypt boost voltage Date: Thu, 11 Apr 2024 10:31:43 +0200 Message-ID: <20240411083149.78537-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411083149.78537-1-angelogioacchino.delregno@collabora.com> References: <20240411083149.78537-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_013158_262847_25270F8E X-CRM114-Status: GOOD ( 12.65 ) 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 5186ad99ad8b..90cd11d4a026 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -564,9 +564,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 08:31:44 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: 13625580 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 A87B3CD128A for ; Thu, 11 Apr 2024 08:32:24 +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=5xoxzbU7XyleIhBfe5TmZs8dAfjrucgsndwS+e87nHE=; b=0UFpofxRsjWhtn 2iTKWp82CumF0s/TXz2i5m+KDZzOO3qzBz2Dgll/EHt16k5qUcoRjJ8BBx59bYoh2ZnC111hJ2th/ aQ+0OofBLxK2FAxIVLDHjDTLxCIhNVYIrL3Hu1mxZ3xOUNmr+wCj5WwrswJcShZlH+Ki4599n0LJU wBIvUO/eyMelIrlZxIez21y8vc8YuLtLw03kbnVMffCH6TIwMs5mq9x8pVCN6jd22vKsn4HtQg0Uf lxJOn+CkT+/wZ4L0lObUIhXAGRgUI0eqNq978uW2M1TWm9+BO8ZHxtBfCo47bnUeHy3+TbwesLdCk EwLIu52/ZVi5s3rGTMlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rupqs-0000000B5p1-1LjT; Thu, 11 Apr 2024 08:32:10 +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 1rupqh-0000000B5hw-1FVr; Thu, 11 Apr 2024 08:32:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712824318; bh=F6W/HVSlQd+0v0oSIGT3n+veRGpMV08z19t8e68fgfk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vFs4T7kgxZRrWTniL6Jn9u3Mej6ZOZ/CSGrMQZq3BR1TazZCtSzoEjhWEs9SSn4fT zwe97X0Di+YJsQ5BSzON/hHMsw/kEMSC/0wjQhgvPcfSDoVHcDOb7HcaIM8ickZb5B l9ll2Z6UhQezIskO8/FFba8uL0TKKgGZ8ljo9g6bk3E06TgOG6HN44qYPZrWJKDG1w L7V0ygg2WL8TsFx84csFpBDOnegXI/gUCkrPSgKm5xOdcPgoQKbsx8IU6NB4lZMrM5 R8YRNLjs7cIOYgb6v2efgRczHJDDL4F1Gv83Nwv8lB3sQqPeQ/bqhaWsxHZ5ZlasCR SLRRK0aabh3zQ== 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 E0A863782132; Thu, 11 Apr 2024 08:31:56 +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, kernel@collabora.com Subject: [PATCH v1 3/8] scsi: ufs: ufs-mediatek: Remove useless mediatek,ufs-boost-crypt property Date: Thu, 11 Apr 2024 10:31:44 +0200 Message-ID: <20240411083149.78537-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411083149.78537-1-angelogioacchino.delregno@collabora.com> References: <20240411083149.78537-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_013159_508921_C158E6BC X-CRM114-Status: GOOD ( 16.59 ) 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 90cd11d4a026..16a76b02c934 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -544,51 +544,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) @@ -617,8 +621,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 08:31:45 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: 13625581 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 D2977CD128A for ; Thu, 11 Apr 2024 08:32:28 +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=BF4k79g3t9QHlfEQFxeZaaLTBHMtOIFX2/RtMz7ieuE=; b=fz+yj0TZ4SR6te /5e/1u1cD0+TQIIo5TCait7zFjA54O0WCQNfU0pfuYinUs8SYHr/g5dd2I5hrAES9nqVkaDg5Nz3S teGZpLfgCAIiDzYH1gieLOui4bUllYn59gFEESf6vSouGYYLkX3Agglzv6Zdsuw/NXtvGbmGjJbW7 j3UKfGBim4X5SG91oIFaWjO+suBDfMbzw6AX5ySnqpwUpWsv5lXYV+fG68TOYFpDfVPoHCKuPIDjJ /vsP/Om5l3CCpwFGlbbitSM+zqD6cky6aj1zNeQXlXed60Z1Uor08yhPsHo/+eDiq7+77qpacYgDh nGuFJUxG6Sj6vyYB2Qqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rupqt-0000000B5qB-2T4R; Thu, 11 Apr 2024 08:32:11 +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 1rupqi-0000000B5iX-3Drm; Thu, 11 Apr 2024 08:32:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712824319; bh=LJ5xtskzI/p24BC4uZa8WFBkjICyouTGIeZYBD8ZDSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hK+JyiwKfJKb9pCyEgkGJ7NPPTcQnUJuwmaTdpHQgo76R6B0qs2LMlJ1a9qTPu/Gr 5sthmdNems1IuaXOSot3LPU7VR28X5gaoAZFzBa1y6BNfShKiL255nlNRc8uYNZDXb 3kvjJjLEkplsHqB8IZaePq9/vU7HwSsFvYSFChO9oGOMB997ZLQInoAmHUMJgp9VUM 2cUwYstgjK5uhapUl2PXL03+y2tqhwSvaAW/56bT6N/xIdI3pIXGaBRT0crzfBBOTa ySuGxphryRjsbhx8NTq+oMA2f545gFYXRUL4jdcLyt9wRK4T1HVRdHhN1g8bL/OnRy wCLLH8SzlDpSA== 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 57728378212D; Thu, 11 Apr 2024 08:31:58 +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, kernel@collabora.com Subject: [PATCH v1 4/8] scsi: ufs: ufs-mediatek: Avoid underscores in crypt clock names Date: Thu, 11 Apr 2024 10:31:45 +0200 Message-ID: <20240411083149.78537-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411083149.78537-1-angelogioacchino.delregno@collabora.com> References: <20240411083149.78537-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_013201_024972_63D6CBA0 X-CRM114-Status: GOOD ( 11.08 ) 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 16a76b02c934..1c0c523ce1ee 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -573,15 +573,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 08:31:46 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: 13625582 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 81298CD1284 for ; Thu, 11 Apr 2024 08:32:29 +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=vrjMCSFthfBw9f iJCbI4xy0GEhyYVHmH9S7/KtRN9hXx8nETvEEVjA87ZBxXFgHW0h+aJfTT1sND4Ui1pbxzJ+Ao8Ue 758mGNoy4/p8Z3gHq0V4dx/hYn4sN0OV+xKV8Q8CbO8aEf7vJQHmNf7I5BMV73FQSZT1l02wM3Qak FBdmfZmIOxUv+QAAOXOBpvlVGoLxcx8naY7HZq/wnm64STPhuFrZAztQ1McsfX28uxHsegoLlMdGg DzQylCmZJopJcgOV9+JAQOMjLtvf+L3P/IG6srHdVUAlqfVsmIg+6bOoSn6fU8jYOol1Oa2aycUGK wGKg0No1ESp0Z1GYWFkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rupqw-0000000B5su-366A; Thu, 11 Apr 2024 08:32:14 +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 1rupqk-0000000B5jH-0xWj; Thu, 11 Apr 2024 08:32:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712824321; bh=qvwukQ63ru7c/su/YXR6zlEYXzSPY/kzv1TeqWamDO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tbv3N6UkWXQ3FwscFqj284jPwjO1i8h8kykuyl6pf1ztcSQ7NqnBmlOAXNenTtw0z KADZtve/5TXBl6DuxO8pdBqLO20VCyb1aD7O74TR025UdSMMBBJO3KvVl95OPN9x69 y65lREzpxn3l4ud07dBNZC8Mapg0vlrSk5Pwun04EYFTY995JJ3VTVm9LugVZmzttC 49DOI2amJX+/WCRBX8u+w3AfI384OABE/JBfEgpcJFqzoE13fnDqvRJ/uTdwEg5qej doNiJ/5tGFo1sqM9RRw+J9uz9RoMg7esE2KInqME7nJvNrpJqBVZ2ZHW1AInfRxH39 rPHdNEGOSRPMQ== 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 BF3A33782134; Thu, 11 Apr 2024 08:31:59 +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, kernel@collabora.com Subject: [PATCH v1 5/8] dt-bindings: ufs: mediatek,ufs: Document MT8192 compatible with MT8183 Date: Thu, 11 Apr 2024 10:31:46 +0200 Message-ID: <20240411083149.78537-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411083149.78537-1-angelogioacchino.delregno@collabora.com> References: <20240411083149.78537-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_013202_960873_F36C214B X-CRM114-Status: UNSURE ( 9.29 ) 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 08:31:47 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: 13625606 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 2F700CD128A for ; Thu, 11 Apr 2024 08:32: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: 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=oRiRXS+iBlyqnD 8RjSWlNpvgvosuZilYWVgK24ZsDo5+s5IWLGyOXfSClVf2N1C72PmM/CXCGbsdTIy9m7uNNg+tJYF QVVhQpAQL+4MyHdM4IwfbHby1E7TWmNdDVeFou5QCXOcbvSwLhVn5/vhORF4FkPo5wkHToTTkSROZ Zu9O1/tOOs2bgVxluXq7iwUoRY1gFOqYDKko8me0MA8YXzKwLJa2+cqgUMJXePIHgAXtp9t8K16zU Qz3KbK3vCdJ8xwkOjvjs5wkdcaxrsm546pSQWZqPniaOaNTEZcN//S/fNx/rP5fynX4/8swefYXtq aIXdtsxK/Jgkzr+mbtyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rupr2-0000000B5yt-49wS; Thu, 11 Apr 2024 08:32:21 +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 1rupql-0000000B5jr-32AA; Thu, 11 Apr 2024 08:32:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712824322; bh=XK+I2rHX8gkIddpwg379tC6deWLfihQGpL9it+LQ4dA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JkCmh2eeCBX4DHpZmQp29q2isI1K3aQlJh5Cj03+1k9HcQ+ECwwStpNJ7wger2CtD w5CdrZ5gOg8buDDe/7hXusQ/Q4Z6m/aPND7t0ozlgds0X2DNu+NUHfyNOnEa6qhqbw /2cVEWaNbt0PWsUkWI+EdrT+k1VkXppQO59weIRZSX5uDaTOxuBbYmKTfH11Zqvzhs LK0P3OWFxkduW1O9GWr8nzLkqqIDWrdoQC4zOKbdc0TN7eeVND6goqRUSfg63xLly3 Lmw7L30sqVoSbLoCn0MdjKvyBedpYrnMcvWRkpcwvy8xXqlcr2NbNK04oX+EZrZPu7 /rI4dslVa7T7A== 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 309B43782135; Thu, 11 Apr 2024 08:32:01 +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, kernel@collabora.com Subject: [PATCH v1 6/8] dt-bindings: ufs: mediatek,ufs: Document MT8195 compatible Date: Thu, 11 Apr 2024 10:31:47 +0200 Message-ID: <20240411083149.78537-7-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411083149.78537-1-angelogioacchino.delregno@collabora.com> References: <20240411083149.78537-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_013203_926175_0B9A784A X-CRM114-Status: UNSURE ( 7.61 ) 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 --- 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 08:31:48 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: 13625607 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 C5D21CD128A for ; Thu, 11 Apr 2024 08:32: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=uNL3uzCm05glpfdBhbGVn5fIdXhjVGysrq+WLEwJTXM=; b=0pswBs8I3ZTuU+ tvLf4lLPv06LN+Cty59LI7blIDNAfSfI2k3U+8kQQ6TtbSF/KGpKsTlEe0uJTUKV9cqQjJWtzXgya 2W7b6DS7nxGQbQghG/PCJOztTn/+QTsqJUJg5bFuib7I/x2W9oD2YoniKsHiDuPmc5X2PL4o1Ele2 3uGePTkmoZ0FPM99Oc6cEn+47K9sxrW09fulkrSzlXBXDCXMLql+RFp8ZqNNzTgSjz+r4myrdL0xU Wehj6RfvcJHYWK+F8qHBgWQ4RPuLk8XPyDoK4gG0HkhiZt02qebwmya/fDXa6FCZtshzKhTnOmjZj NvnU36SLWcl9ZIwkfjWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rupr9-0000000B652-23bR; Thu, 11 Apr 2024 08:32:28 +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 1rupqn-0000000B5kj-0D7q; Thu, 11 Apr 2024 08:32:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712824323; bh=XK0zxw+V4wjxT5QG5ieb50qefYNILSY0qmHMtFLbqcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LAFh3vc4lZpN/yQ0ihuB1SgL/ZUEWS0qCuhvzfxsPXTP1sbaxdJnovVkvq1DAtAZA +4FP1cAO2DL+XPgUy1jzRA3wW58cOSvaYrSuT4fl9m0iMcWUq4tZcGXaKXdFJ6gJ2B eZasrZfb4toePj7m0dFNWWmsPdgKkspV9sK84MmKIYTM9RvqdjNqmluXHf+e6mGaCS wUkMH4risTJOShZsB870kwBn6ZQvBuFecgcDV6Z2lKMNjFW/2olfkFzhM5WhksJuYS OgFCqqRmqfgcpGqgw9+uNDV0gQ/DdPOJPUcnfQpz/+Lt/pGdwHpAFi0k7SYfpL9gBv BArYlzDJz63JQ== 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 99C193782137; Thu, 11 Apr 2024 08:32:02 +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, kernel@collabora.com Subject: [PATCH v1 7/8] dt-bindings: ufs: mediatek,ufs: Document additional clocks Date: Thu, 11 Apr 2024 10:31:48 +0200 Message-ID: <20240411083149.78537-8-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411083149.78537-1-angelogioacchino.delregno@collabora.com> References: <20240411083149.78537-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_013205_267194_BED9B0E4 X-CRM114-Status: UNSURE ( 9.25 ) 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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index e2c276da3f2c..df2e2d388e70 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -26,11 +26,22 @@ 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-mem + - const: crypt-mux + - const: crypt-lp + - const: crypt-perf phys: maxItems: 1 From patchwork Thu Apr 11 08:31:49 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: 13625608 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 D7ABACD128A for ; Thu, 11 Apr 2024 08:32:51 +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=qji2PL1GZVw0jANcaBa5wl7LcsUC5WYjiEIF9S0ik9A=; b=HhcoCiZ/ez9V06 /l5qvcbbRJrwE3wv+Y5QrarYhg6YZWnUt6mLYowLSSurBDhK6FWkyPG8Gp6SxFKzl2DyMpiJ+W4h0 OJZqY/SnMPXjKqnR8wbvkbim+G2xjHaGXVfRpYoLyCXZLHc4AjVAIeFToho26GqqCXR1+SoTCfNgC uTYbSRxFEkVt8Igg4QqhnKj3LWCbhde950mgi935w7rBTCw8qQ/i7h4SxcXQ8ltF5KDn51r05778J KaEFgncea9MjfDJE9c00s53EtvpMTVlNEg2xsJXKudkxts2ElHK6vfrT7pgwaDAiRnZo/EMmKx+4r 9hLUsMwA0hEUzi/zSzSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruprM-0000000B6HE-0xyZ; Thu, 11 Apr 2024 08:32:40 +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 1rupqo-0000000B5lq-2T9t; Thu, 11 Apr 2024 08:32:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712824325; bh=pkymiWIPWxat5Rr2zyDqx/dSmImzanbRzBc2AuBwPV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZWl6KJ2MaCPG2TpRWPsqMCPlaKKShFlrxo4JYx5AsHPwuitSP3TaKHqheV8CBG2n8 oG5L0ARRG551EVUNEcTvGHCr8ktGLwojLReg0KceFzgfs0KHn6v+LYtTgg/Pkt8kCx 3sEfFzTaqnYC+FI1RcK1/gTceXl5WEPd6lJa+qNbIBYcNNIdHlF9pvWLkYr8364W3T 2Oh6DfncModQDTz7eSGwZ/RY16x44WbS/jUSCSjeuUMDjrOhnl06Y0ld14hbiFvybY xRqmmvJ5GL5rAhe2zCtpdgfz1ZMIu1UPudk3xQc8R4GrafUThTIn9dsoVBpIvPJNBR 177BHAR/cYmMw== 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 132DF3782139; Thu, 11 Apr 2024 08:32:04 +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, kernel@collabora.com Subject: [PATCH v1 8/8] dt-bindings: ufs: mediatek,ufs: Document optional dvfsrc/va09 regulators Date: Thu, 11 Apr 2024 10:31:49 +0200 Message-ID: <20240411083149.78537-9-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411083149.78537-1-angelogioacchino.delregno@collabora.com> References: <20240411083149.78537-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_013207_537026_443C4F11 X-CRM114-Status: UNSURE ( 7.67 ) 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 --- 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 df2e2d388e70..118abfad0250 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -49,6 +49,8 @@ properties: reg: maxItems: 1 + dvfsrc-vcore-supply: true + va09-supply: true vcc-supply: true required: