2.6.4-rc-bk3: hdparm -X locks up IDE

From: Denis Vlasenko
Date: Thu Mar 11 2004 - 09:32:55 EST


I discovered that hdparm -X <mode> /dev/hda can lock up IDE
interface if there is some activity.

I walked up from via driver's handler for it:

via_set_speed(): directly programs IDE controller timings.

via_set_drive -> via_set_speed

via82cxxx_tune_drive -> via_set_drive
via82cxxx_ide_dma_check -> via_set_drive

init_hwif_via82cxxx:
hwif->tuneproc = &via82cxxx_tune_drive;
hwif->speedproc = &via_set_drive;
...
hwif->ide_dma_check = &via82cxxx_ide_dma_check;

I think via_set_drive is eventually gets called
by hdparm -X, not other two functions.

ide_set_xfer_rate -> HWIF(drive)->speedproc

pre_reset -> check_dma_crc -> ide_set_xfer_rate

set_xfer_rate -> ide_set_xfer_rate

void ide_add_generic_settings(drive):
...
ide_add_setting(drive, "current_speed", SETTING_RW,
-1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->current_speed,
set_xfer_rate);
^^^^^^^^^^^^^

Seems like there is no locking protecting mode change.
--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/