* [PATCH 0/2] megaraid_sas: few more updates for scsi-next
@ 2016-01-28 15:44 Sumit Saxena
2016-01-28 15:44 ` [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment Sumit Saxena
2016-01-28 15:44 ` [PATCH 2/2] megaraid_sas: Fix SMAP issue Sumit Saxena
0 siblings, 2 replies; 9+ messages in thread
From: Sumit Saxena @ 2016-01-28 15:44 UTC (permalink / raw)
To: jbottomley, hch, martin.petersen, thenzl
Cc: linux-scsi, kashyap.desai, sumit.saxena
These two patches will be applied on top of recent resent patchset by me.
I am posting these patches separately(not in the resent patchset) to avoid confusion
as these are fresh(first time) submitted.
Sumit Saxena (2):
megaraid_sas: Fix for IO failing post OCR in SRIOV environment
megaraid_sas: Fix SMAP issue
drivers/scsi/megaraid/megaraid_sas.h | 13 ++++++---
drivers/scsi/megaraid/megaraid_sas_base.c | 19 ++++++-------
drivers/scsi/megaraid/megaraid_sas_fusion.c | 42 ++++++++++++++++++-----------
3 files changed, 45 insertions(+), 29 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment
2016-01-28 15:44 [PATCH 0/2] megaraid_sas: few more updates for scsi-next Sumit Saxena
@ 2016-01-28 15:44 ` Sumit Saxena
2016-01-29 16:17 ` Tomas Henzl
2016-02-10 1:48 ` Martin K. Petersen
2016-01-28 15:44 ` [PATCH 2/2] megaraid_sas: Fix SMAP issue Sumit Saxena
1 sibling, 2 replies; 9+ messages in thread
From: Sumit Saxena @ 2016-01-28 15:44 UTC (permalink / raw)
To: jbottomley, hch, martin.petersen, thenzl
Cc: linux-scsi, kashyap.desai, sumit.saxena, Uday Lingala
Driver assumes that VFs always have peers present whenever they have same LD IDs. But this is not the case.
This patch handles the above mentioned by explicitly checking for a peer before making HA/non-HA path decision.
Signed-off-by: Uday Lingala <uday.lingala@avagotech.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
---
drivers/scsi/megaraid/megaraid_sas.h | 13 ++++++---
drivers/scsi/megaraid/megaraid_sas_base.c | 6 +++--
drivers/scsi/megaraid/megaraid_sas_fusion.c | 42 ++++++++++++++++++-----------
3 files changed, 39 insertions(+), 22 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index b6fdb48..4484e63 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -393,6 +393,7 @@ enum MR_EVT_ARGS {
#define SGE_BUFFER_SIZE 4096
+#define MEGASAS_CLUSTER_ID_SIZE 16
/*
* define constants for device list query options
*/
@@ -1227,7 +1228,8 @@ struct megasas_ctrl_info {
*/
struct {
#if defined(__BIG_ENDIAN_BITFIELD)
- u32 reserved:26;
+ u32 reserved:25;
+ u32 passive:1;
u32 premiumFeatureMismatch:1;
u32 ctrlPropIncompatible:1;
u32 fwVersionMismatch:1;
@@ -1241,11 +1243,12 @@ struct megasas_ctrl_info {
u32 fwVersionMismatch:1;
u32 ctrlPropIncompatible:1;
u32 premiumFeatureMismatch:1;
- u32 reserved:26;
+ u32 passive:1;
+ u32 reserved:25;
#endif
} cluster;
- char clusterId[16]; /*7D4h */
+ char clusterId[MEGASAS_CLUSTER_ID_SIZE]; /*0x7D4 */
struct {
u8 maxVFsSupported; /*0x7E4*/
u8 numVFsEnabled; /*0x7E5*/
@@ -2126,7 +2129,9 @@ struct megasas_instance {
char skip_heartbeat_timer_del;
u8 requestorId;
char PlasmaFW111;
- char mpio;
+ char clusterId[MEGASAS_CLUSTER_ID_SIZE];
+ u8 peerIsPresent;
+ u8 passive;
u16 throttlequeuedepth;
u8 mask_interrupts;
u16 max_chain_frame_sz;
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 54922e5..52f3419 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1943,7 +1943,7 @@ void megaraid_sas_kill_hba(struct megasas_instance *instance)
writel(MFI_STOP_ADP, &instance->reg_set->doorbell);
/* Flush */
readl(&instance->reg_set->doorbell);
- if (instance->mpio && instance->requestorId)
+ if (instance->requestorId && instance->peerIsPresent)
memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS);
} else {
writel(MFI_STOP_ADP,
@@ -5182,7 +5182,9 @@ static int megasas_init_fw(struct megasas_instance *instance)
tmp_sectors = min_t(u32, max_sectors_1, max_sectors_2);
- instance->mpio = ctrl_info->adapterOperations2.mpio;
+ instance->peerIsPresent = ctrl_info->cluster.peerIsPresent;
+ instance->passive = ctrl_info->cluster.passive;
+ memcpy(instance->clusterId, ctrl_info->clusterId, sizeof(instance->clusterId));
instance->UnevenSpanSupport =
ctrl_info->adapterOperations2.supportUnevenSpans;
if (instance->UnevenSpanSupport) {
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index be9c3f1..d9d0029 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3325,27 +3325,37 @@ out:
return ret;
}
+/*SRIOV get other instance in cluster if any*/
+struct megasas_instance *megasas_get_peer_instance(struct megasas_instance *instance)
+{
+ int i;
+
+ for (i = 0; i < MAX_MGMT_ADAPTERS; i++) {
+ if (megasas_mgmt_info.instance[i] &&
+ (megasas_mgmt_info.instance[i] != instance) &&
+ megasas_mgmt_info.instance[i]->requestorId &&
+ megasas_mgmt_info.instance[i]->peerIsPresent &&
+ (memcmp((megasas_mgmt_info.instance[i]->clusterId),
+ instance->clusterId, MEGASAS_CLUSTER_ID_SIZE) == 0))
+ return megasas_mgmt_info.instance[i];
+ }
+ return NULL;
+}
+
/* Check for a second path that is currently UP */
int megasas_check_mpio_paths(struct megasas_instance *instance,
struct scsi_cmnd *scmd)
{
- int i, j, retval = (DID_RESET << 16);
-
- if (instance->mpio && instance->requestorId) {
- for (i = 0 ; i < MAX_MGMT_ADAPTERS ; i++)
- for (j = 0 ; j < MAX_LOGICAL_DRIVES; j++)
- if (megasas_mgmt_info.instance[i] &&
- (megasas_mgmt_info.instance[i] != instance) &&
- megasas_mgmt_info.instance[i]->mpio &&
- megasas_mgmt_info.instance[i]->requestorId
- &&
- (megasas_mgmt_info.instance[i]->ld_ids[j]
- == scmd->device->id)) {
- retval = (DID_NO_CONNECT << 16);
- goto out;
- }
+ struct megasas_instance *peer_instance = NULL;
+ int retval = (DID_RESET << 16);
+
+ if (instance->peerIsPresent) {
+ peer_instance = megasas_get_peer_instance(instance);
+ if ((peer_instance) &&
+ (atomic_read(&peer_instance->adprecovery) ==
+ MEGASAS_HBA_OPERATIONAL))
+ retval = (DID_NO_CONNECT << 16);
}
-out:
return retval;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] megaraid_sas: Fix SMAP issue
2016-01-28 15:44 [PATCH 0/2] megaraid_sas: few more updates for scsi-next Sumit Saxena
2016-01-28 15:44 ` [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment Sumit Saxena
@ 2016-01-28 15:44 ` Sumit Saxena
2016-01-29 16:24 ` Tomas Henzl
2016-02-10 1:49 ` Martin K. Petersen
1 sibling, 2 replies; 9+ messages in thread
From: Sumit Saxena @ 2016-01-28 15:44 UTC (permalink / raw)
To: jbottomley, hch, martin.petersen, thenzl
Cc: linux-scsi, kashyap.desai, sumit.saxena
Inside compat IOCTL hook of driver, driver was using wrong address of
ioc->frame.raw which leads sense_ioc_ptr to be calculated wrongly and
failing IOCTL.
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
---
drivers/scsi/megaraid/megaraid_sas_base.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 52f3419..cc92c81 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -6843,9 +6843,9 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg)
int i;
int error = 0;
compat_uptr_t ptr;
- unsigned long local_raw_ptr;
u32 local_sense_off;
u32 local_sense_len;
+ u32 user_sense_off;
if (clear_user(ioc, sizeof(*ioc)))
return -EFAULT;
@@ -6863,17 +6863,16 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg)
* sense_len is not null, so prepare the 64bit value under
* the same condition.
*/
- if (get_user(local_raw_ptr, ioc->frame.raw) ||
- get_user(local_sense_off, &ioc->sense_off) ||
- get_user(local_sense_len, &ioc->sense_len))
+ if (get_user(local_sense_off, &ioc->sense_off) ||
+ get_user(local_sense_len, &ioc->sense_len) ||
+ get_user(user_sense_off, &cioc->sense_off))
return -EFAULT;
-
if (local_sense_len) {
void __user **sense_ioc_ptr =
- (void __user **)((u8*)local_raw_ptr + local_sense_off);
+ (void __user **)((u8 *)((unsigned long)&ioc->frame.raw) + local_sense_off);
compat_uptr_t *sense_cioc_ptr =
- (compat_uptr_t *)(cioc->frame.raw + cioc->sense_off);
+ (compat_uptr_t *)(((unsigned long)&cioc->frame.raw) + user_sense_off);
if (get_user(ptr, sense_cioc_ptr) ||
put_user(compat_ptr(ptr), sense_ioc_ptr))
return -EFAULT;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment
2016-01-28 15:44 ` [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment Sumit Saxena
@ 2016-01-29 16:17 ` Tomas Henzl
2016-02-05 12:24 ` Sumit Saxena
2016-02-10 1:48 ` Martin K. Petersen
1 sibling, 1 reply; 9+ messages in thread
From: Tomas Henzl @ 2016-01-29 16:17 UTC (permalink / raw)
To: Sumit Saxena, jbottomley, hch, martin.petersen
Cc: linux-scsi, kashyap.desai, Uday Lingala
On 28.1.2016 16:44, Sumit Saxena wrote:
> Driver assumes that VFs always have peers present whenever they have same LD IDs. But this is not the case.
> This patch handles the above mentioned by explicitly checking for a peer before making HA/non-HA path decision.
>
> Signed-off-by: Uday Lingala <uday.lingala@avagotech.com>
> Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
>
> ---
> drivers/scsi/megaraid/megaraid_sas.h | 13 ++++++---
> drivers/scsi/megaraid/megaraid_sas_base.c | 6 +++--
> drivers/scsi/megaraid/megaraid_sas_fusion.c | 42 ++++++++++++++++++-----------
> 3 files changed, 39 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
> index b6fdb48..4484e63 100644
> --- a/drivers/scsi/megaraid/megaraid_sas.h
> +++ b/drivers/scsi/megaraid/megaraid_sas.h
> @@ -393,6 +393,7 @@ enum MR_EVT_ARGS {
>
>
> #define SGE_BUFFER_SIZE 4096
> +#define MEGASAS_CLUSTER_ID_SIZE 16
> /*
> * define constants for device list query options
> */
> @@ -1227,7 +1228,8 @@ struct megasas_ctrl_info {
> */
> struct {
> #if defined(__BIG_ENDIAN_BITFIELD)
> - u32 reserved:26;
> + u32 reserved:25;
> + u32 passive:1;
> u32 premiumFeatureMismatch:1;
> u32 ctrlPropIncompatible:1;
> u32 fwVersionMismatch:1;
> @@ -1241,11 +1243,12 @@ struct megasas_ctrl_info {
> u32 fwVersionMismatch:1;
> u32 ctrlPropIncompatible:1;
> u32 premiumFeatureMismatch:1;
> - u32 reserved:26;
> + u32 passive:1;
> + u32 reserved:25;
> #endif
> } cluster;
>
> - char clusterId[16]; /*7D4h */
> + char clusterId[MEGASAS_CLUSTER_ID_SIZE]; /*0x7D4 */
> struct {
> u8 maxVFsSupported; /*0x7E4*/
> u8 numVFsEnabled; /*0x7E5*/
> @@ -2126,7 +2129,9 @@ struct megasas_instance {
> char skip_heartbeat_timer_del;
> u8 requestorId;
> char PlasmaFW111;
> - char mpio;
> + char clusterId[MEGASAS_CLUSTER_ID_SIZE];
> + u8 peerIsPresent;
> + u8 passive;
> u16 throttlequeuedepth;
> u8 mask_interrupts;
> u16 max_chain_frame_sz;
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 54922e5..52f3419 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -1943,7 +1943,7 @@ void megaraid_sas_kill_hba(struct megasas_instance *instance)
> writel(MFI_STOP_ADP, &instance->reg_set->doorbell);
> /* Flush */
> readl(&instance->reg_set->doorbell);
> - if (instance->mpio && instance->requestorId)
> + if (instance->requestorId && instance->peerIsPresent)
> memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS);
> } else {
> writel(MFI_STOP_ADP,
> @@ -5182,7 +5182,9 @@ static int megasas_init_fw(struct megasas_instance *instance)
>
> tmp_sectors = min_t(u32, max_sectors_1, max_sectors_2);
>
> - instance->mpio = ctrl_info->adapterOperations2.mpio;
> + instance->peerIsPresent = ctrl_info->cluster.peerIsPresent;
> + instance->passive = ctrl_info->cluster.passive;
> + memcpy(instance->clusterId, ctrl_info->clusterId, sizeof(instance->clusterId));
> instance->UnevenSpanSupport =
> ctrl_info->adapterOperations2.supportUnevenSpans;
> if (instance->UnevenSpanSupport) {
> diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> index be9c3f1..d9d0029 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> @@ -3325,27 +3325,37 @@ out:
> return ret;
> }
>
> +/*SRIOV get other instance in cluster if any*/
> +struct megasas_instance *megasas_get_peer_instance(struct megasas_instance *instance)
> +{
> + int i;
> +
> + for (i = 0; i < MAX_MGMT_ADAPTERS; i++) {
> + if (megasas_mgmt_info.instance[i] &&
> + (megasas_mgmt_info.instance[i] != instance) &&
> + megasas_mgmt_info.instance[i]->requestorId &&
> + megasas_mgmt_info.instance[i]->peerIsPresent &&
> + (memcmp((megasas_mgmt_info.instance[i]->clusterId),
> + instance->clusterId, MEGASAS_CLUSTER_ID_SIZE) == 0))
> + return megasas_mgmt_info.instance[i];
> + }
> + return NULL;
> +}
> +
> /* Check for a second path that is currently UP */
> int megasas_check_mpio_paths(struct megasas_instance *instance,
> struct scsi_cmnd *scmd)
> {
> - int i, j, retval = (DID_RESET << 16);
> -
> - if (instance->mpio && instance->requestorId) {
Seems to me that you've removed this test (instance->requestorId) maybe it is not needed,
is it removed intentionally ?
--tm
> - for (i = 0 ; i < MAX_MGMT_ADAPTERS ; i++)
> - for (j = 0 ; j < MAX_LOGICAL_DRIVES; j++)
> - if (megasas_mgmt_info.instance[i] &&
> - (megasas_mgmt_info.instance[i] != instance) &&
> - megasas_mgmt_info.instance[i]->mpio &&
> - megasas_mgmt_info.instance[i]->requestorId
> - &&
> - (megasas_mgmt_info.instance[i]->ld_ids[j]
> - == scmd->device->id)) {
> - retval = (DID_NO_CONNECT << 16);
> - goto out;
> - }
> + struct megasas_instance *peer_instance = NULL;
> + int retval = (DID_RESET << 16);
> +
> + if (instance->peerIsPresent) {
> + peer_instance = megasas_get_peer_instance(instance);
> + if ((peer_instance) &&
> + (atomic_read(&peer_instance->adprecovery) ==
> + MEGASAS_HBA_OPERATIONAL))
> + retval = (DID_NO_CONNECT << 16);
> }
> -out:
> return retval;
> }
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] megaraid_sas: Fix SMAP issue
2016-01-28 15:44 ` [PATCH 2/2] megaraid_sas: Fix SMAP issue Sumit Saxena
@ 2016-01-29 16:24 ` Tomas Henzl
2016-02-10 1:49 ` Martin K. Petersen
1 sibling, 0 replies; 9+ messages in thread
From: Tomas Henzl @ 2016-01-29 16:24 UTC (permalink / raw)
To: Sumit Saxena, jbottomley, hch, martin.petersen; +Cc: linux-scsi, kashyap.desai
On 28.1.2016 16:44, Sumit Saxena wrote:
> Inside compat IOCTL hook of driver, driver was using wrong address of
> ioc->frame.raw which leads sense_ioc_ptr to be calculated wrongly and
> failing IOCTL.
>
> Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Tomas
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment
2016-01-29 16:17 ` Tomas Henzl
@ 2016-02-05 12:24 ` Sumit Saxena
2016-02-08 12:57 ` Tomas Henzl
0 siblings, 1 reply; 9+ messages in thread
From: Sumit Saxena @ 2016-02-05 12:24 UTC (permalink / raw)
To: Tomas Henzl, Sumit Saxena, jbottomley, hch, martin.petersen
Cc: linux-scsi, kashyap.desai, Uday Lingala
> -----Original Message-----
> From: Tomas Henzl [mailto:thenzl@redhat.com]
> Sent: Friday, January 29, 2016 9:47 PM
> To: Sumit Saxena; jbottomley@parallels.com; hch@infradead.org;
> martin.petersen@oracle.com
> Cc: linux-scsi@vger.kernel.org; kashyap.desai@avagotech.com; Uday
Lingala
> Subject: Re: [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in
SRIOV
> environment
>
> On 28.1.2016 16:44, Sumit Saxena wrote:
> > Driver assumes that VFs always have peers present whenever they have
same
> LD IDs. But this is not the case.
> > This patch handles the above mentioned by explicitly checking for a
peer
> before making HA/non-HA path decision.
> >
> > Signed-off-by: Uday Lingala <uday.lingala@avagotech.com>
> > Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
> >
> > ---
> > drivers/scsi/megaraid/megaraid_sas.h | 13 ++++++---
> > drivers/scsi/megaraid/megaraid_sas_base.c | 6 +++--
> > drivers/scsi/megaraid/megaraid_sas_fusion.c | 42
> > ++++++++++++++++++-----------
> > 3 files changed, 39 insertions(+), 22 deletions(-)
> >
> > diff --git a/drivers/scsi/megaraid/megaraid_sas.h
> > b/drivers/scsi/megaraid/megaraid_sas.h
> > index b6fdb48..4484e63 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas.h
> > +++ b/drivers/scsi/megaraid/megaraid_sas.h
> > @@ -393,6 +393,7 @@ enum MR_EVT_ARGS {
> >
> >
> > #define SGE_BUFFER_SIZE 4096
> > +#define MEGASAS_CLUSTER_ID_SIZE 16
> > /*
> > * define constants for device list query options
> > */
> > @@ -1227,7 +1228,8 @@ struct megasas_ctrl_info {
> > */
> > struct {
> > #if defined(__BIG_ENDIAN_BITFIELD)
> > - u32 reserved:26;
> > + u32 reserved:25;
> > + u32 passive:1;
> > u32 premiumFeatureMismatch:1;
> > u32 ctrlPropIncompatible:1;
> > u32 fwVersionMismatch:1;
> > @@ -1241,11 +1243,12 @@ struct megasas_ctrl_info {
> > u32 fwVersionMismatch:1;
> > u32 ctrlPropIncompatible:1;
> > u32 premiumFeatureMismatch:1;
> > - u32 reserved:26;
> > + u32 passive:1;
> > + u32 reserved:25;
> > #endif
> > } cluster;
> >
> > - char clusterId[16]; /*7D4h */
> > + char clusterId[MEGASAS_CLUSTER_ID_SIZE]; /*0x7D4 */
> > struct {
> > u8 maxVFsSupported; /*0x7E4*/
> > u8 numVFsEnabled; /*0x7E5*/
> > @@ -2126,7 +2129,9 @@ struct megasas_instance {
> > char skip_heartbeat_timer_del;
> > u8 requestorId;
> > char PlasmaFW111;
> > - char mpio;
> > + char clusterId[MEGASAS_CLUSTER_ID_SIZE];
> > + u8 peerIsPresent;
> > + u8 passive;
> > u16 throttlequeuedepth;
> > u8 mask_interrupts;
> > u16 max_chain_frame_sz;
> > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> > b/drivers/scsi/megaraid/megaraid_sas_base.c
> > index 54922e5..52f3419 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> > @@ -1943,7 +1943,7 @@ void megaraid_sas_kill_hba(struct
> megasas_instance *instance)
> > writel(MFI_STOP_ADP, &instance->reg_set->doorbell);
> > /* Flush */
> > readl(&instance->reg_set->doorbell);
> > - if (instance->mpio && instance->requestorId)
> > + if (instance->requestorId && instance->peerIsPresent)
> > memset(instance->ld_ids, 0xff,
> MEGASAS_MAX_LD_IDS);
> > } else {
> > writel(MFI_STOP_ADP,
> > @@ -5182,7 +5182,9 @@ static int megasas_init_fw(struct
> > megasas_instance *instance)
> >
> > tmp_sectors = min_t(u32, max_sectors_1, max_sectors_2);
> >
> > - instance->mpio = ctrl_info->adapterOperations2.mpio;
> > + instance->peerIsPresent = ctrl_info->cluster.peerIsPresent;
> > + instance->passive = ctrl_info->cluster.passive;
> > + memcpy(instance->clusterId, ctrl_info->clusterId,
> > +sizeof(instance->clusterId));
> > instance->UnevenSpanSupport =
> > ctrl_info->adapterOperations2.supportUnevenSpans;
> > if (instance->UnevenSpanSupport) {
> > diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > index be9c3f1..d9d0029 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> > @@ -3325,27 +3325,37 @@ out:
> > return ret;
> > }
> >
> > +/*SRIOV get other instance in cluster if any*/ struct
> > +megasas_instance *megasas_get_peer_instance(struct megasas_instance
> > +*instance) {
> > + int i;
> > +
> > + for (i = 0; i < MAX_MGMT_ADAPTERS; i++) {
> > + if (megasas_mgmt_info.instance[i] &&
> > + (megasas_mgmt_info.instance[i] != instance) &&
> > + megasas_mgmt_info.instance[i]->requestorId &&
> > + megasas_mgmt_info.instance[i]->peerIsPresent &&
> > +
(memcmp((megasas_mgmt_info.instance[i]->clusterId),
> > + instance->clusterId, MEGASAS_CLUSTER_ID_SIZE) ==
0))
> > + return megasas_mgmt_info.instance[i];
> > + }
> > + return NULL;
> > +}
> > +
> > /* Check for a second path that is currently UP */ int
> > megasas_check_mpio_paths(struct megasas_instance *instance,
> > struct scsi_cmnd *scmd)
> > {
> > - int i, j, retval = (DID_RESET << 16);
> > -
> > - if (instance->mpio && instance->requestorId) {
>
> Seems to me that you've removed this test (instance->requestorId) maybe
it is
> not needed, is it removed intentionally ?
Sorry for delay in response. This is removed intentionally.
>
> --tm
>
>
> > - for (i = 0 ; i < MAX_MGMT_ADAPTERS ; i++)
> > - for (j = 0 ; j < MAX_LOGICAL_DRIVES; j++)
> > - if (megasas_mgmt_info.instance[i] &&
> > - (megasas_mgmt_info.instance[i] !=
instance)
> &&
> > - megasas_mgmt_info.instance[i]->mpio &&
> > - megasas_mgmt_info.instance[i]-
> >requestorId
> > - &&
> > -
(megasas_mgmt_info.instance[i]->ld_ids[j]
> > - == scmd->device->id)) {
> > - retval = (DID_NO_CONNECT <<
16);
> > - goto out;
> > - }
> > + struct megasas_instance *peer_instance = NULL;
> > + int retval = (DID_RESET << 16);
> > +
> > + if (instance->peerIsPresent) {
> > + peer_instance = megasas_get_peer_instance(instance);
> > + if ((peer_instance) &&
> > + (atomic_read(&peer_instance->adprecovery) ==
> > + MEGASAS_HBA_OPERATIONAL))
> > + retval = (DID_NO_CONNECT << 16);
> > }
> > -out:
> > return retval;
> > }
> >
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment
2016-02-05 12:24 ` Sumit Saxena
@ 2016-02-08 12:57 ` Tomas Henzl
0 siblings, 0 replies; 9+ messages in thread
From: Tomas Henzl @ 2016-02-08 12:57 UTC (permalink / raw)
To: Sumit Saxena, Sumit Saxena, jbottomley, hch, martin.petersen
Cc: linux-scsi, kashyap.desai, Uday Lingala
On 5.2.2016 13:24, Sumit Saxena wrote:
>> -----Original Message-----
>> From: Tomas Henzl [mailto:thenzl@redhat.com]
>> Sent: Friday, January 29, 2016 9:47 PM
>> To: Sumit Saxena; jbottomley@parallels.com; hch@infradead.org;
>> martin.petersen@oracle.com
>> Cc: linux-scsi@vger.kernel.org; kashyap.desai@avagotech.com; Uday
> Lingala
>> Subject: Re: [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in
> SRIOV
>> environment
>>
>> On 28.1.2016 16:44, Sumit Saxena wrote:
>>> Driver assumes that VFs always have peers present whenever they have
> same
>> LD IDs. But this is not the case.
>>> This patch handles the above mentioned by explicitly checking for a
> peer
>> before making HA/non-HA path decision.
>>> Signed-off-by: Uday Lingala <uday.lingala@avagotech.com>
>>> Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
>>>
>>> ---
>>> drivers/scsi/megaraid/megaraid_sas.h | 13 ++++++---
>>> drivers/scsi/megaraid/megaraid_sas_base.c | 6 +++--
>>> drivers/scsi/megaraid/megaraid_sas_fusion.c | 42
>>> ++++++++++++++++++-----------
>>> 3 files changed, 39 insertions(+), 22 deletions(-)
>>>
>>> diff --git a/drivers/scsi/megaraid/megaraid_sas.h
>>> b/drivers/scsi/megaraid/megaraid_sas.h
>>> index b6fdb48..4484e63 100644
>>> --- a/drivers/scsi/megaraid/megaraid_sas.h
>>> +++ b/drivers/scsi/megaraid/megaraid_sas.h
>>> @@ -393,6 +393,7 @@ enum MR_EVT_ARGS {
>>>
>>>
>>> #define SGE_BUFFER_SIZE 4096
>>> +#define MEGASAS_CLUSTER_ID_SIZE 16
>>> /*
>>> * define constants for device list query options
>>> */
>>> @@ -1227,7 +1228,8 @@ struct megasas_ctrl_info {
>>> */
>>> struct {
>>> #if defined(__BIG_ENDIAN_BITFIELD)
>>> - u32 reserved:26;
>>> + u32 reserved:25;
>>> + u32 passive:1;
>>> u32 premiumFeatureMismatch:1;
>>> u32 ctrlPropIncompatible:1;
>>> u32 fwVersionMismatch:1;
>>> @@ -1241,11 +1243,12 @@ struct megasas_ctrl_info {
>>> u32 fwVersionMismatch:1;
>>> u32 ctrlPropIncompatible:1;
>>> u32 premiumFeatureMismatch:1;
>>> - u32 reserved:26;
>>> + u32 passive:1;
>>> + u32 reserved:25;
>>> #endif
>>> } cluster;
>>>
>>> - char clusterId[16]; /*7D4h */
>>> + char clusterId[MEGASAS_CLUSTER_ID_SIZE]; /*0x7D4 */
>>> struct {
>>> u8 maxVFsSupported; /*0x7E4*/
>>> u8 numVFsEnabled; /*0x7E5*/
>>> @@ -2126,7 +2129,9 @@ struct megasas_instance {
>>> char skip_heartbeat_timer_del;
>>> u8 requestorId;
>>> char PlasmaFW111;
>>> - char mpio;
>>> + char clusterId[MEGASAS_CLUSTER_ID_SIZE];
>>> + u8 peerIsPresent;
>>> + u8 passive;
>>> u16 throttlequeuedepth;
>>> u8 mask_interrupts;
>>> u16 max_chain_frame_sz;
>>> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
>>> b/drivers/scsi/megaraid/megaraid_sas_base.c
>>> index 54922e5..52f3419 100644
>>> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
>>> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
>>> @@ -1943,7 +1943,7 @@ void megaraid_sas_kill_hba(struct
>> megasas_instance *instance)
>>> writel(MFI_STOP_ADP, &instance->reg_set->doorbell);
>>> /* Flush */
>>> readl(&instance->reg_set->doorbell);
>>> - if (instance->mpio && instance->requestorId)
>>> + if (instance->requestorId && instance->peerIsPresent)
>>> memset(instance->ld_ids, 0xff,
>> MEGASAS_MAX_LD_IDS);
>>> } else {
>>> writel(MFI_STOP_ADP,
>>> @@ -5182,7 +5182,9 @@ static int megasas_init_fw(struct
>>> megasas_instance *instance)
>>>
>>> tmp_sectors = min_t(u32, max_sectors_1, max_sectors_2);
>>>
>>> - instance->mpio = ctrl_info->adapterOperations2.mpio;
>>> + instance->peerIsPresent = ctrl_info->cluster.peerIsPresent;
>>> + instance->passive = ctrl_info->cluster.passive;
>>> + memcpy(instance->clusterId, ctrl_info->clusterId,
>>> +sizeof(instance->clusterId));
>>> instance->UnevenSpanSupport =
>>> ctrl_info->adapterOperations2.supportUnevenSpans;
>>> if (instance->UnevenSpanSupport) {
>>> diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c
>>> b/drivers/scsi/megaraid/megaraid_sas_fusion.c
>>> index be9c3f1..d9d0029 100644
>>> --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
>>> +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
>>> @@ -3325,27 +3325,37 @@ out:
>>> return ret;
>>> }
>>>
>>> +/*SRIOV get other instance in cluster if any*/ struct
>>> +megasas_instance *megasas_get_peer_instance(struct megasas_instance
>>> +*instance) {
>>> + int i;
>>> +
>>> + for (i = 0; i < MAX_MGMT_ADAPTERS; i++) {
>>> + if (megasas_mgmt_info.instance[i] &&
>>> + (megasas_mgmt_info.instance[i] != instance) &&
>>> + megasas_mgmt_info.instance[i]->requestorId &&
>>> + megasas_mgmt_info.instance[i]->peerIsPresent &&
>>> +
> (memcmp((megasas_mgmt_info.instance[i]->clusterId),
>>> + instance->clusterId, MEGASAS_CLUSTER_ID_SIZE) ==
> 0))
>>> + return megasas_mgmt_info.instance[i];
>>> + }
>>> + return NULL;
>>> +}
>>> +
>>> /* Check for a second path that is currently UP */ int
>>> megasas_check_mpio_paths(struct megasas_instance *instance,
>>> struct scsi_cmnd *scmd)
>>> {
>>> - int i, j, retval = (DID_RESET << 16);
>>> -
>>> - if (instance->mpio && instance->requestorId) {
>> Seems to me that you've removed this test (instance->requestorId) maybe
> it is
>> not needed, is it removed intentionally ?
> Sorry for delay in response. This is removed intentionally.
ok, thanks,
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Tomas
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment
2016-01-28 15:44 ` [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment Sumit Saxena
2016-01-29 16:17 ` Tomas Henzl
@ 2016-02-10 1:48 ` Martin K. Petersen
1 sibling, 0 replies; 9+ messages in thread
From: Martin K. Petersen @ 2016-02-10 1:48 UTC (permalink / raw)
To: Sumit Saxena
Cc: jbottomley, hch, martin.petersen, thenzl, linux-scsi,
kashyap.desai, Uday Lingala
>>>>> "Sumit" == Sumit Saxena <sumit.saxena@avagotech.com> writes:
Sumit> Driver assumes that VFs always have peers present whenever they
Sumit> have same LD IDs. But this is not the case. This patch handles
Sumit> the above mentioned by explicitly checking for a peer before
Sumit> making HA/non-HA path decision.
Applied to 4.6/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] megaraid_sas: Fix SMAP issue
2016-01-28 15:44 ` [PATCH 2/2] megaraid_sas: Fix SMAP issue Sumit Saxena
2016-01-29 16:24 ` Tomas Henzl
@ 2016-02-10 1:49 ` Martin K. Petersen
1 sibling, 0 replies; 9+ messages in thread
From: Martin K. Petersen @ 2016-02-10 1:49 UTC (permalink / raw)
To: Sumit Saxena
Cc: jbottomley, hch, martin.petersen, thenzl, linux-scsi, kashyap.desai
>>>>> "Sumit" == Sumit Saxena <sumit.saxena@avagotech.com> writes:
Sumit> Inside compat IOCTL hook of driver, driver was using wrong
Sumit> address of ioc-> frame.raw which leads sense_ioc_ptr to be
Sumit> calculated wrongly and failing IOCTL.
Applied to 4.6/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-02-10 1:49 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28 15:44 [PATCH 0/2] megaraid_sas: few more updates for scsi-next Sumit Saxena
2016-01-28 15:44 ` [PATCH 1/2] megaraid_sas: Fix for IO failing post OCR in SRIOV environment Sumit Saxena
2016-01-29 16:17 ` Tomas Henzl
2016-02-05 12:24 ` Sumit Saxena
2016-02-08 12:57 ` Tomas Henzl
2016-02-10 1:48 ` Martin K. Petersen
2016-01-28 15:44 ` [PATCH 2/2] megaraid_sas: Fix SMAP issue Sumit Saxena
2016-01-29 16:24 ` Tomas Henzl
2016-02-10 1:49 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.