diff mbox

[04/10] mpt3sas: Fix removal and addition of vSES device during host reset

Message ID 1507641083-20207-5-git-send-email-Sreekanth.Reddy@broadcom.com (mailing list archive)
State Accepted
Headers show

Commit Message

Sreekanth Reddy Oct. 10, 2017, 1:11 p.m. UTC
For Dev Handles who value is less than hba's phys count number
 driver will return HBA sas address value as a sas address.
So for Virtual SES device also driver was returning HBA sas address instead
 of Virtual SES sas address. So now updated the driver to return
 Virtual SES's sas address for Virtual SES device instead of
 HBA's sas address.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Comments

Tomas Henzl Oct. 11, 2017, 3:35 p.m. UTC | #1
On 10/10/2017 03:11 PM, Sreekanth Reddy wrote:
> For Dev Handles who value is less than hba's phys count number
>  driver will return HBA sas address value as a sas address.
> So for Virtual SES device also driver was returning HBA sas address instead
>  of Virtual SES sas address. So now updated the driver to return
>  Virtual SES's sas address for Virtual SES device instead of
>  HBA's sas address.
>
> Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com>

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
James Bottomley Oct. 11, 2017, 3:56 p.m. UTC | #2
On Wed, 2017-10-11 at 17:35 +0200, Tomas Henzl wrote:
> On 10/10/2017 03:11 PM, Sreekanth Reddy wrote:
> > 
> > For Dev Handles who value is less than hba's phys count number
> >  driver will return HBA sas address value as a sas address.
> > So for Virtual SES device also driver was returning HBA sas address
> > instead
> >  of Virtual SES sas address. So now updated the driver to return
> >  Virtual SES's sas address for Virtual SES device instead of
> >  HBA's sas address.
> > 
> > Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com>
> 
> Signed-off-by: Tomas Henzl <thenzl@redhat.com>

You mean Reviewed-by: I think?

James
Tomas Henzl Oct. 11, 2017, 4:12 p.m. UTC | #3
On 10/11/2017 05:56 PM, James Bottomley wrote:
> On Wed, 2017-10-11 at 17:35 +0200, Tomas Henzl wrote:
>> On 10/10/2017 03:11 PM, Sreekanth Reddy wrote:
>>> For Dev Handles who value is less than hba's phys count number
>>>  driver will return HBA sas address value as a sas address.
>>> So for Virtual SES device also driver was returning HBA sas address
>>> instead
>>>  of Virtual SES sas address. So now updated the driver to return
>>>  Virtual SES's sas address for Virtual SES device instead of
>>>  HBA's sas address.
>>>
>>> Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com>
>> Signed-off-by: Tomas Henzl <thenzl@redhat.com>
> You mean Reviewed-by: I think?

Sure, sorry for that, corrected too late in 8/10
should I resend with  "Reviewed-by" ?

Tomas

>
> James
>
James Bottomley Oct. 11, 2017, 5:19 p.m. UTC | #4
On Wed, 2017-10-11 at 18:12 +0200, Tomas Henzl wrote:
> On 10/11/2017 05:56 PM, James Bottomley wrote:
> > 
> > On Wed, 2017-10-11 at 17:35 +0200, Tomas Henzl wrote:
> > > 
> > > On 10/10/2017 03:11 PM, Sreekanth Reddy wrote:
> > > > 
> > > > For Dev Handles who value is less than hba's phys count number
> > > >  driver will return HBA sas address value as a sas address.
> > > > So for Virtual SES device also driver was returning HBA sas
> > > > address
> > > > instead
> > > >  of Virtual SES sas address. So now updated the driver to
> > > > return
> > > >  Virtual SES's sas address for Virtual SES device instead of
> > > >  HBA's sas address.
> > > > 
> > > > Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com>
> > > Signed-off-by: Tomas Henzl <thenzl@redhat.com>
> > You mean Reviewed-by: I think?
> 
> Sure, sorry for that, corrected too late in 8/10
> should I resend with  "Reviewed-by" ?

It's probably OK, but please do so if there's another resend.
 Patchwork blindly captures what it sees, so the application has to be
hand modified to change Signed-off-by to Reviewed-by even if you resend
with Reviewed-by.

James
Martin K. Petersen Oct. 11, 2017, 5:27 p.m. UTC | #5
Tomas,

> Sure, sorry for that, corrected too late in 8/10 should I resend with
> "Reviewed-by" ?

I'll fix it up.
diff mbox

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 600e8ef..cc78ce4 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -406,11 +406,6 @@  _scsih_get_sas_address(struct MPT3SAS_ADAPTER *ioc, u16 handle,
 
 	*sas_address = 0;
 
-	if (handle <= ioc->sas_hba.num_phys) {
-		*sas_address = ioc->sas_hba.sas_address;
-		return 0;
-	}
-
 	if ((mpt3sas_config_get_sas_device_pg0(ioc, &mpi_reply, &sas_device_pg0,
 	    MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) {
 		pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", ioc->name,
@@ -420,7 +415,15 @@  _scsih_get_sas_address(struct MPT3SAS_ADAPTER *ioc, u16 handle,
 
 	ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & MPI2_IOCSTATUS_MASK;
 	if (ioc_status == MPI2_IOCSTATUS_SUCCESS) {
-		*sas_address = le64_to_cpu(sas_device_pg0.SASAddress);
+		/* For HBA vSES don't return hba sas address instead return
+		 * vSES's sas address.
+		 */
+		if ((handle <= ioc->sas_hba.num_phys) &&
+		   (!(le32_to_cpu(sas_device_pg0.DeviceInfo) &
+		   MPI2_SAS_DEVICE_INFO_SEP)))
+			*sas_address = ioc->sas_hba.sas_address;
+		else
+			*sas_address = le64_to_cpu(sas_device_pg0.SASAddress);
 		return 0;
 	}