We are testing a utility which reads from a hard drive by issuing direct ATA commands. One of the tests involves reading bad sectors. After the attempt to read a bad sector, Linux seems to disable direct ATA access and further, any utilities which try to access hard drive directly, fail. For example:

hparm -I /dev/hda returns
HDIO_DRIVE_CMD(identify) failed: Input/output error

and dmesg log is:
hda: drive not ready for command
hda: status error: status=0x59 { DriveReady SeekComplete DataRequest Error }
hda: status error: error=0x40 { UncorrectableError }, LBAsect=550, high=0, low=550, sector=0
Direct ATA access can only be regained after disk is reset with hdparm -w command
Is it possible to set up the kernel not to disable direct ATA access after reading a bad sector? Or may problem is not in the kernel?

Linux kernel is 2.6.22