diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-05-26 21:54:27 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-05-26 21:54:27 -0400 |
commit | aa8f0dc6c3dbf1cf3ff58f3e945c981be134814d (patch) | |
tree | 3e343cd5493d442d1a26dc7a421422d84698831e /drivers/scsi/sata_qstor.c | |
parent | bef9c558841604116704e10b3d9ff3dbf4939423 (diff) |
libata: Fix use-after-iounmap
Jens Axboe pointed out that the iounmap() call in libata was occurring
too early, and some drivers (ahci, probably others) were using ioremap'd
memory after it had been unmapped.
The patch should address that problem by way of improving the libata
driver API:
* move ->host_stop() call after all ->port_stop() calls have occurred.
* create default helper function ata_host_stop(), and move iounmap()
call there.
* add ->host_stop_prewalk() hook, use it in sata_qstor.c (hi Mark).
sata_qstor appears to require the host-stop-before-port-stop ordering
that existed prior to applying the attached patch.
Diffstat (limited to 'drivers/scsi/sata_qstor.c')
-rw-r--r-- | drivers/scsi/sata_qstor.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c index dfd362104717..1383e8a28d72 100644 --- a/drivers/scsi/sata_qstor.c +++ b/drivers/scsi/sata_qstor.c | |||
@@ -536,6 +536,8 @@ static void qs_host_stop(struct ata_host_set *host_set) | |||
536 | 536 | ||
537 | writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */ | 537 | writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */ |
538 | writeb(QS_CNFG3_GSRST, mmio_base + QS_HCF_CNFG3); /* global reset */ | 538 | writeb(QS_CNFG3_GSRST, mmio_base + QS_HCF_CNFG3); /* global reset */ |
539 | |||
540 | ata_host_stop(host_set); | ||
539 | } | 541 | } |
540 | 542 | ||
541 | static void qs_host_init(unsigned int chip_id, struct ata_probe_ent *pe) | 543 | static void qs_host_init(unsigned int chip_id, struct ata_probe_ent *pe) |