public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: James Courtier-Dutton <James@superbug.co.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Cross platform method for detecting hot unplug in irq handler
Date: Sun, 23 Jul 2006 11:30:01 -0700	[thread overview]
Message-ID: <20060723113001.3fdd426d.akpm@osdl.org> (raw)
In-Reply-To: <44C37565.6090009@superbug.co.uk>

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.

      reply	other threads:[~2006-07-23 18:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060723113001.3fdd426d.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=James@superbug.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox