[PATCH -next] scsi: pmcraid: remove set but not used variables 'res, access'

2018-11-12 Thread YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/scsi/pmcraid.c: In function 'pmcraid_abort_cmd':
drivers/scsi/pmcraid.c:2878:33: warning:
 variable 'res' set but not used [-Wunused-but-set-variable]

drivers/scsi/pmcraid.c: In function 'pmcraid_ioctl_passthrough':
drivers/scsi/pmcraid.c:3603:5: warning:
 variable 'access' set but not used [-Wunused-but-set-variable]

'res' never used since introduction in commit 89a368104150 ("[SCSI] pmcraid:
PMC-Sierra MaxRAID driver to support 6Gb/s SAS RAID controller")

'access' not used any more since commit
edb88cef0570 ("scsi: pmcraid: use normal copy_from_user")

Signed-off-by: YueHaibing 
---
 drivers/scsi/pmcraid.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 707d766..555e4a3 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -2875,10 +2875,8 @@ static struct pmcraid_cmd *pmcraid_abort_cmd(struct 
pmcraid_cmd *cmd)
 {
struct pmcraid_cmd *cancel_cmd;
struct pmcraid_instance *pinstance;
-   struct pmcraid_resource_entry *res;
 
pinstance = (struct pmcraid_instance *)cmd->drv_inst;
-   res = cmd->scsi_cmd->device->hostdata;
 
cancel_cmd = pmcraid_get_free_cmd(pinstance);
 
@@ -3600,7 +3598,7 @@ static long pmcraid_ioctl_passthrough(
u32 ioasc;
int request_size;
int buffer_size;
-   u8 access, direction;
+   u8 direction;
int rc = 0;
 
/* If IOA reset is in progress, wait 10 secs for reset to complete */
@@ -3648,13 +3646,10 @@ static long pmcraid_ioctl_passthrough(
 
request_size = le32_to_cpu(buffer->ioarcb.data_transfer_length);
 
-   if (buffer->ioarcb.request_flags0 & TRANSFER_DIR_WRITE) {
-   access = VERIFY_READ;
+   if (buffer->ioarcb.request_flags0 & TRANSFER_DIR_WRITE)
direction = DMA_TO_DEVICE;
-   } else {
-   access = VERIFY_WRITE;
+   else
direction = DMA_FROM_DEVICE;
-   }
 
if (request_size < 0) {
rc = -EINVAL;





[PATCH -next] scsi: ufs: Fix platform_no_drv_owner.cocci warnings

2018-11-12 Thread YueHaibing
Remove .owner field if calls are used which set it automatically
Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: YueHaibing 
---
 drivers/scsi/ufs/cdns-pltfrm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/scsi/ufs/cdns-pltfrm.c b/drivers/scsi/ufs/cdns-pltfrm.c
index 8bcf863..4a37b4f 100644
--- a/drivers/scsi/ufs/cdns-pltfrm.c
+++ b/drivers/scsi/ufs/cdns-pltfrm.c
@@ -135,7 +135,6 @@ static int cdns_ufs_pltfrm_remove(struct platform_device 
*pdev)
.remove = cdns_ufs_pltfrm_remove,
.driver = {
.name   = "cdns-ufshcd",
-   .owner  = THIS_MODULE,
.pm = _ufs_dev_pm_ops,
.of_match_table = cdns_ufs_of_match,
},







Re: [PATCH] qla2xxx: Add SysFS hook for FC-NVMe autoconnect

2018-11-12 Thread Madhani, Himanshu
Hi Bart, 

> On Nov 12, 2018, at 2:06 PM, Bart Van Assche  wrote:
> 
> External Email
> 
> On Mon, 2018-11-12 at 13:40 -0800, Himanshu Madhani wrote:
>> diff --git a/drivers/scsi/qla2xxx/qla_attr.c
>> b/drivers/scsi/qla2xxx/qla_attr.c
>> index 678aff5ca947..323a4aa35f16 100644
>> --- a/drivers/scsi/qla2xxx/qla_attr.c
>> +++ b/drivers/scsi/qla2xxx/qla_attr.c
>> @@ -1665,6 +1665,125 @@ qla2x00_max_speed_sup_show(struct device *dev,
>> struct device_attribute *attr,
>>  ha->max_speed_sup ? "32Gps" : "16Gps");
>> }
>> 
>> +static ssize_t
>> +qla27xx_nvme_connect_str_show(struct device *dev, struct device_attribute
>> *attr,
>> +char *buf)
>> +{
>> + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
>> + struct nvme_fc_remote_port *rport;
>> + struct nvme_fc_local_port *lport;
>> + struct qla_hw_data *ha = vha->hw;
>> + struct qla_nvme_rport *qla_rport, *trport;
>> + fc_port_t *fcport;
>> + char temp[150] = {0};
>> + char *rportstate = "";
>> +
>> + if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha))
>> + return scnprintf(buf, PAGE_SIZE, "\n");
>> +
>> + if (!vha->flags.nvme_enabled)
>> + return scnprintf(buf, PAGE_SIZE, "%s\n",
>> + "FC-NVMe is not enabled");
>> +
>> + list_for_each_entry(fcport, >vp_fcports, list) {
>> + if (!fcport) {
>> + scnprintf(buf, PAGE_SIZE, "No FC host\n");
>> + return strlen(buf);
>> + }
>> +
>> + if (!vha->nvme_local_port) {
>> + scnprintf(buf, PAGE_SIZE,
>> + "FC-NVMe Initiator on 0x%16llx not
>> registered.\n",
>> + wwn_to_u64(fcport->port_name));
>> + return strlen(buf);
>> + }
>> +
>> + list_for_each_entry_safe(qla_rport, trport,
>> + >nvme_rport_list, list) {
>> + if (qla_rport->fcport == fcport) {
>> + rport = fcport->nvme_remote_port;
>> +
>> + lport = vha->nvme_local_port;
>> +
>> + scnprintf(temp, sizeof(temp),
>> + "FC-NVMe LPORT: host%ld nn-
>> 0x%16llx:pn-0x%16llx port_id %06x %s\n",
>> + vha->host_no, lport->node_name,
>> + lport->port_name, lport->port_id,
>> "ONLINE");
>> +
>> + if (strlcat(buf, temp, PAGE_SIZE) >=
>> PAGE_SIZE)
>> + goto done;
>> +
>> + scnprintf(temp, sizeof(temp),
>> + "FC-NVMe RPORT: host%ld nn-0x%llx:pn-
>> 0x%llx port_id %06x ",
>> + vha->host_no, rport->node_name,
>> + rport->port_name, rport->port_id);
>> +
>> + /* Find out Rport State */
>> + if (rport->port_state &
>> FC_OBJSTATE_ONLINE)
>> + rportstate = "ONLINE";
>> +
>> + if (rport->port_state &
>> FC_OBJSTATE_UNKNOWN)
>> + rportstate = "UNKNOWN";
>> +
>> + if (rport->port_state &
>> ~(FC_OBJSTATE_ONLINE |
>> + FC_OBJSTATE_UNKNOWN))
>> + rportstate = "UNSUPPORTED";
>> +
>> + if (strlcat(buf, temp, PAGE_SIZE) >=
>> + PAGE_SIZE)
>> + goto done;
>> +
>> + if (rport->port_role &
>> + (FC_PORT_ROLE_NVME_INITIATOR |
>> +   FC_PORT_ROLE_NVME_TARGET |
>> +   FC_PORT_ROLE_NVME_DISCOVERY)) {
>> + if (rport->port_role &
>> + FC_PORT_ROLE_NVME_INITIATOR)
>> + if (strlcat(buf,
>> "INITIATOR ",
>> + PAGE_SIZE) >=
>> PAGE_SIZE)
>> + goto done;
>> +
>> + if (rport->port_role &
>> + FC_PORT_ROLE_NVME_TARGET)
>> + if (strlcat(buf, "TARGET
>> ",
>> + PAGE_SIZE) >=
>> PAGE_SIZE)
>> + goto done;
>> +
>> + if (rport->port_role &
>> + FC_PORT_ROLE_NVME_DISCOVERY)
>> + if (strlcat(buf,
>> "DISCOVERY ",
>> + PAGE_SIZE) >=
>> PAGE_SIZE)
>> + 

Re: [PATCH] qla2xxx: Add SysFS hook for FC-NVMe autoconnect

2018-11-12 Thread Bart Van Assche
On Mon, 2018-11-12 at 13:40 -0800, Himanshu Madhani wrote:
> diff --git a/drivers/scsi/qla2xxx/qla_attr.c
> b/drivers/scsi/qla2xxx/qla_attr.c
> index 678aff5ca947..323a4aa35f16 100644
> --- a/drivers/scsi/qla2xxx/qla_attr.c
> +++ b/drivers/scsi/qla2xxx/qla_attr.c
> @@ -1665,6 +1665,125 @@ qla2x00_max_speed_sup_show(struct device *dev,
> struct device_attribute *attr,
>   ha->max_speed_sup ? "32Gps" : "16Gps");
>  }
>  
> +static ssize_t
> +qla27xx_nvme_connect_str_show(struct device *dev, struct device_attribute
> *attr,
> +char *buf)
> +{
> + scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
> + struct nvme_fc_remote_port *rport;
> + struct nvme_fc_local_port *lport;
> + struct qla_hw_data *ha = vha->hw;
> + struct qla_nvme_rport *qla_rport, *trport;
> + fc_port_t *fcport;
> + char temp[150] = {0};
> + char *rportstate = "";
> +
> + if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha))
> + return scnprintf(buf, PAGE_SIZE, "\n");
> +
> + if (!vha->flags.nvme_enabled)
> + return scnprintf(buf, PAGE_SIZE, "%s\n",
> + "FC-NVMe is not enabled");
> +
> + list_for_each_entry(fcport, >vp_fcports, list) {
> + if (!fcport) {
> + scnprintf(buf, PAGE_SIZE, "No FC host\n");
> + return strlen(buf);
> + }
> +
> + if (!vha->nvme_local_port) {
> + scnprintf(buf, PAGE_SIZE,
> + "FC-NVMe Initiator on 0x%16llx not
> registered.\n",
> + wwn_to_u64(fcport->port_name));
> + return strlen(buf);
> + }
> +
> + list_for_each_entry_safe(qla_rport, trport,
> + >nvme_rport_list, list) {
> + if (qla_rport->fcport == fcport) {
> + rport = fcport->nvme_remote_port;
> +
> + lport = vha->nvme_local_port;
> +
> + scnprintf(temp, sizeof(temp),
> + "FC-NVMe LPORT: host%ld nn-
> 0x%16llx:pn-0x%16llx port_id %06x %s\n",
> + vha->host_no, lport->node_name,
> + lport->port_name, lport->port_id,
> "ONLINE");
> +
> + if (strlcat(buf, temp, PAGE_SIZE) >=
> PAGE_SIZE)
> + goto done;
> +
> + scnprintf(temp, sizeof(temp),
> + "FC-NVMe RPORT: host%ld nn-0x%llx:pn-
> 0x%llx port_id %06x ",
> + vha->host_no, rport->node_name,
> + rport->port_name, rport->port_id);
> +
> + /* Find out Rport State */
> + if (rport->port_state &
> FC_OBJSTATE_ONLINE)
> + rportstate = "ONLINE";
> +
> + if (rport->port_state &
> FC_OBJSTATE_UNKNOWN)
> + rportstate = "UNKNOWN";
> +
> + if (rport->port_state &
> ~(FC_OBJSTATE_ONLINE |
> + FC_OBJSTATE_UNKNOWN))
> + rportstate = "UNSUPPORTED";
> +
> + if (strlcat(buf, temp, PAGE_SIZE) >=
> + PAGE_SIZE)
> + goto done;
> +
> + if (rport->port_role &
> + (FC_PORT_ROLE_NVME_INITIATOR |
> +   FC_PORT_ROLE_NVME_TARGET |
> +   FC_PORT_ROLE_NVME_DISCOVERY)) {
> + if (rport->port_role &
> + FC_PORT_ROLE_NVME_INITIATOR)
> + if (strlcat(buf,
> "INITIATOR ",
> + PAGE_SIZE) >=
> PAGE_SIZE)
> + goto done;
> +
> + if (rport->port_role &
> + FC_PORT_ROLE_NVME_TARGET)
> + if (strlcat(buf, "TARGET
> ",
> + PAGE_SIZE) >=
> PAGE_SIZE)
> + goto done;
> +
> + if (rport->port_role &
> + FC_PORT_ROLE_NVME_DISCOVERY)
> + if (strlcat(buf,
> "DISCOVERY ",
> + PAGE_SIZE) >=
> PAGE_SIZE)
> + goto done;
> + } else {
> + if (strlcat(buf, "UNKNOWN_ROLE ",
> + PAGE_SIZE) >= 

[PATCH] qla2xxx: Add SysFS hook for FC-NVMe autoconnect

2018-11-12 Thread Himanshu Madhani
This patch adds a SysFS hook for systemd service to kick
off autoconnect command at the boot time.

Output of the SysFS hook will provide host-traddr/traddr which will
be used by NVMe CLI to kick off discovery at boot time.

Signed-off-by: Himanshu Madhani 
---
Hi Martin, 

This patch provides mechanism for qla2xxx driver's boot time scripts for 
autodiscovery and autoconnection of NVMe LUNs. 

Please apply this to 4.21/scsi-queue at your earliest convenience. 

Thanks,
Himanshu
---
 drivers/scsi/qla2xxx/qla_attr.c | 122 +++-
 1 file changed, 121 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 678aff5ca947..323a4aa35f16 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1665,6 +1665,125 @@ qla2x00_max_speed_sup_show(struct device *dev, struct 
device_attribute *attr,
ha->max_speed_sup ? "32Gps" : "16Gps");
 }
 
+static ssize_t
+qla27xx_nvme_connect_str_show(struct device *dev, struct device_attribute 
*attr,
+char *buf)
+{
+   scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
+   struct nvme_fc_remote_port *rport;
+   struct nvme_fc_local_port *lport;
+   struct qla_hw_data *ha = vha->hw;
+   struct qla_nvme_rport *qla_rport, *trport;
+   fc_port_t *fcport;
+   char temp[150] = {0};
+   char *rportstate = "";
+
+   if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha))
+   return scnprintf(buf, PAGE_SIZE, "\n");
+
+   if (!vha->flags.nvme_enabled)
+   return scnprintf(buf, PAGE_SIZE, "%s\n",
+   "FC-NVMe is not enabled");
+
+   list_for_each_entry(fcport, >vp_fcports, list) {
+   if (!fcport) {
+   scnprintf(buf, PAGE_SIZE, "No FC host\n");
+   return strlen(buf);
+   }
+
+   if (!vha->nvme_local_port) {
+   scnprintf(buf, PAGE_SIZE,
+   "FC-NVMe Initiator on 0x%16llx not registered.\n",
+   wwn_to_u64(fcport->port_name));
+   return strlen(buf);
+   }
+
+   list_for_each_entry_safe(qla_rport, trport,
+   >nvme_rport_list, list) {
+   if (qla_rport->fcport == fcport) {
+   rport = fcport->nvme_remote_port;
+
+   lport = vha->nvme_local_port;
+
+   scnprintf(temp, sizeof(temp),
+   "FC-NVMe LPORT: host%ld 
nn-0x%16llx:pn-0x%16llx port_id %06x %s\n",
+   vha->host_no, lport->node_name,
+   lport->port_name, lport->port_id, "ONLINE");
+
+   if (strlcat(buf, temp, PAGE_SIZE) >= PAGE_SIZE)
+   goto done;
+
+   scnprintf(temp, sizeof(temp),
+   "FC-NVMe RPORT: host%ld nn-0x%llx:pn-0x%llx 
port_id %06x ",
+   vha->host_no, rport->node_name,
+   rport->port_name, rport->port_id);
+
+   /* Find out Rport State */
+   if (rport->port_state & FC_OBJSTATE_ONLINE)
+   rportstate = "ONLINE";
+
+   if (rport->port_state & FC_OBJSTATE_UNKNOWN)
+   rportstate = "UNKNOWN";
+
+   if (rport->port_state & ~(FC_OBJSTATE_ONLINE |
+   FC_OBJSTATE_UNKNOWN))
+   rportstate = "UNSUPPORTED";
+
+   if (strlcat(buf, temp, PAGE_SIZE) >=
+   PAGE_SIZE)
+   goto done;
+
+   if (rport->port_role &
+   (FC_PORT_ROLE_NVME_INITIATOR |
+ FC_PORT_ROLE_NVME_TARGET |
+ FC_PORT_ROLE_NVME_DISCOVERY)) {
+   if (rport->port_role &
+   FC_PORT_ROLE_NVME_INITIATOR)
+   if (strlcat(buf, "INITIATOR ",
+   PAGE_SIZE) >= PAGE_SIZE)
+   goto done;
+
+   if (rport->port_role &
+   FC_PORT_ROLE_NVME_TARGET)
+   if (strlcat(buf, "TARGET ",
+   PAGE_SIZE) >= PAGE_SIZE)
+   goto done;
+
+   if (rport->port_role &
+

With Due Respect!

2018-11-12 Thread Mr.Ghazi Ahmed
Hi friend I am a banker in ADB BANK. I want to transfer an abandoned
$10.2Million to your Bank account. 40/percent will be your share.
For more details contanct me urgently. Yours Mr Ghazi Ahmed



Re: [PATCH V2] sg3_utils: sg_write_buffer: convert string to integer while reading from stdio

2018-11-12 Thread Douglas Gilbert

On 2018-11-12 11:32 a.m., Bean Huo (beanhuo) wrote:

This patch is to convert inputted string to the integer
when read data from stdin. While entering data flow, the
data between bytes can be separated by either space,
or ',' (or by '.').

V1-V2:
1. Rebased the patch on the latest sg_write_buffer.c
2. Added the wrong input checkup, and process
3. Changed the delimer from ",. " to ",. /n/t", in order
 to skip the spaces at the end of string because of misoperation.
4. Modified some wrong indents.

Tested on my own UFS platform, used to issue VU command:

./sg_write_buffer -b 0 -i 0 -v -l 0x2c -m 1  -S 7 -r /dev/block/sda
0x01 0x40 0x20
tried to read 44 bytes from -, got 3 bytes
pad with 0xff bytes and continue
sending single write buffer, mode=0x1, mpsec=7, id=0, offset=0, len=44
 Write buffer cdb: 3b e1 00 00 00 00 00 00 2c 00

./sg_read_buffer -l 32 -m 1 -S 6 -v /dev/block/sda
 Read buffer(10) cdb: 3c c1 00 00 00 00 00 00 20 00
  00 61 34 64 36 63 38 61 42  65 36 4b 4d 4c 34 4c 30
  10 30 34 44 43 45 32 30 32  57 30 00 00 00 00 00 00

Signed-off-by: Bean Huo 


Thanks, applied.

Just prior to getting this patch today I put up a sg3_utils-1.45
(early) beta: revision 795. It's in a tarball at the top of
http://sg.danny.cz/sg/

This patch will be in revision 796.

Doug Gilbert


[PATCH V2] sg3_utils: sg_write_buffer: convert string to integer while reading from stdio

2018-11-12 Thread Bean Huo (beanhuo)
This patch is to convert inputted string to the integer
when read data from stdin. While entering data flow, the
data between bytes can be separated by either space,
or ',' (or by '.').

V1-V2:
1. Rebased the patch on the latest sg_write_buffer.c
2. Added the wrong input checkup, and process
3. Changed the delimer from ",. " to ",. /n/t", in order
 to skip the spaces at the end of string because of misoperation.
4. Modified some wrong indents.

Tested on my own UFS platform, used to issue VU command:

./sg_write_buffer -b 0 -i 0 -v -l 0x2c -m 1  -S 7 -r /dev/block/sda 
0x01 0x40 0x20 
tried to read 44 bytes from -, got 3 bytes
pad with 0xff bytes and continue
sending single write buffer, mode=0x1, mpsec=7, id=0, offset=0, len=44
Write buffer cdb: 3b e1 00 00 00 00 00 00 2c 00 

./sg_read_buffer -l 32 -m 1 -S 6 -v /dev/block/sda 
Read buffer(10) cdb: 3c c1 00 00 00 00 00 00 20 00 
 00 61 34 64 36 63 38 61 42  65 36 4b 4d 4c 34 4c 30
 10 30 34 44 43 45 32 30 32  57 30 00 00 00 00 00 00

Signed-off-by: Bean Huo 
---
 src/sg_write_buffer.c | 58 ++-
 1 file changed, 48 insertions(+), 10 deletions(-)

diff --git a/src/sg_write_buffer.c b/src/sg_write_buffer.c
index 9c81e93..115f0af 100644
--- a/src/sg_write_buffer.c
+++ b/src/sg_write_buffer.c
@@ -212,6 +212,7 @@ main(int argc, char * argv[])
 const char * device_name = NULL;
 const char * file_name = NULL;
 uint8_t * dop = NULL;
+uint8_t * read_buf = NULL;
 uint8_t * free_dop = NULL;
 char * cp;
 const struct mode_s * mp;
@@ -440,16 +441,51 @@ main(int argc, char * argv[])
 }
 }
 }
-res = read(infd, dop, wb_len);
-if (res < 0) {
-ret = sg_convert_errno(errno);
-snprintf(ebuff, EBUFF_SZ, ME "couldn't read from %s",
- file_name);
-perror(ebuff);
-if (! got_stdin)
-close(infd);
-goto err_out;
-}
+   if (infd == STDIN_FILENO) {
+   if (NULL == (read_buf = (unsigned char *)malloc(DEF_XFER_LEN))) 
{
+   pr2serr(ME "out of memory\n");
+ret = SG_LIB_SYNTAX_ERROR;
+goto err_out;
+   }
+   res = read(infd, read_buf, DEF_XFER_LEN);
+   if (res < 0) {
+   snprintf(ebuff, EBUFF_SZ, ME "couldn't read from STDIN");
+   perror(ebuff);
+   ret = SG_LIB_FILE_ERROR;
+   goto err_out;
+   }
+   char * pch;
+   int val = 0;
+   res = 0;
+   pch = strtok((char*)read_buf, ",. \n\t");
+   while (pch != NULL) {
+   val = sg_get_num_nomult(pch);
+   if (val >= 0 && val < 255) {
+   dop[res] = val;
+   res++;
+   } else {
+   pr2serr("Data read from STDIO is wrong.\n"
+   "Please input the data by byte, the bytes 
should be seperated\n"
+   "by either space, or ',' ( or by '.'), and the 
value per byte should\n"
+   "be between 0~255. Hexadecimal number preceded 
by either '0x' or\n"
+   "'OX' (or has a trailing 'h' or 'H').\n");
+   ret = SG_LIB_SYNTAX_ERROR;
+   goto err_out;
+   }
+   pch = strtok(NULL, ",. \n\t");
+   }
+} else {
+res = read(infd, dop, wb_len);
+if (res < 0) {
+ret = sg_convert_errno(errno);
+snprintf(ebuff, EBUFF_SZ, ME "couldn't read from %s",
+ file_name);
+perror(ebuff);
+if (! got_stdin)
+close(infd);
+goto err_out;
+   }
+   }
 if (res < wb_len) {
 if (wb_len_given) {
 pr2serr("tried to read %d bytes from %s, got %d bytes\n",
@@ -537,6 +573,8 @@ main(int argc, char * argv[])
 err_out:
 if (free_dop)
 free(free_dop);
+if (read_buf)
+   free(read_buf);
 if (sg_fd >= 0) {
 res = sg_cmds_close_device(sg_fd);
 if (res < 0) {
-- 
2.7.4


Inquiry 12/11/2018

2018-11-12 Thread sinara-group
Hi,friend,
 
This is Daniel Murray and i am from Sinara Group Co.Ltd Group Co.,LTD in Russia.
We are glad to know about your company from the web and we are interested in 
your products.
Could you kindly send us your Latest catalog and price list for our trial order.
 
Best Regards,
 
Daniel Murray
Purchasing Manager




[PATCH] scsi: lpfc: fix block guard enablement on SLI3 adapters

2018-11-12 Thread Martin Wilck
Since f44ac12f1dcc, BG enablement is tracked with the
LPFC_SLI3_BG_ENABLED bit, which is set in lpfc_get_cfgparam
before lpfc_sli_config_sli_port() is called. The bit
shouldn't be cleared before checking the feature.
Based on problem analysis by David Bond.

Fixes: f44ac12f1dcc "scsi: lpfc: Memory allocation error during driver start-up 
on power8"
Tested-by: David Bond 
Signed-off-by: Martin Wilck 
Cc: sta...@vger.kernel.org # 4.17.x
Cc: sta...@vger.kernel.org # 4.18.x
Cc: sta...@vger.kernel.org # 4.19.x
---
 drivers/scsi/lpfc/lpfc_init.c | 6 +-
 drivers/scsi/lpfc/lpfc_sli.c  | 1 -
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 323a32e..6b61cae 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -167,7 +167,11 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
   sizeof(phba->wwpn));
}
 
-   phba->sli3_options = 0x0;
+   /*
+* Clear all option bits except LPFC_SLI3_BG_ENABLED,
+* which was already set in lpfc_get_cfgparam()
+*/
+   phba->sli3_options &= (uint32_t)LPFC_SLI3_BG_ENABLED;
 
/* Setup and issue mailbox READ REV command */
lpfc_read_rev(phba, pmb);
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 783a154..b9e5cd7 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -4965,7 +4965,6 @@ lpfc_sli_config_port(struct lpfc_hba *phba, int sli_mode)
phba->sli3_options &= ~(LPFC_SLI3_NPIV_ENABLED |
LPFC_SLI3_HBQ_ENABLED |
LPFC_SLI3_CRP_ENABLED |
-   LPFC_SLI3_BG_ENABLED |
LPFC_SLI3_DSS_ENABLED);
if (rc != MBX_SUCCESS) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
-- 
2.19.1