diff options
author | Jeff Garzik <jeff@garzik.org> | 2008-02-29 19:10:51 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-02-29 19:10:51 -0500 |
commit | b445c56815d84b9fce40707f99811bdc354458e0 (patch) | |
tree | f8e9e9137a11417f4bfd422245d251d13a8f2177 /drivers/ata/libata-scsi.c | |
parent | 931506d3b2208362efc678ee863ee42a90755e89 (diff) |
[libata] wrap kmap_atomic(KM_IRQ0) with local_irq_save/restore()
Interrupts must be disabled if using kmap_atomic(KM_IRQ0), but that was
not the case in a few code paths coming directly from ATA driver
interrupt handlers (which use spin_lock rather than spin_lock_irqsave).
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 0562b0a49f3b..7b1f1ee8131d 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -1694,12 +1694,17 @@ void ata_scsi_rbuf_fill(struct ata_scsi_args *args, | |||
1694 | u8 *rbuf; | 1694 | u8 *rbuf; |
1695 | unsigned int buflen, rc; | 1695 | unsigned int buflen, rc; |
1696 | struct scsi_cmnd *cmd = args->cmd; | 1696 | struct scsi_cmnd *cmd = args->cmd; |
1697 | unsigned long flags; | ||
1698 | |||
1699 | local_irq_save(flags); | ||
1697 | 1700 | ||
1698 | buflen = ata_scsi_rbuf_get(cmd, &rbuf); | 1701 | buflen = ata_scsi_rbuf_get(cmd, &rbuf); |
1699 | memset(rbuf, 0, buflen); | 1702 | memset(rbuf, 0, buflen); |
1700 | rc = actor(args, rbuf, buflen); | 1703 | rc = actor(args, rbuf, buflen); |
1701 | ata_scsi_rbuf_put(cmd, rbuf); | 1704 | ata_scsi_rbuf_put(cmd, rbuf); |
1702 | 1705 | ||
1706 | local_irq_restore(flags); | ||
1707 | |||
1703 | if (rc == 0) | 1708 | if (rc == 0) |
1704 | cmd->result = SAM_STAT_GOOD; | 1709 | cmd->result = SAM_STAT_GOOD; |
1705 | args->done(cmd); | 1710 | args->done(cmd); |
@@ -2473,6 +2478,9 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc) | |||
2473 | if ((scsicmd[0] == INQUIRY) && ((scsicmd[1] & 0x03) == 0)) { | 2478 | if ((scsicmd[0] == INQUIRY) && ((scsicmd[1] & 0x03) == 0)) { |
2474 | u8 *buf = NULL; | 2479 | u8 *buf = NULL; |
2475 | unsigned int buflen; | 2480 | unsigned int buflen; |
2481 | unsigned long flags; | ||
2482 | |||
2483 | local_irq_save(flags); | ||
2476 | 2484 | ||
2477 | buflen = ata_scsi_rbuf_get(cmd, &buf); | 2485 | buflen = ata_scsi_rbuf_get(cmd, &buf); |
2478 | 2486 | ||
@@ -2490,6 +2498,8 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc) | |||
2490 | } | 2498 | } |
2491 | 2499 | ||
2492 | ata_scsi_rbuf_put(cmd, buf); | 2500 | ata_scsi_rbuf_put(cmd, buf); |
2501 | |||
2502 | local_irq_restore(flags); | ||
2493 | } | 2503 | } |
2494 | 2504 | ||
2495 | cmd->result = SAM_STAT_GOOD; | 2505 | cmd->result = SAM_STAT_GOOD; |