Skip to contentSkip to conversation

megaraid_sas: Update for scsi for-next

PATCH In review Adam Radford 2 participants 8 messages Jul 9, 2014 – Jul 11, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover megaraid_sas: Update for scsi for-next

(Re-sending again based on feedback from Christoph Hellwig & Martin Petersen)

The following patch series for megaraid_sas brings the driver up to v06.803.02.00-rc1.

1. Fix reset_mutex leak in megasas_reset_fusion().
2. Remove unused variables in megasas_instance.
3. Fix LD/VF affiliation parsing.
4. Add missing initial call to megasas_get_ld_vf_affiliation().
5. Version and Changelog update.

Adam Radford (5):
megaraid_sas: Fix reset_mutex leak
megaraid_sas: Remove unused variables in megasas_instance
megaraid_sas: Fix LD/VF affiliation parsing
megaraid_sas: Add missing initial call to
megasas_get_ld_vf_affiliation().
megaraid_sas: Version and Changelog update

 Documentation/scsi/ChangeLog.megaraid_sas   |  14 ++
 drivers/scsi/megaraid/megaraid_sas.h        |   9 +-
 drivers/scsi/megaraid/megaraid_sas_base.c   | 324 ++++++++++++++++++----------
 drivers/scsi/megaraid/megaraid_sas_fusion.c |   1 +
 4 files changed, 231 insertions(+), 117 deletions(-)
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 1/5 megaraid_sas: Fix reset_mutex leak

The following patch for megaraid_sas fixes a reset_mutex leak in megasas_reset_fusion().

---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/megaraid/megaraid_sas_fusion.c +1 -0
index 2260041..0858851 100644
@@ -2355,6 +2355,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int iotimeout)
 		printk(KERN_WARNING "megaraid_sas: Hardware critical error, "
 		       "returning FAILED for scsi%d.\n",
 			instance->host->host_no);
+		mutex_unlock(&instance->reset_mutex);
 		return FAILED;
 	}
 
Signature · 1 line
1.7.11.7
#2 lore raw

PATCH 2/5 megaraid_sas: Remove unused variables in megasas_instance

In reply to Adam Radford

The following patch for megaraid_sas removes some unused variables from the megasas_instance structure.

---
 drivers/scsi/megaraid/megaraid_sas.h | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/megaraid/megaraid_sas.h +0 -2
index 32166c2..7d722fb 100644
@@ -1633,8 +1633,6 @@ struct megasas_instance {
 	struct timer_list sriov_heartbeat_timer;
 	char skip_heartbeat_timer_del;
 	u8 requestorId;
-	u64 initiator_sas_address;
-	u64 ld_sas_address[64];
 	char PlasmaFW111;
 	char mpio;
 	int throttlequeuedepth;
Signature · 1 line
1.7.11.7
#3 lore raw

PATCH 3/5 megaraid_sas: Fix LD/VF affiliation parsing

In reply to Adam Radford

The following patch for megaraid_sas fixes the LD/VF affiliation policy parsing code to account for LD targetId's and Hidden LD's (not yet affiliated with any Virtual Functions). This also breaks megasas_get_ld_vf_affiliation() into 2 separate functions: megasas_get_ld_vf_affiliation_111() and megasas_get_ld_Vf_affiliation_12() to reduce indentation levels.

---
 drivers/scsi/megaraid/megaraid_sas.h      |   1 +
 drivers/scsi/megaraid/megaraid_sas_base.c | 318 +++++++++++++++++++-----------
 2 files changed, 208 insertions(+), 111 deletions(-)
drivers/scsi/megaraid/megaraid_sas.h +1 -0
index 7d722fb..2e2fcb2 100644
@@ -1659,6 +1659,7 @@ struct MR_LD_VF_AFFILIATION {
 /* Plasma 1.11 FW backward compatibility structures */
 #define IOV_111_OFFSET 0x7CE
 #define MAX_VIRTUAL_FUNCTIONS 8
+#define MR_LD_ACCESS_HIDDEN 15
 
 struct IOV_111 {
 	u8 maxVFsSupported;
drivers/scsi/megaraid/megaraid_sas_base.c +207 -111

390 lines not on this page · raw message

Signature · 1 line
1.7.11.7
Reviewed-by on v1 3/5
#4 lore raw

Re: [PATCH 3/5] megaraid_sas: Fix LD/VF affiliation parsing

Quoted 48 lines · Adam Radford

The following patch for megaraid_sas fixes the LD/VF affiliation policy parsing code to account for LD targetId's and Hidden LD's (not yet affiliated with any Virtual Functions). This also breaks megasas_get_ld_vf_affiliation() into 2 separate functions: megasas_get_ld_vf_affiliation_111() and megasas_get_ld_Vf_affiliation_12() to reduce indentation levels.

---
 drivers/scsi/megaraid/megaraid_sas.h      |   1 +
 drivers/scsi/megaraid/megaraid_sas_base.c | 318 +++++++++++++++++++-----------
 2 files changed, 208 insertions(+), 111 deletions(-)
drivers/scsi/megaraid/megaraid_sas.h +1 -0
index 7d722fb..2e2fcb2 100644
@@ -1659,6 +1659,7 @@ struct MR_LD_VF_AFFILIATION {
 /* Plasma 1.11 FW backward compatibility structures */
 #define IOV_111_OFFSET 0x7CE
 #define MAX_VIRTUAL_FUNCTIONS 8
+#define MR_LD_ACCESS_HIDDEN 15
 
 struct IOV_111 {
 	u8 maxVFsSupported;
drivers/scsi/megaraid/megaraid_sas_base.c +2 -6
index 112799b..b4c032c 100644
@@ -1825,16 +1825,12 @@ void megasas_do_ocr(struct megasas_instance *instance)
 	process_fw_state_change_wq(&instance->work_init);
 }
 
-/* This function will get the current SR-IOV LD/VF affiliation */
-static int megasas_get_ld_vf_affiliation(struct megasas_instance *instance,
-	int initial)
+static int megasas_get_ld_vf_affiliation_111(struct megasas_instance *instance,
+					    int initial)
 {
 	struct megasas_cmd *cmd;
 	struct megasas_dcmd_frame *dcmd;
-	struct MR_LD_VF_AFFILIATION *new_affiliation = NULL;
 	struct MR_LD_VF_AFFILIATION_111 *new_affiliation_111 = NULL;
-	struct MR_LD_VF_MAP *newmap = NULL, *savedmap = NULL;
-	dma_addr_t new_affiliation_h;
 	dma_addr_t new_affiliation_111_h;
 	int ld, retval = 0;
 	u8 thisVf;

drivers/scsi/megaraid/megaraid_sas_base.c static int megasas_get_ld_vf_affiliation(struct megasas_instance *instance, · line 1841

Quoted 6 lines
drivers/scsi/megaraid/megaraid_sas_base.c +1 -2
@@ -1842,15 +1838,15 @@ static int megasas_get_ld_vf_affiliation(struct megasas_instance *instance,
 	cmd = megasas_get_cmd(instance);
 
 	if (!cmd) {
-		printk(KERN_DEBUG "megasas: megasas_get_ld_vf_"
-		       "affiliation: Failed to get cmd for scsi%d.\n",
+		printk(KERN_DEBUG "megasas: megasas_get_ld_vf_affiliation_111:"

You'd make your life easier if you just used __func__ to print the function name.

I also think the initial variant should have their own set of functions, but I'm not going to held this series over over these bits:

#5 lore raw

PATCH 4/5 megaraid_sas: Add missing initial call to megasas_get_ld_vf_affiliation().

In reply to Adam Radford

The following patch for megaraid_sas adds a missing initial call to megasas_get_ld_vf_affiliation() at the end of megasas_probe_one().

---
 drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/scsi/megaraid/megaraid_sas_base.c +4 -0
index b4c032c..6db5c12 100644
@@ -4992,6 +4992,10 @@ retry_irq_register:
 		goto fail_start_aen;
 	}
 
+	/* Get current SR-IOV LD/VF affiliation */
+	if (instance->requestorId)
+		megasas_get_ld_vf_affiliation(instance, 1);
+
 	return 0;
 
       fail_start_aen:
Signature · 1 line
1.7.11.7
#7 lore raw

PATCH 5/5 megaraid_sas: Version and Changelog update

In reply to Adam Radford

The following patch for megaraid_sas updates the driver version and Documentation/scsi/ChangeLog.megaraid_sas.

---
 Documentation/scsi/ChangeLog.megaraid_sas | 14 ++++++++++++++
 drivers/scsi/megaraid/megaraid_sas.h      |  6 +++---
 drivers/scsi/megaraid/megaraid_sas_base.c |  2 +-
 3 files changed, 18 insertions(+), 4 deletions(-)
Documentation/scsi/ChangeLog.megaraid_sas +14 -0
index 91ba58e..18b5709 100644
@@ -1,3 +1,17 @@
+Release Date    : Thu. Jun 19, 2014 17:00:00 PST 2014 -
+			(emaild-id:[email protected])
+			Adam Radford
+			Kashyap Desai
+			Sumit Saxena
+			Uday Lingala
+Current Version : 06.803.02.00-rc1
+Old Version     : 06.803.01.00-rc1
+    1. Fix reset_mutex leak in megasas_reset_fusion().
+    2. Remove unused variables in megasas_instance.
+    3. Fix LD/VF affiliation parsing.
+    4. Add missing initial call to megasas_get_ld_vf_affiliation().
+    5. Version and Changelog update.
+-------------------------------------------------------------------------------
 Release Date    : Mon. Mar 10, 2014 17:00:00 PST 2014 -
 			(emaild-id:[email protected])
 			Adam Radford
drivers/scsi/megaraid/megaraid_sas.h +3 -3
index 2e2fcb2..bc7adcf 100644
@@ -33,9 +33,9 @@
 /*
  * MegaRAID SAS Driver meta data
  */
-#define MEGASAS_VERSION				"06.803.01.00-rc1"
-#define MEGASAS_RELDATE				"Mar. 10, 2014"
-#define MEGASAS_EXT_VERSION			"Mon. Mar. 10 17:00:00 PDT 2014"
+#define MEGASAS_VERSION				"06.803.02.00-rc1"
+#define MEGASAS_RELDATE				"Jun. 19, 2014"
+#define MEGASAS_EXT_VERSION			"Thu. Jun. 19 17:00:00 PDT 2014"
 
 /*
  * Device IDs
drivers/scsi/megaraid/megaraid_sas_base.c +1 -1
index 6db5c12..a2263fd 100644
@@ -18,7 +18,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  *
  *  FILE: megaraid_sas_base.c
- *  Version : 06.803.01.00-rc1
+ *  Version : 06.803.02.00-rc1
  *
  *  Authors: LSI Corporation
  *           Sreenivas Bagalkote
Signature · 1 line
1.7.11.7