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