linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ide-scsi data transfer residuals
@ 2002-07-05 14:07 Tony Battersby
  2002-07-06  2:10 ` Douglas Gilbert
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Battersby @ 2002-07-05 14:07 UTC (permalink / raw)
  To: linux-scsi, linux-ide

Hello,

I am using the scsi-generic and ide-scsi drivers together for low-level
access to an IDE tape drive (vanilla 2.4.17).  I noticed that the data
transfer residual in sg_io_hdr_t { int resid; } is always zero.  I assume
that the residual calculation is just a missing feature from the ide-scsi
driver.  Does anyone know how hard it is to add it?

Please CC me in any replies.

Thanks,
Anthony J. Battersby
Cybernetics


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

* Re: ide-scsi data transfer residuals
  2002-07-05 14:07 Tony Battersby
@ 2002-07-06  2:10 ` Douglas Gilbert
  2002-07-16 18:00   ` Luben Tuikov
  0 siblings, 1 reply; 4+ messages in thread
From: Douglas Gilbert @ 2002-07-06  2:10 UTC (permalink / raw)
  To: tonyb; +Cc: linux-scsi, linux-ide

Tony Battersby wrote:
> 
> Hello,
> 
> I am using the scsi-generic and ide-scsi drivers together for low-level
> access to an IDE tape drive (vanilla 2.4.17).  I noticed that the data
> transfer residual in sg_io_hdr_t { int resid; } is always zero.  I assume
> that the residual calculation is just a missing feature from the ide-scsi
> driver.  Does anyone know how hard it is to add it?

Tony,
Support for the residual count is optional. A inaccurate
survey shows these adapter drivers support it:
  advansys
  aha152x
  aic7xxx_old  (but not the newer aic7xxx)
  dc395x_trm
  scsiiom
  sym53c8xx
  sym53c8xx_2

I do not know how the ide-scsi driver would get the information.
However here is the calculation it should do:
  Scsi_Cmnd::resid = Scsi_Cmnd::bufflen - <actual_bytes_transferred>

Of the drivers that support "resid" most given a scatter
gather list will use the sum of the element lengths instead
of bufflen. Unfortunately that sum can be larger the bufflen 
due to padding and alignment requirements of the most backward
DMA engines out there (I was burnt by the aha1542 ISA card).
IOW HBA driver writers, please use bufflen. Perhaps the CAM
name of "dxfer_len" would be clearer for this field.

Doug Gilbert

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

* Re: ide-scsi data transfer residuals
@ 2002-07-08 16:17 Martin Peschke3
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Peschke3 @ 2002-07-08 16:17 UTC (permalink / raw)
  To: Douglas Gilbert; +Cc: tonyb, linux-scsi, linux-ide


Hi,

unfortunately the residual count is not used by high level
SCSI drivers like sd and sr to recover partial data transfers,
as far as I can see. That's dangerous.

Mit freundlichen Grüßen / with kind regards

Martin Peschke

IBM Deutschland Entwicklung GmbH
Linux for eServer Development
Phone: +49-(0)7031-16-2349


Douglas Gilbert <dougg@torque.net>@vger.kernel.org on 07/06/2002 04:10:01
AM

Please respond to Douglas Gilbert <dougg@torque.net>

Sent by:    linux-scsi-owner@vger.kernel.org


To:    tonyb@cybernetics.com
cc:    linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org
Subject:    Re: ide-scsi data transfer residuals



Tony Battersby wrote:
>
> Hello,
>
> I am using the scsi-generic and ide-scsi drivers together for low-level
> access to an IDE tape drive (vanilla 2.4.17).  I noticed that the data
> transfer residual in sg_io_hdr_t { int resid; } is always zero.  I assume
> that the residual calculation is just a missing feature from the ide-scsi
> driver.  Does anyone know how hard it is to add it?

Tony,
Support for the residual count is optional. A inaccurate
survey shows these adapter drivers support it:
  advansys
  aha152x
  aic7xxx_old  (but not the newer aic7xxx)
  dc395x_trm
  scsiiom
  sym53c8xx
  sym53c8xx_2

I do not know how the ide-scsi driver would get the information.
However here is the calculation it should do:
  Scsi_Cmnd::resid = Scsi_Cmnd::bufflen - <actual_bytes_transferred>

Of the drivers that support "resid" most given a scatter
gather list will use the sum of the element lengths instead
of bufflen. Unfortunately that sum can be larger the bufflen
due to padding and alignment requirements of the most backward
DMA engines out there (I was burnt by the aha1542 ISA card).
IOW HBA driver writers, please use bufflen. Perhaps the CAM
name of "dxfer_len" would be clearer for this field.

Doug Gilbert
-
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] 4+ messages in thread

* Re: ide-scsi data transfer residuals
  2002-07-06  2:10 ` Douglas Gilbert
@ 2002-07-16 18:00   ` Luben Tuikov
  0 siblings, 0 replies; 4+ messages in thread
From: Luben Tuikov @ 2002-07-16 18:00 UTC (permalink / raw)
  To: Douglas Gilbert; +Cc: tonyb, linux-scsi, linux-ide

Douglas Gilbert wrote:
> 
> Of the drivers that support "resid" most given a scatter
> gather list will use the sum of the element lengths instead
> of bufflen. Unfortunately that sum can be larger the bufflen
> due to padding and alignment requirements of the most backward
> DMA engines out there (I was burnt by the aha1542 ISA card).

And aic7xxx ``supports'' only that kind of ``residual'' ONLY
for SCSI READ, but is seems to use scsi_cmnd::bufflen for SCSI
WRITE.

Anyway, I consider this a bug as all data was read after a READ but by
setting scsi_cmd::resid in the low-level device driver (aic7xxx)
nothing works (fs layer)...

> IOW HBA driver writers, please use bufflen.

This message should probably be put somewhere right in
scsi_cmnd definition.

-- 
Luben

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

end of thread, other threads:[~2002-07-16 18:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-08 16:17 ide-scsi data transfer residuals Martin Peschke3
  -- strict thread matches above, loose matches on Subject: below --
2002-07-05 14:07 Tony Battersby
2002-07-06  2:10 ` Douglas Gilbert
2002-07-16 18:00   ` Luben Tuikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).