diff options
author | Hannes Reinecke <hare@suse.de> | 2014-10-29 13:00:11 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-10-31 11:29:00 +0100 |
commit | 8d72db68fe7b45c7e01f815c4ac3e6c7ac0e26c1 (patch) | |
tree | e8c03878cd97adc6eab05dffb173e9f1df985f26 /hw/scsi/megasas.c | |
parent | 77bb6b171043d03f7e4f5212beaa4e6cb3fd6528 (diff) |
megasas: Clear unit attention on initial reset
The EFI firmware doesn't handle unit attentions properly,
so we need to clear the Power On/Reset unit attention upon
initial reset.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/megasas.c')
-rw-r--r-- | hw/scsi/megasas.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 58e29aed71..57d52885b7 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2202,11 +2202,26 @@ static void megasas_soft_reset(MegasasState *s) int i; MegasasCmd *cmd; - trace_megasas_reset(); + trace_megasas_reset(s->fw_state); for (i = 0; i < s->fw_cmds; i++) { cmd = &s->frames[i]; megasas_abort_command(cmd); } + if (s->fw_state == MFI_FWSTATE_READY) { + BusChild *kid; + + /* + * The EFI firmware doesn't handle UA, + * so we need to clear the Power On/Reset UA + * after the initial reset. + */ + QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) { + SCSIDevice *sdev = DO_UPCAST(SCSIDevice, qdev, kid->child); + + sdev->unit_attention = SENSE_CODE(NO_SENSE); + scsi_device_unit_attention_reported(sdev); + } + } megasas_reset_frames(s); s->reply_queue_len = s->fw_cmds; s->reply_queue_pa = 0; @@ -2334,6 +2349,7 @@ static int megasas_scsi_init(PCIDevice *dev) msix_vector_use(dev, 0); } + s->fw_state = MFI_FWSTATE_READY; if (!s->sas_addr) { s->sas_addr = ((NAA_LOCALLY_ASSIGNED_ID << 24) | IEEE_COMPANY_LOCALLY_ASSIGNED) << 36; |