Commit b445c568 authored by Jeff Garzik's avatar Jeff Garzik

[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: default avatarJeff Garzik <jgarzik@redhat.com>
parent 931506d3
...@@ -1694,12 +1694,17 @@ void ata_scsi_rbuf_fill(struct ata_scsi_args *args, ...@@ -1694,12 +1694,17 @@ void ata_scsi_rbuf_fill(struct ata_scsi_args *args,
u8 *rbuf; u8 *rbuf;
unsigned int buflen, rc; unsigned int buflen, rc;
struct scsi_cmnd *cmd = args->cmd; struct scsi_cmnd *cmd = args->cmd;
unsigned long flags;
local_irq_save(flags);
buflen = ata_scsi_rbuf_get(cmd, &rbuf); buflen = ata_scsi_rbuf_get(cmd, &rbuf);
memset(rbuf, 0, buflen); memset(rbuf, 0, buflen);
rc = actor(args, rbuf, buflen); rc = actor(args, rbuf, buflen);
ata_scsi_rbuf_put(cmd, rbuf); ata_scsi_rbuf_put(cmd, rbuf);
local_irq_restore(flags);
if (rc == 0) if (rc == 0)
cmd->result = SAM_STAT_GOOD; cmd->result = SAM_STAT_GOOD;
args->done(cmd); args->done(cmd);
...@@ -2473,6 +2478,9 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc) ...@@ -2473,6 +2478,9 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
if ((scsicmd[0] == INQUIRY) && ((scsicmd[1] & 0x03) == 0)) { if ((scsicmd[0] == INQUIRY) && ((scsicmd[1] & 0x03) == 0)) {
u8 *buf = NULL; u8 *buf = NULL;
unsigned int buflen; unsigned int buflen;
unsigned long flags;
local_irq_save(flags);
buflen = ata_scsi_rbuf_get(cmd, &buf); buflen = ata_scsi_rbuf_get(cmd, &buf);
...@@ -2490,6 +2498,8 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc) ...@@ -2490,6 +2498,8 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc)
} }
ata_scsi_rbuf_put(cmd, buf); ata_scsi_rbuf_put(cmd, buf);
local_irq_restore(flags);
} }
cmd->result = SAM_STAT_GOOD; cmd->result = SAM_STAT_GOOD;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment