Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146940
b: refs/heads/master
c: e93b9fb
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Apr 28, 2009
1 parent e1165b8 commit a83ef75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7090a0a97f55cbf47547a140fcc5a349f32c598c
refs/heads/master: e93b9fb7d85da4fd9d5171649e5ddcac1dd572bf
17 changes: 7 additions & 10 deletions trunk/drivers/block/hd.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,6 @@ static void write_intr(void)
if (i > 0) {
SET_HANDLER(&write_intr);
outsw(HD_DATA, req->buffer, 256);
local_irq_enable();
} else {
#if (HD_DELAY > 0)
last_req = read_timer();
Expand Down Expand Up @@ -541,8 +540,7 @@ static void hd_times_out(unsigned long dummy)
if (!CURRENT)
return;

disable_irq(HD_IRQ);
local_irq_enable();
spin_lock_irq(hd_queue->queue_lock);
reset = 1;
name = CURRENT->rq_disk->disk_name;
printk("%s: timeout\n", name);
Expand All @@ -552,9 +550,8 @@ static void hd_times_out(unsigned long dummy)
#endif
end_request(CURRENT, 0);
}
local_irq_disable();
hd_request();
enable_irq(HD_IRQ);
spin_unlock_irq(hd_queue->queue_lock);
}

static int do_special_op(struct hd_i_struct *disk, struct request *req)
Expand Down Expand Up @@ -592,7 +589,6 @@ static void hd_request(void)
return;
repeat:
del_timer(&device_timer);
local_irq_enable();

req = CURRENT;
if (!req) {
Expand All @@ -601,7 +597,6 @@ static void hd_request(void)
}

if (reset) {
local_irq_disable();
reset_hd();
return;
}
Expand Down Expand Up @@ -660,9 +655,7 @@ static void hd_request(void)

static void do_hd_request(struct request_queue *q)
{
disable_irq(HD_IRQ);
hd_request();
enable_irq(HD_IRQ);
}

static int hd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
Expand All @@ -684,12 +677,16 @@ static irqreturn_t hd_interrupt(int irq, void *dev_id)
{
void (*handler)(void) = do_hd;

spin_lock(hd_queue->queue_lock);

do_hd = NULL;
del_timer(&device_timer);
if (!handler)
handler = unexpected_hd_interrupt;
handler();
local_irq_enable();

spin_unlock(hd_queue->queue_lock);

return IRQ_HANDLED;
}

Expand Down

0 comments on commit a83ef75

Please sign in to comment.