On 10/21/2016 03:33 PM, Kashyap Desai wrote:
From previous patch we have below changes in v2 (only for Virtual Disk)-
1. Updated change log. Provided more detail in change log.
2. Agreed to remove module parameter. If we remove module parameter, we
can ask customer to disable WCE on drive to get similar impact.
3. Always Send SYNCHRONIZE_CACHE for JBOD (non Raid) Device to Firmware.
Current megaraid_sas driver returns SYNCHRONIZE_CACHE(related to Drive
Cache) command back to SCSI layer without sending it down to firmware as
firmware supposed to take care of flushing disk cache for all drives
belongs to Virtual Disk at the time of system reboot/shutdown.
We evaluate and understood that for Raid Volume, why driver should not
send SYNC_CACHE command to the Firmware.
There may be a some reason in past, but now it looks to be not required and
we have fixed this issue as part of this patch.
- Additional background -
There are some instance of MegaRaid FW (E.a Gen2 and Gen2.5 FW) set WCE bit
for Virtual Disk but firmware does not reply correct status for SYNCH_CACHE.
It is very difficult to find out which Device ID and firmware has capability
to manage SYNC_CACHE, so we managed to figure out which are the new firmware
(canHandleSyncCache is set in scratch pad register at 0xB4) and use that
interface for correct behavior as explained above.
E.g Liberator/Thunderbolt MegaRaid FW returns SYNC_CACHE as Unsupported
command (this is a firmware bug) and eventually command will be failed to SML.
This will cause File system to go Read-only.
- New behavior described -
IF application requests SYNCH_CACHE
IF 'JBOD'
Driver sends SYNCH_CACHE command to the FW
FW sends SYNCH_CACHE to drive
FW obtains status from drive and returns same status back to
driver
ELSEIF 'VirtualDisk'
IF any FW which supports new API bit called canHandleSyncCache
Driver sends SYNCH_CACHE command to the FW
FW does not send SYNCH_CACHE to drives
FW returns SUCCESS
ELSE
Driver does not send SYNCH_CACHE command to the
FW.
Driver return SUCCESS for that command.
ENDIF
ENDIF
ENDIF
Signed-off-by: Kashyap Desai <kashyap.de...@broadcom.com>
Signed-off-by: Sumit Saxena <sumit.sax...@broadcom.com>
---
drivers/scsi/megaraid/megaraid_sas.h | 3 +++
drivers/scsi/megaraid/megaraid_sas_base.c | 7 ++-----
drivers/scsi/megaraid/megaraid_sas_fusion.c | 5 +++++
3 files changed, 10 insertions(+), 5 deletions(-)
Reviewed-by: Hannes Reinecke <h...@suse.com>
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
h...@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html