From: Ralf Baechle <ralf@linux-mips.org>
To: Tony <tony.uestc@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: MOD_INC_USE_COUNT
Date: Tue, 15 Nov 2005 15:34:44 +0000 [thread overview]
Message-ID: <20051115153444.GB15733@linux-mips.org> (raw)
In-Reply-To: <43795C71.6070108@gmail.com>
On Tue, Nov 15, 2005 at 11:56:33AM +0800, Tony wrote:
> >Not strange at all. The typical network driver is implemented using
> >pci_register_driver which will set the owner filed of the driver's struct
> >driver which then is being used for internal reference counting. Other
> >busses or line disciplines (SLIP, PPP, AX.25 ...) need to do the equivalent
> >or the kernel will believe reference counting isn't necessary and it's
> >ok to unload the module at any time.
> >
> >In which driver did you hit this problem?
> >
> > Ralf
> >
> I have a radio connected to host using ethernet. I'm writing a radio
> driver that masquerade radio as a NIC. when the module is loaded, I just
> register_netdev a net_device struct, while unregister_netdev at module
> cleanup.
register_netdev / unregister_netdev don't deal with the .owner stuff, so
your bug isn't there. If your NIC is a PCI card, it should register it's
driver through pci_register_driver which would deal with the necessary
reference counting. If it's implemented as a platform device you're
presumably calling driver_register() before platform_device_register() and
driver_register() would do the necessary magic for you. If you're using a
different bus it may have it's own variant of driver_register which you
should call. If you don't, you have a problem :-)
Ralf
next prev parent reply other threads:[~2005-11-15 15:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-10 13:14 MOD_INC_USE_COUNT Tony
2005-11-10 14:03 ` MOD_INC_USE_COUNT linux-os (Dick Johnson)
2005-11-10 14:21 ` MOD_INC_USE_COUNT Tony
2005-11-10 15:28 ` MOD_INC_USE_COUNT linux-os (Dick Johnson)
2005-11-13 10:29 ` MOD_INC_USE_COUNT Ralf Baechle
2005-11-15 3:56 ` MOD_INC_USE_COUNT Tony
2005-11-15 15:34 ` Ralf Baechle [this message]
2005-11-16 7:39 ` MOD_INC_USE_COUNT Tony
2005-11-16 13:24 ` MOD_INC_USE_COUNT Ralf Baechle
2005-11-15 18:52 ` MOD_INC_USE_COUNT Stephen Hemminger
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=20051115153444.GB15733@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.uestc@gmail.com \
/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