public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: "Peter Wang (王信友)" <peter.wang@mediatek.com>,
	"chu.stanley@gmail.com" <chu.stanley@gmail.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"Chunfeng Yun (云春峰)" <Chunfeng.Yun@mediatek.com>,
	"kishon@kernel.org" <kishon@kernel.org>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"Chaotian Jing (井朝天)" <Chaotian.Jing@mediatek.com>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"nicolas.frattaroli@collabora.com"
	<nicolas.frattaroli@collabora.com>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"neil.armstrong@linaro.org" <neil.armstrong@linaro.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-phy@lists.infradead.org" <linux-phy@lists.infradead.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>,
	"kernel@collabora.com" <kernel@collabora.com>
Subject: Re: [PATCH v7 18/23] scsi: ufs: mediatek: Don't acquire dvfsrc-vcore twice
Date: Thu, 26 Feb 2026 11:33:28 +0100	[thread overview]
Message-ID: <20e7b970-df30-455e-8067-128de2dca022@collabora.com> (raw)
In-Reply-To: <c7214effa728b74e753abc0dee8d655e036ca7fb.camel@mediatek.com>

Il 26/02/26 04:45, Peter Wang (王信友) ha scritto:
> On Wed, 2026-02-25 at 13:37 +0100, AngeloGioacchino Del Regno wrote:
>> We need to check both because UFS_MTK_CAP_BOOST_CRYPT_ENGINE depends
>> on:
>>    1. reg_vcore
>>    2. clocks (crypt_mux, crypt_lp, crypt_perf).
>>
>> Failing to check for both ufs_mtk_is_boost_crypt_enabled() and
>> reg_vcore here
>> will introduce a bug that may result in storage corruption.
>>
>> So yes, Nicolas is checking both because it is *required* to check
>> both.
>>
>> Regards,
>> Angelo
> 
> Hi AngeloGioacchino,
> 
> To clarify, BCE stands for UFS_MTK_CAP_BOOST_CRYPT_ENGINE.
> 
> BCE     reg_vcore   Action
> true	true	    If check is false, continue
> true	false	    This case cannot happen (X)
> false	true	    If check is true, return
> false	false	    If check is true, return
> Therefore, we only need to check whether BCE is
> true (to continue) or false (to return).
> 

Thanks for the information.

Now I agree. There's no need to check for that twice, as the cap is set
only when all clocks and when reg_vcore is not NULL - I missed the first
lines of the ufs_mtk_init_boost_crypt_function() from this patch, where
Nicolas is adding a check for that at the very beginning of this function.

This means that the UFS_MTK_CAP_BOOST_CRYPT_ENGINE flag is being set only
when all of the prerequisites (reg_vcore and clocks) are satisfied.

I agree with you, Peter, there's no need to check for both the vreg and
caps, as the cap can only be set if the vreg+clocks are present.

Nicolas, can you please fix that and send a v8 ASAP?

Thanks,
Angelo

> Thanks
> Peter




  reply	other threads:[~2026-02-26 10:33 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16 13:37 [PATCH v7 00/23] MediaTek UFS Cleanup and MT8196 Enablement Nicolas Frattaroli
2026-02-16 13:37 ` [PATCH v7 01/23] dt-bindings: phy: Add mediatek,mt8196-ufsphy variant Nicolas Frattaroli
2026-02-16 13:37 ` [PATCH v7 02/23] dt-bindings: ufs: mediatek,ufs: Complete the binding Nicolas Frattaroli
2026-02-16 13:37 ` [PATCH v7 03/23] dt-bindings: ufs: mediatek,ufs: Add mt8196 variant Nicolas Frattaroli
2026-02-16 13:37 ` [PATCH v7 04/23] scsi: ufs: mediatek: Move MTK_SIP_UFS_CONTROL to mtk_sip_svc.h Nicolas Frattaroli
2026-02-16 13:37 ` [PATCH v7 05/23] phy: mediatek: ufs: Add support for resets Nicolas Frattaroli
2026-02-16 13:37 ` [PATCH v7 06/23] scsi: ufs: mediatek: Rework resets Nicolas Frattaroli
2026-02-16 13:37 ` [PATCH v7 07/23] scsi: ufs: mediatek: Rework 0.9V regulator Nicolas Frattaroli
2026-02-16 13:37 ` [PATCH v7 08/23] scsi: ufs: mediatek: Rework init function Nicolas Frattaroli
2026-02-16 13:37 ` [PATCH v7 09/23] scsi: ufs: mediatek: Rework the crypt-boost stuff Nicolas Frattaroli
2026-02-16 13:37 ` [PATCH v7 10/23] scsi: ufs: mediatek: Handle misc host voltage regulators Nicolas Frattaroli
2026-02-24 12:38   ` Peter Wang (王信友)
2026-02-24 12:41     ` AngeloGioacchino Del Regno
2026-02-25  7:19       ` Peter Wang (王信友)
2026-02-24 12:48     ` Mark Brown
2026-02-25  7:18       ` Peter Wang (王信友)
2026-02-25  7:20   ` Peter Wang (王信友)
2026-02-16 13:37 ` [PATCH v7 11/23] scsi: ufs: mediatek: Rework probe function Nicolas Frattaroli
2026-02-24 12:40   ` Peter Wang (王信友)
2026-02-16 13:37 ` [PATCH v7 12/23] scsi: ufs: mediatek: Remove vendor kernel quirks cruft Nicolas Frattaroli
2026-02-24 12:40   ` Peter Wang (王信友)
2026-02-16 13:37 ` [PATCH v7 13/23] scsi: ufs: mediatek: Use the common PHY framework Nicolas Frattaroli
2026-02-24 12:41   ` Peter Wang (王信友)
2026-02-16 13:37 ` [PATCH v7 14/23] scsi: ufs: mediatek: Remove mediatek,ufs-broken-rtc property Nicolas Frattaroli
2026-02-24 12:43   ` Peter Wang (王信友)
2026-02-25 12:51     ` Nicolas Frattaroli
2026-02-26  6:58       ` Peter Wang (王信友)
2026-02-16 13:37 ` [PATCH v7 15/23] scsi: ufs: mediatek: Rework _ufs_mtk_clk_scale error paths Nicolas Frattaroli
2026-02-24 12:43   ` Peter Wang (王信友)
2026-02-16 13:37 ` [PATCH v7 16/23] scsi: ufs: mediatek: Clean up logging prints Nicolas Frattaroli
2026-02-24 12:47   ` Peter Wang (王信友)
2026-02-25 13:05     ` Nicolas Frattaroli
2026-02-25 13:18       ` AngeloGioacchino Del Regno
2026-02-26  7:00         ` Peter Wang (王信友)
2026-02-26 10:45           ` AngeloGioacchino Del Regno
2026-03-03  8:06             ` Peter Wang (王信友)
2026-02-16 13:37 ` [PATCH v7 17/23] scsi: ufs: mediatek: Rework ufs_mtk_wait_idle_state Nicolas Frattaroli
2026-02-25 10:32   ` Peter Wang (王信友)
2026-02-25 12:33     ` AngeloGioacchino Del Regno
2026-02-26  3:42       ` Peter Wang (王信友)
2026-02-16 13:37 ` [PATCH v7 18/23] scsi: ufs: mediatek: Don't acquire dvfsrc-vcore twice Nicolas Frattaroli
2026-02-25 10:34   ` Peter Wang (王信友)
2026-02-25 12:37     ` AngeloGioacchino Del Regno
2026-02-26  3:45       ` Peter Wang (王信友)
2026-02-26 10:33         ` AngeloGioacchino Del Regno [this message]
2026-02-16 13:37 ` [PATCH v7 19/23] scsi: ufs: mediatek: Rework hardware version reading Nicolas Frattaroli
2026-02-25 10:34   ` Peter Wang (王信友)
2026-02-16 13:37 ` [PATCH v7 20/23] scsi: ufs: mediatek: Back up idle timer in per-instance struct Nicolas Frattaroli
2026-02-25 10:35   ` Peter Wang (王信友)
2026-02-25 12:40     ` AngeloGioacchino Del Regno
2026-02-26  3:46       ` Peter Wang (王信友)
2026-02-26 10:36         ` AngeloGioacchino Del Regno
2026-03-03  8:01           ` Peter Wang (王信友)
2026-03-03 10:15             ` Nicolas Frattaroli
2026-02-16 13:37 ` [PATCH v7 21/23] scsi: ufs: mediatek: Remove ret local from link_startup_notify Nicolas Frattaroli
2026-02-25 10:36   ` Peter Wang (王信友)
2026-02-16 13:37 ` [PATCH v7 22/23] scsi: ufs: mediatek: Remove undocumented "clk-scale-up-vcore-min" Nicolas Frattaroli
2026-02-25 10:37   ` Peter Wang (王信友)
2026-02-25 12:44     ` AngeloGioacchino Del Regno
2026-02-25 12:56     ` Nicolas Frattaroli
2026-02-26  6:59       ` Peter Wang (王信友)
2026-02-16 13:37 ` [PATCH v7 23/23] scsi: ufs: mediatek: Add MT8196 compatible, update copyright Nicolas Frattaroli
2026-02-25 10:38   ` Peter Wang (王信友)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20e7b970-df30-455e-8067-128de2dca022@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=Chaotian.Jing@mediatek.com \
    --cc=Chunfeng.Yun@mediatek.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=broonie@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=chu.stanley@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@collabora.com \
    --cc=kishon@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=louisalexis.eyraud@collabora.com \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=peter.wang@mediatek.com \
    --cc=robh@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox