Bug 619365

Summary: [LSI 5.6 feat] update megaraid_sas to version 4.31 [rhel-5.5.z]
Product: Red Hat Enterprise Linux 5 Reporter: RHEL Program Management <pm-rhel>
Component: kernelAssignee: Tomas Henzl <thenzl>
Status: CLOSED ERRATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: high Docs Contact:
Priority: urgent    
Version: 5.6CC: andriusb, bdonahue, bmr, bo.yang, bugproxy, coughlan, cward, dhoward, eguan, jpirko, kzhang, ltroan, martinez, martin.wilck, moshiro, myamazak, narayanan_d, nobody+PNT0273897, pm-eus, revers, sbest, tao, thenzl
Target Milestone: rcKeywords: FutureFeature, OtherQA, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
A bug was found in the way the megaraid_sas driver (for SAS based RAID controllers) handled physical disks and management IOCTLs (Input/Output Control). All physical disks were exported to the disk layer, allowing an oops in megasas_complete_cmd_dpc() when completing the IOCTL command if a timeout occurred. One possible trigger for this bug was running mkfs. This update resolves this issue by updating the megaraid_sas driver to version 4.31.
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-09 18:08:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 564249    
Bug Blocks:    
Attachments:
Description Flags
Update the megaraid sas driver to rhel5.5.z none

Description RHEL Program Management 2010-07-29 11:53:33 UTC
This bug has been copied from bug #564249 and has been proposed
to be backported to 5.5 z-stream (EUS).

Comment 2 Jiri Pirko 2010-07-29 14:18:02 UTC
Note that purpose of this bz is only to fix issue described in bug 602714. This issue is fixed in 5.6 by a driver update. Separate fix is backported to this z-stream, not the full driver update.

Comment 5 Martin Wilck 2010-08-16 11:22:01 UTC
Can you please attach the patch that has been used here?

Comment 6 Tomas Henzl 2010-08-16 16:38:25 UTC
(In reply to comment #5)
> Can you please attach the patch that has been used here?

Sorry, we don't have the patch yet.

Comment 7 bo yang 2010-08-25 21:13:27 UTC
Created attachment 441053 [details]
Update the megaraid sas driver to rhel5.5.z

Tomas,

Attached is the patch for megaraid sas driver for rhel5.5.z

Comment 8 bo yang 2010-08-25 21:14:31 UTC
Tomas,

Let me know if you are facing the issues for this patch.

Thanks,

Bo Yang

Comment 9 Tomas Henzl 2010-08-26 12:48:57 UTC
(In reply to comment #7)
> Attached is the patch for megaraid sas driver for rhel5.5.z

Thanks, I'll look into it.

Comment 10 Tomas Henzl 2010-08-26 15:43:31 UTC
Hi Bo,
I looked at the differencies between 5.5.z and 5.6 and would like you to clarify some points:

megasas_check_reset_gen2(struct megasas_instance *instance, struct megasas_register_set __iomem * regs)
 {
+        if (instance->adprecovery != MEGASAS_HBA_OPERATIONAL) {
+                return 1;
+        }
1.This is missing in 5.6 should it be added?
 
I'll change the sysfs_max_sectors_read function so it corresponds to what is in 5.6 myself and let you verify that.
@@ -3033,7 +3055,6 @@ megasas_get_pd_list(struct megasas_insta
 	dcmd->timeout = 0;
-	dcmd->pad_0 = 0;
 	dcmd->data_xfer_len = MEGASAS_MAX_PD * sizeof(struct MR_PD_LIST);
2.This is missing in 5.5,z should it be added?

@@ -3142,7 +3159,7 @@ megasas_get_ld_list(struct megasas_insta
 
-	if ( (ret == 0) && (ci->ldCount <= (MAX_LOGICAL_DRIVES))){
+	if ( (ret == 0) && (ci->ldCount < (MAX_LOGICAL_DRIVES))){
 		
3.Which version is wrong?

4.In 5.6 we have scsi_host_put(host); in megasas_suspend this seems to be wrong should it be removed?
@@ -4174,21 +4190,12 @@ megasas_suspend(struct pci_dev *pdev, pm
 
-	scsi_host_put(host);
 	pci_save_state(pdev);


5.Then there is a lot of changes in cancel_delayed_work(&ev->hotplug_work);
which is missing in 5.5.z
@@ -3933,7 +3950,6 @@ megasas_probe_one(struct pci_dev *pdev, 
 	instance->flag_ieee = 0;
-	instance->ev = NULL;
  	instance->issuepend_done = 1;
@@ -4174,21 +4190,12 @@ megasas_suspend(struct pci_dev *pdev, pm
 	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(&ev->hotplug_work);
-		flush_scheduled_work();
-		instance->ev = NULL;
-	}
-
 	tasklet_kill(&instance->isr_tasklet);
@@ -4327,14 +4329,6 @@ static void __devexit megasas_detach_one
 	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(&ev->hotplug_work);
-		flush_scheduled_work();
-		instance->ev = NULL;
-	}
-
 	tasklet_kill(&instance->isr_tasklet);
@@ -5007,7 +4989,6 @@ megasas_aen_polling(void *arg)
 		return;
 	}
-	instance->ev = NULL;
 	host = instance->host;
@@ -5007,7 +4989,6 @@ megasas_aen_polling(void *arg)
 	}
-	instance->ev = NULL;
 	host = instance->host;


6.This is again missing in 5.5.z - which version is ok? 
@@ -4261,11 +4268,6 @@ megasas_resume(struct pci_dev *pdev)
 	/*
-	 * Store instance in PCI softstate
-	 */
-	pci_set_drvdata(pdev, instance);
-

Comment 11 Tomas Henzl 2010-08-31 15:02:51 UTC
Bo,
thanks for posting the 4.9 version. Please answer the question here, as some of them seems to apply also for the 4.9 version.

Thanks, Tomas

Comment 12 Tomas Henzl 2010-09-08 15:01:44 UTC
Bo,
any news here?

Comment 13 bo yang 2010-09-13 14:21:38 UTC
Tomas,

1. megasas_check_reset_gen2(struct megasas_instance *instance, struct
megasas_register_set __iomem * regs)
 {
+        if (instance->adprecovery != MEGASAS_HBA_OPERATIONAL) {
+                return 1;
+        }
1.This is missing in 5.6 should it be added?  

--->this is needed.  It was fixed in later version (4.32).

2.  @@ -3033,7 +3055,6 @@ megasas_get_pd_list(struct megasas_insta
  dcmd->timeout = 0;
- dcmd->pad_0 = 0;
  dcmd->data_xfer_len = MEGASAS_MAX_PD * sizeof(struct MR_PD_LIST);

--->we see the issue in VMWare esx4.xx, but it is not seeing in Linux.  it is OK if not have this.

3.  2.This is missing in 5.5,z should it be added?

@@ -3142,7 +3159,7 @@ megasas_get_ld_list(struct megasas_insta

- if ( (ret == 0) && (ci->ldCount <= (MAX_LOGICAL_DRIVES))){
+ if ( (ret == 0) && (ci->ldCount < (MAX_LOGICAL_DRIVES))){

---> - if ( (ret == 0) && (ci->ldCount <= (MAX_LOGICAL_DRIVES))){ is the correct one, but I only apply the OCR changes based on the base, so it missed.


all items 4, 5 and 6 was not related to OCR.  So they are not in rhel5.5z as base doesn't have.

Comment 14 Tomas Henzl 2010-09-23 12:27:00 UTC
Bo,
I just posted this for internal review.

Next time please consider running checkpatch.pl against your patches and correct the coding style issues. There is a lot of them.
&checkpatch.pl your.patch
....
total: 365 errors, 155 warnings, 2828 lines checked

Comment 15 Jiri Pirko 2010-10-11 08:54:32 UTC
in kernel 2.6.18-194.20.1.el5

linux-2.6-scsi-megaraid_sas-fix-physical-disk-handling.patch

Comment 24 Eryu Guan 2010-11-07 16:04:56 UTC
Hi, any updates? We expect to get feedback before Nov. 8

Comment 25 Eryu Guan 2010-11-09 02:14:36 UTC
Confirmed patch linux-2.6-scsi-megaraid_sas-fix-physical-disk-handling.patch is applied in 2.6.18-194.26.1.el5 kernel correctly. Set SanityOnly verified

Comment 27 errata-xmlrpc 2010-11-09 18:08:37 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0839.html

Comment 28 Martin Prpič 2010-11-11 13:59:54 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
A bug was found in the way the megaraid_sas driver (for SAS based RAID controllers) handled physical disks and management IOCTLs (Input/Output Control). All physical disks were exported to the disk layer, allowing an oops in megasas_complete_cmd_dpc() when completing the IOCTL command if a timeout occurred. One possible trigger for this bug was running mkfs. This update resolves this issue by updating the megaraid_sas driver to version 4.31.