FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 03-28-2012, 06:51 PM
Buford Peek
 
Default Bug#666108: Dell PERC H710P is not supported by Squeeze Standard Kernel

Package: linux-image-2.6.32-5-amd64

Version: 2.6.32-41



Tried to install Debian Squeeze on a new Dell R620 platform. The system could NOT bring up the RAID Array.* Could not get the error output ..but it was trying to use the megaraid driver.



I was able to get this to work properly with Wheezy Standard kernel. I am guessing a packport of megaraid is needed.





I have a working wheezy installation so I can give you any type of diagnostic information needed.



Thanks

-Buford
 
Old 03-28-2012, 07:26 PM
Jonathan Nieder
 
Default Bug#666108: Dell PERC H710P is not supported by Squeeze Standard Kernel

reassign 666108 src:linux-2.6 2.6.32-41
quit

Buford Peek wrote:

> Tried to install Debian Squeeze on a new Dell R620 platform. The
> system could NOT bring up the RAID Array. Could not get the error
> output ..but it was trying to use the megaraid driver.

That's no good. Thanks for reporting it.

[...]
> I have a working wheezy installation so I can give you any type of
> diagnostic information needed.

Great, let's start with that. Please attach output from
"reportbug --template linux-image-$(uname -r)" on the working
installation.

Hope that helps,
Jonathan



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120328192623.GB8982@burratino">http://lists.debian.org/20120328192623.GB8982@burratino
 
Old 03-28-2012, 08:11 PM
Buford Peek
 
Default Bug#666108: Dell PERC H710P is not supported by Squeeze Standard Kernel

attached text file has the bug report..

This is standard Wheezy running on next generation Dell R620. running 3.2.X kernel.

-Buford
________________________________________
From: Jonathan Nieder [jrnieder@gmail.com]
Sent: Wednesday, March 28, 2012 3:26 PM
To: Buford Peek
Cc: 666108@bugs.debian.org
Subject: Re: Dell PERC H710P is not supported by Squeeze Standard Kernel

reassign 666108 src:linux-2.6 2.6.32-41
quit

Buford Peek wrote:

> Tried to install Debian Squeeze on a new Dell R620 platform. The
> system could NOT bring up the RAID Array. Could not get the error
> output ..but it was trying to use the megaraid driver.

That's no good. Thanks for reporting it.

[...]
> I have a working wheezy installation so I can give you any type of
> diagnostic information needed.

Great, let's start with that. Please attach output from
"reportbug --template linux-image-$(uname -r)" on the working
installation.

Hope that helps,
Jonathan
 
Old 03-28-2012, 09:38 PM
Jonathan Nieder
 
Default Bug#666108: Dell PERC H710P is not supported by Squeeze Standard Kernel

Buford Peek wrote:

> This is standard Wheezy running on next generation Dell R620.
> running 3.2.X kernel.

Thanks. Can you get the error message from squeeze, using
netconsole[1], a serial console[2], or a photograph of the screen?

[1] http://www.kernel.org/doc/Documentation/networking/netconsole.txt
[2] http://www.kernel.org/doc/Documentation/serial-console.txt



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120328213842.GI8982@burratino">http://lists.debian.org/20120328213842.GI8982@burratino


Thu Mar 29 01:30:01 2012
Return-path: <advisory-board-bounces@lists.fedoraproject.org>
Envelope-to: tom@linux-archive.org
Delivery-date: Thu, 29 Mar 2012 00:42:28 +0300
Received: from bastion01.fedoraproject.org ([209.132.181.2]:49224 helo=bastion.fedoraproject.org)
by s2.java-tips.org with esmtp (Exim 4.69)
(envelope-from <advisory-board-bounces@lists.fedoraproject.org>)
id 1SD0dQ-0006d5-5t
for tom@linux-archive.org; Thu, 29 Mar 2012 00:42:28 +0300
Received: from lists.fedoraproject.org (collab03.vpn.fedoraproject.org [192.168.1.70])
by bastion01.phx2.fedoraproject.org (Postfix) with ESMTP id BD5A020ED5;
Wed, 28 Mar 2012 21:42:34 +0000 (UTC)
Received: from collab03.fedoraproject.org (localhost [127.0.0.1])
by lists.fedoraproject.org (Postfix) with ESMTP id 2FEBC40A53;
Wed, 28 Mar 2012 21:42:33 +0000 (UTC)
X-Original-To: advisory-board@lists.fedoraproject.org
Delivered-To: advisory-board@lists.fedoraproject.org
Received: from smtp-mm03.fedoraproject.org (vm4.fedora.ibiblio.org
[152.19.134.143])
by lists.fedoraproject.org (Postfix) with ESMTP id 3CBFE40A53
for <advisory-board@lists.fedoraproject.org>;
Wed, 28 Mar 2012 21:35:55 +0000 (UTC)
Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51])
by smtp-mm03.fedoraproject.org (Postfix) with ESMTP id 727D6403F0
for <advisory-board@lists.fedoraproject.org>;
Wed, 28 Mar 2012 21:35:55 +0000 (UTC)
Received: by wgbed3 with SMTP id ed3so1051800wgb.20
for <advisory-board@lists.fedoraproject.org>;
Wed, 28 Mar 2012 14:35:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=message-id:date:from:user-agent:mime-version:to:subject:references
:in-reply-to:content-type:content-transfer-encoding;
bh=ojxSHaoszWe57ONJuAN5DGnKbHOkfCZl3bCk4gXkpnw=;
b=yGk1F6gbpAgvqriNwOoMx42r9M8FQ0/3FpHPO7pL/ce8JXYghzPvct5kGN4zF+btKn
Np0ChsgGa692gMAMmuUoFovCKGWoNrqZeW6fhvcSkpdkDyAxXD Ms4XbkR63fkPs15/7x
wDmr4AC+7O4XpQzJj8e/IXOUQBB1DLfqniymaxn8IynxLemxwuoPE0IeGx68CGEwMMZw
lSHNqytgoAA90wZxoFKU+imeUdztGvkDTjx9voE7Uy6yoQXaX1 pGTkRgThv5aZ5xpLbF
3KcIbVHIhvCHVU7IYBdp/GmBfADNGdheHPmFFXLzJZxkjQClQPuVplRNGNGnr7em9nB9
QNUg==
Received: by 10.180.88.67 with SMTP id be3mr1502494wib.20.1332970553920;
Wed, 28 Mar 2012 14:35:53 -0700 (PDT)
Received: from localhost.localdomain (85-220-55-128.dsl.dynamic.simnet.is.
[85.220.55.128])
by mx.google.com with ESMTPS id fz9sm61192470wib.3.2012.03.28.14.35.52
(version=SSLv3 cipher=OTHER); Wed, 28 Mar 2012 14:35:53 -0700 (PDT)
Message-ID: <4F7383D6.4030000@gmail.com>
Date: Wed, 28 Mar 2012 21:34:14 +0000
From: =?UTF-8?B?IkrDs2hhbm4gQi4gR3XDsG11bmRzc29uIg==?=
<johannbg@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
rv:11.0) Gecko/20120316 Thunderbird/11.0
MIME-Version: 1.0
To: advisory-board@lists.fedoraproject.org
Subject: Re: board followup to "Connotation analysis for Fedora Project
codename"
References: <4F737E24.105@math.unl.edu>
<CA+5PVA5-pEDc88BF=b_hV7mtwCGAqq6A2gYoEM-zped71stO4A@mail.gmail.com>
In-Reply-To: <CA+5PVA5-pEDc88BF=b_hV7mtwCGAqq6A2gYoEM-zped71stO4A@mail.gmail.com>
X-BeenThere: advisory-board@lists.fedoraproject.org
X-Mailman-Version: 2.1.12
Precedence: list
Reply-To: Fedora community advisory board
<advisory-board@lists.fedoraproject.org>
List-Id: Fedora community advisory board
<advisory-board.lists.fedoraproject.org>
List-Unsubscribe: <https://admin.fedoraproject.org/mailman/options/advisory-board>,
<mailto:advisory-board-request@lists.fedoraproject.org?subject=unsubscrib e>
List-Archive: <http://lists.fedoraproject.org/pipermail/advisory-board/>
List-Post: <mailto:advisory-board@lists.fedoraproject.org>
List-Help: <mailto:advisory-board-request@lists.fedoraproject.org?subject=help>
List-Subscribe: <https://admin.fedoraproject.org/mailman/listinfo/advisory-board>,
<mailto:advisory-board-request@lists.fedoraproject.org?subject=subscribe>
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: advisory-board-bounces@lists.fedoraproject.org
Errors-To: advisory-board-bounces@lists.fedoraproject.org

T24gMDMvMjgvMjAxMiAwOToxNyBQTSwgSm9zaCBCb3llciB3cm 90ZToKPiBXaHkgYXQgdGhlIHNh
bWUgdGltZSBhcyBsZWdhbCByZXZpZXc/ICBJZiB0aGUgQm9hcmQvY29tbXVuaXR5IGlzIGdvaW5n
Cj4gdG8gZGlzYWxsb3cgYSBuYW1lIGR1ZSB0byBjb25ub3RhdG lvbiwgdGhlbiBpdCdzIGEgd2Fz
dGUgb2YgcmVzb3VyY2VzCj4gKGJvdGggaHVtYW4gYW5kIGZpbm FuY2lhbCkgdG8gaGF2ZSBsYXd5
ZXJzIHZldHRpbmcgdGhhdCBuYW1lLgoKQWdyZWVkCgorIEkgZm VlbCB0aGlzIGRlY2lzaW9uIGlz
IGp1c3Qgc29tZXRoaW5nIHRoZSBib2FyZCBzaG91bGQganVzdC BkZWNpZGUgCnVwb24gc2luY2Ug
aWYgeW91IHB1dCBhc2lkZSBwZW9wbGVzIHBlcnNvbmFsIHByZW ZlcmVuY2UgYW5kIGJlbGlldmVz
IApkb2VzIHRoZSBnYWluIGZyb20gaGF2aW5nIGNvZGVuYW1lcy BqdXN0aWZ5IHRoZSBwcm9qZWN0
cyByZXNvdXJjZXMgdGhhdCAKYXJlIHB1dCBpbnRvIGl0Li4uCg pKQkcKX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYWR2aX NvcnktYm9hcmQgbWFpbGluZyBs
aXN0CmFkdmlzb3J5LWJvYXJkQGxpc3RzLmZlZG9yYXByb2plY3 Qub3JnCmh0dHBzOi8vYWRtaW4u
ZmVkb3JhcHJvamVjdC5vcmcvbWFpbG1hbi9saXN0aW5mby9hZH Zpc29yeS1ib2FyZA==
 
Old 03-29-2012, 04:58 PM
Jonathan Nieder
 
Default Bug#666108: Dell PERC H710P is not supported by Squeeze Standard Kernel

Buford Peek wrote:

> This is a wheezy OS install running a squeeze kernel (2.6.32-41)..It
> tries to boot up but cannot find a disk and drops me into the
> (initramfs) shell. I am still at the shell so if you need any
> additional information, just ask.

Sure. Can you get output from the following commands?

ls -l /dev/sd*
cat /proc/modules
dmesg | grep mega

Thanks,
Jonathan



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120329165806.GC3147@burratino">http://lists.debian.org/20120329165806.GC3147@burratino
 
Old 03-29-2012, 05:40 PM
Buford Peek
 
Default Bug#666108: Dell PERC H710P is not supported by Squeeze Standard Kernel

ls -l /dev/sd* returned nothing
dmesg | grep mega returned nothing...


I have attached the complete dmesg output and content of the /proc/modules file

NOTE: I had to mount a thumbdrive after I ran these commands so I could copy my output onto a thumbdrive ..so you might see in the dmesg output it attached the thumbdrive to /dev/sda.

-Buford



________________________________________
From: Jonathan Nieder [jrnieder@gmail.com]
Sent: Thursday, March 29, 2012 12:58 PM
To: Buford Peek
Cc: 666108@bugs.debian.org
Subject: Re: Dell PERC H710P is not supported by Squeeze Standard Kernel

Buford Peek wrote:

> This is a wheezy OS install running a squeeze kernel (2.6.32-41)..It
> tries to boot up but cannot find a disk and drops me into the
> (initramfs) shell. I am still at the shell so if you need any
> additional information, just ask.

Sure. Can you get output from the following commands?

ls -l /dev/sd*
cat /proc/modules
dmesg | grep mega

Thanks,
Jonathan
 
Old 03-29-2012, 07:47 PM
Jonathan Nieder
 
Default Bug#666108: Dell PERC H710P is not supported by Squeeze Standard Kernel

block 624794 by 666108
tags 666108 + upstream patch moreinfo
# hardware support
severity 666108 important
quit

Buford Peek wrote:

> dmesg | grep mega returned nothing...

Thanks. Support for this controller was added during the 2.6.38-rc1
merge window (commit 9c915a8c99bc, "[SCSI] megaraid_sas: Add 9565/9285
specific code", 2010-12-21).

Could you try the attached patch series against the squeeze kernel?
Instructions are at [1], and if you have any questions, please don't
hesitate to ask.

Hope that helps,
Jonathan

[1] http://kernel-handbook.alioth.debian.org/ch-common-tasks.html#s-common-official
or the corresponding page in the debian-kernel-handbook package

Adam Radford (5):
[SCSI] megaraid_sas: Rename megaraid_sas.c to megaraid_sas_base.c
[SCSI] megaraid_sas: Add MSI-X support and msix_disable module parameter
[SCSI] megaraid_sas: Use lowest memory bar for SR-IOV VF support
[SCSI] megaraid_sas: Add struct megasas_instance_template changes
[SCSI] megaraid_sas: Add 9565/9285 specific code

Noriyuki Fujii (1):
[SCSI] megaraid_sas: make driver PCI legacy I/O port free driver

Yang, Bo (6):
[SCSI] megaraid_sas: infrastructure to get PDs from FW
[SCSI] megaraid_sas: Add the support for updating the OS after adding/
removing the devices from FW
[SCSI] megaraid_sas: add the logical drive list to driver
[SCSI] megaraid_sas: driver fixed the device update issue
[SCSI] megaraid_sas: add the IEEE SGE support to SAS2 controller
[SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive

drivers/scsi/megaraid/Makefile | 2 +
drivers/scsi/megaraid/megaraid_sas.c | 3827 -------------------
drivers/scsi/megaraid/megaraid_sas.h | 273 +-
drivers/scsi/megaraid/megaraid_sas_base.c | 5253 +++++++++++++++++++++++++++
drivers/scsi/megaraid/megaraid_sas_fp.c | 516 +++
drivers/scsi/megaraid/megaraid_sas_fusion.c | 2248 ++++++++++++
drivers/scsi/megaraid/megaraid_sas_fusion.h | 695 ++++
7 files changed, 8974 insertions(+), 3840 deletions(-)
delete mode 100644 drivers/scsi/megaraid/megaraid_sas.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_base.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fp.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fusion.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fusion.h
From: "Yang, Bo" <Bo.Yang@lsi.com>
Date: Tue, 6 Oct 2009 14:27:54 -0600
Subject: [SCSI] megaraid_sas: infrastructure to get PDs from FW

commit 81e403ce3c6a34cd705bf54d4cdeefdeb7068a8d upstream.

Add system PDs to OS. Driver implemented the get_pd_list function to
get the system PD from FW.

Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
drivers/scsi/megaraid/megaraid_sas.c | 96 ++++++++++++++++++++++++++++++++++
drivers/scsi/megaraid/megaraid_sas.h | 88 ++++++++++++++++++++++++++++++-
2 files changed, 182 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 28b27ce1a914..38abd98a1ffb 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -2057,6 +2057,98 @@ static int megasas_alloc_cmds(struct megasas_instance *instance)
return 0;
}

+/*
+ * megasas_get_pd_list_info - Returns FW's pd_list structure
+ * @instance: Adapter soft state
+ * @pd_list: pd_list structure
+ *
+ * Issues an internal command (DCMD) to get the FW's controller PD
+ * list structure. This information is mainly used to find out SYSTEM
+ * supported by the FW.
+ */
+static int
+megasas_get_pd_list(struct megasas_instance *instance)
+{
+ int ret = 0, pd_index = 0;
+ struct megasas_cmd *cmd;
+ struct megasas_dcmd_frame *dcmd;
+ struct MR_PD_LIST *ci;
+ struct MR_PD_ADDRESS *pd_addr;
+ dma_addr_t ci_h = 0;
+
+ cmd = megasas_get_cmd(instance);
+
+ if (!cmd) {
+ printk(KERN_DEBUG "megasas (get_pd_list): Failed to get cmd
");
+ return -ENOMEM;
+ }
+
+ dcmd = &cmd->frame->dcmd;
+
+ ci = pci_alloc_consistent(instance->pdev,
+ MEGASAS_MAX_PD * sizeof(struct MR_PD_LIST), &ci_h);
+
+ if (!ci) {
+ printk(KERN_DEBUG "Failed to alloc mem for pd_list
");
+ megasas_return_cmd(instance, cmd);
+ return -ENOMEM;
+ }
+
+ memset(ci, 0, sizeof(*ci));
+ memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE);
+
+ dcmd->mbox.b[0] = MR_PD_QUERY_TYPE_EXPOSED_TO_HOST;
+ dcmd->mbox.b[1] = 0;
+ dcmd->cmd = MFI_CMD_DCMD;
+ dcmd->cmd_status = 0xFF;
+ dcmd->sge_count = 1;
+ dcmd->flags = MFI_FRAME_DIR_READ;
+ dcmd->timeout = 0;
+ dcmd->data_xfer_len = MEGASAS_MAX_PD * sizeof(struct MR_PD_LIST);
+ dcmd->opcode = MR_DCMD_PD_LIST_QUERY;
+ dcmd->sgl.sge32[0].phys_addr = ci_h;
+ dcmd->sgl.sge32[0].length = MEGASAS_MAX_PD * sizeof(struct MR_PD_LIST);
+
+ if (!megasas_issue_polled(instance, cmd)) {
+ ret = 0;
+ } else {
+ ret = -1;
+ }
+
+ /*
+ * the following function will get the instance PD LIST.
+ */
+
+ pd_addr = ci->addr;
+
+ if ( ret == 0 &&
+ (ci->count <
+ (MEGASAS_MAX_PD_CHANNELS * MEGASAS_MAX_DEV_PER_CHANNEL))) {
+
+ memset(instance->pd_list, 0,
+ MEGASAS_MAX_PD * sizeof(struct megasas_pd_list));
+
+ for (pd_index = 0; pd_index < ci->count; pd_index++) {
+
+ instance->pd_list[pd_addr->deviceId].tid =
+ pd_addr->deviceId;
+ instance->pd_list[pd_addr->deviceId].driveType =
+ pd_addr->scsiDevType;
+ instance->pd_list[pd_addr->deviceId].driveState =
+ MR_PD_STATE_SYSTEM;
+ pd_addr++;
+ }
+ }
+
+ pci_free_consistent(instance->pdev,
+ MEGASAS_MAX_PD * sizeof(struct MR_PD_LIST),
+ ci, ci_h);
+ megasas_return_cmd(instance, cmd);
+
+ return ret;
+}
+
+
/**
* megasas_get_controller_info - Returns FW's controller structure
* @instance: Adapter soft state
@@ -2347,6 +2439,10 @@ static int megasas_init_mfi(struct megasas_instance *instance)
if (megasas_issue_init_mfi(instance))
goto fail_fw_init;

+ memset(instance->pd_list, 0 ,
+ (MEGASAS_MAX_PD * sizeof(struct megasas_pd_list)));
+ megasas_get_pd_list(instance);
+
ctrl_info = kmalloc(sizeof(struct megasas_ctrl_info), GFP_KERNEL);

/*
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 3b1eed1bbbe0..dc88ea79b0db 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -133,6 +133,7 @@
#define MR_DCMD_CLUSTER 0x08000000
#define MR_DCMD_CLUSTER_RESET_ALL 0x08010100
#define MR_DCMD_CLUSTER_RESET_LD 0x08010200
+#define MR_DCMD_PD_LIST_QUERY 0x02010100

/*
* MFI command completion codes
@@ -253,9 +254,89 @@ enum MR_EVT_ARGS {
MR_EVT_ARGS_STR,
MR_EVT_ARGS_TIME,
MR_EVT_ARGS_ECC,
+ MR_EVT_ARGS_LD_PROP,
+ MR_EVT_ARGS_PD_SPARE,
+ MR_EVT_ARGS_PD_INDEX,
+ MR_EVT_ARGS_DIAG_PASS,
+ MR_EVT_ARGS_DIAG_FAIL,
+ MR_EVT_ARGS_PD_LBA_LBA,
+ MR_EVT_ARGS_PORT_PHY,
+ MR_EVT_ARGS_PD_MISSING,
+ MR_EVT_ARGS_PD_ADDRESS,
+ MR_EVT_ARGS_BITMAP,
+ MR_EVT_ARGS_CONNECTOR,
+ MR_EVT_ARGS_PD_PD,
+ MR_EVT_ARGS_PD_FRU,
+ MR_EVT_ARGS_PD_PATHINFO,
+ MR_EVT_ARGS_PD_POWER_STATE,
+ MR_EVT_ARGS_GENERIC,
+};

+/*
+ * define constants for device list query options
+ */
+enum MR_PD_QUERY_TYPE {
+ MR_PD_QUERY_TYPE_ALL = 0,
+ MR_PD_QUERY_TYPE_STATE = 1,
+ MR_PD_QUERY_TYPE_POWER_STATE = 2,
+ MR_PD_QUERY_TYPE_MEDIA_TYPE = 3,
+ MR_PD_QUERY_TYPE_SPEED = 4,
+ MR_PD_QUERY_TYPE_EXPOSED_TO_HOST = 5,
};

+enum MR_PD_STATE {
+ MR_PD_STATE_UNCONFIGURED_GOOD = 0x00,
+ MR_PD_STATE_UNCONFIGURED_BAD = 0x01,
+ MR_PD_STATE_HOT_SPARE = 0x02,
+ MR_PD_STATE_OFFLINE = 0x10,
+ MR_PD_STATE_FAILED = 0x11,
+ MR_PD_STATE_REBUILD = 0x14,
+ MR_PD_STATE_ONLINE = 0x18,
+ MR_PD_STATE_COPYBACK = 0x20,
+ MR_PD_STATE_SYSTEM = 0x40,
+ };
+
+
+ /*
+ * defines the physical drive address structure
+ */
+struct MR_PD_ADDRESS {
+ u16 deviceId;
+ u16 enclDeviceId;
+
+ union {
+ struct {
+ u8 enclIndex;
+ u8 slotNumber;
+ } mrPdAddress;
+ struct {
+ u8 enclPosition;
+ u8 enclConnectorIndex;
+ } mrEnclAddress;
+ };
+ u8 scsiDevType;
+ union {
+ u8 connectedPortBitmap;
+ u8 connectedPortNumbers;
+ };
+ u64 sasAddr[2];
+} __packed;
+
+/*
+ * defines the physical drive list structure
+ */
+struct MR_PD_LIST {
+ u32 size;
+ u32 count;
+ struct MR_PD_ADDRESS addr[1];
+} __packed;
+
+struct megasas_pd_list {
+ u16 tid;
+ u8 driveType;
+ u8 driveState;
+} __packed;
+
/*
* SAS controller properties
*/
@@ -284,7 +365,7 @@ struct megasas_ctrl_prop {
u8 expose_encl_devices;
u8 reserved[38];

-} __attribute__ ((packed));
+} __packed;

/*
* SAS controller information
@@ -527,7 +608,7 @@ struct megasas_ctrl_info {

u8 pad[0x800 - 0x6a0];

-} __attribute__ ((packed));
+} __packed;

/*
* ===============================
@@ -542,6 +623,8 @@ struct megasas_ctrl_info {
#define MEGASAS_DEFAULT_INIT_ID -1
#define MEGASAS_MAX_LUN 8
#define MEGASAS_MAX_LD 64
+#define MEGASAS_MAX_PD (MEGASAS_MAX_PD_CHANNELS *
+ MEGASAS_MAX_DEV_PER_CHANNEL)

#define MEGASAS_DBG_LVL 1

@@ -1079,6 +1162,7 @@ struct megasas_instance {
unsigned long base_addr;
struct megasas_register_set __iomem *reg_set;

+ struct megasas_pd_list pd_list[MEGASAS_MAX_PD];
s8 init_id;

u16 max_num_sge;
--
1.7.10.rc1

From: "Yang, Bo" <Bo.Yang@lsi.com>
Date: Tue, 6 Oct 2009 14:50:17 -0600
Subject: [SCSI] megaraid_sas: Add the support for updating the OS after adding/removing the devices from FW

commit 7e8a75f4dfbff173977b2f58799c3eceb7b09afd upstream.

Driver will update the OS devices after adding and deleting the device
from FW. When driver receive add or delete AEN from FW, driver will
send the DCMD cmd to get the System PD list from FW. Then driver will
check if this device already in the OS: If add event and OS don't have
the device (but it is in the list), driver add the device to OS,
otherwise driver will not add. If remove event, driver will check the
list, if is not in the list, but OS have the device, driver will
remove the device.

Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
drivers/scsi/megaraid/megaraid_sas.c | 125 +++++++++++++++++++++++++++++++++-
drivers/scsi/megaraid/megaraid_sas.h | 17 +++++
2 files changed, 141 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 38abd98a1ffb..b690c8ca75cc 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -1402,6 +1402,8 @@ megasas_bios_param(struct scsi_device *sdev, struct block_device *bdev,
return 0;
}

+static void megasas_aen_polling(struct work_struct *work);
+
/**
* megasas_service_aen - Processes an event notification
* @instance: Adapter soft state
@@ -1433,6 +1435,20 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd)

instance->aen_cmd = NULL;
megasas_return_cmd(instance, cmd);
+
+ if (instance->unload == 0) {
+ struct megasas_aen_event *ev;
+ ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
+ if (!ev) {
+ printk(KERN_ERR "megasas_service_aen: out of memory
");
+ } else {
+ ev->instance = instance;
+ instance->ev = ev;
+ INIT_WORK(&ev->hotplug_work, megasas_aen_polling);
+ schedule_delayed_work(
+ (struct delayed_work *)&ev->hotplug_work, 0);
+ }
+ }
}

/*
@@ -1952,6 +1968,7 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
}

cmd->frame->io.context = cmd->index;
+ cmd->frame->io.pad_0 = 0;
}

return 0;
@@ -2148,7 +2165,6 @@ megasas_get_pd_list(struct megasas_instance *instance)
return ret;
}

-
/**
* megasas_get_controller_info - Returns FW's controller structure
* @instance: Adapter soft state
@@ -2857,6 +2873,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
*instance->producer = 0;
*instance->consumer = 0;
megasas_poll_wait_aen = 0;
+ instance->ev = NULL;

instance->evt_detail = pci_alloc_consistent(pdev,
sizeof(struct
@@ -3079,6 +3096,16 @@ megasas_suspend(struct pci_dev *pdev, pm_message_t state)

megasas_flush_cache(instance);
megasas_shutdown_controller(instance, MR_DCMD_HIBERNATE_SHUTDOWN);
+
+ /* cancel the delayed work if this work still in queue */
+ if (instance->ev != NULL) {
+ struct megasas_aen_event *ev = instance->ev;
+ cancel_delayed_work(
+ (struct delayed_work *)&ev->hotplug_work);
+ flush_scheduled_work();
+ instance->ev = NULL;
+ }
+
tasklet_kill(&instance->isr_tasklet);

pci_set_drvdata(instance->pdev, instance);
@@ -3219,6 +3246,16 @@ static void __devexit megasas_detach_one(struct pci_dev *pdev)
scsi_remove_host(instance->host);
megasas_flush_cache(instance);
megasas_shutdown_controller(instance, MR_DCMD_CTRL_SHUTDOWN);
+
+ /* cancel the delayed work if this work still in queue*/
+ if (instance->ev != NULL) {
+ struct megasas_aen_event *ev = instance->ev;
+ cancel_delayed_work(
+ (struct delayed_work *)&ev->hotplug_work);
+ flush_scheduled_work();
+ instance->ev = NULL;
+ }
+
tasklet_kill(&instance->isr_tasklet);

/*
@@ -3814,6 +3851,92 @@ out:
return retval;
}

+static void
+megasas_aen_polling(struct work_struct *work)
+{
+ struct megasas_aen_event *ev =
+ container_of(work, struct megasas_aen_event, hotplug_work);
+ struct megasas_instance *instance = ev->instance;
+ union megasas_evt_class_locale class_locale;
+ struct Scsi_Host *host;
+ struct scsi_device *sdev1;
+ u16 pd_index = 0;
+ int i, j, doscan = 0;
+ u32 seq_num;
+ int error;
+
+ if (!instance) {
+ printk(KERN_ERR "invalid instance!
");
+ kfree(ev);
+ return;
+ }
+ instance->ev = NULL;
+ host = instance->host;
+ if (instance->evt_detail) {
+
+ switch (instance->evt_detail->code) {
+ case MR_EVT_PD_INSERTED:
+ case MR_EVT_PD_REMOVED:
+ case MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED:
+ doscan = 1;
+ break;
+ default:
+ doscan = 0;
+ break;
+ }
+ } else {
+ printk(KERN_ERR "invalid evt_detail!
");
+ kfree(ev);
+ return;
+ }
+
+ if (doscan) {
+ printk(KERN_INFO "scanning ...
");
+ megasas_get_pd_list(instance);
+ for (i = 0; i < MEGASAS_MAX_PD_CHANNELS; i++) {
+ for (j = 0; j < MEGASAS_MAX_DEV_PER_CHANNEL; j++) {
+ pd_index = i*MEGASAS_MAX_DEV_PER_CHANNEL + j;
+ sdev1 = scsi_device_lookup(host, i, j, 0);
+ if (instance->pd_list[pd_index].driveState ==
+ MR_PD_STATE_SYSTEM) {
+ if (!sdev1) {
+ scsi_add_device(host, i, j, 0);
+ }
+ if (sdev1)
+ scsi_device_put(sdev1);
+ } else {
+ if (sdev1) {
+ scsi_remove_device(sdev1);
+ scsi_device_put(sdev1);
+ }
+ }
+ }
+ }
+ }
+
+ if ( instance->aen_cmd != NULL ) {
+ kfree(ev);
+ return ;
+ }
+
+ seq_num = instance->evt_detail->seq_num + 1;
+
+ /* Register AEN with FW for latest sequence number plus 1 */
+ class_locale.members.reserved = 0;
+ class_locale.members.locale = MR_EVT_LOCALE_ALL;
+ class_locale.members.class = MR_EVT_CLASS_DEBUG;
+ mutex_lock(&instance->aen_mutex);
+ error = megasas_register_aen(instance, seq_num,
+ class_locale.word);
+ mutex_unlock(&instance->aen_mutex);
+
+ if (error)
+ printk(KERN_ERR "register aen failed error %x
", error);
+
+ kfree(ev);
+}
+
+
static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUSR,
megasas_sysfs_show_poll_mode_io,
megasas_sysfs_set_poll_mode_io);
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index dc88ea79b0db..b0a85fc72d8d 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -284,6 +284,17 @@ enum MR_PD_QUERY_TYPE {
MR_PD_QUERY_TYPE_EXPOSED_TO_HOST = 5,
};

+#define MR_EVT_CFG_CLEARED 0x0004
+#define MR_EVT_LD_STATE_CHANGE 0x0051
+#define MR_EVT_PD_INSERTED 0x005b
+#define MR_EVT_PD_REMOVED 0x0070
+#define MR_EVT_LD_CREATED 0x008a
+#define MR_EVT_LD_DELETED 0x008b
+#define MR_EVT_FOREIGN_CFG_IMPORTED 0x00db
+#define MR_EVT_LD_OFFLINE 0x00fc
+#define MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED 0x0152
+#define MAX_LOGICAL_DRIVES 64
+
enum MR_PD_STATE {
MR_PD_STATE_UNCONFIGURED_GOOD = 0x00,
MR_PD_STATE_UNCONFIGURED_BAD = 0x01,
@@ -1149,6 +1160,11 @@ struct megasas_evt_detail {

} __attribute__ ((packed));

+struct megasas_aen_event {
+ struct work_struct hotplug_work;
+ struct megasas_instance *instance;
+};
+
struct megasas_instance {

u32 *producer;
@@ -1168,6 +1184,7 @@ struct megasas_instance {
u16 max_num_sge;
u16 max_fw_cmds;
u32 max_sectors_per_req;
+ struct megasas_aen_event *ev;

struct megasas_cmd **cmd_list;
struct list_head cmd_pool;
--
1.7.10.rc1

From: "Yang, Bo" <Bo.Yang@lsi.com>
Date: Sun, 6 Dec 2009 08:30:19 -0700
Subject: [SCSI] megaraid_sas: add the logical drive list to driver

commit bdc6fb8d69fab7b4b7f70823e3932bd8e4cfd7db upstream.

Driver issue the get ld list to fw to get the logic drive list.
Driver will keep the logic drive list for the internal use after
driver load.

Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
drivers/scsi/megaraid/megaraid_sas.c | 95 ++++++++++++++++++++++++++++++++++
drivers/scsi/megaraid/megaraid_sas.h | 30 +++++++++++
2 files changed, 125 insertions(+)

diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index b690c8ca75cc..3a35e27e1ab8 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -817,6 +817,12 @@ megasas_build_dcdb(struct megasas_instance *instance, struct scsi_cmnd *scp,
pthru->sge_count = megasas_make_sgl32(instance, scp,
&pthru->sgl);

+ if (pthru->sge_count > instance->max_num_sge) {
+ printk(KERN_ERR "megasas: DCDB two many SGE NUM=%x
",
+ pthru->sge_count);
+ return 0;
+ }
+
/*
* Sense info specific
*/
@@ -935,6 +941,12 @@ megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp,
} else
ldio->sge_count = megasas_make_sgl32(instance, scp, &ldio->sgl);

+ if (ldio->sge_count > instance->max_num_sge) {
+ printk(KERN_ERR "megasas: build_ld_io: sge_count = %x
",
+ ldio->sge_count);
+ return 0;
+ }
+
/*
* Sense info specific
*/
@@ -2165,6 +2177,86 @@ megasas_get_pd_list(struct megasas_instance *instance)
return ret;
}

+/*
+ * megasas_get_ld_list_info - Returns FW's ld_list structure
+ * @instance: Adapter soft state
+ * @ld_list: ld_list structure
+ *
+ * Issues an internal command (DCMD) to get the FW's controller PD
+ * list structure. This information is mainly used to find out SYSTEM
+ * supported by the FW.
+ */
+static int
+megasas_get_ld_list(struct megasas_instance *instance)
+{
+ int ret = 0, ld_index = 0, ids = 0;
+ struct megasas_cmd *cmd;
+ struct megasas_dcmd_frame *dcmd;
+ struct MR_LD_LIST *ci;
+ dma_addr_t ci_h = 0;
+
+ cmd = megasas_get_cmd(instance);
+
+ if (!cmd) {
+ printk(KERN_DEBUG "megasas_get_ld_list: Failed to get cmd
");
+ return -ENOMEM;
+ }
+
+ dcmd = &cmd->frame->dcmd;
+
+ ci = pci_alloc_consistent(instance->pdev,
+ sizeof(struct MR_LD_LIST),
+ &ci_h);
+
+ if (!ci) {
+ printk(KERN_DEBUG "Failed to alloc mem in get_ld_list
");
+ megasas_return_cmd(instance, cmd);
+ return -ENOMEM;
+ }
+
+ memset(ci, 0, sizeof(*ci));
+ memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE);
+
+ dcmd->cmd = MFI_CMD_DCMD;
+ dcmd->cmd_status = 0xFF;
+ dcmd->sge_count = 1;
+ dcmd->flags = MFI_FRAME_DIR_READ;
+ dcmd->timeout = 0;
+ dcmd->data_xfer_len = sizeof(struct MR_LD_LIST);
+ dcmd->opcode = MR_DCMD_LD_GET_LIST;
+ dcmd->sgl.sge32[0].phys_addr = ci_h;
+ dcmd->sgl.sge32[0].length = sizeof(struct MR_LD_LIST);
+ dcmd->pad_0 = 0;
+
+ if (!megasas_issue_polled(instance, cmd)) {
+ ret = 0;
+ } else {
+ ret = -1;
+ }
+
+ /* the following function will get the instance PD LIST */
+
+ if ((ret == 0) && (ci->ldCount < MAX_LOGICAL_DRIVES)) {
+ memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS);
+
+ for (ld_index = 0; ld_index < ci->ldCount; ld_index++) {
+ if (ci->ldList[ld_index].state != 0) {
+ ids = ci->ldList[ld_index].ref.targetId;
+ instance->ld_ids[ids] =
+ ci->ldList[ld_index].ref.targetId;
+ }
+ }
+ }
+
+ pci_free_consistent(instance->pdev,
+ sizeof(struct MR_LD_LIST),
+ ci,
+ ci_h);
+
+ megasas_return_cmd(instance, cmd);
+ return ret;
+}
+
/**
* megasas_get_controller_info - Returns FW's controller structure
* @instance: Adapter soft state
@@ -2459,6 +2551,9 @@ static int megasas_init_mfi(struct megasas_instance *instance)
(MEGASAS_MAX_PD * sizeof(struct megasas_pd_list)));
megasas_get_pd_list(instance);

+ memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS);
+ megasas_get_ld_list(instance);
+
ctrl_info = kmalloc(sizeof(struct megasas_ctrl_info), GFP_KERNEL);

/*
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index b0a85fc72d8d..29cd2c877952 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -116,6 +116,7 @@
#define MFI_CMD_STP 0x08

#define MR_DCMD_CTRL_GET_INFO 0x01010000
+#define MR_DCMD_LD_GET_LIST 0x03010000

#define MR_DCMD_CTRL_CACHE_FLUSH 0x01101000
#define MR_FLUSH_CTRL_CACHE 0x01
@@ -348,6 +349,32 @@ struct megasas_pd_list {
u8 driveState;
} __packed;

+ /*
+ * defines the logical drive reference structure
+ */
+union MR_LD_REF {
+ struct {
+ u8 targetId;
+ u8 reserved;
+ u16 seqNum;
+ };
+ u32 ref;
+} __packed;
+
+/*
+ * defines the logical drive list structure
+ */
+struct MR_LD_LIST {
+ u32 ldCount;
+ u32 reserved;
+ struct {
+ union MR_LD_REF ref;
+ u8 state;
+ u8 reserved[3];
+ u64 size;
+ } ldList[MAX_LOGICAL_DRIVES];
+} __packed;
+
/*
* SAS controller properties
*/
@@ -636,6 +663,8 @@ struct megasas_ctrl_info {
#define MEGASAS_MAX_LD 64
#define MEGASAS_MAX_PD (MEGASAS_MAX_PD_CHANNELS *
MEGASAS_MAX_DEV_PER_CHANNEL)
+#define MEGASAS_MAX_LD_IDS (MEGASAS_MAX_LD_CHANNELS *
+ MEGASAS_MAX_DEV_PER_CHANNEL)

#define MEGASAS_DBG_LVL 1

@@ -1179,6 +1208,7 @@ struct megasas_instance {
struct megasas_register_set __iomem *reg_set;

struct megasas_pd_list pd_list[MEGASAS_MAX_PD];
+ u8 ld_ids[MEGASAS_MAX_LD_IDS];
s8 init_id;

u16 max_num_sge;
--
1.7.10.rc1

From: "Yang, Bo" <Bo.Yang@lsi.com>
Date: Sun, 6 Dec 2009 08:39:25 -0700
Subject: [SCSI] megaraid_sas: driver fixed the device update issue

commit c978684254d11e3768c5a0b2780302fb0cada29c upstream.

driver fixed the device update issue after get the AEN PD delete/ADD
and LD add/delete from FW.

Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
drivers/scsi/megaraid/megaraid_sas.c | 142 ++++++++++++++++++++++++++++++++++
1 file changed, 142 insertions(+)

diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 3a35e27e1ab8..c7e1e40ad24a 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -3956,6 +3956,7 @@ megasas_aen_polling(struct work_struct *work)
struct Scsi_Host *host;
struct scsi_device *sdev1;
u16 pd_index = 0;
+ u16 ld_index = 0;
int i, j, doscan = 0;
u32 seq_num;
int error;
@@ -3971,8 +3972,124 @@ megasas_aen_polling(struct work_struct *work)

switch (instance->evt_detail->code) {
case MR_EVT_PD_INSERTED:
+ if (megasas_get_pd_list(instance) == 0) {
+ for (i = 0; i < MEGASAS_MAX_PD_CHANNELS; i++) {
+ for (j = 0;
+ j < MEGASAS_MAX_DEV_PER_CHANNEL;
+ j++) {
+
+ pd_index =
+ (i * MEGASAS_MAX_DEV_PER_CHANNEL) + j;
+
+ sdev1 =
+ scsi_device_lookup(host, i, j, 0);
+
+ if (instance->pd_list[pd_index].driveState
+ == MR_PD_STATE_SYSTEM) {
+ if (!sdev1) {
+ scsi_add_device(host, i, j, 0);
+ }
+
+ if (sdev1)
+ scsi_device_put(sdev1);
+ }
+ }
+ }
+ }
+ doscan = 0;
+ break;
+
case MR_EVT_PD_REMOVED:
+ if (megasas_get_pd_list(instance) == 0) {
+ megasas_get_pd_list(instance);
+ for (i = 0; i < MEGASAS_MAX_PD_CHANNELS; i++) {
+ for (j = 0;
+ j < MEGASAS_MAX_DEV_PER_CHANNEL;
+ j++) {
+
+ pd_index =
+ (i * MEGASAS_MAX_DEV_PER_CHANNEL) + j;
+
+ sdev1 =
+ scsi_device_lookup(host, i, j, 0);
+
+ if (instance->pd_list[pd_index].driveState
+ == MR_PD_STATE_SYSTEM) {
+ if (sdev1) {
+ scsi_device_put(sdev1);
+ }
+ } else {
+ if (sdev1) {
+ scsi_remove_device(sdev1);
+ scsi_device_put(sdev1);
+ }
+ }
+ }
+ }
+ }
+ doscan = 0;
+ break;
+
+ case MR_EVT_LD_OFFLINE:
+ case MR_EVT_LD_DELETED:
+ megasas_get_ld_list(instance);
+ for (i = 0; i < MEGASAS_MAX_LD_CHANNELS; i++) {
+ for (j = 0;
+ j < MEGASAS_MAX_DEV_PER_CHANNEL;
+ j++) {
+
+ ld_index =
+ (i * MEGASAS_MAX_DEV_PER_CHANNEL) + j;
+
+ sdev1 = scsi_device_lookup(host,
+ i + MEGASAS_MAX_LD_CHANNELS,
+ j,
+ 0);
+
+ if (instance->ld_ids[ld_index] != 0xff) {
+ if (sdev1) {
+ scsi_device_put(sdev1);
+ }
+ } else {
+ if (sdev1) {
+ scsi_remove_device(sdev1);
+ scsi_device_put(sdev1);
+ }
+ }
+ }
+ }
+ doscan = 0;
+ break;
+ case MR_EVT_LD_CREATED:
+ megasas_get_ld_list(instance);
+ for (i = 0; i < MEGASAS_MAX_LD_CHANNELS; i++) {
+ for (j = 0;
+ j < MEGASAS_MAX_DEV_PER_CHANNEL;
+ j++) {
+ ld_index =
+ (i * MEGASAS_MAX_DEV_PER_CHANNEL) + j;
+
+ sdev1 = scsi_device_lookup(host,
+ i+MEGASAS_MAX_LD_CHANNELS,
+ j, 0);
+
+ if (instance->ld_ids[ld_index] !=
+ 0xff) {
+ if (!sdev1) {
+ scsi_add_device(host,
+ i + 2,
+ j, 0);
+ }
+ }
+ if (sdev1) {
+ scsi_device_put(sdev1);
+ }
+ }
+ }
+ doscan = 0;
+ break;
case MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED:
+ case MR_EVT_FOREIGN_CFG_IMPORTED:
doscan = 1;
break;
default:
@@ -4007,6 +4124,31 @@ megasas_aen_polling(struct work_struct *work)
}
}
}
+
+ megasas_get_ld_list(instance);
+ for (i = 0; i < MEGASAS_MAX_LD_CHANNELS; i++) {
+ for (j = 0; j < MEGASAS_MAX_DEV_PER_CHANNEL; j++) {
+ ld_index =
+ (i * MEGASAS_MAX_DEV_PER_CHANNEL) + j;
+
+ sdev1 = scsi_device_lookup(host,
+ i+MEGASAS_MAX_LD_CHANNELS, j, 0);
+ if (instance->ld_ids[ld_index] != 0xff) {
+ if (!sdev1) {
+ scsi_add_device(host,
+ i+2,
+ j, 0);
+ } else {
+ scsi_device_put(sdev1);
+ }
+ } else {
+ if (sdev1) {
+ scsi_remove_device(sdev1);
+ scsi_device_put(sdev1);
+ }
+ }
+ }
+ }
}

if ( instance->aen_cmd != NULL ) {
--
1.7.10.rc1

From: "Yang, Bo" <Bo.Yang@lsi.com>
Date: Tue, 6 Oct 2009 14:43:28 -0600
Subject: [SCSI] megaraid_sas: add the IEEE SGE support to SAS2 controller

commit f4c9a1317d32bb0af7546ef0c1dcc3be52dc8d0a upstream.

To increase the performance, megaraid sas driver added the IEEE SGE
support to support SAS2 controller.

Signed-off-by Bo Yang<bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
drivers/scsi/megaraid/megaraid_sas.c | 80 +++++++++++++++++++++++++++++++---
drivers/scsi/megaraid/megaraid_sas.h | 9 ++++
2 files changed, 82 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index c7e1e40ad24a..2b9e3c68c3e7 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -712,6 +712,35 @@ megasas_make_sgl64(struct megasas_instance *instance, struct scsi_cmnd *scp,
return sge_count;
}

+/**
+ * megasas_make_sgl_skinny - Prepares IEEE SGL
+ * @instance: Adapter soft state
+ * @scp: SCSI command from the mid-layer
+ * @mfi_sgl: SGL to be filled in
+ *
+ * If successful, this function returns the number of SG elements. Otherwise,
+ * it returnes -1.
+ */
+static int
+megasas_make_sgl_skinny(struct megasas_instance *instance,
+ struct scsi_cmnd *scp, union megasas_sgl *mfi_sgl)
+{
+ int i;
+ int sge_count;
+ struct scatterlist *os_sgl;
+
+ sge_count = scsi_dma_map(scp);
+
+ if (sge_count) {
+ scsi_for_each_sg(scp, os_sgl, sge_count, i) {
+ mfi_sgl->sge_skinny[i].length = sg_dma_len(os_sgl);
+ mfi_sgl->sge_skinny[i].phys_addr =
+ sg_dma_address(os_sgl);
+ }
+ }
+ return sge_count;
+}
+
/**
* megasas_get_frame_count - Computes the number of frames
* @frame_type : type of frame- io or pthru frame
@@ -720,7 +749,8 @@ megasas_make_sgl64(struct megasas_instance *instance, struct scsi_cmnd *scp,
* Returns the number of frames required for numnber of sge's (sge_count)
*/

-static u32 megasas_get_frame_count(u8 sge_count, u8 frame_type)
+static u32 megasas_get_frame_count(struct megasas_instance *instance,
+ u8 sge_count, u8 frame_type)
{
int num_cnt;
int sge_bytes;
@@ -730,6 +760,10 @@ static u32 megasas_get_frame_count(u8 sge_count, u8 frame_type)
sge_sz = (IS_DMA64) ? sizeof(struct megasas_sge64) :
sizeof(struct megasas_sge32);

+ if (instance->flag_ieee) {
+ sge_sz = sizeof(struct megasas_sge_skinny);
+ }
+
/*
* Main frame can contain 2 SGEs for 64-bit SGLs and
* 3 SGEs for 32-bit SGLs for ldio &
@@ -737,12 +771,16 @@ static u32 megasas_get_frame_count(u8 sge_count, u8 frame_type)
* 2 SGEs for 32-bit SGLs for pthru frame
*/
if (unlikely(frame_type == PTHRU_FRAME)) {
- if (IS_DMA64)
+ if (instance->flag_ieee == 1) {
+ num_cnt = sge_count - 1;
+ } else if (IS_DMA64)
num_cnt = sge_count - 1;
else
num_cnt = sge_count - 2;
} else {
- if (IS_DMA64)
+ if (instance->flag_ieee == 1) {
+ num_cnt = sge_count - 1;
+ } else if (IS_DMA64)
num_cnt = sge_count - 2;
else
num_cnt = sge_count - 3;
@@ -791,6 +829,10 @@ megasas_build_dcdb(struct megasas_instance *instance, struct scsi_cmnd *scp,
else if (scp->sc_data_direction == PCI_DMA_NONE)
flags = MFI_FRAME_DIR_NONE;

+ if (instance->flag_ieee == 1) {
+ flags |= MFI_FRAME_IEEE;
+ }
+
/*
* Prepare the DCDB frame
*/
@@ -809,7 +851,11 @@ megasas_build_dcdb(struct megasas_instance *instance, struct scsi_cmnd *scp,
/*
* Construct SGL
*/
- if (IS_DMA64) {
+ if (instance->flag_ieee == 1) {
+ pthru->flags |= MFI_FRAME_SGL64;
+ pthru->sge_count = megasas_make_sgl_skinny(instance, scp,
+ &pthru->sgl);
+ } else if (IS_DMA64) {
pthru->flags |= MFI_FRAME_SGL64;
pthru->sge_count = megasas_make_sgl64(instance, scp,
&pthru->sgl);
@@ -834,7 +880,7 @@ megasas_build_dcdb(struct megasas_instance *instance, struct scsi_cmnd *scp,
* Compute the total number of frames this command consumes. FW uses
* this number to pull sufficient number of frames from host memory.
*/
- cmd->frame_count = megasas_get_frame_count(pthru->sge_count,
+ cmd->frame_count = megasas_get_frame_count(instance, pthru->sge_count,
PTHRU_FRAME);

return cmd->frame_count;
@@ -865,6 +911,10 @@ megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp,
else if (scp->sc_data_direction == PCI_DMA_FROMDEVICE)
flags = MFI_FRAME_DIR_READ;

+ if (instance->flag_ieee == 1) {
+ flags |= MFI_FRAME_IEEE;
+ }
+
/*
* Prepare the Logical IO frame: 2nd bit is zero for all read cmds
*/
@@ -935,7 +985,11 @@ megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp,
/*
* Construct SGL
*/
- if (IS_DMA64) {
+ if (instance->flag_ieee) {
+ ldio->flags |= MFI_FRAME_SGL64;
+ ldio->sge_count = megasas_make_sgl_skinny(instance, scp,
+ &ldio->sgl);
+ } else if (IS_DMA64) {
ldio->flags |= MFI_FRAME_SGL64;
ldio->sge_count = megasas_make_sgl64(instance, scp, &ldio->sgl);
} else
@@ -958,7 +1012,8 @@ megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp,
* Compute the total number of frames this command consumes. FW uses
* this number to pull sufficient number of frames from host memory.
*/
- cmd->frame_count = megasas_get_frame_count(ldio->sge_count, IO_FRAME);
+ cmd->frame_count = megasas_get_frame_count(instance,
+ ldio->sge_count, IO_FRAME);

return cmd->frame_count;
}
@@ -1918,6 +1973,10 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
sge_sz = (IS_DMA64) ? sizeof(struct megasas_sge64) :
sizeof(struct megasas_sge32);

+ if (instance->flag_ieee) {
+ sge_sz = sizeof(struct megasas_sge_skinny);
+ }
+
/*
* Calculated the number of 64byte frames required for SGL
*/
@@ -2797,6 +2856,11 @@ megasas_register_aen(struct megasas_instance *instance, u32 seq_num,
dcmd->sgl.sge32[0].phys_addr = (u32) instance->evt_detail_h;
dcmd->sgl.sge32[0].length = sizeof(struct megasas_evt_detail);

+ if (instance->aen_cmd != NULL) {
+ megasas_return_cmd(instance, cmd);
+ return 0;
+ }
+
/*
* Store reference to the cmd used to register for AEN. When an
* application wants us to register for AEN, we have to abort this
@@ -2968,6 +3032,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
*instance->producer = 0;
*instance->consumer = 0;
megasas_poll_wait_aen = 0;
+ instance->flag_ieee = 0;
instance->ev = NULL;

instance->evt_detail = pci_alloc_consistent(pdev,
@@ -3008,6 +3073,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)

if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
(instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
+ instance->flag_ieee = 1;
sema_init(&instance->ioctl_sem, MEGASAS_SKINNY_INT_CMDS);
} else
sema_init(&instance->ioctl_sem, MEGASAS_INT_CMDS);
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 29cd2c877952..a22d8d48b7dd 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -96,6 +96,7 @@
#define MFI_FRAME_DIR_WRITE 0x0008
#define MFI_FRAME_DIR_READ 0x0010
#define MFI_FRAME_DIR_BOTH 0x0018
+#define MFI_FRAME_IEEE 0x0020

/*
* Definition for cmd_status
@@ -772,10 +773,17 @@ struct megasas_sge64 {

} __attribute__ ((packed));

+struct megasas_sge_skinny {
+ u64 phys_addr;
+ u32 length;
+ u32 flag;
+} __packed;
+
union megasas_sgl {

struct megasas_sge32 sge32[1];
struct megasas_sge64 sge64[1];
+ struct megasas_sge_skinny sge_skinny[1];

} __attribute__ ((packed));

@@ -1248,6 +1256,7 @@ struct megasas_instance {

u8 flag;
u8 unload;
+ u8 flag_ieee;
unsigned long last_time;

struct timer_list io_completion_timer;
--
1.7.10.rc1

From: bo yang <boyang1288@gmail.com>
Date: Wed, 22 Sep 2010 22:36:29 -0400
Subject: [SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive

commit 39a985547cbfcbb0b23667b69b8ae82a6cf312ac upstream.

To add the Online controller reset support, driver need to do:
a). reset the controller chips -- Xscale and Gen2 which will change
the function calls and add the reset function related to this two
chips.
b). during the reset, driver will store the pending cmds which not
returned by FW to driver's pending queue. Driver will re-issue those
pending cmds again to FW after the OCR finished.
c). In driver's timeout routine, driver will report to OS as reset.
Also driver's queue routine will block the cmds until the OCR
finished.
d). in Driver's ISR routine, if driver get the FW state as state
change, FW in Failure status and FW support online controller
reset (OCR), driver will start to do the controller reset.
e). In driver's IOCTL routine, the application cmds will wait for the
OCR to finish, then issue the cmds to FW.

Signed-off-by: Bo Yang <bo.yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
drivers/scsi/megaraid/megaraid_sas.c | 756 +++++++++++++++++++++++++++++++---
drivers/scsi/megaraid/megaraid_sas.h | 88 +++-
2 files changed, 787 insertions(+), 57 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 2b9e3c68c3e7..72c925d9e0f3 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -61,6 +61,11 @@ MODULE_VERSION(MEGASAS_VERSION);
MODULE_AUTHOR("megaraidlinux@lsi.com");
MODULE_DESCRIPTION("LSI MegaRAID SAS Driver");

+static int megasas_transition_to_ready(struct megasas_instance *instance);
+static int megasas_get_pd_list(struct megasas_instance *instance);
+static int megasas_issue_init_mfi(struct megasas_instance *instance);
+static int megasas_register_aen(struct megasas_instance *instance,
+ u32 seq_num, u32 class_locale_word);
/*
* PCI ID table for all supported controllers
*/
@@ -163,7 +168,7 @@ megasas_return_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd)
static inline void
megasas_enable_intr_xscale(struct megasas_register_set __iomem * regs)
{
- writel(1, &(regs)->outbound_intr_mask);
+ writel(0, &(regs)->outbound_intr_mask);

/* Dummy readl to force pci flush */
readl(&regs->outbound_intr_mask);
@@ -199,24 +204,27 @@ static int
megasas_clear_intr_xscale(struct megasas_register_set __iomem * regs)
{
u32 status;
+ u32 mfiStatus = 0;
/*
* Check if it is our interrupt
*/
status = readl(&regs->outbound_intr_status);

- if (!(status & MFI_OB_INTR_STATUS_MASK)) {
- return 1;
- }
+ if (status & MFI_OB_INTR_STATUS_MASK)
+ mfiStatus = MFI_INTR_FLAG_REPLY_MESSAGE;
+ if (status & MFI_XSCALE_OMR0_CHANGE_INTERRUPT)
+ mfiStatus |= MFI_INTR_FLAG_FIRMWARE_STATE_CHANGE;

/*
* Clear the interrupt by writing back the same value
*/
- writel(status, &regs->outbound_intr_status);
+ if (mfiStatus)
+ writel(status, &regs->outbound_intr_status);

/* Dummy readl to force pci flush */
readl(&regs->outbound_intr_status);

- return 0;
+ return mfiStatus;
}

/**
@@ -231,8 +239,69 @@ megasas_fire_cmd_xscale(struct megasas_instance *instance,
u32 frame_count,
struct megasas_register_set __iomem *regs)
{
+ unsigned long flags;
+ spin_lock_irqsave(&instance->hba_lock, flags);
writel((frame_phys_addr >> 3)|(frame_count),
&(regs)->inbound_queue_port);
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+}
+
+/**
+ * megasas_adp_reset_xscale - For controller reset
+ * @regs: MFI register set
+ */
+static int
+megasas_adp_reset_xscale(struct megasas_instance *instance,
+ struct megasas_register_set __iomem *regs)
+{
+ u32 i;
+ u32 pcidata;
+ writel(MFI_ADP_RESET, &regs->inbound_doorbell);
+
+ for (i = 0; i < 3; i++)
+ msleep(1000); /* sleep for 3 secs */
+ pcidata = 0;
+ pci_read_config_dword(instance->pdev, MFI_1068_PCSR_OFFSET, &pcidata);
+ printk(KERN_NOTICE "pcidata = %x
", pcidata);
+ if (pcidata & 0x2) {
+ printk(KERN_NOTICE "mfi 1068 offset read=%x
", pcidata);
+ pcidata &= ~0x2;
+ pci_write_config_dword(instance->pdev,
+ MFI_1068_PCSR_OFFSET, pcidata);
+
+ for (i = 0; i < 2; i++)
+ msleep(1000); /* need to wait 2 secs again */
+
+ pcidata = 0;
+ pci_read_config_dword(instance->pdev,
+ MFI_1068_FW_HANDSHAKE_OFFSET, &pcidata);
+ printk(KERN_NOTICE "1068 offset handshake read=%x
", pcidata);
+ if ((pcidata & 0xffff0000) == MFI_1068_FW_READY) {
+ printk(KERN_NOTICE "1068 offset pcidt=%x
", pcidata);
+ pcidata = 0;
+ pci_write_config_dword(instance->pdev,
+ MFI_1068_FW_HANDSHAKE_OFFSET, pcidata);
+ }
+ }
+ return 0;
+}
+
+/**
+ * megasas_check_reset_xscale - For controller reset check
+ * @regs: MFI register set
+ */
+static int
+megasas_check_reset_xscale(struct megasas_instance *instance,
+ struct megasas_register_set __iomem *regs)
+{
+ u32 consumer;
+ consumer = *instance->consumer;
+
+ if ((instance->adprecovery != MEGASAS_HBA_OPERATIONAL) &&
+ (*instance->consumer == MEGASAS_ADPRESET_INPROG_SIGN)) {
+ return 1;
+ }
+ return 0;
}

static struct megasas_instance_template megasas_instance_template_xscale = {
@@ -242,6 +311,8 @@ static struct megasas_instance_template megasas_instance_template_xscale = {
.disable_intr = megasas_disable_intr_xscale,
.clear_intr = megasas_clear_intr_xscale,
.read_fw_status_reg = megasas_read_fw_status_reg_xscale,
+ .adp_reset = megasas_adp_reset_xscale,
+ .check_reset = megasas_check_reset_xscale,
};

/**
@@ -263,7 +334,7 @@ megasas_enable_intr_ppc(struct megasas_register_set __iomem * regs)
{
writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear);

- writel(~0x80000004, &(regs)->outbound_intr_mask);
+ writel(~0x80000000, &(regs)->outbound_intr_mask);

/* Dummy readl to force pci flush */
readl(&regs->outbound_intr_mask);
@@ -306,7 +377,7 @@ megasas_clear_intr_ppc(struct megasas_register_set __iomem * regs)
status = readl(&regs->outbound_intr_status);

if (!(status & MFI_REPLY_1078_MESSAGE_INTERRUPT)) {
- return 1;
+ return 0;
}

/*
@@ -317,7 +388,7 @@ megasas_clear_intr_ppc(struct megasas_register_set __iomem * regs)
/* Dummy readl to force pci flush */
readl(&regs->outbound_doorbell_clear);

- return 0;
+ return 1;
}
/**
* megasas_fire_cmd_ppc - Sends command to the FW
@@ -331,10 +402,34 @@ megasas_fire_cmd_ppc(struct megasas_instance *instance,
u32 frame_count,
struct megasas_register_set __iomem *regs)
{
+ unsigned long flags;
+ spin_lock_irqsave(&instance->hba_lock, flags);
writel((frame_phys_addr | (frame_count<<1))|1,
&(regs)->inbound_queue_port);
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
}

+/**
+ * megasas_adp_reset_ppc - For controller reset
+ * @regs: MFI register set
+ */
+static int
+megasas_adp_reset_ppc(struct megasas_instance *instance,
+ struct megasas_register_set __iomem *regs)
+{
+ return 0;
+}
+
+/**
+ * megasas_check_reset_ppc - For controller reset check
+ * @regs: MFI register set
+ */
+static int
+megasas_check_reset_ppc(struct megasas_instance *instance,
+ struct megasas_register_set __iomem *regs)
+{
+ return 0;
+}
static struct megasas_instance_template megasas_instance_template_ppc = {

.fire_cmd = megasas_fire_cmd_ppc,
@@ -342,6 +437,8 @@ static struct megasas_instance_template megasas_instance_template_ppc = {
.disable_intr = megasas_disable_intr_ppc,
.clear_intr = megasas_clear_intr_ppc,
.read_fw_status_reg = megasas_read_fw_status_reg_ppc,
+ .adp_reset = megasas_adp_reset_ppc,
+ .check_reset = megasas_check_reset_ppc,
};

/**
@@ -396,7 +493,7 @@ megasas_clear_intr_skinny(struct megasas_register_set __iomem *regs)
status = readl(&regs->outbound_intr_status);

if (!(status & MFI_SKINNY_ENABLE_INTERRUPT_MASK)) {
- return 1;
+ return 0;
}

/*
@@ -409,7 +506,7 @@ megasas_clear_intr_skinny(struct megasas_register_set __iomem *regs)
*/
readl(&regs->outbound_intr_status);

- return 0;
+ return 1;
}

/**
@@ -425,11 +522,33 @@ megasas_fire_cmd_skinny(struct megasas_instance *instance,
struct megasas_register_set __iomem *regs)
{
unsigned long flags;
- spin_lock_irqsave(&instance->fire_lock, flags);
+ spin_lock_irqsave(&instance->hba_lock, flags);
writel(0, &(regs)->inbound_high_queue_port);
writel((frame_phys_addr | (frame_count<<1))|1,
&(regs)->inbound_low_queue_port);
- spin_unlock_irqrestore(&instance->fire_lock, flags);
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+}
+
+/**
+ * megasas_adp_reset_skinny - For controller reset
+ * @regs: MFI register set
+ */
+static int
+megasas_adp_reset_skinny(struct megasas_instance *instance,
+ struct megasas_register_set __iomem *regs)
+{
+ return 0;
+}
+
+/**
+ * megasas_check_reset_skinny - For controller reset check
+ * @regs: MFI register set
+ */
+static int
+megasas_check_reset_skinny(struct megasas_instance *instance,
+ struct megasas_register_set __iomem *regs)
+{
+ return 0;
}

static struct megasas_instance_template megasas_instance_template_skinny = {
@@ -439,6 +558,8 @@ static struct megasas_instance_template megasas_instance_template_skinny = {
.disable_intr = megasas_disable_intr_skinny,
.clear_intr = megasas_clear_intr_skinny,
.read_fw_status_reg = megasas_read_fw_status_reg_skinny,
+ .adp_reset = megasas_adp_reset_skinny,
+ .check_reset = megasas_check_reset_skinny,
};


@@ -494,23 +615,29 @@ static int
megasas_clear_intr_gen2(struct megasas_register_set __iomem *regs)
{
u32 status;
+ u32 mfiStatus = 0;
/*
* Check if it is our interrupt
*/
status = readl(&regs->outbound_intr_status);

- if (!(status & MFI_GEN2_ENABLE_INTERRUPT_MASK))
- return 1;
+ if (status & MFI_GEN2_ENABLE_INTERRUPT_MASK) {
+ mfiStatus = MFI_INTR_FLAG_REPLY_MESSAGE;
+ }
+ if (status & MFI_G2_OUTBOUND_DOORBELL_CHANGE_INTERRUPT) {
+ mfiStatus |= MFI_INTR_FLAG_FIRMWARE_STATE_CHANGE;
+ }

/*
* Clear the interrupt by writing back the same value
*/
- writel(status, &regs->outbound_doorbell_clear);
+ if (mfiStatus)
+ writel(status, &regs->outbound_doorbell_clear);

/* Dummy readl to force pci flush */
readl(&regs->outbound_intr_status);

- return 0;
+ return mfiStatus;
}
/**
* megasas_fire_cmd_gen2 - Sends command to the FW
@@ -524,8 +651,74 @@ megasas_fire_cmd_gen2(struct megasas_instance *instance,
u32 frame_count,
struct megasas_register_set __iomem *regs)
{
+ unsigned long flags;
+ spin_lock_irqsave(&instance->hba_lock, flags);
writel((frame_phys_addr | (frame_count<<1))|1,
&(regs)->inbound_queue_port);
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+}
+
+/**
+ * megasas_adp_reset_gen2 - For controller reset
+ * @regs: MFI register set
+ */
+static int
+megasas_adp_reset_gen2(struct megasas_instance *instance,
+ struct megasas_register_set __iomem *reg_set)
+{
+ u32 retry = 0 ;
+ u32 HostDiag;
+
+ writel(0, &reg_set->seq_offset);
+ writel(4, &reg_set->seq_offset);
+ writel(0xb, &reg_set->seq_offset);
+ writel(2, &reg_set->seq_offset);
+ writel(7, &reg_set->seq_offset);
+ writel(0xd, &reg_set->seq_offset);
+ msleep(1000);
+
+ HostDiag = (u32)readl(&reg_set->host_diag);
+
+ while ( !( HostDiag & DIAG_WRITE_ENABLE) ) {
+ msleep(100);
+ HostDiag = (u32)readl(&reg_set->host_diag);
+ printk(KERN_NOTICE "RESETGEN2: retry=%x, hostdiag=%x
",
+ retry, HostDiag);
+
+ if (retry++ >= 100)
+ return 1;
+
+ }
+
+ printk(KERN_NOTICE "ADP_RESET_GEN2: HostDiag=%x
", HostDiag);
+
+ writel((HostDiag | DIAG_RESET_ADAPTER), &reg_set->host_diag);
+
+ ssleep(10);
+
+ HostDiag = (u32)readl(&reg_set->host_diag);
+ while ( ( HostDiag & DIAG_RESET_ADAPTER) ) {
+ msleep(100);
+ HostDiag = (u32)readl(&reg_set->host_diag);
+ printk(KERN_NOTICE "RESET_GEN2: retry=%x, hostdiag=%x
",
+ retry, HostDiag);
+
+ if (retry++ >= 1000)
+ return 1;
+
+ }
+ return 0;
+}
+
+/**
+ * megasas_check_reset_gen2 - For controller reset check
+ * @regs: MFI register set
+ */
+static int
+megasas_check_reset_gen2(struct megasas_instance *instance,
+ struct megasas_register_set __iomem *regs)
+{
+ return 0;
}

static struct megasas_instance_template megasas_instance_template_gen2 = {
@@ -535,11 +728,13 @@ static struct megasas_instance_template megasas_instance_template_gen2 = {
.disable_intr = megasas_disable_intr_gen2,
.clear_intr = megasas_clear_intr_gen2,
.read_fw_status_reg = megasas_read_fw_status_reg_gen2,
+ .adp_reset = megasas_adp_reset_gen2,
+ .check_reset = megasas_check_reset_gen2,
};

/**
* This is the end of set of functions & definitions
-* specific to ppc (deviceid : 0x60) controllers
+* specific to gen2 (deviceid : 0x78, 0x79) controllers
*/

/**
@@ -598,8 +793,7 @@ megasas_issue_blocked_cmd(struct megasas_instance *instance,
instance->instancet->fire_cmd(instance,
cmd->frame_phys_addr, 0, instance->reg_set);

- wait_event_timeout(instance->int_cmd_wait_q, (cmd->cmd_status != ENODATA),
- MEGASAS_INTERNAL_CMD_WAIT_TIME*HZ);
+ wait_event(instance->int_cmd_wait_q, cmd->cmd_status != ENODATA);

return 0;
}
@@ -647,8 +841,8 @@ megasas_issue_blocked_abort_cmd(struct megasas_instance *instance,
/*
* Wait for this cmd to complete
*/
- wait_event_timeout(instance->abort_cmd_wait_q, (cmd->cmd_status != 0xFF),
- MEGASAS_INTERNAL_CMD_WAIT_TIME*HZ);
+ wait_event(instance->abort_cmd_wait_q, cmd->cmd_status != 0xFF);
+ cmd->sync_cmd = 0;

megasas_return_cmd(instance, cmd);
return 0;
@@ -1118,14 +1312,22 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *))
u32 frame_count;
struct megasas_cmd *cmd;
struct megasas_instance *instance;
+ unsigned long flags;

instance = (struct megasas_instance *)
scmd->device->host->hostdata;

- /* Don't process if we have already declared adapter dead */
- if (instance->hw_crit_error)
+ if (instance->issuepend_done == 0)
return SCSI_MLQUEUE_HOST_BUSY;

+ spin_lock_irqsave(&instance->hba_lock, flags);
+ if (instance->adprecovery != MEGASAS_HBA_OPERATIONAL) {
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+ return SCSI_MLQUEUE_HOST_BUSY;
+ }
+
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+
scmd->scsi_done = done;
scmd->result = 0;

@@ -1209,6 +1411,18 @@ static int megasas_slave_configure(struct scsi_device *sdev)
return 0;
}

+static void megaraid_sas_kill_hba(struct megasas_instance *instance)
+{
+ if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0073SKINNY) ||
+ (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) {
+ writel(MFI_STOP_ADP,
+ &instance->reg_set->reserved_0[0]);
+ } else {
+ writel(MFI_STOP_ADP,
+ &instance->reg_set->inbound_doorbell);
+ }
+}
+
/**
* megasas_complete_cmd_dpc - Returns FW's controller structure
* @instance_addr: Address of adapter soft state
@@ -1226,7 +1440,7 @@ static void megasas_complete_cmd_dpc(unsigned long instance_addr)
unsigned long flags;

/* If we have already declared adapter dead, donot complete cmds */
- if (instance->hw_crit_error)
+ if (instance->adprecovery == MEGASAS_HW_CRITICAL_ERROR )
return;

spin_lock_irqsave(&instance->completion_lock, flags);
@@ -1236,6 +1450,11 @@ static void megasas_complete_cmd_dpc(unsigned long instance_addr)

while (consumer != producer) {
context = instance->reply_queue[consumer];
+ if (context >= instance->max_fw_cmds) {
+ printk(KERN_ERR "Unexpected context value %x
",
+ context);
+ BUG();
+ }

cmd = instance->cmd_list[context];

@@ -1285,7 +1504,76 @@ static void megasas_complete_cmd_dpc(unsigned long instance_addr)
static int megasas_wait_for_outstanding(struct megasas_instance *instance)
{
int i;
+ u32 reset_index;
u32 wait_time = MEGASAS_RESET_WAIT_TIME;
+ u8 adprecovery;
+ unsigned long flags;
+ struct list_head clist_local;
+ struct megasas_cmd *reset_cmd;
+
+ spin_lock_irqsave(&instance->hba_lock, flags);
+ adprecovery = instance->adprecovery;
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+
+ if (adprecovery != MEGASAS_HBA_OPERATIONAL) {
+
+ INIT_LIST_HEAD(&clist_local);
+ spin_lock_irqsave(&instance->hba_lock, flags);
+ list_splice_init(&instance->internal_reset_pending_q,
+ &clist_local);
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+
+ printk(KERN_NOTICE "megasas: HBA reset wait ...
");
+ for (i = 0; i < wait_time; i++) {
+ msleep(1000);
+ spin_lock_irqsave(&instance->hba_lock, flags);
+ adprecovery = instance->adprecovery;
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+ if (adprecovery == MEGASAS_HBA_OPERATIONAL)
+ break;
+ }
+
+ if (adprecovery != MEGASAS_HBA_OPERATIONAL) {
+ printk(KERN_NOTICE "megasas: reset: Stopping HBA.
");
+ spin_lock_irqsave(&instance->hba_lock, flags);
+ instance->adprecovery = MEGASAS_HW_CRITICAL_ERROR;
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+ return FAILED;
+ }
+
+ reset_index = 0;
+ while (!list_empty(&clist_local)) {
+ reset_cmd = list_entry((&clist_local)->next,
+ struct megasas_cmd, list);
+ list_del_init(&reset_cmd->list);
+ if (reset_cmd->scmd) {
+ reset_cmd->scmd->result = DID_RESET << 16;
+ printk(KERN_NOTICE "%d:%p reset [%02x], %#lx
",
+ reset_index, reset_cmd,
+ reset_cmd->scmd->cmnd[0],
+ reset_cmd->scmd->serial_number);
+
+ reset_cmd->scmd->scsi_done(reset_cmd->scmd);
+ megasas_return_cmd(instance, reset_cmd);
+ } else if (reset_cmd->sync_cmd) {
+ printk(KERN_NOTICE "megasas:%p synch cmds"
+ "reset queue
",
+ reset_cmd);
+
+ reset_cmd->cmd_status = ENODATA;
+ instance->instancet->fire_cmd(instance,
+ reset_cmd->frame_phys_addr,
+ 0, instance->reg_set);
+ } else {
+ printk(KERN_NOTICE "megasas: %p unexpected"
+ "cmds lst
",
+ reset_cmd);
+ }
+ reset_index++;
+ }
+
+ return SUCCESS;
+ }

for (i = 0; i < wait_time; i++) {

@@ -1308,6 +1596,7 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance)
}

if (atomic_read(&instance->fw_outstanding)) {
+ printk(KERN_NOTICE "megaraid_sas: pending cmds after reset
");
/*
* Send signal to FW to stop processing any pending cmds.
* The controller will be taken offline by the OS now.
@@ -1323,10 +1612,14 @@ static int megasas_wait_for_outstanding(struct megasas_instance *instance)
&instance->reg_set->inbound_doorbell);
}
megasas_dump_pending_frames(instance);
- instance->hw_crit_error = 1;
+ spin_lock_irqsave(&instance->hba_lock, flags);
+ instance->adprecovery = MEGASAS_HW_CRITICAL_ERROR;
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
return FAILED;
}

+ printk(KERN_NOTICE "megaraid_sas: no pending cmds after reset
");
+
return SUCCESS;
}

@@ -1348,7 +1641,7 @@ static int megasas_generic_reset(struct scsi_cmnd *scmd)
scmd_printk(KERN_NOTICE, scmd, "megasas: RESET -%ld cmd=%x retries=%x
",
scmd->serial_number, scmd->cmnd[0], scmd->retries);

- if (instance->hw_crit_error) {
+ if (instance->adprecovery == MEGASAS_HW_CRITICAL_ERROR) {
printk(KERN_ERR "megasas: cannot recover from previous reset "
"failures
");
return FAILED;
@@ -1503,7 +1796,8 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd)
instance->aen_cmd = NULL;
megasas_return_cmd(instance, cmd);

- if (instance->unload == 0) {
+ if ((instance->unload == 0) &&
+ ((instance->issuepend_done == 1))) {
struct megasas_aen_event *ev;
ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
if (!ev) {
@@ -1597,6 +1891,9 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
struct megasas_header *hdr = &cmd->frame->hdr;
unsigned long flags;

+ /* flag for the retry reset */
+ cmd->retry_for_fw_reset = 0;
+
if (cmd->scmd)
cmd->scmd->SCp.ptr = NULL;

@@ -1717,39 +2014,301 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
}

/**
+ * megasas_issue_pending_cmds_again - issue all pending cmds
+ * in FW again because of the fw reset
+ * @instance: Adapter soft state
+ */
+static inline void
+megasas_issue_pending_cmds_again(struct megasas_instance *instance)
+{
+ struct megasas_cmd *cmd;
+ struct list_head clist_local;
+ union megasas_evt_class_locale class_locale;
+ unsigned long flags;
+ u32 seq_num;
+
+ INIT_LIST_HEAD(&clist_local);
+ spin_lock_irqsave(&instance->hba_lock, flags);
+ list_splice_init(&instance->internal_reset_pending_q, &clist_local);
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+
+ while (!list_empty(&clist_local)) {
+ cmd = list_entry((&clist_local)->next,
+ struct megasas_cmd, list);
+ list_del_init(&cmd->list);
+
+ if (cmd->sync_cmd || cmd->scmd) {
+ printk(KERN_NOTICE "megaraid_sas: command %p, %p:%d"
+ "detected to be pending while HBA reset.
",
+ cmd, cmd->scmd, cmd->sync_cmd);
+
+ cmd->retry_for_fw_reset++;
+
+ if (cmd->retry_for_fw_reset == 3) {
+ printk(KERN_NOTICE "megaraid_sas: cmd %p, %p:%d"
+ "was tried multiple times during reset."
+ "Shutting down the HBA
",
+ cmd, cmd->scmd, cmd->sync_cmd);
+ megaraid_sas_kill_hba(instance);
+
+ instance->adprecovery =
+ MEGASAS_HW_CRITICAL_ERROR;
+ return;
+ }
+ }
+
+ if (cmd->sync_cmd == 1) {
+ if (cmd->scmd) {
+ printk(KERN_NOTICE "megaraid_sas: unexpected"
+ "cmd attached to internal command!
");
+ }
+ printk(KERN_NOTICE "megasas: %p synchronous cmd"
+ "on the internal reset queue,"
+ "issue it again.
", cmd);
+ cmd->cmd_status = ENODATA;
+ instance->instancet->fire_cmd(instance,
+ cmd->frame_phys_addr ,
+ 0, instance->reg_set);
+ } else if (cmd->scmd) {
+ printk(KERN_NOTICE "megasas: %p scsi cmd [%02x],%#lx"
+ "detected on the internal queue, issue again.
",
+ cmd, cmd->scmd->cmnd[0], cmd->scmd->serial_number);
+
+ atomic_inc(&instance->fw_outstanding);
+ instance->instancet->fire_cmd(instance,
+ cmd->frame_phys_addr,
+ cmd->frame_count-1, instance->reg_set);
+ } else {
+ printk(KERN_NOTICE "megasas: %p unexpected cmd on the"
+ "internal reset defer list while re-issue!!
",
+ cmd);
+ }
+ }
+
+ if (instance->aen_cmd) {
+ printk(KERN_NOTICE "megaraid_sas: aen_cmd in def process
");
+ megasas_return_cmd(instance, instance->aen_cmd);
+
+ instance->aen_cmd = NULL;
+ }
+
+ /*
+ * Initiate AEN (Asynchronous Event Notification)
+ */
+ seq_num = instance->last_seq_num;
+ class_locale.members.reserved = 0;
+ class_locale.members.locale = MR_EVT_LOCALE_ALL;
+ class_locale.members.class = MR_EVT_CLASS_DEBUG;
+
+ megasas_register_aen(instance, seq_num, class_locale.word);
+}
+
+/**
+ * Move the internal reset pending commands to a deferred queue.
+ *
+ * We move the commands pending at internal reset time to a
+ * pending queue. This queue would be flushed after successful
+ * completion of the internal reset sequence. if the internal reset
+ * did not complete in time, the kernel reset handler would flush
+ * these commands.
+ **/
+static void
+megasas_internal_reset_defer_cmds(struct megasas_instance *instance)
+{
+ struct megasas_cmd *cmd;
+ int i;
+ u32 max_cmd = instance->max_fw_cmds;
+ u32 defer_index;
+ unsigned long flags;
+
+ defer_index = 0;
+ spin_lock_irqsave(&instance->cmd_pool_lock, flags);
+ for (i = 0; i < max_cmd; i++) {
+ cmd = instance->cmd_list[i];
+ if (cmd->sync_cmd == 1 || cmd->scmd) {
+ printk(KERN_NOTICE "megasas: moving cmd[%d]:%p:%d:%p"
+ "on the defer queue as internal
",
+ defer_index, cmd, cmd->sync_cmd, cmd->scmd);
+
+ if (!list_empty(&cmd->list)) {
+ printk(KERN_NOTICE "megaraid_sas: ERROR while"
+ " moving this cmd:%p, %d %p, it was"
+ "discovered on some list?
",
+ cmd, cmd->sync_cmd, cmd->scmd);
+
+ list_del_init(&cmd->list);
+ }
+ defer_index++;
+ list_add_tail(&cmd->list,
+ &instance->internal_reset_pending_q);
+ }
+ }
+ spin_unlock_irqrestore(&instance->cmd_pool_lock, flags);
+}
+
+
+static void
+process_fw_state_change_wq(struct work_struct *work)
+{
+ struct megasas_instance *instance =
+ container_of(work, struct megasas_instance, work_init);
+ u32 wait;
+ unsigned long flags;
+
+ if (instance->adprecovery != MEGASAS_ADPRESET_SM_INFAULT) {
+ printk(KERN_NOTICE "megaraid_sas: error, recovery st %x
",
+ instance->adprecovery);
+ return ;
+ }
+
+ if (instance->adprecovery == MEGASAS_ADPRESET_SM_INFAULT) {
+ printk(KERN_NOTICE "megaraid_sas: FW detected to be in fault"
+ "state, restarting it...
");
+
+ instance->instancet->disable_intr(instance->reg_set);
+ atomic_set(&instance->fw_outstanding, 0);
+
+ atomic_set(&instance->fw_reset_no_pci_access, 1);
+ instance->instancet->adp_reset(instance, instance->reg_set);
+ atomic_set(&instance->fw_reset_no_pci_access, 0 );
+
+ printk(KERN_NOTICE "megaraid_sas: FW restarted successfully,"
+ "initiating next stage...
");
+
+ printk(KERN_NOTICE "megaraid_sas: HBA recovery state machine,"
+ "state 2 starting...
");
+
+ /*waitting for about 20 second before start the second init*/
+ for (wait = 0; wait < 30; wait++) {
+ msleep(1000);
+ }
+
+ if (megasas_transition_to_ready(instance)) {
+ printk(KERN_NOTICE "megaraid_sas:adapter not ready
");
+
+ megaraid_sas_kill_hba(instance);
+ instance->adprecovery = MEGASAS_HW_CRITICAL_ERROR;
+ return ;
+ }
+
+ if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1064R) ||
+ (instance->pdev->device == PCI_DEVICE_ID_DELL_PERC5) ||
+ (instance->pdev->device == PCI_DEVICE_ID_LSI_VERDE_ZCR)
+ ) {
+ *instance->consumer = *instance->producer;
+ } else {
+ *instance->consumer = 0;
+ *instance->producer = 0;
+ }
+
+ megasas_issue_init_mfi(instance);
+
+ spin_lock_irqsave(&instance->hba_lock, flags);
+ instance->adprecovery = MEGASAS_HBA_OPERATIONAL;
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+ instance->instancet->enable_intr(instance->reg_set);
+
+ megasas_issue_pending_cmds_again(instance);
+ instance->issuepend_done = 1;
+ }
+ return ;
+}
+
+/**
* megasas_deplete_reply_queue - Processes all completed commands
* @instance: Adapter soft state
* @alt_status: Alternate status to be returned to
* SCSI mid-layer instead of the status
* returned by the FW
+ * Note: this must be called with hba lock held
*/
static int
-megasas_deplete_reply_queue(struct megasas_instance *instance, u8 alt_status)
+megasas_deplete_reply_queue(struct megasas_instance *instance,
+ u8 alt_status)
{
- /*
- * Check if it is our interrupt
- * Clear the interrupt
- */
- if(instance->instancet->clear_intr(instance->reg_set))
+ u32 mfiStatus;
+ u32 fw_state;
+
+ if ((mfiStatus = instance->instancet->check_reset(instance,
+ instance->reg_set)) == 1) {
+ return IRQ_HANDLED;
+ }
+
+ if ((mfiStatus = instance->instancet->clear_intr(
+ instance->reg_set)
+ ) == 0) {
return IRQ_NONE;
+ }
+
+ instance->mfiStatus = mfiStatus;
+
+ if ((mfiStatus & MFI_INTR_FLAG_FIRMWARE_STATE_CHANGE)) {
+ fw_state = instance->instancet->read_fw_status_reg(
+ instance->reg_set) & MFI_STATE_MASK;
+
+ if (fw_state != MFI_STATE_FAULT) {
+ printk(KERN_NOTICE "megaraid_sas: fw state:%x
",
+ fw_state);
+ }
+
+ if ((fw_state == MFI_STATE_FAULT) &&
+ (instance->disableOnlineCtrlReset == 0)) {
+ printk(KERN_NOTICE "megaraid_sas: wait adp restart
");
+
+ if ((instance->pdev->device ==
+ PCI_DEVICE_ID_LSI_SAS1064R) ||
+ (instance->pdev->device ==
+ PCI_DEVICE_ID_DELL_PERC5) ||
+ (instance->pdev->device ==
+ PCI_DEVICE_ID_LSI_VERDE_ZCR)) {
+
+ *instance->consumer =
+ MEGASAS_ADPRESET_INPROG_SIGN;
+ }
+
+
+ instance->instancet->disable_intr(instance->reg_set);
+ instance->adprecovery = MEGASAS_ADPRESET_SM_INFAULT;
+ instance->issuepend_done = 0;
+
+ atomic_set(&instance->fw_outstanding, 0);
+ megasas_internal_reset_defer_cmds(instance);
+
+ printk(KERN_NOTICE "megasas: fwState=%x, stage:%d
",
+ fw_state, instance->adprecovery);
+
+ schedule_work(&instance->work_init);
+ return IRQ_HANDLED;
+
+ } else {
+ printk(KERN_NOTICE "megasas: fwstate:%x, dis_OCR=%x
",
+ fw_state, instance->disableOnlineCtrlReset);
+ }
+ }

- if (instance->hw_crit_error)
- goto out_done;
- /*
- * Schedule the tasklet for cmd completion
- */
tasklet_schedule(&instance->isr_tasklet);
-out_done:
return IRQ_HANDLED;
}
-
/**
* megasas_isr - isr entry point
*/
static irqreturn_t megasas_isr(int irq, void *devp)
{
- return megasas_deplete_reply_queue((struct megasas_instance *)devp,
- DID_OK);
+ struct megasas_instance *instance;
+ unsigned long flags;
+ irqreturn_t rc;
+
+ if (atomic_read(
+ &(((struct megasas_instance *)devp)->fw_reset_no_pci_access)))
+ return IRQ_HANDLED;
+
+ instance = (struct megasas_instance *)devp;
+
+ spin_lock_irqsave(&instance->hba_lock, flags);
+ rc = megasas_deplete_reply_queue(instance, DID_OK);
+ spin_unlock_irqrestore(&instance->hba_lock, flags);
+
+ return rc;
}

/**
@@ -1900,7 +2459,7 @@ megasas_transition_to_ready(struct megasas_instance* instance)
"in %d secs
", fw_state, max_wait);
return -ENODEV;
}
- };
+ }
printk(KERN_INFO "megasas: FW now in Ready state
");

return 0;
@@ -1982,6 +2541,7 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
*/
sgl_sz = sge_sz * instance->max_num_sge;
frame_count = (sgl_sz + MEGAMFI_FRAME_SIZE - 1) / MEGAMFI_FRAME_SIZE;
+ frame_count = 15;

/*
* We need one extra frame for the MFI command
@@ -2129,6 +2689,7 @@ static int megasas_alloc_cmds(struct megasas_instance *instance)
cmd = instance->cmd_list[i];
memset(cmd, 0, sizeof(struct megasas_cmd));
cmd->index = i;
+ cmd->scmd = NULL;
cmd->instance = instance;

list_add_tail(&cmd->list, &instance->cmd_pool);
@@ -2295,7 +2856,7 @@ megasas_get_ld_list(struct megasas_instance *instance)

/* the following function will get the instance PD LIST */

- if ((ret == 0) && (ci->ldCount < MAX_LOGICAL_DRIVES)) {
+ if ((ret == 0) && (ci->ldCount <= MAX_LOGICAL_DRIVES)) {
memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS);

for (ld_index = 0; ld_index < ci->ldCount; ld_index++) {
@@ -2606,6 +3167,21 @@ static int megasas_init_mfi(struct megasas_instance *instance)
if (megasas_issue_init_mfi(instance))
goto fail_fw_init;

+ instance->fw_support_ieee =
 
Old 03-30-2012, 12:47 PM
Buford Peek
 
Default Bug#666108: Dell PERC H710P is not supported by Squeeze Standard Kernel

Jonathon,

Looks like the patch didn't work ..I got the same problem as before when I booted the system. The system booted me to initramfs shell..It did not find any megaraid drivers( megaraid not in /proc/modules or not megaraid output in dmesg). The Drives were not found (ls -al /dev/sd* returned nothing).

Just for Clarification, and to verify that I have patched the kernel properly(I usually just compile from linux-source package, so I don't manually patch the kernel)... here is the process I went through to patch the kernel.

# first I downloaded the source and patches
apt-get source llinux-2.6
apt-get install linux-patch-debian-2.6.32

#patched the source
cd linux-2.6-2.6.32
./debian/rules source

# Manually applied the SCSI megaraid patches
patch <0001-XXX.patch ..... 0012-XXX.patch

# Verified that Megaraid patches were applied to build target
# It looked like the patch was applied successfully
diff /lancope/var/pristine/linux-2.6-2.6.32/drivers/scsi/megaraid/megaraid_sas.c ./drivers/scsi/megaraid/megaraid_sas.c

# Compile and build package
make-kpkg --rootcmd fakeroot --initrd kernel-image kernel-headers kernel-source

thanks,
-Buford
________________________________________

From: Jonathan Nieder [jrnieder@gmail.com]
Sent: Thursday, March 29, 2012 3:47 PM
To: Buford Peek
Cc: 666108@bugs.debian.org
Subject: Re: Dell PERC H710P is not supported by Squeeze Standard Kernel

block 624794 by 666108
tags 666108 + upstream patch moreinfo
# hardware support
severity 666108 important
quit

Buford Peek wrote:

> dmesg | grep mega returned nothing...

Thanks. Support for this controller was added during the 2.6.38-rc1
merge window (commit 9c915a8c99bc, "[SCSI] megaraid_sas: Add 9565/9285
specific code", 2010-12-21).

Could you try the attached patch series against the squeeze kernel?
Instructions are at [1], and if you have any questions, please don't
hesitate to ask.

Hope that helps,
Jonathan

[1] http://kernel-handbook.alioth.debian.org/ch-common-tasks.html#s-common-official
or the corresponding page in the debian-kernel-handbook package

Adam Radford (5):
[SCSI] megaraid_sas: Rename megaraid_sas.c to megaraid_sas_base.c
[SCSI] megaraid_sas: Add MSI-X support and msix_disable module parameter
[SCSI] megaraid_sas: Use lowest memory bar for SR-IOV VF support
[SCSI] megaraid_sas: Add struct megasas_instance_template changes
[SCSI] megaraid_sas: Add 9565/9285 specific code

Noriyuki Fujii (1):
[SCSI] megaraid_sas: make driver PCI legacy I/O port free driver

Yang, Bo (6):
[SCSI] megaraid_sas: infrastructure to get PDs from FW
[SCSI] megaraid_sas: Add the support for updating the OS after adding/
removing the devices from FW
[SCSI] megaraid_sas: add the logical drive list to driver
[SCSI] megaraid_sas: driver fixed the device update issue
[SCSI] megaraid_sas: add the IEEE SGE support to SAS2 controller
[SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive

drivers/scsi/megaraid/Makefile | 2 +
drivers/scsi/megaraid/megaraid_sas.c | 3827 -------------------
drivers/scsi/megaraid/megaraid_sas.h | 273 +-
drivers/scsi/megaraid/megaraid_sas_base.c | 5253 +++++++++++++++++++++++++++
drivers/scsi/megaraid/megaraid_sas_fp.c | 516 +++
drivers/scsi/megaraid/megaraid_sas_fusion.c | 2248 ++++++++++++
drivers/scsi/megaraid/megaraid_sas_fusion.h | 695 ++++
7 files changed, 8974 insertions(+), 3840 deletions(-)
delete mode 100644 drivers/scsi/megaraid/megaraid_sas.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_base.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fp.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fusion.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fusion.h



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: FB09F9AF3FE25444B277AA82BB35EE175F02905F@LCHQEX03. lancope.local">http://lists.debian.org/FB09F9AF3FE25444B277AA82BB35EE175F02905F@LCHQEX03. lancope.local
 
Old 03-30-2012, 01:09 PM
Buford Peek
 
Default Bug#666108: Dell PERC H710P is not supported by Squeeze Standard Kernel

Jonathon,

Nix my last comment, ..it is looking like it works..It was late last night and I pretty much booted the standard linux-image-2.6.32-41 package again..I am still doing some preliminary testing and will get back with you later today on my findings.

thanks for you help,
-Buford
________________________________________
From: Buford Peek [BPeek@lancope.com]
Sent: Friday, March 30, 2012 8:47 AM
To: Jonathan Nieder
Cc: 666108@bugs.debian.org
Subject: Bug#666108: Dell PERC H710P is not supported by Squeeze Standard Kernel

Jonathon,

Looks like the patch didn't work ..I got the same problem as before when I booted the system. The system booted me to initramfs shell..It did not find any megaraid drivers( megaraid not in /proc/modules or not megaraid output in dmesg). The Drives were not found (ls -al /dev/sd* returned nothing).

Just for Clarification, and to verify that I have patched the kernel properly(I usually just compile from linux-source package, so I don't manually patch the kernel)... here is the process I went through to patch the kernel.

# first I downloaded the source and patches
apt-get source llinux-2.6
apt-get install linux-patch-debian-2.6.32

#patched the source
cd linux-2.6-2.6.32
./debian/rules source

# Manually applied the SCSI megaraid patches
patch <0001-XXX.patch ..... 0012-XXX.patch

# Verified that Megaraid patches were applied to build target
# It looked like the patch was applied successfully
diff /lancope/var/pristine/linux-2.6-2.6.32/drivers/scsi/megaraid/megaraid_sas.c ./drivers/scsi/megaraid/megaraid_sas.c

# Compile and build package
make-kpkg --rootcmd fakeroot --initrd kernel-image kernel-headers kernel-source

thanks,
-Buford
________________________________________

From: Jonathan Nieder [jrnieder@gmail.com]
Sent: Thursday, March 29, 2012 3:47 PM
To: Buford Peek
Cc: 666108@bugs.debian.org
Subject: Re: Dell PERC H710P is not supported by Squeeze Standard Kernel

block 624794 by 666108
tags 666108 + upstream patch moreinfo
# hardware support
severity 666108 important
quit

Buford Peek wrote:

> dmesg | grep mega returned nothing...

Thanks. Support for this controller was added during the 2.6.38-rc1
merge window (commit 9c915a8c99bc, "[SCSI] megaraid_sas: Add 9565/9285
specific code", 2010-12-21).

Could you try the attached patch series against the squeeze kernel?
Instructions are at [1], and if you have any questions, please don't
hesitate to ask.

Hope that helps,
Jonathan

[1] http://kernel-handbook.alioth.debian.org/ch-common-tasks.html#s-common-official
or the corresponding page in the debian-kernel-handbook package

Adam Radford (5):
[SCSI] megaraid_sas: Rename megaraid_sas.c to megaraid_sas_base.c
[SCSI] megaraid_sas: Add MSI-X support and msix_disable module parameter
[SCSI] megaraid_sas: Use lowest memory bar for SR-IOV VF support
[SCSI] megaraid_sas: Add struct megasas_instance_template changes
[SCSI] megaraid_sas: Add 9565/9285 specific code

Noriyuki Fujii (1):
[SCSI] megaraid_sas: make driver PCI legacy I/O port free driver

Yang, Bo (6):
[SCSI] megaraid_sas: infrastructure to get PDs from FW
[SCSI] megaraid_sas: Add the support for updating the OS after adding/
removing the devices from FW
[SCSI] megaraid_sas: add the logical drive list to driver
[SCSI] megaraid_sas: driver fixed the device update issue
[SCSI] megaraid_sas: add the IEEE SGE support to SAS2 controller
[SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive

drivers/scsi/megaraid/Makefile | 2 +
drivers/scsi/megaraid/megaraid_sas.c | 3827 -------------------
drivers/scsi/megaraid/megaraid_sas.h | 273 +-
drivers/scsi/megaraid/megaraid_sas_base.c | 5253 +++++++++++++++++++++++++++
drivers/scsi/megaraid/megaraid_sas_fp.c | 516 +++
drivers/scsi/megaraid/megaraid_sas_fusion.c | 2248 ++++++++++++
drivers/scsi/megaraid/megaraid_sas_fusion.h | 695 ++++
7 files changed, 8974 insertions(+), 3840 deletions(-)
delete mode 100644 drivers/scsi/megaraid/megaraid_sas.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_base.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fp.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fusion.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fusion.h






--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: FB09F9AF3FE25444B277AA82BB35EE175F029149@LCHQEX03. lancope.local">http://lists.debian.org/FB09F9AF3FE25444B277AA82BB35EE175F029149@LCHQEX03. lancope.local
 
Old 03-30-2012, 06:45 PM
Buford Peek
 
Default Bug#666108: Dell PERC H710P is not supported by Squeeze Standard Kernel

Jonathon,

So far everything is looking good..We do NOT run a stock config so I have recompiled the kernel with our specific config and will run LTP testing on the system to determine if their are any more issues.

-Buford
________________________________________
From: Jonathan Nieder [jrnieder@gmail.com]
Sent: Thursday, March 29, 2012 3:47 PM
To: Buford Peek
Cc: 666108@bugs.debian.org
Subject: Re: Dell PERC H710P is not supported by Squeeze Standard Kernel

block 624794 by 666108
tags 666108 + upstream patch moreinfo
# hardware support
severity 666108 important
quit

Buford Peek wrote:

> dmesg | grep mega returned nothing...

Thanks. Support for this controller was added during the 2.6.38-rc1
merge window (commit 9c915a8c99bc, "[SCSI] megaraid_sas: Add 9565/9285
specific code", 2010-12-21).

Could you try the attached patch series against the squeeze kernel?
Instructions are at [1], and if you have any questions, please don't
hesitate to ask.

Hope that helps,
Jonathan

[1] http://kernel-handbook.alioth.debian.org/ch-common-tasks.html#s-common-official
or the corresponding page in the debian-kernel-handbook package

Adam Radford (5):
[SCSI] megaraid_sas: Rename megaraid_sas.c to megaraid_sas_base.c
[SCSI] megaraid_sas: Add MSI-X support and msix_disable module parameter
[SCSI] megaraid_sas: Use lowest memory bar for SR-IOV VF support
[SCSI] megaraid_sas: Add struct megasas_instance_template changes
[SCSI] megaraid_sas: Add 9565/9285 specific code

Noriyuki Fujii (1):
[SCSI] megaraid_sas: make driver PCI legacy I/O port free driver

Yang, Bo (6):
[SCSI] megaraid_sas: infrastructure to get PDs from FW
[SCSI] megaraid_sas: Add the support for updating the OS after adding/
removing the devices from FW
[SCSI] megaraid_sas: add the logical drive list to driver
[SCSI] megaraid_sas: driver fixed the device update issue
[SCSI] megaraid_sas: add the IEEE SGE support to SAS2 controller
[SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive

drivers/scsi/megaraid/Makefile | 2 +
drivers/scsi/megaraid/megaraid_sas.c | 3827 -------------------
drivers/scsi/megaraid/megaraid_sas.h | 273 +-
drivers/scsi/megaraid/megaraid_sas_base.c | 5253 +++++++++++++++++++++++++++
drivers/scsi/megaraid/megaraid_sas_fp.c | 516 +++
drivers/scsi/megaraid/megaraid_sas_fusion.c | 2248 ++++++++++++
drivers/scsi/megaraid/megaraid_sas_fusion.h | 695 ++++
7 files changed, 8974 insertions(+), 3840 deletions(-)
delete mode 100644 drivers/scsi/megaraid/megaraid_sas.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_base.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fp.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fusion.c
create mode 100644 drivers/scsi/megaraid/megaraid_sas_fusion.h



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: FB09F9AF3FE25444B277AA82BB35EE175F029319@LCHQEX03. lancope.local">http://lists.debian.org/FB09F9AF3FE25444B277AA82BB35EE175F029319@LCHQEX03. lancope.local
 

Thread Tools




All times are GMT. The time now is 09:24 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org