Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 89877e42827f16fa5f86b1df0c2860b1 > files > 2140

kernel-2.6.18-128.1.10.el5.src.rpm

From: Chip Coldwell <coldwell@redhat.com>
Subject: [RHEL-5.1 PATCH] bz279571 Can't boot 2.6.18-26.el5 with VMWare ESX
Date: Mon, 10 Sep 2007 16:10:16 -0400 (EDT)
Bugzilla: 279571
Message-Id: <alpine.LRH.0.9999.0709101604230.9356@bogart.boston.redhat.com>
Changelog: [scsi] fusion: allow VMWare's emulator to work again



The attached patch is a workaround for a bug in VMWare's emulated LSI
Fusion SCSI HBA.  The emulated firmware returns zero for the maximum
number of attached devices; the real firmware returns a positive
number.  Therefore, the kernel that boots and works fine on bare metal
will fail on VMWare because this firmware value is handed to the SCSI
midlayer, which then skips the entire bus scan.

The patch below was submitted by Eric Moore of LSI to the linux-scsi
mailing list:

http://marc.info/?l=linux-scsi&m=117432237404247

then immediately rejected by Christoph Hellwig, who prefers that
VMWare fix their emulation instead.  We should include the workaround
in RHEL-5 or risk a large number of customer issues.

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index eddb933..21fadf2 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -2571,8 +2571,19 @@ GetPortFacts(MPT_ADAPTER *ioc, int portnum, int sleepFlag)
 	pfacts->MaxPersistentIDs = le16_to_cpu(pfacts->MaxPersistentIDs);
 	pfacts->MaxLanBuckets = le16_to_cpu(pfacts->MaxLanBuckets);
 
-	max_id = (ioc->bus_type == SAS) ? pfacts->PortSCSIID :
-	    pfacts->MaxDevices;
+	switch (ioc->bus_type) {
+	case SAS:
+		max_id = pfacts->PortSCSIID;
+		break;
+	case FC:
+		max_id = pfacts->MaxDevices;
+		break;
+	case SPI:
+	default:
+		max_id = MPT_MAX_SCSI_DEVICES;
+		break;
+	}
+
 	ioc->devices_per_bus = (max_id > 255) ? 256 : max_id;
 	ioc->number_of_buses = (ioc->devices_per_bus < 256) ? 1 : max_id/256;
 


-- 
Charles M. "Chip" Coldwell
Senior Software Engineer
Red Hat, Inc
978-392-2426