From nobody Sat Feb 7 06:35:24 2026 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B99ED2DBF4B; Sat, 24 Jan 2026 12:03:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.112 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769256190; cv=pass; b=ujDUlu5QJVEbflm40ZFeuhgGCDsdKv8sogLwjoClIhCWwOILXwp1qILiDkwcq8KY+yN17e08hi3QCCIjIP01xwC+xD/YPRwnJ8KU+QuD8OYOY41Qouby5B466tfCPaYIK1PVLbeoKYYkGU3XIq7Jjgv8XvrPCKavATRebneiDwY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769256190; c=relaxed/simple; bh=YBeqx3mTla1Zq0Q5HgdPm2tm7MBoKnDDeSF3FciQ1ko=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Zt3ZkA5DrDL+wESvnqOJu+kKBCwMh1avXzCqDkyilr7kgTbaa8JSqMkVU/c6AVi+gT0awdlxN/Kc40iXoyuhoNKWYiJrLqk7+zb/TgXXHYEktU9n3KpYd2WoIWBi5+ppw8uYDUO1f1u323JFXKdZLnmb6DZ4Wa5qzXSSYpgJqx0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (1024-bit key) header.d=collabora.com header.i=nicolas.frattaroli@collabora.com header.b=akuPEzDJ; arc=pass smtp.client-ip=136.143.188.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=nicolas.frattaroli@collabora.com header.b="akuPEzDJ" ARC-Seal: i=1; a=rsa-sha256; t=1769256148; cv=none; d=zohomail.com; s=zohoarc; b=FpfNY42imPkXVzeZwR8bAKwqZXllrQ3egOSQ/csPb+TPV162qMsw6BU5z3WAIhHvrx+PMj8x7cP09fn/Vsmfw5smDiYk/zOQO2+3udcGtUFBK6tJ4rWnG7Q3zv0FxxCzqYBBaFkqUockas4nmGqfnQPx7f5z4Fnhpvk8SIaoGc4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769256148; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=2jPjjJAlxolJ5SZdAxCSvwzy43UK4mx+Q/TOpQ2kDsI=; b=aH6ykwc29GHMcbnk4AafhF2ZNMK5OCkfxThAPSOSAtN/gjsnCQJJxJC3eH01mQGWazHBtC7PeJbr1dGyaCHJc9ACq6O3oRE1o2dOlB83u7r2on787M2kmtjOv/pAPHuxI96aBVs/ese2RYOu1626iTONNwD/RB3vaCbzxE2+rZE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=nicolas.frattaroli@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1769256148; s=zohomail; d=collabora.com; i=nicolas.frattaroli@collabora.com; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:References:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=2jPjjJAlxolJ5SZdAxCSvwzy43UK4mx+Q/TOpQ2kDsI=; b=akuPEzDJgbfu1oBEeq/Lz88adBEfrpODaE5p2O1QAfoRLdY0nAluaZf9U61wXJdl wPiZ8rAngUhosaSBBTL/4l8Ryn+PoxYSCCrMzcarDFz3apC0cao49InA2T30IYlqNZS 4rkSNVAQLztWSG8HjKmCDsituf8XF+XvuG74vJsk= Received: by mx.zohomail.com with SMTPS id 1769256148020941.2050961507542; Sat, 24 Jan 2026 04:02:28 -0800 (PST) From: Nicolas Frattaroli Date: Sat, 24 Jan 2026 13:00:58 +0100 Subject: [PATCH v6 12/24] scsi: ufs: mediatek: Remove vendor kernel quirks cruft Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260124-mt8196-ufs-v6-12-e7c005b60028@collabora.com> References: <20260124-mt8196-ufs-v6-0-e7c005b60028@collabora.com> In-Reply-To: <20260124-mt8196-ufs-v6-0-e7c005b60028@collabora.com> To: Alim Akhtar , Avri Altman , Bart Van Assche , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Peter Wang , Stanley Jhu , "James E.J. Bottomley" , "Martin K. Petersen" , Philipp Zabel , Liam Girdwood , Mark Brown , Chaotian Jing , Neil Armstrong Cc: Louis-Alexis Eyraud , kernel@collabora.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, Nicolas Frattaroli , Krzysztof Kozlowski X-Mailer: b4 0.14.3 Both ufs_mtk_vreg_fix_vcc and ufs_mtk_vreg_fix_vccqx look like they are vendor kernel hacks to work around existing downstream device trees. Mainline does not need or want them, so remove them. Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Signed-off-by: Nicolas Frattaroli --- drivers/ufs/host/ufs-mediatek.c | 69 -------------------------------------= ---- 1 file changed, 69 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediate= k.c index fc72bf54ec2a..45e088f6e92e 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -1017,73 +1017,6 @@ static void ufs_mtk_init_clocks(struct ufs_hba *hba) } } =20 -#define MAX_VCC_NAME 30 -static int ufs_mtk_vreg_fix_vcc(struct ufs_hba *hba) -{ - struct ufs_vreg_info *info =3D &hba->vreg_info; - struct device_node *np =3D hba->dev->of_node; - struct device *dev =3D hba->dev; - char vcc_name[MAX_VCC_NAME]; - struct arm_smccc_res res; - int err, ver; - - if (info->vcc) - return 0; - - if (of_property_read_bool(np, "mediatek,ufs-vcc-by-num")) { - ufs_mtk_get_vcc_num(res); - if (res.a1 > UFS_VCC_NONE && res.a1 < UFS_VCC_MAX) - snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%lu", res.a1); - else - return -ENODEV; - } else if (of_property_read_bool(np, "mediatek,ufs-vcc-by-ver")) { - ver =3D (hba->dev_info.wspecversion & 0xF00) >> 8; - snprintf(vcc_name, MAX_VCC_NAME, "vcc-ufs%u", ver); - } else { - return 0; - } - - err =3D ufshcd_populate_vreg(dev, vcc_name, &info->vcc, false); - if (err) - return err; - - err =3D ufshcd_get_vreg(dev, info->vcc); - if (err) - return err; - - err =3D regulator_enable(info->vcc->reg); - if (!err) { - info->vcc->enabled =3D true; - dev_info(dev, "%s: %s enabled\n", __func__, vcc_name); - } - - return err; -} - -static void ufs_mtk_vreg_fix_vccqx(struct ufs_hba *hba) -{ - struct ufs_vreg_info *info =3D &hba->vreg_info; - struct ufs_vreg **vreg_on, **vreg_off; - - if (hba->dev_info.wspecversion >=3D 0x0300) { - vreg_on =3D &info->vccq; - vreg_off =3D &info->vccq2; - } else { - vreg_on =3D &info->vccq2; - vreg_off =3D &info->vccq; - } - - if (*vreg_on) - (*vreg_on)->always_on =3D true; - - if (*vreg_off) { - regulator_disable((*vreg_off)->reg); - devm_kfree(hba->dev, (*vreg_off)->name); - devm_kfree(hba->dev, *vreg_off); - *vreg_off =3D NULL; - } -} - static void ufs_mtk_setup_clk_gating(struct ufs_hba *hba) { unsigned long flags; @@ -1981,8 +1914,6 @@ static void ufs_mtk_fixup_dev_quirks(struct ufs_hba *= hba) hba->dev_quirks &=3D ~UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM; } =20 - ufs_mtk_vreg_fix_vcc(hba); - ufs_mtk_vreg_fix_vccqx(hba); ufs_mtk_fix_ahit(hba); ufs_mtk_fix_clock_scaling(hba); } --=20 2.52.0