RE: FW: Concerns regarding file backed storage gadget

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

 



On Thu, 19 Aug 2010, Murphy, Robert wrote:

> Yes, we have done extensive testing in this area and have things working well.  Just to clarify, we are considering the USB client as the Linux device which has the backing file and the USB host as the PC (Windows).
> 
> During the initial development, we did run into "cache coherency"-like issues in Windows.  We found that if we changed the contents of the backing file from the client, the host (Windows) would never read the new data.  However, we found that in Windows, if we opened the file with the FILE_FLAG_NO_BUFFERING attribute set, Windows would always read (and write) the latest data from (or to) the device (instead of its local cache).
> 
> The mechanism works as follows:
> We have set aside a 512kb portion of the backing file as a ring buffered transfer area which is split into buffers for host to client writes and client to host writes.  Again, all host reads/writes are non-cached.  When the host wants to transfer some data, if first does a read of the host to client ring buffer index and then performs writes to the currently unused ring buffers.  The opposite works for client to host.
> 
> We've tested this functionality on a few Windows 7 and XP systems and haven't seen any issues yet.
> 
> Given all this, is there any reason to believe there could be a possibility of stability issues on either side (PC or Linux)?

In fact this sounds okay.  You're not using the device to hold a 
filesystem and the host knows not to cache the data, so it won't get 
confused if the data changes without its knowledge.

You've got an unusual setup.  Most people just stick a filesystem on
the gadget and use it that way.

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


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

  Powered by Linux