mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zwane Mwaikambo <zwane@arm.linux.org.uk>
To: Davide Rossetti <davide.rossetti@roma1.infn.it>
Cc: linux-kernel@vger.kernel.org
Subject: Re: rmmod while module is in use
Date: Thu, 17 Feb 2005 07:40:48 -0700 (MST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0502170739530.26742@montezuma.fsmlabs.com> (raw)
In-Reply-To: <4214926B.3030707@roma1.infn.it>

On Thu, 17 Feb 2005, Davide Rossetti wrote:

> maybe RTFM...
> a module:
> - char device driver for..
> - a PCI device
> 
> any clue as to how to protect from module unloading while there is still some
> process opening it??? have I to sleep in the remove_one() pci driver function
> till last process closes its file descriptor???
> 
> static void __devexit apedev_remove_one(struct pci_dev *pdev)
> {
>    ApeDev* apedev = pci_get_drvdata(pdev);
> 
>    if(test_bit(APEDEV_FLAG_OPEN, &apedev->flags)) {
>        PERROR("still open flag on!!! (flags=0x%08x)\n", apedev->flags);
> 
>        // sleep here till it gets closed...
> 
>    }
>    ...
> }
> 
> static struct pci_driver apedev_driver = {
>    .name     =  DEVNAME,
>    .id_table =  apedev_pci_tbl,
>    .probe    =  apedev_init_one,
>    .remove   =  __devexit_p(apedev_remove_one),
> };

Add .module = THIS_MODULE to your file_operations.


  parent reply	other threads:[~2005-02-17 14:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-17 12:47 Davide Rossetti
2005-02-17 13:04 ` linux-os
2005-02-17 13:11 ` Sean Neakums
2005-02-17 14:40 ` Zwane Mwaikambo [this message]
2005-02-17 14:48   ` Zwane Mwaikambo

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=Pine.LNX.4.61.0502170739530.26742@montezuma.fsmlabs.com \
    --to=zwane@arm.linux.org.uk \
    --cc=davide.rossetti@roma1.infn.it \
    --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

all inboxes | Powered by JetHome®