On Wed, 6 Feb 2013, victor yeo wrote: > Hi, > > >> Thanks, i added in UDC driver to call bulk_in_complete for every > >> request over a bulk in ep, now the gadget driver is able to process > >> the SCSI Inquiry command. When it comes to SCSI Read Format Capacities > >> command, the gadget driver gives attention condition error in > >> check_command() in the code snippet below, and the command is not > >> processed by do_read_format_capacities(). > >> > >> if (curlun && curlun->unit_attention_data != SS_NO_SENSE && > >> fsg->cmnd[0] != INQUIRY && > >> fsg->cmnd[0] != REQUEST_SENSE) { > >> curlun->sense_data = curlun->unit_attention_data; > >> curlun->unit_attention_data = SS_NO_SENSE; > >> return -EINVAL; > >> } > >> > >> Besides the code snippet, the only place that sets unit_attention data > >> to SS_NO_SENSE is in handle_exception(). How is UDC driver able to > >> overcome this problem? > > > > What problem? This all sounds perfectly normal. > > > > Maybe you should post the kernel debugging log. > > > > The problem is READ FORMAT CAPACITIES command is not processed, and no > reply is sent back in response to the command. What do you mean by "no reply is sent back"? Doesn't the CSW packet get sent by send_status? Not processing the command is normal if curlun->unit_attention_data is set to something other than SS_NO_SENSE. Note that the code above changes curlun->unit_attention_data back to SS_NO_SENSE, so if the host sends the same command again then it should work the second time. > the kernel log does not show any error that is related to SCSI commands. Please post it anyway. It still may contain useful information even though it doesn't contain any errors. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html