System hang in USB umass module while processing panic

Shah, Vishal Vishal.Shah at netapp.com
Thu May 19 19:56:36 UTC 2011


Hi Folks,

 

This is regarding the issue we saw in the USB driver of FreeBSD 8,
particularly umass driver. We have a USB flash device in our system.

 

The issue is, when the system panics, it gets into the uni-processor
mode, and while processing that panic, scsi layer shutdown handler
(dashutdown())is called to issue the SYNCHRONIZE_CACHE command to the
device. This command is never completed and the system hangs.

 

Details:

 

When the system panics, it gets into the uniprocessor mode and the
usb_proc is never scheduled to complete the transfer which was enqueued
while executing the SYNCHRONIZE_CACHE command sent by xpt_action() in
the below loop. After sending(enqueuing xfer) the command, current
process waits in a loop for the command to complete with a very large
timeout value. 
 
Loop in xpt_polled_action() called by dashutdown():
 
if (timeout != 0) {
               xpt_action(start_ccb);
               while(--timeout > 0) {
                       (*(sim->sim_poll))(sim);
                       camisr_runqueue(&sim->sim_doneq);
                       if ((start_ccb->ccb_h.status  & CAM_STATUS_MASK)
                           != CAM_REQ_INPROG)
                               break;
                       DELAY(1000);
               }
In FreeBSD 8 USB driver, commands are asynchronously sent from umass
layer onto the wire, in other words, multiple threads are involved
before the command is sent from the umass layer all the way to the wire.
Since the usb_proc is not scheduled current process keeps waiting for
the command to complete, hence the hang.
 
Is this a known issue? If yes, is there a fix available? Are there any
plans of adding a synchronous path to send the command to the device?
 
Any information regarding this issue is much appreciated.
 
Thanks in advance,
Vishal

 



More information about the freebsd-usb mailing list