On Wed, Sep 14, 2005 at 02:19:43AM -0700, Andrew Morton wrote: > Harald Welte <[email protected]> wrote: > > > > Add new Omnikey Cardman 4040 smartcard reader driver > > > > I see a timer, but I see no del_timer_sync() anywhere. Cannot the timer be > left pending after device shutdown or rmmod? Please see the patch below (against -rc1-mm1): [CM4040] CardMan 4040 Driver Update * Don't initialize variable in bss * Introduce and use function to stop polling timer * Remove unneeded dev_info variable Signed-off-by: Harald Welte <[email protected]> --- a/drivers/char/pcmcia/cm4040_cs.c 2005-09-18 18:56:29.000000000 +0200 +++ b/drivers/char/pcmcia/cm4040_cs.c 2005-09-18 20:17:14.000000000 +0200 @@ -85,8 +85,7 @@ struct timer_list poll_timer; }; -static dev_info_t dev_info = MODULE_NAME; -static dev_link_t *dev_table[CM_MAX_DEV] = { NULL, }; +static dev_link_t *dev_table[CM_MAX_DEV]; #ifndef PCMCIA_DEBUG #define xoutb outb @@ -138,6 +137,11 @@ mod_timer(&dev->poll_timer, jiffies + POLL_PERIOD); } +static void cm4040_stop_poll(struct reader_dev *dev) +{ + del_timer_sync(&dev->poll_timer); +} + static int wait_for_bulk_out_ready(struct reader_dev *dev) { int i, rc; @@ -485,6 +489,8 @@ if (link == NULL) return -ENODEV; + cm4040_stop_poll(dev); + link->open = 0; wake_up(&dev->devq); @@ -627,7 +633,7 @@ link->state |= DEV_SUSPEND; if (link->state & DEV_CONFIG) - pcmcia_release_configuration(link->handle); + pcmcia_release_configuration(p_dev); return 0; } @@ -643,7 +649,6 @@ return 0; } - static void reader_release(dev_link_t *link) { cm4040_reader_release(link->priv); @@ -713,6 +718,8 @@ if (link->state & DEV_CONFIG) reader_release(link); + cm4040_stop_poll(dev); + dev_table[devno] = NULL; kfree(dev); -- - Harald Welte <[email protected]> http://gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)
Attachment:
pgpOZB1LTE98Y.pgp
Description: PGP signature
- References:
- [PATCH 1/2] New Omnikey Cardman 4040 driver
- From: Harald Welte <[email protected]>
- Re: [PATCH 1/2] New Omnikey Cardman 4040 driver
- From: Nish Aravamudan <[email protected]>
- Re: [PATCH 1/2] New Omnikey Cardman 4040 driver
- From: Harald Welte <[email protected]>
- Re: [PATCH 1/2] New Omnikey Cardman 4040 driver
- From: Andrew Morton <[email protected]>
- [PATCH 1/2] New Omnikey Cardman 4040 driver
- Prev by Date: [PATCH] Omnikey CardMan 4000 update
- Next by Date: Re: dell's latitude cdburner problem
- Previous by thread: Re: [PATCH 1/2] New Omnikey Cardman 4040 driver
- Next by thread: [PATCH 2/2] New Omnikey Cardman 4000 driver
- Index(es):