All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Manfred Spraul <manfred@colorfullife.com>,
	ktech@wanadoo.es,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.7-rc1 breaks forcedeth
Date: Sun, 06 Jun 2004 14:13:43 -0400	[thread overview]
Message-ID: <40C35ED7.1080000@pobox.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0406060957410.7010@ppc970.osdl.org>

Linus Torvalds wrote:
> But it's usually a good thing to try to reset a device as much as possible 
> when you probe for it. If for no other reason than the fact that then 
> you'll have it in a "known state", and hopefully there won't be as many 
> surprises..


Strongly agreed.  I stress this, in Linux driver writing talks and 
rants, to whomever will listen as "the proper way to do things in Linux".

Presuming things about a device's state upon entry to the driver has led 
to bugs in the past.  Popular bugs include assuming (a) MAC address 
registers hold a valid/useful value or (b) ethernet NIC's DMA engine is 
not active.  Both of these are quite often not true when you take into 
account driver re-loads, warm reboots, and firmware features such as USB 
kbd/mouse/storage or PXE booting from a network.

A good driver unconditionally makes sure the device is inactive in its 
probe function (struct pci_driver::probe), before registering itself 
with any kernel subsystems.  This must also be done before request_irq 
and before enabling the bus-mastering bit in PCI_COMMAND register.

	Jeff



  reply	other threads:[~2004-06-06 18:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-06  1:59 2.6.7-rc1 breaks forcedeth ktech
2004-06-06  3:14 ` Linus Torvalds
2004-06-06  8:36   ` Manfred Spraul
2004-06-06 17:04     ` Linus Torvalds
2004-06-06 18:13       ` Jeff Garzik [this message]
2004-06-06 18:21   ` Jeff Garzik
2004-06-06 18:32     ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2004-06-16 18:40 David Mansfield
2004-06-06 13:49 jjluza
     [not found] <E1BWxTh-0002dx-KR@mb06.in.mad.eresmas.com>
2004-06-06 13:31 ` Daniel Schmitt
2004-06-06 12:10 ktech
2004-06-06 12:53 ` Vincent van de Camp
2004-06-06 13:40   ` Manfred Spraul
2004-06-06 14:17 ` Manfred Spraul
2004-06-05 23:41 Luis Miguel García Mancebo
2004-06-05 23:50 ` Linus Torvalds
2004-05-31  0:29 jjluza
2004-05-30 17:54 Luis Miguel García Mancebo
2004-05-30 20:47 ` Jeff Garzik
2004-05-30 15:57 Lee Howard
2004-05-30 17:20 ` Jeff Garzik
2004-05-30 22:59   ` Lee Howard

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=40C35ED7.1080000@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=ktech@wanadoo.es \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.