[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/17] megasas: Ignore duplicate init_firmware comma
From: |
Hannes Reinecke |
Subject: |
[Qemu-devel] [PATCH 13/17] megasas: Ignore duplicate init_firmware commands |
Date: |
Wed, 29 Oct 2014 08:53:48 +0100 |
The windows driver is sending several init_firmware commands
when in MSI-X mode. It is, however, using only the first
queue. So disregard any additional init_firmware commands
until the HBA is reset.
Signed-off-by: Hannes Reinecke <address@hidden>
---
hw/scsi/megasas.c | 9 ++++++---
trace-events | 1 +
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 7a6c94f..c1bc563 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -609,16 +609,19 @@ static int megasas_init_firmware(MegasasState *s,
MegasasCmd *cmd)
{
PCIDevice *pcid = PCI_DEVICE(s);
uint32_t pa_hi, pa_lo;
- hwaddr iq_pa, initq_size;
- struct mfi_init_qinfo *initq;
+ hwaddr iq_pa, initq_size = sizeof(struct mfi_init_qinfo);
+ struct mfi_init_qinfo *initq = NULL;
uint32_t flags;
int ret = MFI_STAT_OK;
+ if (s->reply_queue_pa) {
+ trace_megasas_initq_mapped(s->reply_queue_pa);
+ goto out;
+ }
pa_lo = le32_to_cpu(cmd->frame->init.qinfo_new_addr_lo);
pa_hi = le32_to_cpu(cmd->frame->init.qinfo_new_addr_hi);
iq_pa = (((uint64_t) pa_hi << 32) | pa_lo);
trace_megasas_init_firmware((uint64_t)iq_pa);
- initq_size = sizeof(*initq);
initq = pci_dma_map(pcid, iq_pa, &initq_size, 0);
if (!initq || initq_size != sizeof(*initq)) {
trace_megasas_initq_map_failed(cmd->index);
diff --git a/trace-events b/trace-events
index 11cfc44..62f04da 100644
--- a/trace-events
+++ b/trace-events
@@ -697,6 +697,7 @@ lm32_uart_irq_state(int level) "irq state %d"
megasas_init_firmware(uint64_t pa) "pa %" PRIx64 " "
megasas_init_queue(uint64_t queue_pa, int queue_len, uint64_t head, uint64_t
tail, uint32_t flags) "queue at %" PRIx64 " len %d head %" PRIx64 " tail %"
PRIx64 " flags %x"
megasas_initq_map_failed(int frame) "scmd %d: failed to map queue"
+megasas_initq_mapped(uint64_t pa) "queue already mapped at %" PRIx64 ""
megasas_initq_mismatch(int queue_len, int fw_cmds) "queue size %d max fw cmds
%d"
megasas_qf_found(unsigned int index, uint64_t pa) "mapped frame %x pa %"
PRIx64 ""
megasas_qf_new(unsigned int index, void *cmd) "return new frame %x cmd %p"
--
1.8.4.5
- [Qemu-devel] [PATCH 09/17] megasas: add MegaRAID SAS 2108 emulation, (continued)
- [Qemu-devel] [PATCH 09/17] megasas: add MegaRAID SAS 2108 emulation, Hannes Reinecke, 2014/10/29
- [Qemu-devel] [PATCH 12/17] megasas: Clear unit attention on initial reset, Hannes Reinecke, 2014/10/29
- [Qemu-devel] [PATCH 03/17] scsi: Rename scsi_cdb_length() to scsi_xfer_length(), Hannes Reinecke, 2014/10/29
- [Qemu-devel] [PATCH 10/17] megasas: Fix typo in megasas_dcmd_ld_get_list(), Hannes Reinecke, 2014/10/29
- [Qemu-devel] [PATCH 07/17] megasas: simplify trace event messages, Hannes Reinecke, 2014/10/29
- [Qemu-devel] [PATCH 11/17] megasas: Decode register names, Hannes Reinecke, 2014/10/29
- [Qemu-devel] [PATCH 14/17] megasas: Implement DCMD_CLUSTER_RESET_LD, Hannes Reinecke, 2014/10/29
- [Qemu-devel] [PATCH 13/17] megasas: Ignore duplicate init_firmware commands,
Hannes Reinecke <=
- [Qemu-devel] [PATCH 15/17] megasas: Update queue logging, Hannes Reinecke, 2014/10/29
- [Qemu-devel] [PATCH 17/17] megasas: Fixup MSI-X handling, Hannes Reinecke, 2014/10/29
- [Qemu-devel] [PATCH 02/17] atapi: clear sense code, Hannes Reinecke, 2014/10/29
- Re: [Qemu-devel] [PATCH 00/17] megasas: gen2 emulation and MSI-X fixes, Paolo Bonzini, 2014/10/29