Skip to contentSkip to conversation

Calling scsi_done from queuecommand()

DISCUSSION Zhikun Wang 2 participants 3 messages Jan 12, 2006 SCSI

lore
Share & tools
lore
#0 lore raw

Hi list,
Can we call scsi_done() to complete the I/O from the queuecommand() ? (e.g. to make queuecommand synchronous).
I try this method in my LsiLogic 22320 SCSI card driver in Redhat9, and i can correctly handle read command. But Write command is stop when i call scsi_done() in the queuecommand. I am very puzzled! Thanks for any answers!

Regards,
-zkwang

#1 lore raw
Quoted 2 lines · Zhikun Wang

Hi list,
Can we call scsi_done() to complete the I/O from the queuecommand() ?

yes that should be fine *IF THE COMMAND COMPLETED*. (for example that can be done for battery backed ram cards)

Quoted 2 lines

(e.g. to make queuecommand synchronous).
I try this method in my LsiLogic 22320 SCSI card driver

but... that sounds unlikely to be right. That is real scsi, which means you have to wait a REALLY long time (easily 5 miliseconds) before the command completes, and you cannot sleep in queuecommand (it's called from interrupt context). So this sounds really fishy

Quoted 1 line

in Redhat9,

you do realize you're using a truely antique linux kernel/distribution there, right? I suggest you go to a far more recent (and an actual maintained) distribution

#2 lore raw
Quoted 14 lines · Zhikun Wang

Hi list,
Can we call scsi_done() to complete the I/O from the queuecommand() ?

Quoted 2 lines

yes that should be fine *IF THE COMMAND COMPLETED*. (for example that can be done for battery backed ram cards)

(e.g. to make queuecommand synchronous).
I try this method in my LsiLogic 22320 SCSI card driver

Quoted 4 lines

but... that sounds unlikely to be right. That is real scsi, which means you have to wait a REALLY long time (easily 5 miliseconds) before the command completes, and you cannot sleep in queuecommand (it's called from interrupt context). So this sounds really fishy

I intend to use a global variable to make queuecommand synchronously. In the <queuecommand function> i set the global variable to 0.

	......
	global = 0;
	......
	while(!global)
    	barrier();
    SCpnt->scsi_done(SCpnt);
	......
When the command completes, in the <interrupt routine> i set the global variable to 1.
	......
	global = 1;
    ......

this method works for read command, but write command will stop at scsi_done routine and then timeout! i am very puzzled about this!

Quoted 5 lines

in Redhat9,

Quoted 3 lines

you do realize you're using a truely antique linux kernel/distribution there, right? I suggest you go to a far more recent (and an actual maintained) distribution

i know Redhat9 is out of time, but i must use this kernel/distribution in my project!