lkml.org 
[lkml]   [1998]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectpatch: AHA-1542 driver as a module
With recent kernels, when the aha1542 driver is compiled as a module,
attempts to load the module generate this error:

/lib/modules/2.1.76/scsi/aha1542.o: unresolved symbol scsi_sleep

After I made the attached changes, that error goes away. I'm able to load
and unload the module. I'm able to use my tape drive with no problems.
When I try to use my CDROM drive, I get these messages:

# mount /dev/sr0 /cdrom/
Detected scsi CD-ROM sr0 at scsi1, channel 0, id 4, lun 0
aha1542.c: Trying device reset for target 4
HACC aha1542.c: interrupt received, but no mail.
Sent BUS RESET to scsi host 1
mount: block device /dev/sr0 is write-protected, mounting read-only
mount: /dev/sr0 is not a valid block device

When I try to use the AHA-1542 driver while my PnP sound card (configured
by Tom Lees' kernel PnP) is in place, I get these messages:

Jan 5 02:54:37 topside kernel: Configuring Adaptec (SCSI-ID 7) at IO:334,
IRQ 10, DMA priority 6
Jan 5 02:54:37 topside kernel: scsi0 : Adaptec 1542
Jan 5 02:54:37 topside kernel: scsi : 1 host.
Jan 5 02:54:43 topside kernel: aha1542.c: Unable to abort command for
target 0
Jan 5 02:54:43 topside kernel: aha1542.c: Trying device reset for target
0
Jan 5 02:55:10 topside kernel: Sent BUS RESET to scsi host 0
Jan 5 02:55:26 topside kernel: aha1542.c: Unable to abort command for
target 1
Jan 5 02:55:26 topside kernel: aha1542.c: Trying device reset for target
1
Jan 5 02:55:54 topside kernel: Sent BUS RESET to scsi host 0
Jan 5 02:56:10 topside kernel: aha1542.c: Unable to abort command for
target 2
Jan 5 02:56:10 topside kernel: aha1542.c: Trying device reset for target
2
Jan 5 02:56:37 topside kernel: Sent BUS RESET to scsi host 0
Jan 5 02:56:53 topside kernel: aha1542.c: Unable to abort command for
target 3
Jan 5 02:56:53 topside kernel: aha1542.c: Trying device reset for target
3
Jan 5 02:57:20 topside kernel: Sent BUS RESET to scsi host 0
Jan 5 02:57:36 topside kernel: aha1542.c: Unable to abort command for
target 4
Jan 5 02:57:36 topside kernel: aha1542.c: Trying device reset for target
4
Jan 5 02:58:03 topside kernel: Sent BUS RESET to scsi host 0
Jan 5 02:58:19 topside kernel: aha1542.c: Unable to abort command for
target 5
Jan 5 02:58:19 topside kernel: aha1542.c: Trying device reset for target
5
Jan 5 02:58:46 topside kernel: Sent BUS RESET to scsi host 0
Jan 5 02:59:02 topside kernel: aha1542.c: Unable to abort command for
target 6
Jan 5 02:59:02 topside kernel: aha1542.c: Trying device reset for target
6
Jan 5 02:59:29 topside kernel: Sent BUS RESET to scsi host 0

The SCSI LED flashes occasionally while this happens, and at the end the
module gets loaded, but the SCSI bus doesn't get initialized properly. On
unloading, the driver prints:

Jan 5 03:09:01 topside kernel: scsi : 0 hosts.

A look at /proc/dma, /proc/ioports and /proc/interrupts shows the correct
resources being assigned to the driver while it's doing the resets, and
shows them deallocated after the module has been unloaded.

I haven't tried the 2.1.78 pre-patches, but by my reading of the second
one, it doesn't look as though the scsi_sleep problem is addressed in it.
___
Trevor Johnson
diff -ruN linux-2.1.77-dist/drivers/scsi/aha1542.c linux/drivers/scsi/aha1542.c
--- linux-2.1.77-dist/drivers/scsi/aha1542.c Sun Dec 21 17:04:48 1997
+++ linux/drivers/scsi/aha1542.c Sat Jan 3 21:45:17 1998
@@ -33,6 +33,7 @@
#include <asm/io.h>
#include <linux/blk.h>
#include "scsi.h"
+#include "scsi_sleep.h"
#include "hosts.h"


diff -ruN linux-2.1.77-dist/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
--- linux-2.1.77-dist/drivers/scsi/scsi.c Sun Dec 21 17:49:49 1997
+++ linux/drivers/scsi/scsi.c Sun Jan 4 15:21:23 1998
@@ -607,7 +607,7 @@
{
SCSI_LOG_SCAN_BUS(4,printk("%p ", scmd));
}
- SCSI_LOG_SCAN_BUS(4,printk("\n", scmd));
+ SCSI_LOG_SCAN_BUS(4,printk("%p\n", scmd));
}
}
}
diff -ruN linux-2.1.77-dist/drivers/scsi/scsi_error.c linux/drivers/scsi/scsi_error.c
--- linux-2.1.77-dist/drivers/scsi/scsi_error.c Sun Dec 21 17:04:49 1997
+++ linux/drivers/scsi/scsi_error.c Mon Jan 5 01:52:16 1998
@@ -35,6 +35,7 @@
#include "scsi.h"
#include "hosts.h"
#include "constants.h"
+#include "scsi_sleep.h"

#define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGTERM))

@@ -449,34 +450,6 @@
* Hey, we are done. Let's look to see what happened.
*/
return SCpnt->eh_state;
-}
-
-STATIC
-void scsi_sleep_done (struct semaphore * sem)
-{
- if( sem != NULL )
- {
- up(sem);
- }
-}
-
-
-void scsi_sleep (int timeout)
-{
- struct semaphore sem = MUTEX_LOCKED;
- struct timer_list timer;
-
- timer.data = (unsigned long) &sem;
- timer.expires = jiffies + timeout;
- timer.function = (void (*)(unsigned long))scsi_sleep_done;
-
- SCSI_LOG_ERROR_RECOVERY(5,printk("Sleeping for timer tics %d\n", timeout));
-
- add_timer(&timer);
-
- down(&sem);
-
- del_timer(&timer);
}

/*
diff -ruN linux-2.1.77-dist/drivers/scsi/scsi_sleep.h linux/drivers/scsi/scsi_sleep.h
--- linux-2.1.77-dist/drivers/scsi/scsi_sleep.h Wed Dec 31 16:00:00 1969
+++ linux/drivers/scsi/scsi_sleep.h Sun Jan 4 12:58:50 1998
@@ -0,0 +1,24 @@
+void scsi_sleep_done (struct semaphore * sem)
+{
+ if( sem != NULL )
+ {
+ up(sem);
+ }
+}
+
+void scsi_sleep (int timeout)
+{
+ struct semaphore sem = MUTEX_LOCKED;
+ struct timer_list timer;
+
+ timer.data = (unsigned long) &sem;
+ timer.expires = jiffies + timeout;
+ timer.function = (void (*)(unsigned long))scsi_sleep_done;
+
+ SCSI_LOG_ERROR_RECOVERY(5,printk("Sleeping for timer tics %d\n", timeout));
+ add_timer(&timer);
+
+ down(&sem);
+
+ del_timer(&timer);
+}
diff -ruN linux-2.1.77-dist/drivers/scsi/sr_vendor.c linux/drivers/scsi/sr_vendor.c
--- linux-2.1.77-dist/drivers/scsi/sr_vendor.c Tue Dec 2 11:41:45 1997
+++ linux/drivers/scsi/sr_vendor.c Sun Jan 4 13:14:14 1998
@@ -147,7 +147,7 @@

int sr_cd_check(struct cdrom_device_info *cdi)
{
- unsigned long sector,min,sec,frame;
+ unsigned long sector;
unsigned char *buffer; /* the buffer for the ioctl */
unsigned char cmd[12]; /* the scsi-command */
int rc,is_xa,no_multi,minor;
\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.032 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site