mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] qla2xxx: use F/W calculated residual length.
@ 2009-12-01  1:37 Joe Jin
  2009-12-02 20:39 ` Giridhar Malavali
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Jin @ 2009-12-01  1:37 UTC (permalink / raw)
  To: andrew.vasquez; +Cc: linux-scsi, linux-kernel, gurudas.pai, kate.zhang, joe.jin

Hi,

When comp_status is CS_DATA_OVERRUN, residual length calculated by F/W,
but when comp_status is CS_COMMPLETE, residual length just set to residual
count, at here calculated residual length may via F/W?

Please review.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
CC: Andrew Vasquez <andrew.vasquez@qlogic.com>

---
 qla_isr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index b20a716..4d1d410 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -1398,7 +1398,7 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
 			break;
 		}
 		if (scsi_status & (SS_RESIDUAL_UNDER | SS_RESIDUAL_OVER)) {
-			resid = resid_len;
+			resid = IS_FWI2_CAPABLE(ha) ? fw_resid_len : resid_len;
 			scsi_set_resid(cp, resid);
 
 			if (!lscsi_status &&



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] qla2xxx: use F/W calculated residual length.
  2009-12-01  1:37 [patch] qla2xxx: use F/W calculated residual length Joe Jin
@ 2009-12-02 20:39 ` Giridhar Malavali
  0 siblings, 0 replies; 2+ messages in thread
From: Giridhar Malavali @ 2009-12-02 20:39 UTC (permalink / raw)
  To: Joe Jin; +Cc: Andrew Vasquez, linux-scsi, linux-kernel, gurudas.pai, kate.zhang


On Nov 30, 2009, at 5:37 PM, Joe Jin wrote:

> Hi,
>
> When comp_status is CS_DATA_OVERRUN, residual length calculated by F/ 
> W,
> but when comp_status is CS_COMMPLETE, residual length just set to  
> residual
> count, at here calculated residual length may via F/W?

In case of good scsi completion with residual flag set, then firmware  
does not report the residual information, hence, driver depends upon  
the scsi residual obtained from target. The code does this now.

In case of over-run condition driver reports DID_ERROR to mid layer.

In case of under-run condition, the firmware detects and reports under  
run length which can be different from what obtained from target.  
Hence, driver gives preference to firmware reported residual length.

>
>
> Please review.
>
> Signed-off-by: Joe Jin <joe.jin@oracle.com>
> CC: Andrew Vasquez <andrew.vasquez@qlogic.com>
>
> ---
> qla_isr.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/ 
> qla_isr.c
> index b20a716..4d1d410 100644
> --- a/drivers/scsi/qla2xxx/qla_isr.c
> +++ b/drivers/scsi/qla2xxx/qla_isr.c
> @@ -1398,7 +1398,7 @@ qla2x00_status_entry(scsi_qla_host_t *vha,  
> struct rsp_que *rsp, void *pkt)
> 			break;
> 		}
> 		if (scsi_status & (SS_RESIDUAL_UNDER | SS_RESIDUAL_OVER)) {
> -			resid = resid_len;
> +			resid = IS_FWI2_CAPABLE(ha) ? fw_resid_len : resid_len;
> 			scsi_set_resid(cp, resid);
>
> 			if (!lscsi_status &&
>
>
> --
> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-02 20:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-01  1:37 [patch] qla2xxx: use F/W calculated residual length Joe Jin
2009-12-02 20:39 ` Giridhar Malavali

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®