Annotation of /trunk/kernel26-magellan-server/patches-2.6.24-r7/0301-2.6.24-mptbase-vmware-fix.patch
Parent Directory | Revision Log
Revision 589 -
(hide annotations)
(download)
Fri May 9 12:49:26 2008 UTC (16 years, 4 months ago) by niro
File size: 1699 byte(s)
Fri May 9 12:49:26 2008 UTC (16 years, 4 months ago) by niro
File size: 1699 byte(s)
-2.6.24-magellan-r7; updated to linux-2.6.24.7
1 | niro | 589 | From: Petr Vandrovec <vandrove@vc.cvut.cz> |
2 | Subject: Installation in VMware-Server fails | ||
3 | References: 263883 | ||
4 | |||
5 | Installation in VMware-Server fails as the VMware mpt emulation is | ||
6 | broken; it does not (or wrongly) set the MaxDevices field to '0'. | ||
7 | |||
8 | Signed-off-by: Hannes Reinecke <hare@suse.de> | ||
9 | |||
10 | diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c | ||
11 | index 97471af..b3eb367 100644 | ||
12 | --- a/drivers/message/fusion/mptbase.c | ||
13 | +++ b/drivers/message/fusion/mptbase.c | ||
14 | @@ -2567,6 +2567,16 @@ GetPortFacts(MPT_ADAPTER *ioc, int portn | ||
15 | pfacts->IOCStatus = le16_to_cpu(pfacts->IOCStatus); | ||
16 | pfacts->IOCLogInfo = le32_to_cpu(pfacts->IOCLogInfo); | ||
17 | pfacts->MaxDevices = le16_to_cpu(pfacts->MaxDevices); | ||
18 | + /* | ||
19 | + * VMware emulation is broken, its PortFact's MaxDevices reports value | ||
20 | + * programmed by IOC Init, so if IOC Init is programmed to 256 (which | ||
21 | + * is 0, as that field is only 8 bit), it reports back 0 in port facts, | ||
22 | + * instead of 256... And unfortunately using 256 triggers another bug | ||
23 | + * in the code (parallel SCSI can have only 16 devices). | ||
24 | + */ | ||
25 | + if (pfacts->MaxDevices == 0) { | ||
26 | + pfacts->MaxDevices = 16; | ||
27 | + } | ||
28 | pfacts->PortSCSIID = le16_to_cpu(pfacts->PortSCSIID); | ||
29 | pfacts->ProtocolFlags = le16_to_cpu(pfacts->ProtocolFlags); | ||
30 | pfacts->MaxPostedCmdBuffers = le16_to_cpu(pfacts->MaxPostedCmdBuffers); | ||
31 | @@ -2574,7 +2584,7 @@ GetPortFacts(MPT_ADAPTER *ioc, int portn | ||
32 | pfacts->MaxLanBuckets = le16_to_cpu(pfacts->MaxLanBuckets); | ||
33 | |||
34 | max_id = (ioc->bus_type == SAS) ? pfacts->PortSCSIID : | ||
35 | - pfacts->MaxDevices; | ||
36 | + pfacts->MaxDevices; | ||
37 | ioc->devices_per_bus = (max_id > 255) ? 256 : max_id; | ||
38 | ioc->number_of_buses = (ioc->devices_per_bus < 256) ? 1 : max_id/256; | ||
39 |