diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2008-07-23 13:55:59 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:59 -0400 |
commit | 2207fa5af1507ea018fc95e777276edb1ca5601a (patch) | |
tree | 7e8ee9c8932bb71bc5ef79007ae35b777f8f254c /drivers/ide | |
parent | d7c26ebb5bca284ece9db7311a9e180aabae1922 (diff) |
ide-floppy: use drive->pc_callback instead of pc->callback
It is important that drive->pc_callback is set prior to enabling IRQs on the
device since this is called from the IRQ handler. Otherwise it hurts as I learnt
the hard way from the several "Kernel panic - not synching: Fatal exception in
interrupt" during the weekend :).
The if-else block in the IRQ handler is only temporary so that bisect searches
don't break and it'll be removed after converting the remainder of the drivers.
There should be no functionality change resulting from this patch.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-atapi.c | 10 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 6789b81ea78d..0c4f45247d86 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -31,7 +31,10 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
31 | debug_log("Enter %s - interrupt handler\n", __func__); | 31 | debug_log("Enter %s - interrupt handler\n", __func__); |
32 | 32 | ||
33 | if (pc->flags & PC_FLAG_TIMEDOUT) { | 33 | if (pc->flags & PC_FLAG_TIMEDOUT) { |
34 | pc->callback(drive); | 34 | if (drive->media == ide_floppy) |
35 | drive->pc_callback(drive); | ||
36 | else | ||
37 | pc->callback(drive); | ||
35 | return ide_stopped; | 38 | return ide_stopped; |
36 | } | 39 | } |
37 | 40 | ||
@@ -97,7 +100,10 @@ cmd_finished: | |||
97 | return ide_stopped; | 100 | return ide_stopped; |
98 | } | 101 | } |
99 | /* Command finished - Call the callback function */ | 102 | /* Command finished - Call the callback function */ |
100 | pc->callback(drive); | 103 | if (drive->media == ide_floppy) |
104 | drive->pc_callback(drive); | ||
105 | else | ||
106 | pc->callback(drive); | ||
101 | return ide_stopped; | 107 | return ide_stopped; |
102 | } | 108 | } |
103 | 109 | ||
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 62be2b27f236..44b53896f105 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -354,7 +354,6 @@ static void idefloppy_init_pc(struct ide_atapi_pc *pc) | |||
354 | memset(pc, 0, sizeof(*pc)); | 354 | memset(pc, 0, sizeof(*pc)); |
355 | pc->buf = pc->pc_buf; | 355 | pc->buf = pc->pc_buf; |
356 | pc->buf_size = IDEFLOPPY_PC_BUFFER_SIZE; | 356 | pc->buf_size = IDEFLOPPY_PC_BUFFER_SIZE; |
357 | pc->callback = ide_floppy_callback; | ||
358 | } | 357 | } |
359 | 358 | ||
360 | static void idefloppy_create_request_sense_cmd(struct ide_atapi_pc *pc) | 359 | static void idefloppy_create_request_sense_cmd(struct ide_atapi_pc *pc) |
@@ -474,7 +473,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive, | |||
474 | pc->error = IDEFLOPPY_ERROR_GENERAL; | 473 | pc->error = IDEFLOPPY_ERROR_GENERAL; |
475 | 474 | ||
476 | floppy->failed_pc = NULL; | 475 | floppy->failed_pc = NULL; |
477 | pc->callback(drive); | 476 | drive->pc_callback(drive); |
478 | return ide_stopped; | 477 | return ide_stopped; |
479 | } | 478 | } |
480 | 479 | ||
@@ -1040,6 +1039,7 @@ static void idefloppy_setup(ide_drive_t *drive, idefloppy_floppy_t *floppy) | |||
1040 | 1039 | ||
1041 | *((u16 *) &gcw) = drive->id->config; | 1040 | *((u16 *) &gcw) = drive->id->config; |
1042 | floppy->pc = floppy->pc_stack; | 1041 | floppy->pc = floppy->pc_stack; |
1042 | drive->pc_callback = ide_floppy_callback; | ||
1043 | 1043 | ||
1044 | if (((gcw[0] & 0x60) >> 5) == 1) | 1044 | if (((gcw[0] & 0x60) >> 5) == 1) |
1045 | floppy->flags |= IDEFLOPPY_FLAG_DRQ_INTERRUPT; | 1045 | floppy->flags |= IDEFLOPPY_FLAG_DRQ_INTERRUPT; |