Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751248AbWEZSdC (ORCPT ); Fri, 26 May 2006 14:33:02 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751260AbWEZSdC (ORCPT ); Fri, 26 May 2006 14:33:02 -0400 Received: from mail0.lsil.com ([147.145.40.20]:40144 "EHLO mail0.lsil.com") by vger.kernel.org with ESMTP id S1751248AbWEZSdA (ORCPT ); Fri, 26 May 2006 14:33:00 -0400 Subject: [Patch 2/2] megaraid_sas: add support for ZCR controller From: Sumant Patro To: linux-kernel@vger.kernel.org Cc: hch@lst.de Content-Type: multipart/mixed; boundary="=-dmnJF/uWV5XLdJta+NRM" Date: Fri, 26 May 2006 12:36:21 -0700 Message-Id: <1148672181.8277.17.camel@dhcp80-125.lsil.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-22) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 12231 Lines: 370 --=-dmnJF/uWV5XLdJta+NRM Content-Type: text/plain Content-Transfer-Encoding: 7bit Hello All, Here is a patch that adds support for a ZCR controller (Device ID : 0x413). It also has a bug fix : Disable controller interrupt before firing INIT cmd to FW. Interrupt is enabled after required initialization is over. This is done to ensure that driver is ready to handle interrupts when it is generated by the controller. Thanks, Sumant Patro Signed-off-by: Sumant Patro diff -uprN linux-2.6.17-rc4-orig/Documentation/scsi/ChangeLog.megaraid_sas linux-2.6.17-rc4-new/Documentation/scsi/ChangeLog.megaraid_sas --- linux-2.6.17-rc4-orig/Documentation/scsi/ChangeLog.megaraid_sas 2006-05-25 18:00:02.000000000 -0700 +++ linux-2.6.17-rc4-new/Documentation/scsi/ChangeLog.megaraid_sas 2006-05-25 18:55:52.000000000 -0700 @@ -1,4 +1,20 @@ +1 Release Date : Sun May 14 22:49:52 PDT 2006 - Sumant Patro +2 Current Version : 00.00.03.01 +3 Older Version : 00.00.02.04 + +i. Added support for ZCR controller. + + New device id 0x413 added. + +ii. Bug fix : Disable controller interrupt before firing INIT cmd to FW. + + Interrupt is enabled after required initialization is over. + This is done to ensure that driver is ready to handle interrupts when + it is generated by the controller. + + -Sumant Patro + 1 Release Date : Wed Feb 03 14:31:44 PST 2006 - Sumant Patro 2 Current Version : 00.00.02.04 3 Older Version : 00.00.02.04 diff -uprN linux-2.6.17-rc4-orig/drivers/scsi/megaraid/megaraid_sas.c linux-2.6.17-rc4-new/drivers/scsi/megaraid/megaraid_sas.c --- linux-2.6.17-rc4-orig/drivers/scsi/megaraid/megaraid_sas.c 2006-05-25 17:03:14.000000000 -0700 +++ linux-2.6.17-rc4-new/drivers/scsi/megaraid/megaraid_sas.c 2006-05-25 18:45:55.000000000 -0700 @@ -10,7 +10,7 @@ * 2 of the License, or (at your option) any later version. * * FILE : megaraid_sas.c - * Version : v00.00.02.04 + * Version : v00.00.03.01 * * Authors: * Sreenivas Bagalkote @@ -55,19 +55,24 @@ static struct pci_device_id megasas_pci_ { PCI_VENDOR_ID_LSI_LOGIC, - PCI_DEVICE_ID_LSI_SAS1064R, // xscale IOP + PCI_DEVICE_ID_LSI_SAS1064R, /* xscale IOP */ PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_LSI_LOGIC, - PCI_DEVICE_ID_LSI_SAS1078R, // ppc IOP + PCI_DEVICE_ID_LSI_SAS1078R, /* ppc IOP */ PCI_ANY_ID, PCI_ANY_ID, }, + PCI_VENDOR_ID_LSI_LOGIC, + PCI_DEVICE_ID_LSI_VERDE_ZCR, /* xscale IOP, vega */ + PCI_ANY_ID, + PCI_ANY_ID, + }, { PCI_VENDOR_ID_DELL, - PCI_DEVICE_ID_DELL_PERC5, // xscale IOP + PCI_DEVICE_ID_DELL_PERC5, /* xscale IOP */ PCI_ANY_ID, PCI_ANY_ID, }, @@ -289,9 +294,14 @@ static struct megasas_instance_template * @regs: MFI register set */ static inline void -megasas_disable_intr(struct megasas_register_set __iomem * regs) +megasas_disable_intr(struct megasas_instance *instance) { u32 mask = 0x1f; + struct megasas_register_set __iomem *regs = instance->reg_set; + + if(instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1078R) + mask = 0xffffffff; + writel(mask, ®s->outbound_intr_mask); /* Dummy readl to force pci flush */ @@ -1260,7 +1270,7 @@ megasas_transition_to_ready(struct megas /* * Bring it to READY state; assuming max wait 2 secs */ - megasas_disable_intr(instance->reg_set); + megasas_disable_intr(instance); writel(MFI_INIT_READY, &instance->reg_set->inbound_doorbell); max_wait = 10; @@ -1757,6 +1767,11 @@ static int megasas_init_mfi(struct megas init_frame->data_xfer_len = sizeof(struct megasas_init_queue_info); /* + * disable the intr before firing the init frame to FW + */ + megasas_disable_intr(instance); + + /* * Issue the init frame in polled mode */ if (megasas_issue_polled(instance, cmd)) { @@ -2234,7 +2249,7 @@ megasas_probe_one(struct pci_dev *pdev, megasas_mgmt_info.max_index--; pci_set_drvdata(pdev, NULL); - megasas_disable_intr(instance->reg_set); + megasas_disable_intr(instance); free_irq(instance->pdev->irq, instance); megasas_release_mfi(instance); @@ -2364,7 +2379,7 @@ static void megasas_detach_one(struct pc pci_set_drvdata(instance->pdev, NULL); - megasas_disable_intr(instance->reg_set); + megasas_disable_intr(instance); free_irq(instance->pdev->irq, instance); diff -uprN linux-2.6.17-rc4-orig/drivers/scsi/megaraid/megaraid_sas.h linux-2.6.17-rc4-new/drivers/scsi/megaraid/megaraid_sas.h --- linux-2.6.17-rc4-orig/drivers/scsi/megaraid/megaraid_sas.h 2006-05-25 17:04:02.000000000 -0700 +++ linux-2.6.17-rc4-new/drivers/scsi/megaraid/megaraid_sas.h 2006-05-25 18:42:49.000000000 -0700 @@ -18,9 +18,16 @@ /** * MegaRAID SAS Driver meta data */ -#define MEGASAS_VERSION "00.00.02.04" -#define MEGASAS_RELDATE "Feb 03, 2006" -#define MEGASAS_EXT_VERSION "Fri Feb 03 14:31:44 PST 2006" +#define MEGASAS_VERSION "00.00.03.01" +#define MEGASAS_RELDATE "May 14, 2006" +#define MEGASAS_EXT_VERSION "Sun May 14 22:49:52 PDT 2006" + +/* + * Device IDs + */ +#define PCI_DEVICE_ID_LSI_SAS1078R 0x0060 +#define PCI_DEVICE_ID_LSI_VERDE_ZCR 0x0413 + /* * ===================================== * MegaRAID SAS MFI firmware definitions @@ -554,7 +561,11 @@ struct megasas_ctrl_info { #define MFI_POLL_TIMEOUT_SECS 10 #define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000 -#define PCI_DEVICE_ID_LSI_SAS1078R 0x00000060 + +/* +* register set for both 1068 and 1078 controllers +* structure extended for 1078 registers +*/ struct megasas_register_set { u32 reserved_0[4]; /*0000h*/ @@ -1150,10 +1161,10 @@ struct compat_megasas_iocpacket { struct compat_iovec sgl[MAX_IOCTL_SGE]; } __attribute__ ((packed)); +#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket) #endif #define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct megasas_iocpacket) -#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket) #define MEGASAS_IOC_GET_AEN _IOW('M', 3, struct megasas_aen) struct megasas_mgmt_info { --=-dmnJF/uWV5XLdJta+NRM Content-Disposition: attachment; filename=megaraid_sas_zcr.patch Content-Type: text/x-patch; name=megaraid_sas_zcr.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -uprN linux-2.6.17-rc4-orig/Documentation/scsi/ChangeLog.megaraid_sas linux-2.6.17-rc4-new/Documentation/scsi/ChangeLog.megaraid_sas --- linux-2.6.17-rc4-orig/Documentation/scsi/ChangeLog.megaraid_sas 2006-05-25 18:00:02.000000000 -0700 +++ linux-2.6.17-rc4-new/Documentation/scsi/ChangeLog.megaraid_sas 2006-05-25 18:55:52.000000000 -0700 @@ -1,4 +1,20 @@ +1 Release Date : Sun May 14 22:49:52 PDT 2006 - Sumant Patro +2 Current Version : 00.00.03.01 +3 Older Version : 00.00.02.04 + +i. Added support for ZCR controller. + + New device id 0x413 added. + +ii. Bug fix : Disable controller interrupt before firing INIT cmd to FW. + + Interrupt is enabled after required initialization is over. + This is done to ensure that driver is ready to handle interrupts when + it is generated by the controller. + + -Sumant Patro + 1 Release Date : Wed Feb 03 14:31:44 PST 2006 - Sumant Patro 2 Current Version : 00.00.02.04 3 Older Version : 00.00.02.04 diff -uprN linux-2.6.17-rc4-orig/drivers/scsi/megaraid/megaraid_sas.c linux-2.6.17-rc4-new/drivers/scsi/megaraid/megaraid_sas.c --- linux-2.6.17-rc4-orig/drivers/scsi/megaraid/megaraid_sas.c 2006-05-25 17:03:14.000000000 -0700 +++ linux-2.6.17-rc4-new/drivers/scsi/megaraid/megaraid_sas.c 2006-05-25 18:45:55.000000000 -0700 @@ -10,7 +10,7 @@ * 2 of the License, or (at your option) any later version. * * FILE : megaraid_sas.c - * Version : v00.00.02.04 + * Version : v00.00.03.01 * * Authors: * Sreenivas Bagalkote @@ -55,19 +55,24 @@ static struct pci_device_id megasas_pci_ { PCI_VENDOR_ID_LSI_LOGIC, - PCI_DEVICE_ID_LSI_SAS1064R, // xscale IOP + PCI_DEVICE_ID_LSI_SAS1064R, /* xscale IOP */ PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_LSI_LOGIC, - PCI_DEVICE_ID_LSI_SAS1078R, // ppc IOP + PCI_DEVICE_ID_LSI_SAS1078R, /* ppc IOP */ PCI_ANY_ID, PCI_ANY_ID, }, + PCI_VENDOR_ID_LSI_LOGIC, + PCI_DEVICE_ID_LSI_VERDE_ZCR, /* xscale IOP, vega */ + PCI_ANY_ID, + PCI_ANY_ID, + }, { PCI_VENDOR_ID_DELL, - PCI_DEVICE_ID_DELL_PERC5, // xscale IOP + PCI_DEVICE_ID_DELL_PERC5, /* xscale IOP */ PCI_ANY_ID, PCI_ANY_ID, }, @@ -289,9 +294,14 @@ static struct megasas_instance_template * @regs: MFI register set */ static inline void -megasas_disable_intr(struct megasas_register_set __iomem * regs) +megasas_disable_intr(struct megasas_instance *instance) { u32 mask = 0x1f; + struct megasas_register_set __iomem *regs = instance->reg_set; + + if(instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1078R) + mask = 0xffffffff; + writel(mask, ®s->outbound_intr_mask); /* Dummy readl to force pci flush */ @@ -1260,7 +1270,7 @@ megasas_transition_to_ready(struct megas /* * Bring it to READY state; assuming max wait 2 secs */ - megasas_disable_intr(instance->reg_set); + megasas_disable_intr(instance); writel(MFI_INIT_READY, &instance->reg_set->inbound_doorbell); max_wait = 10; @@ -1757,6 +1767,11 @@ static int megasas_init_mfi(struct megas init_frame->data_xfer_len = sizeof(struct megasas_init_queue_info); /* + * disable the intr before firing the init frame to FW + */ + megasas_disable_intr(instance); + + /* * Issue the init frame in polled mode */ if (megasas_issue_polled(instance, cmd)) { @@ -2234,7 +2249,7 @@ megasas_probe_one(struct pci_dev *pdev, megasas_mgmt_info.max_index--; pci_set_drvdata(pdev, NULL); - megasas_disable_intr(instance->reg_set); + megasas_disable_intr(instance); free_irq(instance->pdev->irq, instance); megasas_release_mfi(instance); @@ -2364,7 +2379,7 @@ static void megasas_detach_one(struct pc pci_set_drvdata(instance->pdev, NULL); - megasas_disable_intr(instance->reg_set); + megasas_disable_intr(instance); free_irq(instance->pdev->irq, instance); diff -uprN linux-2.6.17-rc4-orig/drivers/scsi/megaraid/megaraid_sas.h linux-2.6.17-rc4-new/drivers/scsi/megaraid/megaraid_sas.h --- linux-2.6.17-rc4-orig/drivers/scsi/megaraid/megaraid_sas.h 2006-05-25 17:04:02.000000000 -0700 +++ linux-2.6.17-rc4-new/drivers/scsi/megaraid/megaraid_sas.h 2006-05-25 18:42:49.000000000 -0700 @@ -18,9 +18,16 @@ /** * MegaRAID SAS Driver meta data */ -#define MEGASAS_VERSION "00.00.02.04" -#define MEGASAS_RELDATE "Feb 03, 2006" -#define MEGASAS_EXT_VERSION "Fri Feb 03 14:31:44 PST 2006" +#define MEGASAS_VERSION "00.00.03.01" +#define MEGASAS_RELDATE "May 14, 2006" +#define MEGASAS_EXT_VERSION "Sun May 14 22:49:52 PDT 2006" + +/* + * Device IDs + */ +#define PCI_DEVICE_ID_LSI_SAS1078R 0x0060 +#define PCI_DEVICE_ID_LSI_VERDE_ZCR 0x0413 + /* * ===================================== * MegaRAID SAS MFI firmware definitions @@ -554,7 +561,11 @@ struct megasas_ctrl_info { #define MFI_POLL_TIMEOUT_SECS 10 #define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000 -#define PCI_DEVICE_ID_LSI_SAS1078R 0x00000060 + +/* +* register set for both 1068 and 1078 controllers +* structure extended for 1078 registers +*/ struct megasas_register_set { u32 reserved_0[4]; /*0000h*/ @@ -1150,10 +1161,10 @@ struct compat_megasas_iocpacket { struct compat_iovec sgl[MAX_IOCTL_SGE]; } __attribute__ ((packed)); +#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket) #endif #define MEGASAS_IOC_FIRMWARE _IOWR('M', 1, struct megasas_iocpacket) -#define MEGASAS_IOC_FIRMWARE32 _IOWR('M', 1, struct compat_megasas_iocpacket) #define MEGASAS_IOC_GET_AEN _IOW('M', 3, struct megasas_aen) struct megasas_mgmt_info { --=-dmnJF/uWV5XLdJta+NRM-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/