* Cross platform method for detecting hot unplug in irq handler
@ 2006-07-23 13:11 James Courtier-Dutton
2006-07-23 18:30 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: James Courtier-Dutton @ 2006-07-23 13:11 UTC (permalink / raw)
To: linux-kernel
Hi,
I am writing a driver for a PCMCIA device.
When the card is removed, the driver's IRQ handler is called.
The first thing the IRQ handler does is read a status register from the
card's IOPORT. On the ia32 (i386) platform, the resulting status read
will return 0xffffffff. If the driver reads this value, it assumes the
card has been removed and acts accordingly.
Is this a reliable way of detecting PCMCIA or Hotplug card removal
inside an IRQ handler?
Is it consistent cross platforms. E.g. ia64, amd64, PPC, MIPS etc.?
Does a more reliable detection method exist in the kernel?
James
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Cross platform method for detecting hot unplug in irq handler
2006-07-23 13:11 Cross platform method for detecting hot unplug in irq handler James Courtier-Dutton
@ 2006-07-23 18:30 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2006-07-23 18:30 UTC (permalink / raw)
To: James Courtier-Dutton; +Cc: linux-kernel
On Sun, 23 Jul 2006 14:11:01 +0100
James Courtier-Dutton <James@superbug.co.uk> wrote:
> Hi,
>
> I am writing a driver for a PCMCIA device.
> When the card is removed, the driver's IRQ handler is called.
> The first thing the IRQ handler does is read a status register from the
> card's IOPORT. On the ia32 (i386) platform, the resulting status read
> will return 0xffffffff. If the driver reads this value, it assumes the
> card has been removed and acts accordingly.
>
> Is this a reliable way of detecting PCMCIA or Hotplug card removal
> inside an IRQ handler?
> Is it consistent cross platforms. E.g. ia64, amd64, PPC, MIPS etc.?
> Does a more reliable detection method exist in the kernel?
Cardbus has detection pins, ad they can be queried via the controller. But
it's too slow and afaik cardbus will reliably rern 0xffffffff for a removed
card.
Lots of drivers treat a read of all-ones as indicating a removed card. It
works.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-07-23 18:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-23 13:11 Cross platform method for detecting hot unplug in irq handler James Courtier-Dutton
2006-07-23 18:30 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox