[SCSI] megaraid_sas: function pointer for disable interrupt

This patch adds function pointer to invoke disable interrupt for
xscale and ppc IOP based controllers. Removes old implementation that checks
for controller type in megasas_disable_intr.

Signed-off-by: Sumant Patro <Sumant.Patro@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by Sumant Patro and committed by James Bottomley b274cab7 b1df99d9

+33 -23
+32 -23
drivers/scsi/megaraid/megaraid_sas.c
··· 135 } 136 137 /** 138 * megasas_read_fw_status_reg_xscale - returns the current FW status value 139 * @regs: MFI register set 140 */ ··· 198 199 .fire_cmd = megasas_fire_cmd_xscale, 200 .enable_intr = megasas_enable_intr_xscale, 201 .clear_intr = megasas_clear_intr_xscale, 202 .read_fw_status_reg = megasas_read_fw_status_reg_xscale, 203 }; ··· 224 225 writel(~0x80000004, &(regs)->outbound_intr_mask); 226 227 /* Dummy readl to force pci flush */ 228 readl(&regs->outbound_intr_mask); 229 } ··· 292 293 .fire_cmd = megasas_fire_cmd_ppc, 294 .enable_intr = megasas_enable_intr_ppc, 295 .clear_intr = megasas_clear_intr_ppc, 296 .read_fw_status_reg = megasas_read_fw_status_reg_ppc, 297 }; ··· 301 * This is the end of set of functions & definitions 302 * specific to ppc (deviceid : 0x60) controllers 303 */ 304 - 305 - /** 306 - * megasas_disable_intr - Disables interrupts 307 - * @regs: MFI register set 308 - */ 309 - static inline void 310 - megasas_disable_intr(struct megasas_instance *instance) 311 - { 312 - u32 mask = 0x1f; 313 - struct megasas_register_set __iomem *regs = instance->reg_set; 314 - 315 - if(instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1078R) 316 - mask = 0xffffffff; 317 - 318 - writel(mask, &regs->outbound_intr_mask); 319 - 320 - /* Dummy readl to force pci flush */ 321 - readl(&regs->outbound_intr_mask); 322 - } 323 324 /** 325 * megasas_issue_polled - Issues a polling command ··· 1302 /* 1303 * Bring it to READY state; assuming max wait 10 secs 1304 */ 1305 - megasas_disable_intr(instance); 1306 writel(MFI_RESET_FLAGS, &instance->reg_set->inbound_doorbell); 1307 1308 max_wait = 10; ··· 1808 /* 1809 * disable the intr before firing the init frame to FW 1810 */ 1811 - megasas_disable_intr(instance); 1812 1813 /* 1814 * Issue the init frame in polled mode ··· 2288 megasas_mgmt_info.max_index--; 2289 2290 pci_set_drvdata(pdev, NULL); 2291 - megasas_disable_intr(instance); 2292 free_irq(instance->pdev->irq, instance); 2293 2294 megasas_release_mfi(instance); ··· 2418 2419 pci_set_drvdata(instance->pdev, NULL); 2420 2421 - megasas_disable_intr(instance); 2422 2423 free_irq(instance->pdev->irq, instance); 2424
··· 135 } 136 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, &regs->outbound_intr_mask); 146 + /* Dummy readl to force pci flush */ 147 + readl(&regs->outbound_intr_mask); 148 + } 149 + 150 + /** 151 * megasas_read_fw_status_reg_xscale - returns the current FW status value 152 * @regs: MFI register set 153 */ ··· 185 186 .fire_cmd = megasas_fire_cmd_xscale, 187 .enable_intr = megasas_enable_intr_xscale, 188 + .disable_intr = megasas_disable_intr_xscale, 189 .clear_intr = megasas_clear_intr_xscale, 190 .read_fw_status_reg = megasas_read_fw_status_reg_xscale, 191 }; ··· 210 211 writel(~0x80000004, &(regs)->outbound_intr_mask); 212 213 + /* Dummy readl to force pci flush */ 214 + readl(&regs->outbound_intr_mask); 215 + } 216 + 217 + /** 218 + * megasas_disable_intr_ppc - Disable interrupt 219 + * @regs: MFI register set 220 + */ 221 + static inline void 222 + megasas_disable_intr_ppc(struct megasas_register_set __iomem * regs) 223 + { 224 + u32 mask = 0xFFFFFFFF; 225 + writel(mask, &regs->outbound_intr_mask); 226 /* Dummy readl to force pci flush */ 227 readl(&regs->outbound_intr_mask); 228 } ··· 265 266 .fire_cmd = megasas_fire_cmd_ppc, 267 .enable_intr = megasas_enable_intr_ppc, 268 + .disable_intr = megasas_disable_intr_ppc, 269 .clear_intr = megasas_clear_intr_ppc, 270 .read_fw_status_reg = megasas_read_fw_status_reg_ppc, 271 }; ··· 273 * This is the end of set of functions & definitions 274 * specific to ppc (deviceid : 0x60) controllers 275 */ 276 277 /** 278 * megasas_issue_polled - Issues a polling command ··· 1293 /* 1294 * Bring it to READY state; assuming max wait 10 secs 1295 */ 1296 + instance->instancet->disable_intr(instance->reg_set); 1297 writel(MFI_RESET_FLAGS, &instance->reg_set->inbound_doorbell); 1298 1299 max_wait = 10; ··· 1799 /* 1800 * disable the intr before firing the init frame to FW 1801 */ 1802 + instance->instancet->disable_intr(instance->reg_set); 1803 1804 /* 1805 * Issue the init frame in polled mode ··· 2279 megasas_mgmt_info.max_index--; 2280 2281 pci_set_drvdata(pdev, NULL); 2282 + instance->instancet->disable_intr(instance->reg_set); 2283 free_irq(instance->pdev->irq, instance); 2284 2285 megasas_release_mfi(instance); ··· 2409 2410 pci_set_drvdata(instance->pdev, NULL); 2411 2412 + instance->instancet->disable_intr(instance->reg_set); 2413 2414 free_irq(instance->pdev->irq, instance); 2415
+1
drivers/scsi/megaraid/megaraid_sas.h
··· 1049 void (*fire_cmd)(dma_addr_t ,u32 ,struct megasas_register_set __iomem *); 1050 1051 void (*enable_intr)(struct megasas_register_set __iomem *) ; 1052 1053 int (*clear_intr)(struct megasas_register_set __iomem *); 1054
··· 1049 void (*fire_cmd)(dma_addr_t ,u32 ,struct megasas_register_set __iomem *); 1050 1051 void (*enable_intr)(struct megasas_register_set __iomem *) ; 1052 + void (*disable_intr)(struct megasas_register_set __iomem *); 1053 1054 int (*clear_intr)(struct megasas_register_set __iomem *); 1055