rpms/kernel/devel linux-2.6-libata-pata-dma-disable-option.patch, NONE, 1.1 linux-2.6-scsi-mpt-vmware-fix.patch, NONE, 1.1 kernel.spec, 1.156, 1.157

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Tue Sep 11 21:26:23 UTC 2007


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9903

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-libata-pata-dma-disable-option.patch 
	linux-2.6-scsi-mpt-vmware-fix.patch 
Log Message:
* Tue Sep 11 2007 Chuck Ebbert <cebbert at redhat.com>
- fix emulated vmware SCSI disks
- add option to disable libata PATA DMA


linux-2.6-libata-pata-dma-disable-option.patch:

--- NEW FILE linux-2.6-libata-pata-dma-disable-option.patch ---
This is useful when debugging, handling problem systems, or for
distributions just to get the system installed so it can be sorted
out later.

This is a bit smarter than the old IDE one and lets you do

libata.pata_dma=0		Disable all PATA DMA like old IDE
libata.pata_dma=1		Disk DMA only
libata.pata_dma=2		ATAPI DMA only
libata.pata_dma=4		CF DMA only

(or combinations thereof - 0,1,3 being the useful ones I suspect)

(I've split CF as it seems to be a seperate case of pain and suffering
different to the others and caused by assorted PIO wired adapters etc)

SATA is not affected - for one its not clear it makes sense to disable
DMA for SATA if even always possible, for two we've seen no failure 
evidence to justify needing to support this kind of hammer on SATA.

Signed-off-by: Alan Cox <alan at redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.23rc3-mm1/include/linux/libata.h linux-2.6.23rc3-mm1/include/linux/libata.h
--- linux.vanilla-2.6.23rc3-mm1/include/linux/libata.h	2007-08-22 17:23:14.000000000 +0100
+++ linux-2.6.23rc3-mm1/include/linux/libata.h	2007-08-22 17:50:32.000000000 +0100
@@ -315,6 +315,12 @@
 	ATA_HORKAGE_NONCQ	= (1 << 2),	/* Don't use NCQ */
 	ATA_HORKAGE_MAX_SEC_128	= (1 << 3),	/* Limit max sects to 128 */
 	ATA_HORKAGE_BROKEN_HPA	= (1 << 4),	/* Broken HPA */
+ 
+	/* DMA mask for user DMA control: User visible values do not 
+	   renumber */
+	ATA_DMA_MASK_ATA	= (1 << 0),	/* DMA on ATA Disk */
+	ATA_DMA_MASK_ATAPI	= (1 << 1),	/* DMA on ATAPI */
+	ATA_DMA_MASK_CFA	= (1 << 2),	/* DMA on CF Card */
 };
 
 enum hsm_task_states {
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.23rc3-mm1/drivers/ata/libata-core.c linux-2.6.23rc3-mm1/drivers/ata/libata-core.c
--- linux.vanilla-2.6.23rc3-mm1/drivers/ata/libata-core.c	2007-08-22 17:23:00.000000000 +0100
+++ linux-2.6.23rc3-mm1/drivers/ata/libata-core.c	2007-08-22 18:17:31.321738376 +0100
@@ -99,6 +99,10 @@
 module_param_named(ignore_hpa, ata_ignore_hpa, int, 0644);
 MODULE_PARM_DESC(ignore_hpa, "Ignore HPA limit (0=keep BIOS limits, 1=ignore limits, using full disk)");
 
+static int ata_pata_dma = ATA_DMA_MASK_ATA|ATA_DMA_MASK_ATAPI|ATA_DMA_MASK_CFA;
+module_param_named(pata_dma, ata_pata_dma, int, 0644);
+MODULE_PARM_DESC(pata_dma, "Use DMA on PATA devices");
+
 static int ata_probe_timeout = ATA_TMOUT_INTERNAL / HZ;
 module_param(ata_probe_timeout, int, 0444);
 MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)");
@@ -2839,16 +2854,29 @@
 	/* step 1: calculate xfer_mask */
	for (i = 0; i < ATA_MAX_DEVICES; i++) {
 		unsigned int pio_mask, dma_mask;
+		unsigned int mode_mask;
 
 		dev = &ap->device[i];
 
 		if (!ata_dev_enabled(dev))
 			continue;
 
+		mode_mask = ATA_DMA_MASK_ATA;
+		if (dev->class == ATA_DEV_ATAPI)
+			mode_mask = ATA_DMA_MASK_ATAPI;
+		else if (ata_id_is_cfa(dev->id))
+			mode_mask = ATA_DMA_MASK_CFA;
+
 		ata_dev_xfermask(dev);
 
 		pio_mask = ata_pack_xfermask(dev->pio_mask, 0, 0);
 		dma_mask = ata_pack_xfermask(0, dev->mwdma_mask, dev->udma_mask);
+
+		if ((ata_pata_dma & mode_mask) || ap->cbl == ATA_CBL_SATA)
+			dma_mask = ata_pack_xfermask(0, dev->mwdma_mask, dev->udma_mask);
+		else
+			dma_mask = 0;
+
 		dev->pio_mode = ata_xfer_mask2mode(pio_mask);
 		dev->dma_mode = ata_xfer_mask2mode(dma_mask);
 
--- linux-2.6.22.noarch.orig/Documentation/kernel-parameters.txt
+++ linux-2.6.22.noarch/Documentation/kernel-parameters.txt
@@ -870,6 +870,12 @@ and is between 256 and 4096 characters. 
 	lasi=		[HW,SCSI] PARISC LASI driver for the 53c700 chip
 			Format: addr:<io>,irq:<irq>
 
+	libata.pata_dma= [LIBATA]
+		libata.pata_dma=0	Disable all PATA DMA like old IDE
+		libata.pata_dma=1	Disk DMA only
+		libata.pata_dma=2	ATAPI DMA only
+		libata.pata_dma=4	CF DMA only
+
 	load_ramdisk=	[RAM] List of ramdisks to load from floppy
 			See Documentation/ramdisk.txt.
 

linux-2.6-scsi-mpt-vmware-fix.patch:

--- NEW FILE linux-2.6-scsi-mpt-vmware-fix.patch ---
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.

F7 bz 241935

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.

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;
 


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -r1.156 -r1.157
--- kernel.spec	11 Sep 2007 18:03:54 -0000	1.156
+++ kernel.spec	11 Sep 2007 21:25:51 -0000	1.157
@@ -608,6 +608,7 @@
 Patch370: linux-2.6-crash-driver.patch
 Patch400: linux-2.6-scsi-cpqarray-set-master.patch
 Patch401: linux-2.6-scsi-async-double-add.patch
+Patch402: linux-2.6-scsi-mpt-vmware-fix.patch
 Patch420: linux-2.6-squashfs.patch
 Patch423: linux-2.6-gfs-locking-exports.patch
 Patch430: linux-2.6-net-silence-noisy-printks.patch
@@ -624,6 +625,7 @@
 Patch630: linux-2.6-defaults-nonmi.patch
 Patch660: linux-2.6-libata-ali-atapi-dma.patch
 Patch661: linux-2.6-libata-acpi-enable.patch
+Patch662: linux-2.6-libata-pata-dma-disable-option.patch
 Patch670: linux-2.6-ata-quirk.patch
 #Patch680: linux-2.6-wireless.patch
 Patch681: linux-2.6-wireless-pending.patch
@@ -1072,6 +1074,8 @@
 ApplyPatch linux-2.6-scsi-cpqarray-set-master.patch
 # Fix async scanning double-add problems
 ApplyPatch linux-2.6-scsi-async-double-add.patch
+# fix vmware emulated scsi controller
+ApplyPatch linux-2.6-scsi-mpt-vmware-fix.patch
 
 # Filesystem patches.
 # Squashfs
@@ -1119,6 +1123,8 @@
 ApplyPatch linux-2.6-ata-quirk.patch
 # Enable ACPI ATA objects
 ApplyPatch linux-2.6-libata-acpi-enable.patch
+# add option to disable PATA DMA
+ApplyPatch linux-2.6-libata-pata-dma-disable-option.patch
 
 # wireless patches headed for 2.6.23
 #ApplyPatch linux-2.6-wireless.patch
@@ -1791,6 +1797,10 @@
 
 %changelog
 * Tue Sep 11 2007 Chuck Ebbert <cebbert at redhat.com>
+- fix emulated vmware SCSI disks
+- add option to disable libata PATA DMA
+
+* Tue Sep 11 2007 Chuck Ebbert <cebbert at redhat.com>
 - utrace update
 
 * Tue Sep 11 2007 Chuck Ebbert <cebbert at redhat.com>




More information about the fedora-extras-commits mailing list