diff options
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.c | 55 | ||||
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.h | 1 |
2 files changed, 33 insertions, 23 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index e177fc5c5dd0..c3b50b375799 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
@@ -135,6 +135,19 @@ megasas_enable_intr_xscale(struct megasas_register_set __iomem * regs) | |||
135 | } | 135 | } |
136 | 136 | ||
137 | /** | 137 | /** |
138 | * megasas_disable_intr_xscale -Disables interrupt | ||
139 | * @regs: MFI register set | ||
140 | */ | ||
141 | static inline void | ||
142 | megasas_disable_intr_xscale(struct megasas_register_set __iomem * regs) | ||
143 | { | ||
144 | u32 mask = 0x1f; | ||
145 | writel(mask, ®s->outbound_intr_mask); | ||
146 | /* Dummy readl to force pci flush */ | ||
147 | readl(®s->outbound_intr_mask); | ||
148 | } | ||
149 | |||
150 | /** | ||
138 | * megasas_read_fw_status_reg_xscale - returns the current FW status value | 151 | * megasas_read_fw_status_reg_xscale - returns the current FW status value |
139 | * @regs: MFI register set | 152 | * @regs: MFI register set |
140 | */ | 153 | */ |
@@ -185,6 +198,7 @@ static struct megasas_instance_template megasas_instance_template_xscale = { | |||
185 | 198 | ||
186 | .fire_cmd = megasas_fire_cmd_xscale, | 199 | .fire_cmd = megasas_fire_cmd_xscale, |
187 | .enable_intr = megasas_enable_intr_xscale, | 200 | .enable_intr = megasas_enable_intr_xscale, |
201 | .disable_intr = megasas_disable_intr_xscale, | ||
188 | .clear_intr = megasas_clear_intr_xscale, | 202 | .clear_intr = megasas_clear_intr_xscale, |
189 | .read_fw_status_reg = megasas_read_fw_status_reg_xscale, | 203 | .read_fw_status_reg = megasas_read_fw_status_reg_xscale, |
190 | }; | 204 | }; |
@@ -215,6 +229,19 @@ megasas_enable_intr_ppc(struct megasas_register_set __iomem * regs) | |||
215 | } | 229 | } |
216 | 230 | ||
217 | /** | 231 | /** |
232 | * megasas_disable_intr_ppc - Disable interrupt | ||
233 | * @regs: MFI register set | ||
234 | */ | ||
235 | static inline void | ||
236 | megasas_disable_intr_ppc(struct megasas_register_set __iomem * regs) | ||
237 | { | ||
238 | u32 mask = 0xFFFFFFFF; | ||
239 | writel(mask, ®s->outbound_intr_mask); | ||
240 | /* Dummy readl to force pci flush */ | ||
241 | readl(®s->outbound_intr_mask); | ||
242 | } | ||
243 | |||
244 | /** | ||
218 | * megasas_read_fw_status_reg_ppc - returns the current FW status value | 245 | * megasas_read_fw_status_reg_ppc - returns the current FW status value |
219 | * @regs: MFI register set | 246 | * @regs: MFI register set |
220 | */ | 247 | */ |
@@ -265,6 +292,7 @@ static struct megasas_instance_template megasas_instance_template_ppc = { | |||
265 | 292 | ||
266 | .fire_cmd = megasas_fire_cmd_ppc, | 293 | .fire_cmd = megasas_fire_cmd_ppc, |
267 | .enable_intr = megasas_enable_intr_ppc, | 294 | .enable_intr = megasas_enable_intr_ppc, |
295 | .disable_intr = megasas_disable_intr_ppc, | ||
268 | .clear_intr = megasas_clear_intr_ppc, | 296 | .clear_intr = megasas_clear_intr_ppc, |
269 | .read_fw_status_reg = megasas_read_fw_status_reg_ppc, | 297 | .read_fw_status_reg = megasas_read_fw_status_reg_ppc, |
270 | }; | 298 | }; |
@@ -275,25 +303,6 @@ static struct megasas_instance_template megasas_instance_template_ppc = { | |||
275 | */ | 303 | */ |
276 | 304 | ||
277 | /** | 305 | /** |
278 | * megasas_disable_intr - Disables interrupts | ||
279 | * @regs: MFI register set | ||
280 | */ | ||
281 | static inline void | ||
282 | megasas_disable_intr(struct megasas_instance *instance) | ||
283 | { | ||
284 | u32 mask = 0x1f; | ||
285 | struct megasas_register_set __iomem *regs = instance->reg_set; | ||
286 | |||
287 | if(instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1078R) | ||
288 | mask = 0xffffffff; | ||
289 | |||
290 | writel(mask, ®s->outbound_intr_mask); | ||
291 | |||
292 | /* Dummy readl to force pci flush */ | ||
293 | readl(®s->outbound_intr_mask); | ||
294 | } | ||
295 | |||
296 | /** | ||
297 | * megasas_issue_polled - Issues a polling command | 306 | * megasas_issue_polled - Issues a polling command |
298 | * @instance: Adapter soft state | 307 | * @instance: Adapter soft state |
299 | * @cmd: Command packet to be issued | 308 | * @cmd: Command packet to be issued |
@@ -1293,7 +1302,7 @@ megasas_transition_to_ready(struct megasas_instance* instance) | |||
1293 | /* | 1302 | /* |
1294 | * Bring it to READY state; assuming max wait 10 secs | 1303 | * Bring it to READY state; assuming max wait 10 secs |
1295 | */ | 1304 | */ |
1296 | megasas_disable_intr(instance); | 1305 | instance->instancet->disable_intr(instance->reg_set); |
1297 | writel(MFI_RESET_FLAGS, &instance->reg_set->inbound_doorbell); | 1306 | writel(MFI_RESET_FLAGS, &instance->reg_set->inbound_doorbell); |
1298 | 1307 | ||
1299 | max_wait = 10; | 1308 | max_wait = 10; |
@@ -1799,7 +1808,7 @@ static int megasas_init_mfi(struct megasas_instance *instance) | |||
1799 | /* | 1808 | /* |
1800 | * disable the intr before firing the init frame to FW | 1809 | * disable the intr before firing the init frame to FW |
1801 | */ | 1810 | */ |
1802 | megasas_disable_intr(instance); | 1811 | instance->instancet->disable_intr(instance->reg_set); |
1803 | 1812 | ||
1804 | /* | 1813 | /* |
1805 | * Issue the init frame in polled mode | 1814 | * Issue the init frame in polled mode |
@@ -2279,7 +2288,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2279 | megasas_mgmt_info.max_index--; | 2288 | megasas_mgmt_info.max_index--; |
2280 | 2289 | ||
2281 | pci_set_drvdata(pdev, NULL); | 2290 | pci_set_drvdata(pdev, NULL); |
2282 | megasas_disable_intr(instance); | 2291 | instance->instancet->disable_intr(instance->reg_set); |
2283 | free_irq(instance->pdev->irq, instance); | 2292 | free_irq(instance->pdev->irq, instance); |
2284 | 2293 | ||
2285 | megasas_release_mfi(instance); | 2294 | megasas_release_mfi(instance); |
@@ -2409,7 +2418,7 @@ static void megasas_detach_one(struct pci_dev *pdev) | |||
2409 | 2418 | ||
2410 | pci_set_drvdata(instance->pdev, NULL); | 2419 | pci_set_drvdata(instance->pdev, NULL); |
2411 | 2420 | ||
2412 | megasas_disable_intr(instance); | 2421 | instance->instancet->disable_intr(instance->reg_set); |
2413 | 2422 | ||
2414 | free_irq(instance->pdev->irq, instance); | 2423 | free_irq(instance->pdev->irq, instance); |
2415 | 2424 | ||
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 930c06d0a4f7..74feffe2fff3 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h | |||
@@ -1049,6 +1049,7 @@ struct megasas_evt_detail { | |||
1049 | void (*fire_cmd)(dma_addr_t ,u32 ,struct megasas_register_set __iomem *); | 1049 | void (*fire_cmd)(dma_addr_t ,u32 ,struct megasas_register_set __iomem *); |
1050 | 1050 | ||
1051 | void (*enable_intr)(struct megasas_register_set __iomem *) ; | 1051 | void (*enable_intr)(struct megasas_register_set __iomem *) ; |
1052 | void (*disable_intr)(struct megasas_register_set __iomem *); | ||
1052 | 1053 | ||
1053 | int (*clear_intr)(struct megasas_register_set __iomem *); | 1054 | int (*clear_intr)(struct megasas_register_set __iomem *); |
1054 | 1055 | ||