mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
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>
This commit is contained in:
parent
77bb6b1710
commit
8d72db68fe
4 changed files with 20 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -84,7 +84,7 @@ static SCSIRequest *scsi_device_alloc_req(SCSIDevice *s, uint32_t tag, uint32_t
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void scsi_device_unit_attention_reported(SCSIDevice *s)
|
||||
void scsi_device_unit_attention_reported(SCSIDevice *s)
|
||||
{
|
||||
SCSIDeviceClass *sc = SCSI_DEVICE_GET_CLASS(s);
|
||||
if (sc->unit_attention_reported) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue