fix scsi/aha15*.c for 2.5.60
Subsystems (2)
PATCH 1/1 fix scsi/aha15*.c for 2.5.60
Hi,
Here are patches to aha152x.c and aha1542.c so that they will build in 2.5.60.
Please review and apply or comment...
Thanks,
~Randy
patch_name: scsi-aha15xyz-2560.patchpatch_version: 2003-02-11.21:20:32
author: Randy.Dunlap <[email protected]>
description: repair scsi/aha152x.c and aha1542.c for 2.5.60
product: Linuxproduct_versions: linux-2560
changelog: _
URL: _
requires: _
conflicts: _
diffstat: =
aha152x.c | 78 ++++++++++++++++++++++++++++++++------------------------ aha1542.c | 86 +++++++++++++++++++++++++++++++------------------------------- 2 files changed, 88 insertions(+), 76 deletions(-)
drivers/scsi/aha152x.c renamed from drivers/scsi/aha152x.c%SYN +45 -33
@@ -306,9 +306,9 @@#define ERR_LEAD KERN_ERR LEAD#define DEBUG_LEAD KERN_DEBUG LEAD#define CMDINFO (cmd) \ - (cmd) ? ((cmd)->host->host_no) : -1, \ - (cmd) ? ((cmd)->target & 0x0f) : -1, \ - (cmd) ? ((cmd)->lun & 0x07) : -1 + (cmd) ? ((cmd)->device->host->host_no) : -1, \ + (cmd) ? ((cmd)->device->id & 0x0f) : -1, \ + (cmd) ? ((cmd)->device->lun & 0x07) : -1#define DELAY_DEFAULT 1000
@@ -583,8 +583,8 @@#define DATA_LEN (HOSTDATA(shpnt)->data_len) -#define SYNCRATE (HOSTDATA(shpnt)->syncrate[CURRENT_SC->target]) -#define SYNCNEG (HOSTDATA(shpnt)->syncneg[CURRENT_SC->target]) +#define SYNCRATE (HOSTDATA(shpnt)->syncrate[CURRENT_SC->device->id]) +#define SYNCNEG (HOSTDATA(shpnt)->syncneg[CURRENT_SC->device->id])#define DELAY (HOSTDATA(shpnt)->delay)#define EXT_TRANS (HOSTDATA(shpnt)->ext_trans)
@@ -771,7 +771,7 @@Scsi_Cmnd *ptr, *prev;for (ptr = *SC , prev =NULL ; - ptr && ((ptr->target != target) || (ptr->lun != lun)); + ptr && ((ptr->device->id != target) || (ptr->device->lun != lun)); prev = ptr, ptr =SCNEXT (ptr)) ;
@@ -1476,7 +1476,7 @@*/ int aha152x_internal_queue (Scsi_Cmnd *SCpnt,struct semaphore *sem,int phase,Scsi_Cmnd *done_SC,void (*done)(Scsi_Cmnd *)) { -struct Scsi_Host *shpnt = SCpnt->host; +struct Scsi_Host *shpnt = SCpnt->device->host;unsigned long flags;#if defined(AHA152X_DEBUG )
@@ -1589,7 +1589,7 @@*/ int aha152x_abort (Scsi_Cmnd *SCpnt) { -struct Scsi_Host *shpnt = SCpnt->host; +struct Scsi_Host *shpnt = SCpnt->device->host;Scsi_Cmnd *ptr;unsigned long flags;
@@ -1641,7 +1641,7 @@ {Scsi_Cmnd *SCp = (Scsi_Cmnd *)p;struct semaphore *sem =SCSEM (SCp); -struct Scsi_Host *shpnt = SCp->host; +struct Scsi_Host *shpnt = SCp->device->host;/* remove command from issue queue */ if (remove_SC (&ISSUE_SC , SCp)) {
@@ -1663,10 +1663,11 @@*/ int aha152x_device_reset (Scsi_Cmnd * SCpnt) { -struct Scsi_Host *shpnt = SCpnt->host; +struct Scsi_Host *shpnt = SCpnt->device->host;DECLARE_MUTEX_LOCKED (sem);struct timer_list timer; -Scsi_Cmnd cmnd; +Scsi_Cmnd *cmd; +int ret;#if defined(AHA152X_DEBUG )if (HOSTDATA (shpnt)->debug & debug_eh) {
@@ -1680,31 +1681,42 @@return FAILED ; } - cmnd.cmd_len =0 ; - cmnd.host = SCpnt->host; - cmnd.target = SCpnt->target; - cmnd.lun = SCpnt->lun; - cmnd.use_sg =0 ; - cmnd.request_buffer =0 ; - cmnd.request_bufflen =0 ; +spin_unlock_irq (shpnt->host_lock); + cmd =scsi_get_command (SCpnt->device,GFP_ATOMIC ); +if (!cmd) { +spin_lock_irq (shpnt->host_lock); +return FAILED ; + } + + cmd->cmd_len =0 ; + cmd->device->host = SCpnt->device->host; + cmd->device->id = SCpnt->device->id; + cmd->device->lun = SCpnt->device->lun; + cmd->use_sg =0 ; + cmd->request_buffer =0 ; + cmd->request_bufflen =0 ;init_timer (&timer); - timer.data = (unsigned long ) &cmnd; + timer.data = (unsigned long ) cmd; timer.expires = jiffies +100 *HZ ;/* 10s */ timer.function = (void (*)(unsigned long )) timer_expired; -aha152x_internal_queue (&cmnd, &sem, resetting,0 , internal_done); +aha152x_internal_queue (cmd, &sem, resetting,0 , internal_done);add_timer (&timer);down (&sem);del_timer (&timer); -if (cmnd.SCp.phase & resetted) { -return SUCCESS ; +if (cmd->SCp.phase & resetted) { + ret =SUCCESS ; }else { -return FAILED ; + ret =FAILED ; } + +scsi_put_command (cmd); +spin_lock_irq (shpnt->host_lock); +return ret; }void free_hard_reset_SCs (struct Scsi_Host *shpnt,Scsi_Cmnd **SCs)
@@ -1738,7 +1750,7 @@*/ int aha152x_bus_reset (Scsi_Cmnd *SCpnt) { -struct Scsi_Host *shpnt = SCpnt->host; +struct Scsi_Host *shpnt = SCpnt->device->host;unsigned long flags;#if defined(AHA152X_DEBUG )
@@ -1822,7 +1834,7 @@aha152x_bus_reset (SCpnt);DPRINTK (debug_eh,DEBUG_LEAD "resetting ports\n" ,CMDINFO (SCpnt)); -reset_ports (SCpnt->host); +reset_ports (SCpnt->device->host);return SUCCESS ; }
@@ -2052,9 +2064,9 @@ cmnd->cmnd[4 ] =sizeof (ptr->sense_buffer); cmnd->cmnd[5 ] =0 ; cmnd->cmd_len =6 ; - cmnd->host = ptr->host; - cmnd->target = ptr->target; - cmnd->lun = ptr->lun; + cmnd->device->host = ptr->device->host; + cmnd->device->id = ptr->device->id; + cmnd->device->lun = ptr->device->lun; cmnd->use_sg =0 ; cmnd->request_buffer = ptr->sense_buffer; cmnd->request_bufflen =sizeof (ptr->sense_buffer);
@@ -2113,7 +2125,7 @@/* clear selection timeout */ SETPORT (SSTAT1 ,SELTO ); -SETPORT (SCSIID , (shpnt->this_id <<OID_ ) |CURRENT_SC ->target); +SETPORT (SCSIID , (shpnt->this_id <<OID_ ) |CURRENT_SC ->device->id);SETPORT (SXFRCTL1 , (PARITY ?ENSPCHK :0 ) |ENSTIMER );SETPORT (SCSISEQ ,ENSELO |ENAUTOATNO | (DISCONNECTED_SC ?ENRESELI :0 )); }else {
@@ -2152,7 +2164,7 @@SETPORT (SSTAT0 ,CLRSELDO ); -ADDMSGO (IDENTIFY (RECONNECT ,CURRENT_SC ->lun)); +ADDMSGO (IDENTIFY (RECONNECT ,CURRENT_SC ->device->lun));if (CURRENT_SC ->SCp.phase & aborting) {ADDMSGO (ABORT );
@@ -2472,7 +2484,7 @@ {if (MSGOLEN ==0 ) {if ((CURRENT_SC ->SCp.phase & syncneg) &&SYNCNEG ==2 &&SYNCRATE ==0 ) { -ADDMSGO (IDENTIFY (RECONNECT ,CURRENT_SC ->lun)); +ADDMSGO (IDENTIFY (RECONNECT ,CURRENT_SC ->device->lun)); }else {printk (INFO_LEAD "unexpected MESSAGE OUT phase; rejecting\n" ,CMDINFO (CURRENT_SC ));ADDMSGO (MESSAGE_REJECT );
@@ -3376,7 +3388,7 @@static void show_command (Scsi_Cmnd *ptr) {printk (KERN_DEBUG "0x%08x: target=%d; lun=%d; cmnd=(" , - (unsigned int ) ptr, ptr->target, ptr->lun); + (unsigned int ) ptr, ptr->device->id, ptr->device->lun);print_command (ptr->cmnd);
@@ -3441,7 +3453,7 @@int i;SPRINTF ("0x%08x: target=%d; lun=%d; cmnd=( " , - (unsigned int ) ptr, ptr->target, ptr->lun); + (unsigned int ) ptr, ptr->device->id, ptr->device->lun);for (i =0 ; i <COMMAND_SIZE (ptr->cmnd[0 ]); i++)SPRINTF ("0x%02x " , ptr->cmnd[i]);
drivers/scsi/aha1542.c renamed from drivers/scsi/aha1542.c%SYN +43 -43
226 lines not on this page · raw message
Quoted 6 lines · Randy.Dunlap
Hi,
Here are patches to
aha152x.candaha1542.cso that they will build in 2.5.60.Please review and apply or comment...
well it applies, compiles, but it gives a warning on depmod in make modules_install:
<snip>
if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.5.60; fi
WARNING: /lib/modules/2.5.60/kernel/drivers/scsi/aha152x.ko needs unknown symbol scsi_put_command
WARNING: /lib/modules/2.5.60/kernel/drivers/scsi/aha152x.ko needs unknown symbol scsi_get_command
this is the relevant part of my .config:CONFIG_SCSI=mCONFIG_SCSI_AHA152X=m
this gives these modules in /lib/modules/2.5.60/kernel/drivers/scsi/:
aha152x.ko scsi_mod.ko sg.ko
what am i missing??
Rudmer
Quoted 3 lines
Thanks,
~Randy
Quoted 18 lines · Rudmer van Dijk
Quoted 6 lines · Randy.Dunlap
Hi,
Here are patches to
aha152x.candaha1542.cso that they will build in 2.5.60.Please review and apply or comment...
well it applies, compiles, but it gives a warning on depmod in make
modules_install:<snip>
if [ -r System.map ]; then/sbin/depmod-ae -F System.map 2.5.60; fi
WARNING:/lib/modules/2.5.60/kernel/drivers/scsi/aha152x.koneeds unknown symbolscsi_put_command
WARNING:/lib/modules/2.5.60/kernel/drivers/scsi/aha152x.koneeds unknown symbolscsi_get_command
Quoted 8 lines
this is the relevant part of my .config:
CONFIG_SCSI=mCONFIG_SCSI_AHA152X=mthis gives these modules in
/lib/modules/2.5.60/kernel/drivers/scsi/:
aha152x.ko scsi_mod.ko sg.kowhat am i missing??
Nothing really, the symbols need to be exported from the SCSI core. I'll add them to the export list.
James
| > > Here are patches to aha152x.c and aha1542.c so that they will build | > > in 2.5.60. | > > | > > Please review and apply or comment... | > | > well it applies, compiles, but it gives a warning on depmod in make | > modules_install: | > | > <snip> | > if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.5.60; fi | > WARNING: /lib/modules/2.5.60/kernel/drivers/scsi/aha152x.ko needs unknown | > symbol scsi_put_command | > WARNING: /lib/modules/2.5.60/kernel/drivers/scsi/aha152x.ko needs unknown | > symbol scsi_get_command | > | > this is the relevant part of my .config: | > CONFIG_SCSI=m | > CONFIG_SCSI_AHA152X=m | > | > this gives these modules in /lib/modules/2.5.60/kernel/drivers/scsi/: | > aha152x.ko scsi_mod.ko sg.ko | > | > what am i missing?? | | Nothing really, the symbols need to be exported from the SCSI core. | I'll add them to the export list.
I generated a patch for Rudmer in case he needs it.
~Randy
patch_name: scsi-exports-2560.patchpatch_version: 2003-02-12.14:44:43
author: Randy.Dunlap <[email protected]>
description: _
product: Linuxproduct_versions: linux-2560
changelog: _
URL: _
requires: _
conflicts: _
diffstat: TBD
drivers/scsi/scsi_syms.c renamed from drivers/scsi/scsi_syms.c%EXP +2 -0
@@ -80,6 +80,8 @@EXPORT_SYMBOL (scsi_slave_detach);EXPORT_SYMBOL (scsi_device_get);EXPORT_SYMBOL (scsi_device_put); +EXPORT_SYMBOL (scsi_get_command); +EXPORT_SYMBOL (scsi_put_command);/* * This symbol is for the highlevel drivers (e.g. sg) only.
Quoted 7 lines · James Bottomley
Quoted 4 lines
this gives these modules in
/lib/modules/2.5.60/kernel/drivers/scsi/:
aha152x.ko scsi_mod.ko sg.kowhat am i missing??
Nothing really, the symbols need to be exported from the SCSI core. I'll add them to the export list.
it should _not_ be exported. drivers are supposed to use the request-based interface instead.
Quoted 11 lines · Christoph Hellwig
Quoted 7 lines · James Bottomley
Quoted 4 lines
this gives these modules in
/lib/modules/2.5.60/kernel/drivers/scsi/:
aha152x.ko scsi_mod.ko sg.kowhat am i missing??
Nothing really, the symbols need to be exported from the SCSI core. I'll add them to the export list.
it should _not_ be exported. drivers are supposed to use the request-based interface instead.
Yes, if they issue commands via the mid-layer. This one is queueing a message (encapsulated as a pseudo command) on it's internal queue (which is a cmd queue) to issue a bus device reset. In this instance, it cannot use the request based interface because the device will be in_recovery when this happens, so it would never be issued.
Personally, it would be nice to have a messaging interface to get around these problems, but I don't think that one's coming any time soon...
James