RE: [PATCH] USB: g_mass_storage: Hide caching mode page to improve write speed for Windows

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

 



> Michal Nazarewicz:
>> How does it interact with the nofua attribute?  With f_mass_storage,
>> you can write 1 to nofua file in sysfs's directory for given lun to
>> make it ignore the FUA bit.

On Fri, Sep 21 2012, Leo Song wrote:
> Actually this patch does not interact with the nofua attribute
> directly. The original code will let Windows PC go into a confused
> state, and Windows will always send WRITE COMMAND with FUA=1. If
> manually "echo 1 > ./f_mass_storage/lun/nofua" to let the UMS device
> ignore the FUA bit from host PC, it can improve write speed.
>
> But with original code, if you check the properties of the UMS device
> in Windows Device Manger, there is an unpleasant yellow "!" under the
> "Policies" item, and the "Removal policy" is fixed to "Better
> performance". If you try to change to "Quick removal", Windows will
> cry. This is very different with a normal USB flash disk, and
> unfriendly to end user.
>
> This patch's solution is to hide the "caching mode page", if Windows
> does not see this page, it will not be confused, and will not send
> WRITE COMMAND with FUA=1, so that write speed will be fast.
>
> With this patch, the unpleasant yellow "!" will disappear, and
> "Removal policy" will be "Quick removal" by default, and you can
> change to "Better performance" if you want. It will be the same as
> a normal USB flash disk.

Wait, I'm totally confused at the moment.  I also don't have Windows to
test...

Are you saying that if I plug a device with g_mass_storage Windows will
show a warning icon and use “Better performance” mode?

But if I understand what “Better performance” means, Windows should not
set FUA bit.  My understanding is that FUA is set in “Quick removal”
mode so that data is written to the media without the need to flush
cache and therefore user “can safely” remove the flash drive w/o
unmounting.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@xxxxxxxxxx>--------------ooO--(_)--Ooo--

Attachment: pgpE0N3g32ua6.pgp
Description: PGP signature


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

  Powered by Linux