* SCSI problem solved
@ 1998-09-12 22:38 Thomas Bogendoerfer
1998-09-14 23:42 ` ralf
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Bogendoerfer @ 1998-09-12 22:38 UTC (permalink / raw)
To: linux
Right now I'm doing some stress test with my Indy (dd from DAT and untaring
a tar file from one disk to another at the same time). And it hasn't crashed.
Below is the patch I'm using. If it works for others too, I'll check it in.
Thomas.
Index: sgiwd93.c
===================================================================
RCS file: /var/mips/linus/cvs/linux/drivers/scsi/sgiwd93.c,v
retrieving revision 1.8
diff -u -r1.8 sgiwd93.c
--- sgiwd93.c 1998/08/25 09:18:49 1.8
+++ sgiwd93.c 1998/09/12 22:32:01
@@ -77,7 +77,7 @@
static int dma_setup(Scsi_Cmnd *cmd, int datainp)
{
- struct WD33C93_hostdata *hdata = CMDHOSTDATA(cmd);
+ struct WD33C93_hostdata *hdata = (struct WD33C93_hostdata *)cmd->host->hostdata;
wd33c93_regs *regp = hdata->regp;
struct hpc3_scsiregs *hregs = (struct hpc3_scsiregs *) cmd->host->base;
struct hpc_chunk *hcp = (struct hpc_chunk *) hdata->dma_bounce_buffer;
@@ -89,14 +89,14 @@
hdata->dma_dir = datainp;
- if(cmd->use_sg) {
+ if(cmd->SCp.buffers_residual) {
struct scatterlist *slp = cmd->SCp.buffer;
int i, totlen = 0;
#ifdef DEBUG_DMA
printk("SCLIST<");
#endif
- for(i = 0; i <= (cmd->use_sg - 1); i++, hcp++) {
+ for(i = 0; i <= cmd->SCp.buffers_residual; i++, hcp++) {
#ifdef DEBUG_DMA
printk("[%p,%d]", slp[i].address, slp[i].length);
#endif
@@ -146,7 +146,7 @@
static void dma_stop(struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
int status)
{
- struct WD33C93_hostdata *hdata = INSTHOSTDATA(instance);
+ struct WD33C93_hostdata *hdata = (struct WD33C93_hostdata *)instance->hostdata;
wd33c93_regs *regp = hdata->regp;
struct hpc3_scsiregs *hregs = (struct hpc3_scsiregs *) SCpnt->host->base;
@@ -163,7 +163,7 @@
hregs->ctrl = 0;
/* See how far we got and update scatterlist state if necessary. */
- if(SCpnt->use_sg) {
+ if(SCpnt->SCp.buffers_residual) {
struct scatterlist *slp = SCpnt->SCp.buffer;
int totlen, wd93_residual, transferred, i;
@@ -183,7 +183,7 @@
#ifdef DEBUG_DMA
printk("Jed was here...");
#endif
- for(i = 0; i <= (SCpnt->use_sg - 1); i++) {
+ for(i = 0; i <= SCpnt->SCp.buffers_residual; i++) {
if(slp[i].length >= transferred)
break;
transferred -= slp[i].length;
@@ -193,10 +193,10 @@
#ifdef DEBUG_DMA
printk("did it all...");
#endif
- i = (SCpnt->use_sg - 1);
+ i = SCpnt->SCp.buffers_residual;
}
SCpnt->SCp.buffer = &slp[i];
- SCpnt->SCp.buffers_residual = (SCpnt->use_sg - 1 - i);
+ SCpnt->SCp.buffers_residual = SCpnt->SCp.buffers_residual - i;
SCpnt->SCp.ptr = (char *) slp[i].address;
SCpnt->SCp.this_residual = slp[i].length;
}
@@ -244,7 +244,7 @@
wd33c93_init(sgiwd93_host, (wd33c93_regs *) 0xbfbc0003,
dma_setup, dma_stop, WD33C93_FS_16_20);
- hdata = INSTHOSTDATA(sgiwd93_host);
+ hdata = (struct WD33C93_hostdata *)sgiwd93_host->hostdata;
hdata->no_sync = 0;
hdata->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf));
dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE);
--
See, you not only have to be a good coder to create a system like Linux,
you have to be a sneaky bastard too ;-)
[Linus Torvalds in <4rikft$7g5@linux.cs.Helsinki.FI>]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: SCSI problem solved
1998-09-12 22:38 SCSI problem solved Thomas Bogendoerfer
@ 1998-09-14 23:42 ` ralf
0 siblings, 0 replies; 2+ messages in thread
From: ralf @ 1998-09-14 23:42 UTC (permalink / raw)
To: Thomas Bogendoerfer, linux
On Sun, Sep 13, 1998 at 12:38:02AM +0200, Thomas Bogendoerfer wrote:
> Right now I'm doing some stress test with my Indy (dd from DAT and untaring
> a tar file from one disk to another at the same time). And it hasn't crashed.
> Below is the patch I'm using. If it works for others too, I'll check it in.
Side effect: lmbench says disk write bandwidth has roughly trippled.
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-09-14 23:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-09-12 22:38 SCSI problem solved Thomas Bogendoerfer
1998-09-14 23:42 ` ralf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.