diff options
author | Mark Haverkamp <markh@osdl.org> | 2005-08-03 18:39:01 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-08-05 17:51:11 -0400 |
commit | bd1aac809ddbcf7772cfd809d8cfb29c729c6cf9 (patch) | |
tree | 7ec25f58f22929ee48495addf8facda797668852 /drivers/scsi/aacraid/sa.c | |
parent | c7f476023f57145357df32346b7de9202ce47d5f (diff) |
[SCSI] aacraid: driver shutdown method
Add in pci shutdown method so that the adapter shuts down correctly and
flushes its cache. Shutdown should also disable the adapter's interrupt
when shutdown (in particularly if the driver is rmmod'd) to prevent
spurious hardware activities.
Signed-off-by: Mark Haverkamp <markh@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/sa.c')
-rw-r--r-- | drivers/scsi/aacraid/sa.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c index 0680249ab861..3900abc5850d 100644 --- a/drivers/scsi/aacraid/sa.c +++ b/drivers/scsi/aacraid/sa.c | |||
@@ -82,6 +82,16 @@ static irqreturn_t aac_sa_intr(int irq, void *dev_id, struct pt_regs *regs) | |||
82 | } | 82 | } |
83 | 83 | ||
84 | /** | 84 | /** |
85 | * aac_sa_disable_interrupt - disable interrupt | ||
86 | * @dev: Which adapter to enable. | ||
87 | */ | ||
88 | |||
89 | static void aac_sa_disable_interrupt (struct aac_dev *dev) | ||
90 | { | ||
91 | sa_writew(dev, SaDbCSR.PRISETIRQMASK, 0xffff); | ||
92 | } | ||
93 | |||
94 | /** | ||
85 | * aac_sa_notify_adapter - handle adapter notification | 95 | * aac_sa_notify_adapter - handle adapter notification |
86 | * @dev: Adapter that notification is for | 96 | * @dev: Adapter that notification is for |
87 | * @event: Event to notidy | 97 | * @event: Event to notidy |
@@ -214,9 +224,8 @@ static int sa_sync_cmd(struct aac_dev *dev, u32 command, | |||
214 | 224 | ||
215 | static void aac_sa_interrupt_adapter (struct aac_dev *dev) | 225 | static void aac_sa_interrupt_adapter (struct aac_dev *dev) |
216 | { | 226 | { |
217 | u32 ret; | ||
218 | sa_sync_cmd(dev, BREAKPOINT_REQUEST, 0, 0, 0, 0, 0, 0, | 227 | sa_sync_cmd(dev, BREAKPOINT_REQUEST, 0, 0, 0, 0, 0, 0, |
219 | &ret, NULL, NULL, NULL, NULL); | 228 | NULL, NULL, NULL, NULL, NULL); |
220 | } | 229 | } |
221 | 230 | ||
222 | /** | 231 | /** |
@@ -352,10 +361,18 @@ int aac_sa_init(struct aac_dev *dev) | |||
352 | */ | 361 | */ |
353 | 362 | ||
354 | dev->a_ops.adapter_interrupt = aac_sa_interrupt_adapter; | 363 | dev->a_ops.adapter_interrupt = aac_sa_interrupt_adapter; |
364 | dev->a_ops.adapter_disable_int = aac_sa_disable_interrupt; | ||
355 | dev->a_ops.adapter_notify = aac_sa_notify_adapter; | 365 | dev->a_ops.adapter_notify = aac_sa_notify_adapter; |
356 | dev->a_ops.adapter_sync_cmd = sa_sync_cmd; | 366 | dev->a_ops.adapter_sync_cmd = sa_sync_cmd; |
357 | dev->a_ops.adapter_check_health = aac_sa_check_health; | 367 | dev->a_ops.adapter_check_health = aac_sa_check_health; |
358 | 368 | ||
369 | /* | ||
370 | * First clear out all interrupts. Then enable the one's that | ||
371 | * we can handle. | ||
372 | */ | ||
373 | sa_writew(dev, SaDbCSR.PRISETIRQMASK, 0xffff); | ||
374 | sa_writew(dev, SaDbCSR.PRICLEARIRQMASK, (PrintfReady | DOORBELL_1 | | ||
375 | DOORBELL_2 | DOORBELL_3 | DOORBELL_4)); | ||
359 | 376 | ||
360 | if(aac_init_adapter(dev) == NULL) | 377 | if(aac_init_adapter(dev) == NULL) |
361 | goto error_irq; | 378 | goto error_irq; |
@@ -381,6 +398,7 @@ error_kfree: | |||
381 | kfree(dev->queues); | 398 | kfree(dev->queues); |
382 | 399 | ||
383 | error_irq: | 400 | error_irq: |
401 | sa_writew(dev, SaDbCSR.PRISETIRQMASK, 0xffff); | ||
384 | free_irq(dev->scsi_host_ptr->irq, (void *)dev); | 402 | free_irq(dev->scsi_host_ptr->irq, (void *)dev); |
385 | 403 | ||
386 | error_iounmap: | 404 | error_iounmap: |