netdev
[Top] [All Lists]

Re: Hot-plug for pcnet32 ?

To: Don Fry <brazilnut@xxxxxxxxxx>
Subject: Re: Hot-plug for pcnet32 ?
From: Donald Becker <becker@xxxxxxxxx>
Date: Mon, 19 Jan 2004 12:29:59 -0500 (EST)
Cc: linux-net@xxxxxxxxxxxxxxx, <netdev@xxxxxxxxxxx>
In-reply-to: <200401191614.i0JGE9p10337@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Mon, 19 Jan 2004, Don Fry wrote:
> > > Any chance that anyone is thinking of adding hot-plug support
> > > to the pcnet32 driver? 
> Here is a repeat of a patch to enable PCI Hot Plug for pcnet32.

Errrmmm, you need to much more than that!

Here are a few rules for writing hotremove-safe drivers:

   Don't count on "remove interrupts": hardware may disappear at any time.
   Always check for 0xffffffff when starting a new hardware operation.
   This may usually be done very efficiently: in an interrupt handler
   check for all error status bits with a mask, and in the error
   handling routine check for missing hardware.

   Analyze the transmit routine routine.  In many cases the driver can
   "just assume everything will according to plan and leave the room".
   But if the driver reads from the hardware, it presumably depends on
   the value and should check for missing hardware.

   Don't forget statistics and ioctl() routines when checking for
   missing hardware.

   Never have unlimited loops.  Always use an explicit loop limit
   (e.g. 'boguscnt=1000' or 'work_limit=20') rather than rely on the
   value in a hardware register changing.


-- 
Donald Becker                           becker@xxxxxxxxx
Scyld Computing Corporation             http://www.scyld.com
914 Bay Ridge Road, Suite 220           Scyld Beowulf cluster systems
Annapolis MD 21403                      410-990-9993


<Prev in Thread] Current Thread [Next in Thread>