RE: Issue with file transfers to a mass storage device on SMP system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Mankad, Maulik Ojas
> Sent: Tuesday, July 27, 2010 12:05 PM
> To: linux-usb@xxxxxxxxxxxxxxx
> Cc: Shilimkar, Santosh; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-
> omap@xxxxxxxxxxxxxxx
> Subject: Issue with file transfers to a mass storage device on SMP system
> 
> Hello,
> 
> I am working on OMAP4 which has two ARM Cortex A9 microprocessors (SMP
> system) with 2.6.35-rc5 kernel.
> 
> I have an issue whereby transferring a large file (>20MB) over USB (OMAP
> Mentor USB controller acts as USB host) to an attached USB thumb drive
> fails.
> 
> The USB analyzer trace shows that the 31 bytes CBW packet is corrupted and
> device responds with a STALL when this issue occurs.
> 
> Further it was found that the CBWCB field (the last 16 bytes which
> contains
> the command to be executed by the device) of the CBW packet was Zero in
> the
> failure case. Also the first 15 bytes of the CBW packet contained valid
> data.
> 
> The code snippet below from usb_stor_Bulk_transport () in
> drivers/usb/storage/transport.c looks to be a problem area.
> 
> /* copy the command payload */
> 
>  memset(bcb->CDB, 0, sizeof(bcb->CDB));
>  memcpy(bcb->CDB, srb->cmnd, bcb->Length);
> 
> Looks like when the issue occurs the memory (bcb->CDB) is not yet updated
> due to likely out of order execution due to SMP.
> 
As discussed, the main reason is the cache maintenance isn't done on
 "bcb->CDB"  buffers and hence the data remains in CPU write buffer instead of the physical memory on which DMA operates. 
In working scenario's, there might be a barrier in the path which is helping
you.

Regards,
Santosh
--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux