linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, pawel.baldysiak@intel.com,
	Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Subject: [PATCH 1/2] imsm: support for second AHCI controller in EFI mode
Date: Fri, 28 Feb 2014 11:29:27 +0100	[thread overview]
Message-ID: <1393583368-31542-2-git-send-email-artur.paszkiewicz@intel.com> (raw)
In-Reply-To: <1393583368-31542-1-git-send-email-artur.paszkiewicz@intel.com>

mdadm was unable to find IMSM platform capabilities when only the second
AHCI controller was enabled on a platform in EFI mode. The second AHCI
controller uses a different EFI variable and this patch adds support for
reading this variable.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-by: Lukasz Dorau <lukasz.dorau@intel.com>
---
 platform-intel.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/platform-intel.c b/platform-intel.c
index f347382..77f8639 100644
--- a/platform-intel.c
+++ b/platform-intel.c
@@ -343,6 +343,7 @@ static const struct imsm_orom *find_imsm_hba_orom(enum sys_dev_type hba_id)
 #define SYS_EFI_VAR_PATH "/sys/firmware/efi/vars"
 #define SCU_PROP "RstScuV"
 #define AHCI_PROP "RstSataV"
+#define AHCI_SSATA_PROP "RstsSatV"
 
 #define VENDOR_GUID \
 	EFI_GUID(0x193dfefa, 0xa445, 0x4302, 0x99, 0xd8, 0xef, 0x3a, 0xad, 0x1a, 0x04, 0xc6)
@@ -397,6 +398,8 @@ int read_efi_variable(void *buffer, ssize_t buf_size, char *variable_name, struc
 
 const struct imsm_orom *find_imsm_efi(enum sys_dev_type hba_id)
 {
+	int err;
+
 	if (hba_id >= SYS_DEV_MAX)
 		return NULL;
 
@@ -419,7 +422,13 @@ const struct imsm_orom *find_imsm_efi(enum sys_dev_type hba_id)
 	if (check_env("IMSM_TEST_OROM"))
 		return NULL;
 
-	if (read_efi_variable(&imsm_efi[hba_id], sizeof(imsm_efi[0]), hba_id == SYS_DEV_SAS ? SCU_PROP : AHCI_PROP, VENDOR_GUID)) {
+	err = read_efi_variable(&imsm_efi[hba_id], sizeof(imsm_efi[0]), hba_id == SYS_DEV_SAS ? SCU_PROP : AHCI_PROP, VENDOR_GUID);
+
+	/* try to read variable for second AHCI controller */
+	if (err && hba_id == SYS_DEV_SATA)
+		err = read_efi_variable(&imsm_efi[hba_id], sizeof(imsm_efi[0]), AHCI_SSATA_PROP, VENDOR_GUID);
+
+	if (err) {
 		populated_efi[hba_id] = 0;
 		return NULL;
 	}
-- 
1.8.4.5


  reply	other threads:[~2014-02-28 10:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 10:29 [PATCH 0/2] imsm: fixes for platform capabilities checking Artur Paszkiewicz
2014-02-28 10:29 ` Artur Paszkiewicz [this message]
2014-02-28 10:29 ` [PATCH 2/2] imsm: improved " Artur Paszkiewicz

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=1393583368-31542-2-git-send-email-artur.paszkiewicz@intel.com \
    --to=artur.paszkiewicz@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=pawel.baldysiak@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).