The value is the first argument and the port is the second, but the code was using the opposite order.
Cc: Hannes Reinecke hare@suse.de Signed-off-by: Stefan Weil sw@weilnetz.de ---
The outw statement looks strange, because there is also an outl statement with the same arguments.
Maybe both statements should either use outw or outl.
Regards Stefan
src/hw/megasas.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/hw/megasas.c b/src/hw/megasas.c index 5a07ab3..c009951 100644 --- a/src/hw/megasas.c +++ b/src/hw/megasas.c @@ -301,9 +301,9 @@ static int megasas_transition_to_ready(struct pci_device *pci, u32 ioaddr) pci->device == PCI_DEVICE_ID_LSI_SAS2008 || pci->device == PCI_DEVICE_ID_LSI_SAS2208 || pci->device == PCI_DEVICE_ID_LSI_SAS3108) { - outl(ioaddr + MFI_DB, mfi_flags); + outl(mfi_flags, ioaddr + MFI_DB); } else { - outl(ioaddr + MFI_IDB, mfi_flags); + outl(mfi_flags, ioaddr + MFI_IDB); } break; case MFI_STATE_OPERATIONAL: @@ -312,7 +312,7 @@ static int megasas_transition_to_ready(struct pci_device *pci, u32 ioaddr) pci->device == PCI_DEVICE_ID_LSI_SAS2008 || pci->device == PCI_DEVICE_ID_LSI_SAS2208 || pci->device == PCI_DEVICE_ID_LSI_SAS3108) { - outl(ioaddr + MFI_DB, mfi_flags); + outl(mfi_flags, ioaddr + MFI_DB); if (pci->device == PCI_DEVICE_ID_LSI_SAS2208 || pci->device == PCI_DEVICE_ID_LSI_SAS3108) { int j = 0; @@ -327,7 +327,7 @@ static int megasas_transition_to_ready(struct pci_device *pci, u32 ioaddr) } } } else { - outw(ioaddr + MFI_IDB, mfi_flags); + outw(mfi_flags, ioaddr + MFI_IDB); } break; case MFI_STATE_READY:
On 08/29/2015 08:02 AM, Stefan Weil wrote:
The value is the first argument and the port is the second, but the code was using the opposite order.
Cc: Hannes Reinecke hare@suse.de Signed-off-by: Stefan Weil sw@weilnetz.de
The outw statement looks strange, because there is also an outl statement with the same arguments.
Maybe both statements should either use outw or outl.
Regards Stefan
src/hw/megasas.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/hw/megasas.c b/src/hw/megasas.c index 5a07ab3..c009951 100644 --- a/src/hw/megasas.c +++ b/src/hw/megasas.c @@ -301,9 +301,9 @@ static int megasas_transition_to_ready(struct pci_device *pci, u32 ioaddr) pci->device == PCI_DEVICE_ID_LSI_SAS2008 || pci->device == PCI_DEVICE_ID_LSI_SAS2208 || pci->device == PCI_DEVICE_ID_LSI_SAS3108) {
outl(ioaddr + MFI_DB, mfi_flags);
outl(mfi_flags, ioaddr + MFI_DB); } else {
outl(ioaddr + MFI_IDB, mfi_flags);
outl(mfi_flags, ioaddr + MFI_IDB); } break; case MFI_STATE_OPERATIONAL:
@@ -312,7 +312,7 @@ static int megasas_transition_to_ready(struct pci_device *pci, u32 ioaddr) pci->device == PCI_DEVICE_ID_LSI_SAS2008 || pci->device == PCI_DEVICE_ID_LSI_SAS2208 || pci->device == PCI_DEVICE_ID_LSI_SAS3108) {
outl(ioaddr + MFI_DB, mfi_flags);
outl(mfi_flags, ioaddr + MFI_DB); if (pci->device == PCI_DEVICE_ID_LSI_SAS2208 || pci->device == PCI_DEVICE_ID_LSI_SAS3108) { int j = 0;
@@ -327,7 +327,7 @@ static int megasas_transition_to_ready(struct pci_device *pci, u32 ioaddr) } } } else {
outw(ioaddr + MFI_IDB, mfi_flags);
outw(mfi_flags, ioaddr + MFI_IDB); } break; case MFI_STATE_READY:
And indeed, this should've been an 'outl'. Can you fix it up?
Thanks.
Cheers,
Hannes
On Sat, Aug 29, 2015 at 08:02:38AM +0200, Stefan Weil wrote:
The value is the first argument and the port is the second, but the code was using the opposite order.
Thanks - I committed this patch. I also committed a follow up patch turning the outw() into an outl().
-Kevin