sd: Avoid sending medium write commands if device is write protected
sd: Avoid sending medium write commands if device is write protected

The SYNCHRONIZE_CACHE command is a medium write command and hence can
fail when the device is write protected. Avoid sending such commands by
making sure that write-cache-enable is disabled even though the device
claim to support it.

Signed-off-by: Sujit Reddy Thumma <d09719b174b1d7232763de9bbeaca66508591b55@codeaurora.org>
Signed-off-by: Dolev Raviv <3d75773ad3271f97975e35fbf4c96b1bb9f3e9d6@codeaurora.org>
Reviewed-by: Martin K. Petersen <0384aaef27f06874adbdb09a807bb339f4aff9fd@oracle.com>
Reviewed-by: Venkatesh Srinivas <f08656a93e4f864a84f28aef76f82a58b34ffb9e@google.com>
Signed-off-by: Christoph Hellwig <923f7720577207a44b32e59bbfbea59d27f1ae8e@lst.de>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs