[RFC] pcmcia IRQ handling overhaul
Dominik Brodowski
linux at dominikbrodowski.de
Tue Jan 4 08:02:05 EST 2005
On top of what's in 2.6.10-mm1 I'd like to push a cleanup of IRQ management
done in the PCMCIA subsystem. Currently, it has the following problems and
shortcomings:
- PCMCIA device drivers pass IRQ numbers they'd like to work with. However,
the drivers should only care about the PCMCIA cards, and there's just one
special pin which can be used for IRQ, so the drivers should only say "I want
that IRQ enabled" and not care about the socket and/or platform IRQ handling
or numbering.
- a "dummy" handler is registered first, if the registration succeeds, the
dummy handler is unregistered, and only then a correct handler is registered.
This is racy.
- current /etc/pcmcia/config.opts based exclusion of certain IRQs does not
allow for per-socket manipulation of valid IRQs
Therefore, I've written the patches listed below. Review and comments are most
welcome.
Dominik
http://www.kernel.org/pub/linux/kernel/people/brodo/patches/2.6.10/pcmcia-21b-01-remove-irq-type-time
IRQ_TYPE_TIME is unused in the whole kernel, so remove it.
drivers/pcmcia/rsrc_mgr.c | 26 --------------------------
1 files changed, 26 deletions(-)
http://www.kernel.org/pub/linux/kernel/people/brodo/patches/2.6.10/pcmcia-21b-02-ignore-driver-irq-mask
As its just one pin which can be used for IRQs on PCMCIA/CardBus cards,
and only the _socket drivers_ care with which IRQ this pin is connected,
only the socket drivers (assisted by the PCCARD core) should care about which
IRQ to use. Therefore, ignore the information passed to pcmcia_request_irq()
in IRQInfo2. In additional patches, all in-kernel users of IRQInfo2 will
be removed; users wishing to influence the usage of IRQs can do so by modifying
several driver's irq_mask parameter and/or by adding "exclude irq 3" to
/etc/pcmcia/config.opts. Note that a new sysfs-based interface to do so
will be added in subsequent patches.
drivers/pcmcia/cs.c | 37 +++++++++++++++----------------------
include/pcmcia/cs.h | 2 +-
2 files changed, 16 insertions(+), 23 deletions(-)
http://www.kernel.org/pub/linux/kernel/people/brodo/patches/2.6.10/pcmcia-21b-03-remove-IRQInfo2-from-drivers
Remove the now useless irq_mask and irq_list parameters from PCMCIA
drivers. Users should use either the socket driver's irq_mask / irq_list
parameter or use /sys/class/pcmcia_socket/pcmcia_socket%n/card_irq_mask
which will be added in a subsequent patch.
drivers/bluetooth/bluecard_cs.c | 17 ++---------------
drivers/bluetooth/bt3c_cs.c | 17 ++---------------
drivers/bluetooth/btuart_cs.c | 17 ++---------------
drivers/bluetooth/dtl1_cs.c | 17 ++---------------
drivers/char/pcmcia/synclink_cs.c | 17 +----------------
drivers/ide/legacy/ide-cs.c | 14 ++------------
drivers/isdn/hardware/avm/avm_cs.c | 21 ++-------------------
drivers/isdn/hisax/avma1_cs.c | 16 +++-------------
drivers/isdn/hisax/elsa_cs.c | 19 ++-----------------
drivers/isdn/hisax/sedlbauer_cs.c | 20 +++-----------------
drivers/isdn/hisax/teles_cs.c | 19 ++-----------------
drivers/net/pcmcia/3c574_cs.c | 14 ++------------
drivers/net/pcmcia/3c589_cs.c | 14 ++------------
drivers/net/pcmcia/axnet_cs.c | 14 ++------------
drivers/net/pcmcia/com20020_cs.c | 15 ++-------------
drivers/net/pcmcia/fmvj18x_cs.c | 15 ++-------------
drivers/net/pcmcia/ibmtr_cs.c | 15 ++-------------
drivers/net/pcmcia/nmclan_cs.c | 14 ++------------
drivers/net/pcmcia/pcnet_cs.c | 14 ++------------
drivers/net/pcmcia/smc91c92_cs.c | 14 ++------------
drivers/net/pcmcia/xirc2ps_cs.c | 19 ++-----------------
drivers/net/wireless/airo_cs.c | 17 ++---------------
drivers/net/wireless/atmel_cs.c | 17 ++---------------
drivers/net/wireless/netwave_cs.c | 16 ++--------------
drivers/net/wireless/orinoco_cs.c | 27 +++------------------------
drivers/net/wireless/ray_cs.c | 7 +------
drivers/net/wireless/wavelan_cs.c | 9 ++-------
drivers/net/wireless/wavelan_cs.p.h | 7 -------
drivers/net/wireless/wl3501_cs.c | 16 ++--------------
drivers/parport/parport_cs.c | 14 ++------------
drivers/scsi/pcmcia/aha152x_stub.c | 15 ++-------------
drivers/scsi/pcmcia/fdomain_stub.c | 15 ++-------------
drivers/scsi/pcmcia/nsp_cs.c | 19 ++-----------------
drivers/scsi/pcmcia/qlogic_stub.c | 20 ++------------------
drivers/scsi/pcmcia/sym53c500_cs.c | 22 ++--------------------
drivers/serial/serial_cs.c | 16 ++--------------
sound/pcmcia/pdaudiocf/pdaudiocf.c | 14 +-------------
sound/pcmcia/vx/vx_entry.c | 7 +------
sound/pcmcia/vx/vxpocket.c | 8 --------
sound/pcmcia/vx/vxpocket.h | 2 --
40 files changed, 73 insertions(+), 537 deletions(-)
http://www.kernel.org/pub/linux/kernel/people/brodo/patches/2.6.10/pcmcia-21b-04-use-irq-mask
Unset bits in the per-socket irq_mask to mark IRQs as unusable, if asked
to do so by the user in /etc/pcmcia/config.opts
drivers/pcmcia/rsrc_mgr.c | 84 +++++++++++++++++++---------------------------
1 files changed, 35 insertions(+), 49 deletions(-)
http://www.kernel.org/pub/linux/kernel/people/brodo/patches/2.6.10/pcmcia-21b-05-remove-racy-try-irq
Remove the racy try_irq/check_irq/undo_irq interface, and try to register
the correct handler directly in pcmcia_request_irq(). Also, remove the
unneeded database in rsrc_mgr, as the kernel IRQ subsystem does that for us.
drivers/pcmcia/cs.c | 107 +++++++++++++++++++++-----------------
drivers/pcmcia/cs_internal.h | 2
drivers/pcmcia/rsrc_mgr.c | 118 -------------------------------------------
3 files changed, 59 insertions(+), 168 deletions(-)
http://www.kernel.org/pub/linux/kernel/people/brodo/patches/2.6.10/pcmcia-21b-06-modify-irq-mask-via-sysfs
Allow to modify the per-socket irq_mask via sysfs. Note that you can only
clear bits from the mask, but not re-add bits.
drivers/pcmcia/socket_sysfs.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+)
http://www.kernel.org/pub/linux/kernel/people/brodo/patches/2.6.10/pcmcia-21b-07-remove-unneeded-headers-in-rsrc-mgr
Remove #includes in rsrc_mgr which are no longer needed.
drivers/pcmcia/rsrc_mgr.c | 15 +--------------
1 files changed, 1 insertion(+), 14 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20050104/70e3f5f7/attachment.bin
More information about the linux-pcmcia
mailing list