On 5/16/06, sudheer <urwithsudheer@xxxxxxxxx> wrote:
When i insmod my block driver for a compact flash that sits on a fpga
based pci card, i could see the following in the /proc/partitons
What does "fdisk -l /dev/foo" report?
When i do fdisk /dev/foo , the driver enters into continous loop in the
request_do_xxx function. And only option is to restart the system.
I am tring in Interrput mode (INTR_MODE)
xsysace_do_request(request_queue_t * q)
{
/* We're already handling a request. Don't accept another. */
if (req_active)
return;
for (;;) {
INIT_REQUEST;
switch (CURRENT->cmd) {
case READ:
req_str = "reading";
req_fnc = XSysAce_SectorRead;
printk("DEBUG:xsysace_do_request: cmd-0x%x, StartSect-0x%x,
NoOfSectsToRead-0x%x \n",
CURRENT->cmd, CURRENT->sector, CURRENT->current_nr_sectors);
break;
case WRITE:
req_str = "writing";
req_fnc = XSysAce_SectorWrite;
break;
default:
printk(KERN_CRIT "%s: unknown request %d.\n",
DEVICE_NAME, CURRENT->cmd);
end_request(0); /* Bad request. End it and onwards. */
continue; /* Go on to the next request. */
}
req_active = 1;
wake_up(&req_wait); /* Schedule task to take care of it */
/*
* It is up to the task or interrupt handler to complete
* the request. We return now so the io_request_lock
* will get cleared and requests can be queued.
*/
/* Below are added by sudheer to
* Wait till the request is done.
* REQUEST_DONE is a user defined variable affected in
* xsysace_compactflash.c, once the request is done.
* If 0-not done, 1-done.
*/
#ifndef INTR_MODE //may16
while(REQUEST_DONE!=1)
{
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ / 100);
}
/*End the request*/
xsa_complete_request(1);
REQUEST_DONE =0;
#endif
}
}
In the poll mode . i am able to do fdisk, In interrupt mode the printk
staement gets printed continously.
Plz help me.
Thanks
Sudheer
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/