From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: root@chaos.analogic.com
Cc: davej@suse.de, Alan Cox <alan@redhat.com>,
becker@scyld.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Hamachi not doing pci_enable before reading resources
Date: Wed, 07 Feb 2001 15:05:56 -0500 [thread overview]
Message-ID: <3A81AAA4.318BCD4E@mandrakesoft.com> (raw)
In-Reply-To: <Pine.LNX.3.95.1010207144124.1258B-100000@chaos.analogic.com>
"Richard B. Johnson" wrote:
> A PCI device does not and should not be enabled to probe for resources!
Some PCI devices do not -have- resources until pci_enable_device() is
called, hence the rule.
> It is only devices that have BIOS that require the device to be enabled
> for memory I/O prior to downloading the BIOS into RAM. The BARs are
> read/writable (and are required to be), even when the Mem/I/O bits
> in the cmd/status register are clear.
>
> This is a required condition! You certainly don't want to write all
> ones to a decode (to find the resource length) of a live, on-line chip!
> If the chip hickups (think network chips connected to networks, on a
> warm-boot), you will trash lots of stuff in memory.
When writing 0xFFFFFFFF to a BAR to find its length, you must disable IO
and MEM decoding. This is a ideally what we should be doing anyway..
But you can re-enabling decoding once region size detection is
complete. AND. Region sizing only occurs once, and the value is cached
in dev->resource[], so it should not be occurring all over again, even
if pci_enable_device() is called.
> It looks as though you are "fixing" drivers that are not broken and,
> in fact, are trying to do the right thing. Maybe the PCI code in the
> kernel is preventing access to resources unless the device has been
> enabled??? If so, it's broken and should be fixed, instead of all
> the drivers.
wrong, you just missed this new "rule"...
Jeff
--
Jeff Garzik | "You see, in this world there's two kinds of
Building 1024 | people, my friend: Those with loaded guns
MandrakeSoft | and those who dig. You dig." --Blondie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2001-02-07 20:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-07 19:17 [PATCH] Hamachi not doing pci_enable before reading resources davej
2001-02-07 19:23 ` Jeff Garzik
2001-02-07 19:50 ` Richard B. Johnson
2001-02-07 20:05 ` Jeff Garzik [this message]
2001-02-07 20:30 ` Richard B. Johnson
2001-02-07 20:42 ` Alan Cox
2001-02-07 20:50 ` Gérard Roudier
2001-02-07 22:18 ` Richard B. Johnson
-- strict thread matches above, loose matches on Subject: below --
2001-02-07 19:43 davej
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=3A81AAA4.318BCD4E@mandrakesoft.com \
--to=jgarzik@mandrakesoft.com \
--cc=alan@redhat.com \
--cc=becker@scyld.com \
--cc=davej@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=root@chaos.analogic.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