lkml.org 
[lkml]   [1998]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectMore SCSI load problems (includes SCSI clean ups patch)
Firstly, since I was reading the SCSI code anyway I thought I
might as well do some work.

The serious one is eata_dma.c which allocates memory for scatter
gather as need with GFP_ATOMIC - and panics if it fails. I actually
managed to get ahead of kswapd enough to trigger this(!) so I changed
it to return a BUS_BUSY instead.

The rest is general clean up: scsi_init_malloc() always zeros
the memory before it returns it so there is no need to do it again
in the caller.


Then the problems...

On Wed, 29 Jul 1998, Mike Jagdis wrote:

> Tonight will switch the Future Domain for another DPT.

Did it. Wished I hadn't. Failed consitently with hardware controller
lock ups. Different boards, different ways. I was lucky if it
managed to get through a ckraid. It only took load on two of the
DPTs (just one _seemed_ to work?), the mere presence of the third
was enough(?). It crashed with 2.1.107, 2.1.112 *and* 2.0.35
with both eata_dma and the Ballabio driver.

Took the Future Domain home and hammered it for hours. No problem.
Swapped it back in this morning and we have seeming stability back
(until I hammer the FD?).

I'll start rotating and hammering the DPTs this weekend but it
_looks_ like this could be something to do with hardware PCI
(multiple busmasters?) and, perhaps, patterns of access.

N.B. (Abit BX6 M/B, 2 x DPT 2044 (7G1 firmware), 1 x DPT 2044
(7H0 firmware).

Of course my home machine is a different M/B, slower processor
and the narrow SCSI drives I have available for test are less than
half the speed of the wide work drives...

>
> 1. Anybody using a Future Domain successfully? (later crashes may
> be _solely_ down to the FD)

No. It works.

> It is possible that both the Balles* EATA driver and the Future
> Domain driver have race conditions which break them eventually.
> However, my current feeling is that the race is higher level
> and loading four or five devices on two or three controllers
> just makes it more likely.

Latest hypothesis is that this one is a PCI problem - which probably
isn't exposed by the usual wimpy Windows tests :-).

Mike

--
.----------------------------------------------------------------------.
| Mike Jagdis | Internet: mailto:mike@roan.co.uk |
| Roan Technology Ltd. | |
| 54A Peach Street, Wokingham | Telephone: +44 118 989 0403 |
| RG40 1XG, ENGLAND | Fax: +44 118 989 1195 |
`----------------------------------------------------------------------'diff -ur linux-2.1/drivers/scsi/eata_dma.c linux-2.1+/drivers/scsi/eata_dma.c
--- linux-2.1/drivers/scsi/eata_dma.c Sat Apr 11 19:13:25 1998
+++ linux-2.1+/drivers/scsi/eata_dma.c Thu Jul 30 23:20:17 1998
@@ -570,8 +570,16 @@
ccb->sg_list = kmalloc(sh->sg_tablesize * sizeof(struct eata_sg_list),
GFP_ATOMIC | GFP_DMA);
}
- if (ccb->sg_list == NULL)
- panic("eata_dma: Run out of DMA memory for SG lists !\n");
+ if (ccb->sg_list == NULL) {
+ printk(KERN_ERR "scsi%d: unable to get DMA memory for SG list\n",
+ HD(cmd)->HBA_number);
+ ccb->status = FREE;
+ cmd->result = DID_BUS_BUSY << 16;
+ cli();
+ done(cmd);
+ restore_flags(flags);
+ return(0);
+ }
ccb->cp_dataDMA = htonl(virt_to_bus(ccb->sg_list));

ccb->cp_datalen = htonl(cmd->use_sg * sizeof(struct eata_sg_list));
@@ -926,13 +934,17 @@

cp = (struct eata_ccb *) scsi_init_malloc(sizeof(struct eata_ccb),
GFP_ATOMIC | GFP_DMA);
+ if (!cp)
+ return NULL;
sp = (struct eata_sp *) scsi_init_malloc(sizeof(struct eata_sp),
GFP_ATOMIC | GFP_DMA);
+ if (!sp) {
+ scsi_init_free((void *)cp, sizeof(struct eata_ccb));
+ return NULL;
+ }

buff = dma_scratch;

- memset(cp, 0, sizeof(struct eata_ccb));
- memset(sp, 0, sizeof(struct eata_sp));
memset(buff, 0, 256);

cp->DataIn = TRUE;
@@ -1531,6 +1543,8 @@
dma_scratch = scsi_init_malloc(1024, GFP_ATOMIC | GFP_DMA);

if(status == NULL || dma_scratch == NULL) {
+ if (status) scsi_init_free((void *)status, 512);
+ if (dma_scratch) scsi_init_free((void *)dma_scratch, 1024);
printk("eata_dma: can't allocate enough memory to probe for hosts !\n");
return(0);
}
diff -ur linux-2.1/drivers/scsi/pluto.c linux-2.1+/drivers/scsi/pluto.c
--- linux-2.1/drivers/scsi/pluto.c Thu Jul 30 20:39:29 1998
+++ linux-2.1+/drivers/scsi/pluto.c Thu Jul 30 22:41:29 1998
@@ -119,7 +119,6 @@
return 0;
}

- memset (fcs, 0, sizeof (struct ctrl_inquiry) * fcscount);
memset (&dev, 0, sizeof(dev));
atomic_set (&fcss, fcscount);
fc_timer.function = pluto_detect_timeout;
diff -ur linux-2.1/drivers/scsi/scsi.c linux-2.1+/drivers/scsi/scsi.c
--- linux-2.1/drivers/scsi/scsi.c Thu Jul 30 20:56:42 1998
+++ linux-2.1+/drivers/scsi/scsi.c Thu Jul 30 22:57:57 1998
@@ -446,10 +446,8 @@
int sparse_lun;

SCpnt = (Scsi_Cmnd *) scsi_init_malloc (sizeof (Scsi_Cmnd), GFP_ATOMIC | GFP_DMA);
- memset (SCpnt, 0, sizeof (Scsi_Cmnd));

SDpnt = (Scsi_Device *) scsi_init_malloc (sizeof (Scsi_Device), GFP_ATOMIC);
- memset (SDpnt, 0, sizeof (Scsi_Device));


/* Make sure we have something that is valid for DMA purposes */
@@ -867,8 +865,6 @@
return 0;
}

- memset (SDpnt, 0, sizeof (Scsi_Device));
-
/*
* And hook up our command block to the new device we will be testing
* for.
@@ -2499,11 +2495,9 @@
{
size = (new_dma_sectors / SECTORS_PER_PAGE)*sizeof(FreeSectorBitmap);
new_dma_malloc_freelist = (FreeSectorBitmap *) scsi_init_malloc(size, GFP_ATOMIC);
- memset(new_dma_malloc_freelist, 0, size);

size = (new_dma_sectors / SECTORS_PER_PAGE)*sizeof(*new_dma_malloc_pages);
new_dma_malloc_pages = (unsigned char **) scsi_init_malloc(size, GFP_ATOMIC);
- memset(new_dma_malloc_pages, 0, size);
}

/*
@@ -3283,7 +3277,6 @@
/* One bit per sector to indicate free/busy */
size = (dma_sectors / SECTORS_PER_PAGE)*sizeof(FreeSectorBitmap);
dma_malloc_freelist = (unsigned char *) scsi_init_malloc(size, GFP_ATOMIC);
- memset(dma_malloc_freelist, 0, size);

/* One pointer per page for the page list */
dma_malloc_pages = (unsigned char **)
diff -ur linux-2.1/drivers/scsi/scsi_error.c linux-2.1+/drivers/scsi/scsi_error.c
--- linux-2.1/drivers/scsi/scsi_error.c Wed May 20 18:36:12 1998
+++ linux-2.1+/drivers/scsi/scsi_error.c Thu Jul 30 23:08:27 1998
@@ -445,7 +445,6 @@
* 0 is not a valid sense code.
*/
memset ((void *) SCpnt->sense_buffer, 0, sizeof(SCpnt->sense_buffer));
- memset ((void *) scsi_result, 0, 256);

SCpnt->request_buffer = scsi_result;
SCpnt->request_bufflen = 256;
@@ -511,7 +510,6 @@
* 0 is not a valid sense code.
*/
memset ((void *) SCpnt->sense_buffer, 0, sizeof(SCpnt->sense_buffer));
- memset ((void *) scsi_result, 0, 256);

SCpnt->request_buffer = scsi_result;
SCpnt->request_bufflen = 256;
diff -ur linux-2.1/drivers/scsi/scsi_proc.c linux-2.1+/drivers/scsi/scsi_proc.c
--- linux-2.1/drivers/scsi/scsi_proc.c Mon Jun 22 23:43:54 1998
+++ linux-2.1+/drivers/scsi/scsi_proc.c Thu Jul 30 23:09:03 1998
@@ -124,7 +124,6 @@
scsi_hba_dir = scsi_init_malloc(sizeof(struct scsi_dir), GFP_KERNEL);
if(scsi_hba_dir == NULL)
panic("Not enough memory to register SCSI HBA in /proc/scsi !\n");
- memset(scsi_hba_dir, 0, sizeof(struct scsi_dir));
scsi_hba_dir->entry.low_ino = PROC_SCSI_FILE + hpnt->host_no;
scsi_hba_dir->entry.namelen = sprintf(scsi_hba_dir->name,"%d",
hpnt->host_no);
diff -ur linux-2.1/drivers/scsi/sd.c linux-2.1+/drivers/scsi/sd.c
--- linux-2.1/drivers/scsi/sd.c Mon May 11 19:07:08 1998
+++ linux-2.1+/drivers/scsi/sd.c Thu Jul 30 23:11:13 1998
@@ -1478,11 +1478,9 @@

rscsi_disks = (Scsi_Disk *)
scsi_init_malloc(sd_template.dev_max * sizeof(Scsi_Disk), GFP_ATOMIC);
- memset(rscsi_disks, 0, sd_template.dev_max * sizeof(Scsi_Disk));

sd_sizes = (int *) scsi_init_malloc((sd_template.dev_max << 4) *
sizeof(int), GFP_ATOMIC);
- memset(sd_sizes, 0, (sd_template.dev_max << 4) * sizeof(int));

sd_blocksizes = (int *) scsi_init_malloc((sd_template.dev_max << 4) *
sizeof(int), GFP_ATOMIC);
diff -ur linux-2.1/drivers/scsi/sg.c linux-2.1+/drivers/scsi/sg.c
--- linux-2.1/drivers/scsi/sg.c Sun Apr 26 06:15:22 1998
+++ linux-2.1+/drivers/scsi/sg.c Thu Jul 30 23:11:51 1998
@@ -627,8 +627,6 @@
scsi_generics = (struct scsi_generic *)
scsi_init_malloc((sg_template.dev_noticed + SG_EXTRA_DEVS)
* sizeof(struct scsi_generic), GFP_ATOMIC);
- memset(scsi_generics, 0, (sg_template.dev_noticed + SG_EXTRA_DEVS)
- * sizeof(struct scsi_generic));

sg_template.dev_max = sg_template.dev_noticed + SG_EXTRA_DEVS;
return 0;
diff -ur linux-2.1/drivers/scsi/sr.c linux-2.1+/drivers/scsi/sr.c
--- linux-2.1/drivers/scsi/sr.c Thu May 14 17:07:33 1998
+++ linux-2.1+/drivers/scsi/sr.c Thu Jul 30 23:13:01 1998
@@ -1033,10 +1033,8 @@
sr_template.dev_max =
sr_template.dev_noticed + SR_EXTRA_DEVS;
scsi_CDs = (Scsi_CD *) scsi_init_malloc(sr_template.dev_max * sizeof(Scsi_CD), GFP_ATOMIC);
- memset(scsi_CDs, 0, sr_template.dev_max * sizeof(Scsi_CD));

sr_sizes = (int *) scsi_init_malloc(sr_template.dev_max * sizeof(int), GFP_ATOMIC);
- memset(sr_sizes, 0, sr_template.dev_max * sizeof(int));

sr_blocksizes = (int *) scsi_init_malloc(sr_template.dev_max *
sizeof(int), GFP_ATOMIC);
diff -ur linux-2.1/drivers/scsi/st.c linux-2.1+/drivers/scsi/st.c
--- linux-2.1/drivers/scsi/st.c Wed May 6 18:56:05 1998
+++ linux-2.1+/drivers/scsi/st.c Thu Jul 30 23:16:32 1998
@@ -3298,14 +3298,11 @@
st_buffer_size, st_write_threshold);
#endif

- memset(scsi_tapes, 0, st_template.dev_max * sizeof(Scsi_Tape));
for (i=0; i < st_template.dev_max; ++i) {
STp = &(scsi_tapes[i]);
STp->capacity = 0xfffff;
STp->mt_status = (struct mtget *) scsi_init_malloc(sizeof(struct mtget),
GFP_ATOMIC);
- /* Initialize status */
- memset((void *) scsi_tapes[i].mt_status, 0, sizeof(struct mtget));
}

/* Allocate the buffers */
\
 
 \ /
  Last update: 2005-03-22 13:43    [from the cache]
©2003-2011 Jasper Spaans