[kernel] r15114 - in dists/lenny/linux-2.6/debian: . patches/bugfix/all patches/features/all patches/series

Ben Hutchings benh at alioth.debian.org
Thu Feb 4 02:40:13 UTC 2010


Author: benh
Date: Thu Feb  4 02:40:11 2010
New Revision: 15114

Log:
Apply megaraid_sas changes from 2.6.27:

Fix I/O and shutdown sequencing bugs (Closes: #568345)
Add support for MegaRAID SAS 9260 and other PCIe gen2 controllers (Closes: #547183)

Do not apply "megaraid_sas: remove sysfs dbg_lvl world writeable permissions"
which will be included in an interim security update.

Added:
   dists/lenny/linux-2.6/debian/patches/bugfix/all/megaraid_sas-add-readl-to-force-PCI-posting-flush.patch
   dists/lenny/linux-2.6/debian/patches/bugfix/all/megaraid_sas-add-the-shutdown-DCMD-cmd.patch
   dists/lenny/linux-2.6/debian/patches/features/all/megaraid_sas-add-new-controllers-0x78-0x79.patch
Modified:
   dists/lenny/linux-2.6/debian/changelog
   dists/lenny/linux-2.6/debian/patches/series/22

Modified: dists/lenny/linux-2.6/debian/changelog
==============================================================================
--- dists/lenny/linux-2.6/debian/changelog	Thu Feb  4 01:44:43 2010	(r15113)
+++ dists/lenny/linux-2.6/debian/changelog	Thu Feb  4 02:40:11 2010	(r15114)
@@ -20,6 +20,9 @@
   * audit: Fix memory management bugs (Closes: #562815)
     - fix braindamage in audit_tree.c untag_chunk()
     - fix more leaks in audit_tree.c tag_chunk()
+  * megaraid_sas: Fix I/O and shutdown sequencing bugs (Closes: #568345)
+  * megaraid_sas: Add support for MegaRAID SAS 9260 and other PCIe gen2
+    controllers (Closes: #547183)
 
  -- maximilian attems <maks at debian.org>  Mon, 28 Dec 2009 23:44:19 +0100
 

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/megaraid_sas-add-readl-to-force-PCI-posting-flush.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/megaraid_sas-add-readl-to-force-PCI-posting-flush.patch	Thu Feb  4 02:40:11 2010	(r15114)
@@ -0,0 +1,43 @@
+From 06f579dee5dd75c2aaf8fe83d034b5470eeee2f4 Mon Sep 17 00:00:00 2001
+From: Yang, Bo <Bo.Yang at lsi.com>
+Date: Sun, 10 Aug 2008 12:42:37 -0700
+Subject: [PATCH] [SCSI] megaraid_sas: add readl to force PCI posting flush
+
+MegaRAID SAS Driver get unexpected Interrupt.  Add the dummy readl to
+force PCI flush will fix this issue.
+
+Signed-off-by: Bo Yang <bo.yang at lsi.com>
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+Cc: Stable Tree <stable at kernel.org>
+Signed-off-by: James Bottomley <James.Bottomley at HansenPartnership.com>
+---
+ drivers/scsi/megaraid/megaraid_sas.c |    6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
+index fc7ac15..d7b9984 100644
+--- a/drivers/scsi/megaraid/megaraid_sas.c
++++ b/drivers/scsi/megaraid/megaraid_sas.c
+@@ -198,6 +198,9 @@ megasas_clear_intr_xscale(struct megasas_register_set __iomem * regs)
+ 	 */
+ 	writel(status, &regs->outbound_intr_status);
+ 
++	/* Dummy readl to force pci flush */
++	readl(&regs->outbound_intr_status);
++
+ 	return 0;
+ }
+ 
+@@ -293,6 +296,9 @@ megasas_clear_intr_ppc(struct megasas_register_set __iomem * regs)
+ 	 */
+ 	writel(status, &regs->outbound_doorbell_clear);
+ 
++	/* Dummy readl to force pci flush */
++	readl(&regs->outbound_doorbell_clear);
++
+ 	return 0;
+ }
+ /**
+-- 
+1.6.6
+

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/megaraid_sas-add-the-shutdown-DCMD-cmd.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/megaraid_sas-add-the-shutdown-DCMD-cmd.patch	Thu Feb  4 02:40:11 2010	(r15114)
@@ -0,0 +1,30 @@
+From 530e6fc1e05f14762aea954ca8d6422c5a7077c1 Mon Sep 17 00:00:00 2001
+From: Yang, Bo <Bo.Yang at lsi.com>
+Date: Sun, 10 Aug 2008 12:42:37 -0700
+Subject: [PATCH] [SCSI] megaraid_sas: add the shutdown DCMD cmd to driver shutdown routine
+
+Add the shutdown DCMD cmd to driver shutdown routine to make megaraid sas
+FW shutdown proper.
+
+Signed-off-by: Bo Yang <bo.yang at lsi.com>
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+Signed-off-by: James Bottomley <James.Bottomley at HansenPartnership.com>
+---
+ drivers/scsi/megaraid/megaraid_sas.c |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
+index d7b9984..e880cd4 100644
+--- a/drivers/scsi/megaraid/megaraid_sas.c
++++ b/drivers/scsi/megaraid/megaraid_sas.c
+@@ -2863,6 +2863,7 @@ static void megasas_shutdown(struct pci_dev *pdev)
+ {
+ 	struct megasas_instance *instance = pci_get_drvdata(pdev);
+ 	megasas_flush_cache(instance);
++	megasas_shutdown_controller(instance, MR_DCMD_CTRL_SHUTDOWN);
+ }
+ 
+ /**
+-- 
+1.6.6
+

Added: dists/lenny/linux-2.6/debian/patches/features/all/megaraid_sas-add-new-controllers-0x78-0x79.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/features/all/megaraid_sas-add-new-controllers-0x78-0x79.patch	Thu Feb  4 02:40:11 2010	(r15114)
@@ -0,0 +1,192 @@
+From 6610a6b354d6c3377a1e79cd1d760ffe4358245c Mon Sep 17 00:00:00 2001
+From: Yang, Bo <Bo.Yang at lsi.com>
+Date: Sun, 10 Aug 2008 12:42:38 -0700
+Subject: [PATCH] [SCSI] megaraid_sas: add new controllers (0x78 0x79)
+
+Add the new controllers (0x78 0x79) support to the driver.  Those
+controllers are LSI's next generation (gen2) SAS controllers.
+
+[akpm at linux-foundation.org: coding-style fixes]
+[akpm at linux-foundation.org: parenthesise a macro]
+Signed-off-by: Bo Yang <bo.yang at lsi.com>
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+Signed-off-by: James Bottomley <James.Bottomley at HansenPartnership.com>
+---
+ drivers/scsi/megaraid/megaraid_sas.c |  110 +++++++++++++++++++++++++++++++++-
+ drivers/scsi/megaraid/megaraid_sas.h |    4 +
+ 2 files changed, 112 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
+index e880cd4..870dc1c 100644
+--- a/drivers/scsi/megaraid/megaraid_sas.c
++++ b/drivers/scsi/megaraid/megaraid_sas.c
+@@ -10,7 +10,7 @@
+  *	   2 of the License, or (at your option) any later version.
+  *
+  * FILE		: megaraid_sas.c
+- * Version	: v00.00.03.20-rc1
++ * Version     : v00.00.04.01-rc1
+  *
+  * Authors:
+  *	(email-id : megaraidlinux at lsi.com)
+@@ -71,6 +71,10 @@ static struct pci_device_id megasas_pci_table[] = {
+ 	/* ppc IOP */
+ 	{PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1078DE)},
+ 	/* ppc IOP */
++	{PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1078GEN2)},
++	/* gen2*/
++	{PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS0079GEN2)},
++	/* gen2*/
+ 	{PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_VERDE_ZCR)},
+ 	/* xscale IOP, vega */
+ 	{PCI_DEVICE(PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_PERC5)},
+@@ -324,6 +328,99 @@ static struct megasas_instance_template megasas_instance_template_ppc = {
+ };
+ 
+ /**
++*	The following functions are defined for gen2 (deviceid : 0x78 0x79)
++*	controllers
++*/
++
++/**
++ * megasas_enable_intr_gen2 -  Enables interrupts
++ * @regs:                      MFI register set
++ */
++static inline void
++megasas_enable_intr_gen2(struct megasas_register_set __iomem *regs)
++{
++	writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear);
++
++	/* write ~0x00000005 (4 & 1) to the intr mask*/
++	writel(~MFI_GEN2_ENABLE_INTERRUPT_MASK, &(regs)->outbound_intr_mask);
++
++	/* Dummy readl to force pci flush */
++	readl(&regs->outbound_intr_mask);
++}
++
++/**
++ * megasas_disable_intr_gen2 - Disables interrupt
++ * @regs:                      MFI register set
++ */
++static inline void
++megasas_disable_intr_gen2(struct megasas_register_set __iomem *regs)
++{
++	u32 mask = 0xFFFFFFFF;
++	writel(mask, &regs->outbound_intr_mask);
++	/* Dummy readl to force pci flush */
++	readl(&regs->outbound_intr_mask);
++}
++
++/**
++ * megasas_read_fw_status_reg_gen2 - returns the current FW status value
++ * @regs:                      MFI register set
++ */
++static u32
++megasas_read_fw_status_reg_gen2(struct megasas_register_set __iomem *regs)
++{
++	return readl(&(regs)->outbound_scratch_pad);
++}
++
++/**
++ * megasas_clear_interrupt_gen2 -      Check & clear interrupt
++ * @regs:                              MFI register set
++ */
++static int
++megasas_clear_intr_gen2(struct megasas_register_set __iomem *regs)
++{
++	u32 status;
++	/*
++	 * Check if it is our interrupt
++	 */
++	status = readl(&regs->outbound_intr_status);
++
++	if (!(status & MFI_GEN2_ENABLE_INTERRUPT_MASK))
++		return 1;
++
++	/*
++	 * Clear the interrupt by writing back the same value
++	 */
++	writel(status, &regs->outbound_doorbell_clear);
++
++	/* Dummy readl to force pci flush */
++	readl(&regs->outbound_intr_status);
++
++	return 0;
++}
++/**
++ * megasas_fire_cmd_gen2 -     Sends command to the FW
++ * @frame_phys_addr :          Physical address of cmd
++ * @frame_count :              Number of frames for the command
++ * @regs :                     MFI register set
++ */
++static inline void
++megasas_fire_cmd_gen2(dma_addr_t frame_phys_addr, u32 frame_count,
++			struct megasas_register_set __iomem *regs)
++{
++	writel((frame_phys_addr | (frame_count<<1))|1,
++			&(regs)->inbound_queue_port);
++}
++
++static struct megasas_instance_template megasas_instance_template_gen2 = {
++
++	.fire_cmd = megasas_fire_cmd_gen2,
++	.enable_intr = megasas_enable_intr_gen2,
++	.disable_intr = megasas_disable_intr_gen2,
++	.clear_intr = megasas_clear_intr_gen2,
++	.read_fw_status_reg = megasas_read_fw_status_reg_gen2,
++};
++
++/**
+ *	This is the end of set of functions & definitions
+ * 	specific to ppc (deviceid : 0x60) controllers
+ */
+@@ -1982,7 +2079,12 @@ static int megasas_init_mfi(struct megasas_instance *instance)
+ 	/*
+ 	 * Map the message registers
+ 	 */
+-	instance->base_addr = pci_resource_start(instance->pdev, 0);
++	if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1078GEN2) ||
++		(instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0079GEN2)) {
++		instance->base_addr = pci_resource_start(instance->pdev, 1);
++	} else {
++		instance->base_addr = pci_resource_start(instance->pdev, 0);
++	}
+ 
+ 	if (pci_request_regions(instance->pdev, "megasas: LSI")) {
+ 		printk(KERN_DEBUG "megasas: IO memory region busy!\n");
+@@ -2004,6 +2106,10 @@ static int megasas_init_mfi(struct megasas_instance *instance)
+ 		case PCI_DEVICE_ID_LSI_SAS1078DE:
+ 			instance->instancet = &megasas_instance_template_ppc;
+ 			break;
++		case PCI_DEVICE_ID_LSI_SAS1078GEN2:
++		case PCI_DEVICE_ID_LSI_SAS0079GEN2:
++			instance->instancet = &megasas_instance_template_gen2;
++			break;
+ 		case PCI_DEVICE_ID_LSI_SAS1064R:
+ 		case PCI_DEVICE_ID_DELL_PERC5:
+ 		default:
+diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
+index b0c41e6..7072ff2 100644
+--- a/drivers/scsi/megaraid/megaraid_sas.h
++++ b/drivers/scsi/megaraid/megaraid_sas.h
+@@ -28,6 +28,8 @@
+ #define	PCI_DEVICE_ID_LSI_SAS1078R		0x0060
+ #define	PCI_DEVICE_ID_LSI_SAS1078DE		0x007C
+ #define	PCI_DEVICE_ID_LSI_VERDE_ZCR		0x0413
++#define	PCI_DEVICE_ID_LSI_SAS1078GEN2		0x0078
++#define	PCI_DEVICE_ID_LSI_SAS0079GEN2		0x0079
+ 
+ /*
+  * =====================================
+@@ -580,6 +582,8 @@ struct megasas_ctrl_info {
+ #define MEGASAS_COMPLETION_TIMER_INTERVAL      (HZ/10)
+ 
+ #define MFI_REPLY_1078_MESSAGE_INTERRUPT	0x80000000
++#define MFI_REPLY_GEN2_MESSAGE_INTERRUPT	0x00000001
++#define MFI_GEN2_ENABLE_INTERRUPT_MASK		(0x00000001 | 0x00000004)
+ 
+ /*
+ * register set for both 1068 and 1078 controllers
+-- 
+1.6.6
+

Modified: dists/lenny/linux-2.6/debian/patches/series/22
==============================================================================
--- dists/lenny/linux-2.6/debian/patches/series/22	Thu Feb  4 01:44:43 2010	(r15113)
+++ dists/lenny/linux-2.6/debian/patches/series/22	Thu Feb  4 02:40:11 2010	(r15114)
@@ -14,3 +14,6 @@
 + bugfix/all/fix-more-leaks-in-audit_tree.c-tag_chunk.patch
 + bugfix/all/ALSA-cs4232-fix-crash-during-chip-PNP-detection.patch
 + bugfix/all/matroxfb-fix-problems-with-display-stability.patch
++ bugfix/all/megaraid_sas-add-readl-to-force-PCI-posting-flush.patch
++ bugfix/all/megaraid_sas-add-the-shutdown-DCMD-cmd.patch
++ features/all/megaraid_sas-add-new-controllers-0x78-0x79.patch



More information about the Kernel-svn-changes mailing list