Blame SOURCES/0057-mdadm-added-support-for-Intel-Alderlake-RST-on-VMD-p.patch

2ad819
From ea7a02a3294aae223e1329aed5da7f4aa3ac05c5 Mon Sep 17 00:00:00 2001
2ad819
From: =?UTF-8?q?Old=C5=99ich=20Jedli=C4=8Dka?= <oldium.pro@gmail.com>
2ad819
Date: Wed, 31 Aug 2022 19:57:29 +0200
2ad819
Subject: [PATCH 57/83] mdadm: added support for Intel Alderlake RST on VMD
2ad819
 platform
2ad819
MIME-Version: 1.0
2ad819
Content-Type: text/plain; charset=UTF-8
2ad819
Content-Transfer-Encoding: 8bit
2ad819
2ad819
Alderlake RST on VMD uses RstVmdV UEFI variable name, so detect it.
2ad819
2ad819
Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
2ad819
Reviewed-by: Kinga Tanska <kinga.tanska@linux.intel.com>
2ad819
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2ad819
---
2ad819
 platform-intel.c | 18 +++++++++++++-----
2ad819
 1 file changed, 13 insertions(+), 5 deletions(-)
2ad819
2ad819
diff --git a/platform-intel.c b/platform-intel.c
2ad819
index 5a8729e7..757f0b1b 100644
2ad819
--- a/platform-intel.c
2ad819
+++ b/platform-intel.c
2ad819
@@ -512,7 +512,8 @@ static const struct imsm_orom *find_imsm_hba_orom(struct sys_dev *hba)
2ad819
 #define AHCI_PROP "RstSataV"
2ad819
 #define AHCI_SSATA_PROP "RstsSatV"
2ad819
 #define AHCI_TSATA_PROP "RsttSatV"
2ad819
-#define VMD_PROP "RstUefiV"
2ad819
+#define VROC_VMD_PROP "RstUefiV"
2ad819
+#define RST_VMD_PROP "RstVmdV"
2ad819
 
2ad819
 #define VENDOR_GUID \
2ad819
 	EFI_GUID(0x193dfefa, 0xa445, 0x4302, 0x99, 0xd8, 0xef, 0x3a, 0xad, 0x1a, 0x04, 0xc6)
2ad819
@@ -605,6 +606,7 @@ const struct imsm_orom *find_imsm_efi(struct sys_dev *hba)
2ad819
 	struct orom_entry *ret;
2ad819
 	static const char * const sata_efivars[] = {AHCI_PROP, AHCI_SSATA_PROP,
2ad819
 						    AHCI_TSATA_PROP};
2ad819
+	static const char * const vmd_efivars[] = {VROC_VMD_PROP, RST_VMD_PROP};
2ad819
 	unsigned long i;
2ad819
 
2ad819
 	if (check_env("IMSM_TEST_AHCI_EFI") || check_env("IMSM_TEST_SCU_EFI"))
2ad819
@@ -636,10 +638,16 @@ const struct imsm_orom *find_imsm_efi(struct sys_dev *hba)
2ad819
 
2ad819
 		break;
2ad819
 	case SYS_DEV_VMD:
2ad819
-		if (!read_efi_variable(&orom, sizeof(orom), VMD_PROP,
2ad819
-				       VENDOR_GUID))
2ad819
-			break;
2ad819
-		return NULL;
2ad819
+		for (i = 0; i < ARRAY_SIZE(vmd_efivars); i++) {
2ad819
+			if (!read_efi_variable(&orom, sizeof(orom),
2ad819
+						vmd_efivars[i], VENDOR_GUID))
2ad819
+				break;
2ad819
+		}
2ad819
+
2ad819
+		if (i == ARRAY_SIZE(vmd_efivars))
2ad819
+			return NULL;
2ad819
+
2ad819
+		break;
2ad819
 	default:
2ad819
 		return NULL;
2ad819
 	}
2ad819
-- 
2ad819
2.38.1
2ad819