diff options
Diffstat (limited to 'drivers/scsi/aacraid/sa.c')
-rw-r--r-- | drivers/scsi/aacraid/sa.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c index 511b0a938fb1..8535db068c2f 100644 --- a/drivers/scsi/aacraid/sa.c +++ b/drivers/scsi/aacraid/sa.c | |||
@@ -92,6 +92,17 @@ static void aac_sa_disable_interrupt (struct aac_dev *dev) | |||
92 | } | 92 | } |
93 | 93 | ||
94 | /** | 94 | /** |
95 | * aac_sa_enable_interrupt - enable interrupt | ||
96 | * @dev: Which adapter to enable. | ||
97 | */ | ||
98 | |||
99 | static void aac_sa_enable_interrupt (struct aac_dev *dev) | ||
100 | { | ||
101 | sa_writew(dev, SaDbCSR.PRICLEARIRQMASK, (PrintfReady | DOORBELL_1 | | ||
102 | DOORBELL_2 | DOORBELL_3 | DOORBELL_4)); | ||
103 | } | ||
104 | |||
105 | /** | ||
95 | * aac_sa_notify_adapter - handle adapter notification | 106 | * aac_sa_notify_adapter - handle adapter notification |
96 | * @dev: Adapter that notification is for | 107 | * @dev: Adapter that notification is for |
97 | * @event: Event to notidy | 108 | * @event: Event to notidy |
@@ -347,32 +358,36 @@ int aac_sa_init(struct aac_dev *dev) | |||
347 | msleep(1); | 358 | msleep(1); |
348 | } | 359 | } |
349 | 360 | ||
350 | if (request_irq(dev->scsi_host_ptr->irq, aac_sa_intr, IRQF_SHARED|IRQF_DISABLED, "aacraid", (void *)dev ) < 0) { | ||
351 | printk(KERN_WARNING "%s%d: Interrupt unavailable.\n", name, instance); | ||
352 | goto error_iounmap; | ||
353 | } | ||
354 | |||
355 | /* | 361 | /* |
356 | * Fill in the function dispatch table. | 362 | * Fill in the function dispatch table. |
357 | */ | 363 | */ |
358 | 364 | ||
359 | dev->a_ops.adapter_interrupt = aac_sa_interrupt_adapter; | 365 | dev->a_ops.adapter_interrupt = aac_sa_interrupt_adapter; |
360 | dev->a_ops.adapter_disable_int = aac_sa_disable_interrupt; | 366 | dev->a_ops.adapter_disable_int = aac_sa_disable_interrupt; |
367 | dev->a_ops.adapter_enable_int = aac_sa_enable_interrupt; | ||
361 | dev->a_ops.adapter_notify = aac_sa_notify_adapter; | 368 | dev->a_ops.adapter_notify = aac_sa_notify_adapter; |
362 | dev->a_ops.adapter_sync_cmd = sa_sync_cmd; | 369 | dev->a_ops.adapter_sync_cmd = sa_sync_cmd; |
363 | dev->a_ops.adapter_check_health = aac_sa_check_health; | 370 | dev->a_ops.adapter_check_health = aac_sa_check_health; |
371 | dev->a_ops.adapter_intr = aac_sa_intr; | ||
364 | dev->a_ops.adapter_ioremap = aac_sa_ioremap; | 372 | dev->a_ops.adapter_ioremap = aac_sa_ioremap; |
365 | 373 | ||
366 | /* | 374 | /* |
367 | * First clear out all interrupts. Then enable the one's that | 375 | * First clear out all interrupts. Then enable the one's that |
368 | * we can handle. | 376 | * we can handle. |
369 | */ | 377 | */ |
370 | sa_writew(dev, SaDbCSR.PRISETIRQMASK, 0xffff); | 378 | aac_adapter_disable_int(dev); |
371 | sa_writew(dev, SaDbCSR.PRICLEARIRQMASK, (PrintfReady | DOORBELL_1 | | 379 | aac_adapter_enable_int(dev); |
372 | DOORBELL_2 | DOORBELL_3 | DOORBELL_4)); | ||
373 | 380 | ||
374 | if(aac_init_adapter(dev) == NULL) | 381 | if(aac_init_adapter(dev) == NULL) |
375 | goto error_irq; | 382 | goto error_irq; |
383 | if (request_irq(dev->scsi_host_ptr->irq, dev->a_ops.adapter_intr, | ||
384 | IRQF_SHARED|IRQF_DISABLED, | ||
385 | "aacraid", (void *)dev ) < 0) { | ||
386 | printk(KERN_WARNING "%s%d: Interrupt unavailable.\n", | ||
387 | name, instance); | ||
388 | goto error_iounmap; | ||
389 | } | ||
390 | aac_adapter_enable_int(dev); | ||
376 | 391 | ||
377 | /* | 392 | /* |
378 | * Tell the adapter that all is configure, and it can start | 393 | * Tell the adapter that all is configure, and it can start |
@@ -382,7 +397,7 @@ int aac_sa_init(struct aac_dev *dev) | |||
382 | return 0; | 397 | return 0; |
383 | 398 | ||
384 | error_irq: | 399 | error_irq: |
385 | sa_writew(dev, SaDbCSR.PRISETIRQMASK, 0xffff); | 400 | aac_sa_disable_interrupt(dev); |
386 | free_irq(dev->scsi_host_ptr->irq, (void *)dev); | 401 | free_irq(dev->scsi_host_ptr->irq, (void *)dev); |
387 | 402 | ||
388 | error_iounmap: | 403 | error_iounmap: |