Re: IDE device driver query



Nutty wrote:


Hello to all,

I am doing diagnostic of HDD on the linux 2.6. The challenge we are
facing is the synchronization with the existing ide driver. The kernel
module that we have written directly accesses the ide controller
registers. The restriction is that we cannot make any changes in the
currently running ide driver. But how to make sure that while my module
is writing into a particular sector, the existing driver does not
interfere?
Is there a way to temporarily shutdown the running IDE interface and
resume it once the diagnostics is done?

Thanks & Regards,
-Nutty

Others have said it - don't do it. Unload the driver first.

If you absolutely must, you _may_ be able to catch
an opportune moment when the IDE driver is idle
and disable interrupts on all processors.

You then wait to make sure that any running DMA transfer
is finished.

At this point, you should be able to access the registers,
provided you can restore the state afterwards exactly.
Don't even think of writing to an active filesystem.

Don't do it.

Kind regards,

Iwo

.