* [PATCH 0/4] megaraid_sas: Update for scsi for-next
@ 2014-07-01 0:19 Adam Radford
2014-07-01 0:19 ` [PATCH 1/4] megaraid_sas: Fix reset_mutex leak Adam Radford
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Adam Radford @ 2014-07-01 0:19 UTC (permalink / raw)
To: linux-scsi, kashyap.desai, sumit.saxena, uday.lingala; +Cc: Adam Radford
(Re-sending with git-send-email on advice of Martin Petersen @ Oracle)
James/linux-scsi,
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. Version and Changelog update.
Adam Radford (4):
megaraid_sas: Fix reset_mutex leak
megaraid_sas: Removed unused variables in megasas_instance
megaraid_sas: Fix LD/VF affiliation parsing
megaraid_sas: Version and Changelog update
Documentation/scsi/ChangeLog.megaraid_sas | 13 +++++
drivers/scsi/megaraid/megaraid_sas.h | 9 ++-
drivers/scsi/megaraid/megaraid_sas_base.c | 90 ++++++++++++++++++++---------
drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 +
4 files changed, 82 insertions(+), 31 deletions(-)
--
1.7.11.7
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 1/4] megaraid_sas: Fix reset_mutex leak
2014-07-01 0:19 [PATCH 0/4] megaraid_sas: Update for scsi for-next Adam Radford
@ 2014-07-01 0:19 ` Adam Radford
2014-07-01 0:19 ` [PATCH 2/4] megaraid_sas: Removed unused variables in megasas_instance Adam Radford
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Adam Radford @ 2014-07-01 0:19 UTC (permalink / raw)
To: linux-scsi, kashyap.desai, sumit.saxena, uday.lingala; +Cc: Adam Radford
James/linux-scsi,
The following patch for megaraid_sas fixes a reset_mutex leak in megasas_reset_fusion().
Signed-off-by: Adam Radford <aradford@gmail.com>
---
drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 2260041..0858851 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -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;
}
--
1.7.11.7
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/4] megaraid_sas: Removed unused variables in megasas_instance
2014-07-01 0:19 [PATCH 0/4] megaraid_sas: Update for scsi for-next Adam Radford
2014-07-01 0:19 ` [PATCH 1/4] megaraid_sas: Fix reset_mutex leak Adam Radford
@ 2014-07-01 0:19 ` Adam Radford
2014-07-01 0:19 ` [PATCH 3/4] megaraid_sas: Fix LD/VF affiliation parsing Adam Radford
2014-07-01 0:19 ` [PATCH 4/4] megaraid_sas: Version and Changelog update Adam Radford
3 siblings, 0 replies; 9+ messages in thread
From: Adam Radford @ 2014-07-01 0:19 UTC (permalink / raw)
To: linux-scsi, kashyap.desai, sumit.saxena, uday.lingala; +Cc: Adam Radford
James/linux-scsi,
The following patch for megaraid_sas removes some unused variables from the megasas_instance structure.
Signed-off-by: Adam Radford <aradford@gmail.com>
---
drivers/scsi/megaraid/megaraid_sas.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 32166c2..7d722fb 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -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;
--
1.7.11.7
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/4] megaraid_sas: Fix LD/VF affiliation parsing
2014-07-01 0:19 [PATCH 0/4] megaraid_sas: Update for scsi for-next Adam Radford
2014-07-01 0:19 ` [PATCH 1/4] megaraid_sas: Fix reset_mutex leak Adam Radford
2014-07-01 0:19 ` [PATCH 2/4] megaraid_sas: Removed unused variables in megasas_instance Adam Radford
@ 2014-07-01 0:19 ` Adam Radford
2014-07-03 8:18 ` Christoph Hellwig
2014-07-01 0:19 ` [PATCH 4/4] megaraid_sas: Version and Changelog update Adam Radford
3 siblings, 1 reply; 9+ messages in thread
From: Adam Radford @ 2014-07-01 0:19 UTC (permalink / raw)
To: linux-scsi, kashyap.desai, sumit.saxena, uday.lingala; +Cc: Adam Radford
James/linux-scsi,
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).
Signed-off-by: Adam Radford <aradford@gmail.com>
---
drivers/scsi/megaraid/megaraid_sas.h | 1 +
drivers/scsi/megaraid/megaraid_sas_base.c | 88 ++++++++++++++++++++++---------
2 files changed, 64 insertions(+), 25 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 7d722fb..2e2fcb2 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -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;
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 112799b..8f62b30 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1836,7 +1836,7 @@ static int megasas_get_ld_vf_affiliation(struct megasas_instance *instance,
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;
+ int ld, i, j, retval = 0, found = 0, doscan = 0;
u8 thisVf;
cmd = megasas_get_cmd(instance);
@@ -1944,14 +1944,6 @@ static int megasas_get_ld_vf_affiliation(struct megasas_instance *instance,
if (!initial) {
if (instance->PlasmaFW111) {
- if (!new_affiliation_111->vdCount) {
- printk(KERN_WARNING "megasas: SR-IOV: Got new "
- "LD/VF affiliation for passive path "
- "for scsi%d.\n",
- instance->host->host_no);
- retval = 1;
- goto out;
- }
thisVf = new_affiliation_111->thisVf;
for (ld = 0 ; ld < new_affiliation_111->vdCount; ld++)
if (instance->vf_affiliation_111->map[ld].policy[thisVf] != new_affiliation_111->map[ld].policy[thisVf]) {
@@ -1977,29 +1969,75 @@ static int megasas_get_ld_vf_affiliation(struct megasas_instance *instance,
newmap = new_affiliation->map;
savedmap = instance->vf_affiliation->map;
thisVf = new_affiliation->thisVf;
- for (ld = 0 ; ld < new_affiliation->ldCount; ld++) {
- if (savedmap->policy[thisVf] !=
- newmap->policy[thisVf]) {
- printk(KERN_WARNING "megasas: SR-IOV: "
- "Got new LD/VF affiliation "
- "for scsi%d.\n",
- instance->host->host_no);
- memcpy(instance->vf_affiliation,
- new_affiliation,
- new_affiliation->size);
- retval = 1;
+ for (i = 0 ; i < new_affiliation->ldCount; i++) {
+ found = 0;
+ for (j = 0;
+ j < instance->vf_affiliation->ldCount;
+ j++) {
+ if (newmap->ref.targetId ==
+ savedmap->ref.targetId) {
+ found = 1;
+ if (newmap->policy[thisVf] !=
+ savedmap->policy[thisVf]) {
+ doscan = 1;
+ goto out;
+ }
+ }
+ savedmap =
+ (struct MR_LD_VF_MAP *)
+ ((unsigned char *)savedmap +
+ savedmap->size);
+ }
+ if (!found && newmap->policy[thisVf] !=
+ MR_LD_ACCESS_HIDDEN) {
+ doscan = 1;
goto out;
}
- savedmap = (struct MR_LD_VF_MAP *)
- ((unsigned char *)savedmap +
- savedmap->size);
newmap = (struct MR_LD_VF_MAP *)
- ((unsigned char *)newmap +
- newmap->size);
+ ((unsigned char *)newmap + newmap->size);
+ }
+
+ newmap = new_affiliation->map;
+ savedmap = instance->vf_affiliation->map;
+
+ for (i = 0 ; i < instance->vf_affiliation->ldCount;
+ i++) {
+ found = 0;
+ for (j = 0 ; j < new_affiliation->ldCount;
+ j++) {
+ if (savedmap->ref.targetId ==
+ newmap->ref.targetId) {
+ found = 1;
+ if (savedmap->policy[thisVf] !=
+ newmap->policy[thisVf]) {
+ doscan = 1;
+ goto out;
+ }
+ }
+ newmap = (struct MR_LD_VF_MAP *)
+ ((unsigned char *)newmap +
+ newmap->size);
+ }
+ if (!found && savedmap->policy[thisVf] !=
+ MR_LD_ACCESS_HIDDEN) {
+ doscan = 1;
+ goto out;
+ }
+ savedmap = (struct MR_LD_VF_MAP *)
+ ((unsigned char *)savedmap +
+ savedmap->size);
}
}
}
out:
+ if (doscan) {
+ printk(KERN_WARNING "megasas: SR-IOV: Got new LD/VF "
+ "affiliation for scsi%d.\n", instance->host->host_no);
+ memcpy(instance->vf_affiliation, new_affiliation,
+ new_affiliation->size);
+ retval = 1;
+ }
+
if (new_affiliation) {
if (instance->PlasmaFW111)
pci_free_consistent(instance->pdev,
--
1.7.11.7
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 3/4] megaraid_sas: Fix LD/VF affiliation parsing
2014-07-01 0:19 ` [PATCH 3/4] megaraid_sas: Fix LD/VF affiliation parsing Adam Radford
@ 2014-07-03 8:18 ` Christoph Hellwig
2014-07-03 23:17 ` adam radford
0 siblings, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2014-07-03 8:18 UTC (permalink / raw)
To: Adam Radford; +Cc: linux-scsi, kashyap.desai, sumit.saxena, uday.lingala
On Mon, Jun 30, 2014 at 05:19:57PM -0700, Adam Radford wrote:
> James/linux-scsi,
>
> 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).
Hi Adam,
this doesn't address Martins comment about removing the initial != 0
case. And while we're at it there basically is no significant shared
code between the PlasmaFW111 and !PlasmaFW111, so split these into
two different functions. With those two levels of indentation removed
the code might actually become readable, too.
Also please remove the "James/linux-scsi," address in the individual
patches, that's something that should just go into the cover letter,
and make sure to include all "Reviewed-by:" and "Acked-by:" tags when
resending already reviewd patches.
Thanks,
Christoph
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/4] megaraid_sas: Fix LD/VF affiliation parsing
2014-07-03 8:18 ` Christoph Hellwig
@ 2014-07-03 23:17 ` adam radford
0 siblings, 0 replies; 9+ messages in thread
From: adam radford @ 2014-07-03 23:17 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-scsi, kashyap.desai, sumit.saxena, uday.lingala
On Thu, Jul 3, 2014 at 1:18 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Mon, Jun 30, 2014 at 05:19:57PM -0700, Adam Radford wrote:
>> James/linux-scsi,
>>
>> 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).
>
> Hi Adam,
>
> this doesn't address Martins comment about removing the initial != 0
> case. And while we're at it there basically is no significant shared
> code between the PlasmaFW111 and !PlasmaFW111, so split these into
> two different functions. With those two levels of indentation removed
> the code might actually become readable, too.
>
> Also please remove the "James/linux-scsi," address in the individual
> patches, that's something that should just go into the cover letter,
> and make sure to include all "Reviewed-by:" and "Acked-by:" tags when
> resending already reviewd patches.
>
> Thanks,
> Christoph
Christoph,
Thanks for your and Martin's feedback.
Actually there is a missing call to megasas_get_ld_vf_affiliation()
with initial = 1 that should be at the bottom of megasas_probe_one().
This got dropped inadvertently during a manual merge. I will add that
and split the megasas_get_ld_vf_affiliation() function into 2
functions (as you suggested) and resubmit the patch series while
including all currently received "Reviewed-by" and "Acked-by" messages
for the other patches and dropping the "James/linux-scsi" text.
-Adam
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 4/4] megaraid_sas: Version and Changelog update
2014-07-01 0:19 [PATCH 0/4] megaraid_sas: Update for scsi for-next Adam Radford
` (2 preceding siblings ...)
2014-07-01 0:19 ` [PATCH 3/4] megaraid_sas: Fix LD/VF affiliation parsing Adam Radford
@ 2014-07-01 0:19 ` Adam Radford
3 siblings, 0 replies; 9+ messages in thread
From: Adam Radford @ 2014-07-01 0:19 UTC (permalink / raw)
To: linux-scsi, kashyap.desai, sumit.saxena, uday.lingala; +Cc: Adam Radford
James/linux-scsi,
The following patch for megaraid_sas updates the driver version and Documentation/scsi/ChangeLog.megaraid_sas.
Signed-off-by: Adam Radford <aradford@gmail.com>
---
Documentation/scsi/ChangeLog.megaraid_sas | 13 +++++++++++++
drivers/scsi/megaraid/megaraid_sas.h | 6 +++---
drivers/scsi/megaraid/megaraid_sas_base.c | 2 +-
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas
index 91ba58e..2741efe 100644
--- a/Documentation/scsi/ChangeLog.megaraid_sas
+++ b/Documentation/scsi/ChangeLog.megaraid_sas
@@ -1,3 +1,16 @@
+Release Date : Thu. Jun 19, 2014 17:00:00 PST 2014 -
+ (emaild-id:megaraidlinux@lsi.com)
+ 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. Version and Changelog update.
+-------------------------------------------------------------------------------
Release Date : Mon. Mar 10, 2014 17:00:00 PST 2014 -
(emaild-id:megaraidlinux@lsi.com)
Adam Radford
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 2e2fcb2..bc7adcf 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -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
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 8f62b30..222bab2 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -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
--
1.7.11.7
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/4] megaraid_sas: Fix LD/VF affiliation parsing
@ 2014-06-20 0:32 adam radford
2014-06-26 2:08 ` Martin K. Petersen
0 siblings, 1 reply; 9+ messages in thread
From: adam radford @ 2014-06-20 0:32 UTC (permalink / raw)
To: linux-scsi, kashyap.desai, sumit.saxena, uday.lingala
[-- Attachment #1: Type: text/plain, Size: 4110 bytes --]
James/linux-scsi,
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).
Signed-off-by: Adam Radford <aradford@gmail.com>
diff -Naur scsi-for-next.old/drivers/scsi/megaraid/megaraid_sas_base.c
scsi-for-next.new/drivers/scsi/megaraid/megaraid_sas_base.c
--- scsi-for-next.old/drivers/scsi/megaraid/megaraid_sas_base.c
2014-06-19 15:03:05.000000000 -0700
+++ scsi-for-next.new/drivers/scsi/megaraid/megaraid_sas_base.c
2014-06-19 15:53:26.537229974 -0700
@@ -1836,7 +1836,7 @@
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;
+ int ld, i, j, retval = 0, found = 0, doscan = 0;
u8 thisVf;
cmd = megasas_get_cmd(instance);
@@ -1944,14 +1944,6 @@
if (!initial) {
if (instance->PlasmaFW111) {
- if (!new_affiliation_111->vdCount) {
- printk(KERN_WARNING "megasas: SR-IOV: Got new "
- "LD/VF affiliation for passive path "
- "for scsi%d.\n",
- instance->host->host_no);
- retval = 1;
- goto out;
- }
thisVf = new_affiliation_111->thisVf;
for (ld = 0 ; ld < new_affiliation_111->vdCount; ld++)
if (instance->vf_affiliation_111->map[ld].policy[thisVf] !=
new_affiliation_111->map[ld].policy[thisVf]) {
@@ -1977,29 +1969,75 @@
newmap = new_affiliation->map;
savedmap = instance->vf_affiliation->map;
thisVf = new_affiliation->thisVf;
- for (ld = 0 ; ld < new_affiliation->ldCount; ld++) {
- if (savedmap->policy[thisVf] !=
- newmap->policy[thisVf]) {
- printk(KERN_WARNING "megasas: SR-IOV: "
- "Got new LD/VF affiliation "
- "for scsi%d.\n",
- instance->host->host_no);
- memcpy(instance->vf_affiliation,
- new_affiliation,
- new_affiliation->size);
- retval = 1;
+ for (i = 0 ; i < new_affiliation->ldCount; i++) {
+ found = 0;
+ for (j = 0;
+ j < instance->vf_affiliation->ldCount;
+ j++) {
+ if (newmap->ref.targetId ==
+ savedmap->ref.targetId) {
+ found = 1;
+ if (newmap->policy[thisVf] !=
+ savedmap->policy[thisVf]) {
+ doscan = 1;
+ goto out;
+ }
+ }
+ savedmap =
+ (struct MR_LD_VF_MAP *)
+ ((unsigned char *)savedmap +
+ savedmap->size);
+ }
+ if (!found && newmap->policy[thisVf] !=
+ MR_LD_ACCESS_HIDDEN) {
+ doscan = 1;
goto out;
}
- savedmap = (struct MR_LD_VF_MAP *)
- ((unsigned char *)savedmap +
- savedmap->size);
newmap = (struct MR_LD_VF_MAP *)
- ((unsigned char *)newmap +
- newmap->size);
+ ((unsigned char *)newmap + newmap->size);
+ }
+
+ newmap = new_affiliation->map;
+ savedmap = instance->vf_affiliation->map;
+
+ for (i = 0 ; i < instance->vf_affiliation->ldCount;
+ i++) {
+ found = 0;
+ for (j = 0 ; j < new_affiliation->ldCount;
+ j++) {
+ if (savedmap->ref.targetId ==
+ newmap->ref.targetId) {
+ found = 1;
+ if (savedmap->policy[thisVf] !=
+ newmap->policy[thisVf]) {
+ doscan = 1;
+ goto out;
+ }
+ }
+ newmap = (struct MR_LD_VF_MAP *)
+ ((unsigned char *)newmap +
+ newmap->size);
+ }
+ if (!found && savedmap->policy[thisVf] !=
+ MR_LD_ACCESS_HIDDEN) {
+ doscan = 1;
+ goto out;
+ }
+ savedmap = (struct MR_LD_VF_MAP *)
+ ((unsigned char *)savedmap +
+ savedmap->size);
}
}
}
out:
+ if (doscan) {
+ printk(KERN_WARNING "megasas: SR-IOV: Got new LD/VF "
+ "affiliation for scsi%d.\n", instance->host->host_no);
+ memcpy(instance->vf_affiliation, new_affiliation,
+ new_affiliation->size);
+ retval = 1;
+ }
+
if (new_affiliation) {
if (instance->PlasmaFW111)
pci_free_consistent(instance->pdev,
diff -Naur scsi-for-next.old/drivers/scsi/megaraid/megaraid_sas.h
scsi-for-next.new/drivers/scsi/megaraid/megaraid_sas.h
--- scsi-for-next.old/drivers/scsi/megaraid/megaraid_sas.h 2014-06-19
15:31:49.110125604 -0700
+++ scsi-for-next.new/drivers/scsi/megaraid/megaraid_sas.h 2014-06-19
15:42:37.229075664 -0700
@@ -1659,6 +1659,7 @@
/* 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;
[-- Attachment #2: megaraid_sas.patch3 --]
[-- Type: application/octet-stream, Size: 4205 bytes --]
diff -Naur scsi-for-next.old/drivers/scsi/megaraid/megaraid_sas_base.c scsi-for-next.new/drivers/scsi/megaraid/megaraid_sas_base.c
--- scsi-for-next.old/drivers/scsi/megaraid/megaraid_sas_base.c 2014-06-19 15:03:05.000000000 -0700
+++ scsi-for-next.new/drivers/scsi/megaraid/megaraid_sas_base.c 2014-06-19 15:53:26.537229974 -0700
@@ -1836,7 +1836,7 @@
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;
+ int ld, i, j, retval = 0, found = 0, doscan = 0;
u8 thisVf;
cmd = megasas_get_cmd(instance);
@@ -1944,14 +1944,6 @@
if (!initial) {
if (instance->PlasmaFW111) {
- if (!new_affiliation_111->vdCount) {
- printk(KERN_WARNING "megasas: SR-IOV: Got new "
- "LD/VF affiliation for passive path "
- "for scsi%d.\n",
- instance->host->host_no);
- retval = 1;
- goto out;
- }
thisVf = new_affiliation_111->thisVf;
for (ld = 0 ; ld < new_affiliation_111->vdCount; ld++)
if (instance->vf_affiliation_111->map[ld].policy[thisVf] != new_affiliation_111->map[ld].policy[thisVf]) {
@@ -1977,29 +1969,75 @@
newmap = new_affiliation->map;
savedmap = instance->vf_affiliation->map;
thisVf = new_affiliation->thisVf;
- for (ld = 0 ; ld < new_affiliation->ldCount; ld++) {
- if (savedmap->policy[thisVf] !=
- newmap->policy[thisVf]) {
- printk(KERN_WARNING "megasas: SR-IOV: "
- "Got new LD/VF affiliation "
- "for scsi%d.\n",
- instance->host->host_no);
- memcpy(instance->vf_affiliation,
- new_affiliation,
- new_affiliation->size);
- retval = 1;
+ for (i = 0 ; i < new_affiliation->ldCount; i++) {
+ found = 0;
+ for (j = 0;
+ j < instance->vf_affiliation->ldCount;
+ j++) {
+ if (newmap->ref.targetId ==
+ savedmap->ref.targetId) {
+ found = 1;
+ if (newmap->policy[thisVf] !=
+ savedmap->policy[thisVf]) {
+ doscan = 1;
+ goto out;
+ }
+ }
+ savedmap =
+ (struct MR_LD_VF_MAP *)
+ ((unsigned char *)savedmap +
+ savedmap->size);
+ }
+ if (!found && newmap->policy[thisVf] !=
+ MR_LD_ACCESS_HIDDEN) {
+ doscan = 1;
goto out;
}
- savedmap = (struct MR_LD_VF_MAP *)
- ((unsigned char *)savedmap +
- savedmap->size);
newmap = (struct MR_LD_VF_MAP *)
- ((unsigned char *)newmap +
- newmap->size);
+ ((unsigned char *)newmap + newmap->size);
+ }
+
+ newmap = new_affiliation->map;
+ savedmap = instance->vf_affiliation->map;
+
+ for (i = 0 ; i < instance->vf_affiliation->ldCount;
+ i++) {
+ found = 0;
+ for (j = 0 ; j < new_affiliation->ldCount;
+ j++) {
+ if (savedmap->ref.targetId ==
+ newmap->ref.targetId) {
+ found = 1;
+ if (savedmap->policy[thisVf] !=
+ newmap->policy[thisVf]) {
+ doscan = 1;
+ goto out;
+ }
+ }
+ newmap = (struct MR_LD_VF_MAP *)
+ ((unsigned char *)newmap +
+ newmap->size);
+ }
+ if (!found && savedmap->policy[thisVf] !=
+ MR_LD_ACCESS_HIDDEN) {
+ doscan = 1;
+ goto out;
+ }
+ savedmap = (struct MR_LD_VF_MAP *)
+ ((unsigned char *)savedmap +
+ savedmap->size);
}
}
}
out:
+ if (doscan) {
+ printk(KERN_WARNING "megasas: SR-IOV: Got new LD/VF "
+ "affiliation for scsi%d.\n", instance->host->host_no);
+ memcpy(instance->vf_affiliation, new_affiliation,
+ new_affiliation->size);
+ retval = 1;
+ }
+
if (new_affiliation) {
if (instance->PlasmaFW111)
pci_free_consistent(instance->pdev,
diff -Naur scsi-for-next.old/drivers/scsi/megaraid/megaraid_sas.h scsi-for-next.new/drivers/scsi/megaraid/megaraid_sas.h
--- scsi-for-next.old/drivers/scsi/megaraid/megaraid_sas.h 2014-06-19 15:31:49.110125604 -0700
+++ scsi-for-next.new/drivers/scsi/megaraid/megaraid_sas.h 2014-06-19 15:42:37.229075664 -0700
@@ -1659,6 +1659,7 @@
/* 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;
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-07-03 23:17 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-01 0:19 [PATCH 0/4] megaraid_sas: Update for scsi for-next Adam Radford
2014-07-01 0:19 ` [PATCH 1/4] megaraid_sas: Fix reset_mutex leak Adam Radford
2014-07-01 0:19 ` [PATCH 2/4] megaraid_sas: Removed unused variables in megasas_instance Adam Radford
2014-07-01 0:19 ` [PATCH 3/4] megaraid_sas: Fix LD/VF affiliation parsing Adam Radford
2014-07-03 8:18 ` Christoph Hellwig
2014-07-03 23:17 ` adam radford
2014-07-01 0:19 ` [PATCH 4/4] megaraid_sas: Version and Changelog update Adam Radford
-- strict thread matches above, loose matches on Subject: below --
2014-06-20 0:32 [PATCH 3/4] megaraid_sas: Fix LD/VF affiliation parsing adam radford
2014-06-26 2:08 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).