diff mbox

[v2,2/5] ipr: Don't set NO_ULEN_CHK bit when resource is a vset.

Message ID 1446575170-18656-2-git-send-email-krisman@linux.vnet.ibm.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Gabriel Krisman Bertazi Nov. 3, 2015, 6:26 p.m. UTC
According to the IPR specification, Inhibit Underlength Checking bit
must be disabled when issuing commands to vsets.  Enabling it in this
case might cause SCSI commands to fail with an Illegal Request, so make
sure we keep this bit cleared when resource is a vset.

Changes since v1:
	- Put gsci exclusive stuff in a separate block.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
---
 drivers/scsi/ipr.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Manoj Kumar Nov. 3, 2015, 8:39 p.m. UTC | #1
Gabriel:

On applying this patch, I noticed that this statement
seems to be unnecessary:

                 else
                         ioarcb->cmd_pkt.flags_lo |= 
IPR_FLAGS_LO_UNTAGGED_TASK;

As the value is 0x00:
#define IPR_FLAGS_LO_UNTAGGED_TASK              0x00

You can resolve this in a future update.

Reviewed-by: Manoj Kumar <manoj@linux.vnet.ibm.com>

---
Manoj Kumar

On 11/3/2015 12:26 PM, Gabriel Krisman Bertazi wrote:
> According to the IPR specification, Inhibit Underlength Checking bit
> must be disabled when issuing commands to vsets.  Enabling it in this
> case might cause SCSI commands to fail with an Illegal Request, so make
> sure we keep this bit cleared when resource is a vset.
>
> Changes since v1:
> 	- Put gsci exclusive stuff in a separate block.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
> ---
>   drivers/scsi/ipr.c | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 238efab..6849b7f 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -6363,15 +6363,19 @@ static int ipr_queuecommand(struct Scsi_Host *shost,
>   	ipr_cmd->scsi_cmd = scsi_cmd;
>   	ipr_cmd->done = ipr_scsi_eh_done;
>
> -	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
> +	if (ipr_is_gscsi(res)) {
>   		if (scsi_cmd->underflow == 0)
>   			ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_ULEN_CHK;
>
> -		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
> -		if (ipr_is_gscsi(res) && res->reset_occurred) {
> +		if (res->reset_occurred) {
>   			res->reset_occurred = 0;
>   			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_DELAY_AFTER_RST;
>   		}
> +	}
> +
> +	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
> +		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
> +
>   		ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_ALIGNED_BFR;
>   		if (scsi_cmd->flags & SCMD_TAGGED)
>   			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_SIMPLE_TASK;
>

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Brian King Nov. 4, 2015, 2:52 a.m. UTC | #2
Acked-by: Brian King <brking@linux.vnet.ibm.com>
wenxiong@linux.vnet.ibm.com Nov. 4, 2015, 6:50 p.m. UTC | #3
Reviewed-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>

Thanks,
Wendy

Quoting Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>:

> According to the IPR specification, Inhibit Underlength Checking bit
> must be disabled when issuing commands to vsets.  Enabling it in this
> case might cause SCSI commands to fail with an Illegal Request, so make
> sure we keep this bit cleared when resource is a vset.
>
> Changes since v1:
> 	- Put gsci exclusive stuff in a separate block.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
> ---
>  drivers/scsi/ipr.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 238efab..6849b7f 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -6363,15 +6363,19 @@ static int ipr_queuecommand(struct Scsi_Host *shost,
>  	ipr_cmd->scsi_cmd = scsi_cmd;
>  	ipr_cmd->done = ipr_scsi_eh_done;
>
> -	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
> +	if (ipr_is_gscsi(res)) {
>  		if (scsi_cmd->underflow == 0)
>  			ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_ULEN_CHK;
>
> -		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
> -		if (ipr_is_gscsi(res) && res->reset_occurred) {
> +		if (res->reset_occurred) {
>  			res->reset_occurred = 0;
>  			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_DELAY_AFTER_RST;
>  		}
> +	}
> +
> +	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
> +		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
> +
>  		ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_ALIGNED_BFR;
>  		if (scsi_cmd->flags & SCMD_TAGGED)
>  			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_SIMPLE_TASK;
> --
> 2.1.0


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 238efab..6849b7f 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -6363,15 +6363,19 @@  static int ipr_queuecommand(struct Scsi_Host *shost,
 	ipr_cmd->scsi_cmd = scsi_cmd;
 	ipr_cmd->done = ipr_scsi_eh_done;
 
-	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
+	if (ipr_is_gscsi(res)) {
 		if (scsi_cmd->underflow == 0)
 			ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_ULEN_CHK;
 
-		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
-		if (ipr_is_gscsi(res) && res->reset_occurred) {
+		if (res->reset_occurred) {
 			res->reset_occurred = 0;
 			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_DELAY_AFTER_RST;
 		}
+	}
+
+	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
+		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;
+
 		ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_ALIGNED_BFR;
 		if (scsi_cmd->flags & SCMD_TAGGED)
 			ioarcb->cmd_pkt.flags_lo |= IPR_FLAGS_LO_SIMPLE_TASK;