Skip to content

Commit a157b10

Browse files
avasquez01James Bottomley
authored andcommitted
[SCSI] qla2xxx: Correct pci_set_msi() usage semantics.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1 parent 75edf81 commit a157b10

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,17 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)
130130
int
131131
qla2100_pci_config(scsi_qla_host_t *ha)
132132
{
133-
uint16_t w, mwi;
133+
int ret;
134+
uint16_t w;
134135
uint32_t d;
135136
unsigned long flags;
136137
struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
137138

138139
pci_set_master(ha->pdev);
139-
mwi = 0;
140-
if (pci_set_mwi(ha->pdev))
141-
mwi = PCI_COMMAND_INVALIDATE;
140+
ret = pci_set_mwi(ha->pdev);
142141

143142
pci_read_config_word(ha->pdev, PCI_COMMAND, &w);
144-
w |= mwi | (PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
143+
w |= (PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
145144
pci_write_config_word(ha->pdev, PCI_COMMAND, w);
146145

147146
/* Reset expansion ROM address decode enable */
@@ -166,22 +165,22 @@ qla2100_pci_config(scsi_qla_host_t *ha)
166165
int
167166
qla2300_pci_config(scsi_qla_host_t *ha)
168167
{
169-
uint16_t w, mwi;
168+
int ret;
169+
uint16_t w;
170170
uint32_t d;
171171
unsigned long flags = 0;
172172
uint32_t cnt;
173173
struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
174174

175175
pci_set_master(ha->pdev);
176-
mwi = 0;
177-
if (pci_set_mwi(ha->pdev))
178-
mwi = PCI_COMMAND_INVALIDATE;
176+
ret = pci_set_mwi(ha->pdev);
179177

180178
pci_read_config_word(ha->pdev, PCI_COMMAND, &w);
181-
w |= mwi | (PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
179+
w |= (PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
182180

183181
if (IS_QLA2322(ha) || IS_QLA6322(ha))
184182
w &= ~PCI_COMMAND_INTX_DISABLE;
183+
pci_write_config_word(ha->pdev, PCI_COMMAND, w);
185184

186185
/*
187186
* If this is a 2300 card and not 2312, reset the
@@ -210,7 +209,7 @@ qla2300_pci_config(scsi_qla_host_t *ha)
210209
ha->fb_rev = RD_FB_CMD_REG(ha, reg);
211210

212211
if (ha->fb_rev == FPM_2300)
213-
w &= ~PCI_COMMAND_INVALIDATE;
212+
pci_clear_mwi(ha->pdev);
214213

215214
/* Deselect FPM registers. */
216215
WRT_REG_WORD(&reg->ctrl_status, 0x0);
@@ -227,7 +226,6 @@ qla2300_pci_config(scsi_qla_host_t *ha)
227226

228227
spin_unlock_irqrestore(&ha->hardware_lock, flags);
229228
}
230-
pci_write_config_word(ha->pdev, PCI_COMMAND, w);
231229

232230
pci_write_config_byte(ha->pdev, PCI_LATENCY_TIMER, 0x80);
233231

@@ -253,19 +251,18 @@ qla2300_pci_config(scsi_qla_host_t *ha)
253251
int
254252
qla24xx_pci_config(scsi_qla_host_t *ha)
255253
{
256-
uint16_t w, mwi;
254+
int ret;
255+
uint16_t w;
257256
uint32_t d;
258257
unsigned long flags = 0;
259258
struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
260259
int pcix_cmd_reg, pcie_dctl_reg;
261260

262261
pci_set_master(ha->pdev);
263-
mwi = 0;
264-
if (pci_set_mwi(ha->pdev))
265-
mwi = PCI_COMMAND_INVALIDATE;
262+
ret = pci_set_mwi(ha->pdev);
266263

267264
pci_read_config_word(ha->pdev, PCI_COMMAND, &w);
268-
w |= mwi | (PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
265+
w |= (PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
269266
w &= ~PCI_COMMAND_INTX_DISABLE;
270267
pci_write_config_word(ha->pdev, PCI_COMMAND, w);
271268

0 commit comments

Comments
 (0)