public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* scsi wait_for_completion hangs!!!
@ 2003-08-22  9:48 invictus rm
  2003-08-22  9:53 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: invictus rm @ 2003-08-22  9:48 UTC (permalink / raw)
  To: linux-scsi

hi ,
    I am trying to write a HBA driver for a  PCI SCSI card(linux - 2.4.7 ).

   On insmoding the driver( after enabling scsi verbose logging) i was able 
to trace the point at which it get stuck.

Aug 22 13:07:21  kernel: Wake up parent 0
Aug 22 13:07:21  kernel: Error handler sleeping
Aug 22 13:07:21  kernel: scsi0 : SCSI Adapter Registeration...
Aug 22 13:07:21  kernel:
Aug 22 13:07:21  kernel: scsi: performing INQUIRY
Aug 22 13:07:21  kernel: scsi_do_req (host = 0, channel = 0 target = 0, 
buffer =f6995d90, bufflen = 256, done = f90f6090, timeout = 600, retries = 
3)
Aug 22 13:07:21  kernel: command : 12  00  00  00  ff  00  99  f6  2a  82
Aug 22 13:07:21  kernel: Activating command for device 0 (1)
Aug 22 13:07:21  kernel: Leaving scsi_init_cmd_from_req()
Aug 22 12:38:42  kernel: Adding timer for command f6eeb800 at 600 (f88cdcc0)
Aug 22 12:38:42  kernel: scsi_dispatch_cmnd (host = 0, channel = 0, target = 
0, command = f6eeb858, buffer = f6983d90,
Aug 22 12:38:42  kernel: bufflen = 256, done = f88c9090)
Aug 22 12:38:42  kernel: queuecommand : routine at f913b8e4
Aug 22 12:38:42  kernel:
Aug 22 12:38:43  kernel: leaving scsi_dispatch_cmnd()
Aug 22 12:38:43  kernel: Leaving scsi_do_req()
Aug 22 12:38:43  kernel: Clearing timer for command f6eeb800 1
Aug 22 12:38:43  kernel: Notifying upper driver of completion for device 0 0
Aug 22 12:38:43  kernel: Clearing timer for command f6eeb800 0

HANGS after this ( lsmod shows the module as initializing)

It seems to be waiting on wait_for_completion( ) but the scsi_wait_done ( ) 
never calls the complete(req->waiting) and so the driver hangs.

Any help will be highly appreciated...
Tx a ton

_________________________________________________________________
Access Hotmail from your mobile now. 
http://server1.msn.co.in/sp03/mobilesms/ Click here.


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

* Re: scsi wait_for_completion hangs!!!
  2003-08-22  9:48 scsi wait_for_completion hangs!!! invictus rm
@ 2003-08-22  9:53 ` Christoph Hellwig
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2003-08-22  9:53 UTC (permalink / raw)
  To: invictus rm; +Cc: linux-scsi

On Fri, Aug 22, 2003 at 03:18:06PM +0530, invictus rm wrote:
> hi ,
>     I am trying to write a HBA driver for a  PCI SCSI card(linux - 2.4.7 ).
> 
>    On insmoding the driver( after enabling scsi verbose logging) i was able 
> to trace the point at which it get stuck.

2.4.7 is obsolete.  IF it still happens with 2.4.21 please post the
affected driver source so we can take a look what you're doing wrong.


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

* Re: scsi wait_for_completion hangs!!!
@ 2003-08-22 10:25 invictus rm
  0 siblings, 0 replies; 3+ messages in thread
From: invictus rm @ 2003-08-22 10:25 UTC (permalink / raw)
  To: hch; +Cc: linux-scsi

hi,
  Tx for the reply
  I am attaching the relevant portions of the driver which deals with SCSI 
interaction::

#include "/usr/src/linux/drivers/scsi/scsi.h"
#include "/usr/src/linux/drivers/scsi/hosts.h"

#define SCSIHBA_CAN_QUEUE               1


#define SCSIHBA {                                               \
        name:                   " SCSI  HBA",                   \
        detect:                 scsihba_detect,                 \
        release:                scsihba_release,                        \
        info:                   scsihba_info,                   \
        queuecommand:           scsihba_scsi_queuecommand,      \
        can_queue:              SCSIHBA_CAN_QUEUE,              \
        this_id:                -1,                             \
        sg_tablesize:           1,                              \
        cmd_per_lun:            1,                              \
        use_clustering:         DISABLE_CLUSTERING,             \
        eh_abort_handler:       scsihba_scsi_abort,          \
        eh_device_reset_handler:NULL,                           \
        eh_bus_reset_handler:   NULL,                           \
        eh_host_reset_handler:  NULL,                           \
}


int scsihba_detect(Scsi_Host_Template *);
int scsihba_release(struct Scsi_Host *);
const char * scsihba_info(struct Scsi_Host *);
int scsihba_scsi_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
int scsihba_scsi_abort(Scsi_Cmnd *);

int scsihba_scsi_queuecommand(Scsi_Cmnd *SCpnt, void (* done)(Scsi_Cmnd *))
{
        SCpnt->done = done;

        // Frame the packets and send to the hardware

        return 0;
}


int scsihba_scsi_abort(Scsi_Cmnd *SCpnt)
{
        SCpnt->result = DID_ABORT;
        printk("scsihba_scsi_abort..\n");
        return SUCCESS;
}

int __init scsihba_detect(Scsi_Host_Template *tpnt)
{
        struct Scsi_Host *host;

        tpnt->proc_name = "scsihba_hba";
        host = scsi_register (tpnt, sizeof(struct scsihba_host));
        if (!host)
        {
                printk("scsi_register fails ...\n");
        }

        host->max_id = 2;
        host->hostt->use_new_eh_code = 1;
        host->this_id = tpnt->this_id;

        return 1;
}

int scsihba_release(struct Scsi_Host *host)
{
        return 0;
}

const char *scsihba_info(struct Scsi_Host *host)
{
        static char buf[80];
        sprintf(buf,"SCSI Adapter...\n");
        return buf;
}

void my_callback_function(void *data)
{
        // Get the Scsi Command from the data
        (*SCpnt->scsi_done)(SCpnt);

}
static Scsi_Host_Template driver_template = SCSIHBA;

#include "/usr/src/linux/drivers/scsi/scsi_module.c"

-----------------------------------------------------------
-----------------------------------------------------------

Hope this will help to figure out the problem
Tx again for the help




>From: Christoph Hellwig <hch@infradead.org>
>To: invictus rm <invictus_rm@hotmail.com>
>CC: linux-scsi@vger.kernel.org
>Subject: Re: scsi wait_for_completion hangs!!!
>Date: Fri, 22 Aug 2003 10:53:03 +0100
>
>On Fri, Aug 22, 2003 at 03:18:06PM +0530, invictus rm wrote:
> > hi ,
> >     I am trying to write a HBA driver for a  PCI SCSI card(linux - 2.4.7 
>).
> >
> >    On insmoding the driver( after enabling scsi verbose logging) i was 
>able
> > to trace the point at which it get stuck.
>
>2.4.7 is obsolete.  IF it still happens with 2.4.21 please post the
>affected driver source so we can take a look what you're doing wrong.
>

_________________________________________________________________
ICICI's NRI services. They make life easy. 
http://server1.msn.co.in/msnspecials/nriservices/index.asp Find out more.


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

end of thread, other threads:[~2003-08-22 10:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-22  9:48 scsi wait_for_completion hangs!!! invictus rm
2003-08-22  9:53 ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2003-08-22 10:25 invictus rm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox