From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Greg Kroah-Hartman <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Document pci_disable_device()
Date: Tue, 3 Aug 2004 14:26:29 -0600 [thread overview]
Message-ID: <200408031426.29228.bjorn.helgaas@hp.com> (raw)
Add documentation for pci_disable_device(). We don't actually
deallocate IRQ resources in pci_disable_device() yet, but I suspect
we'll need to do so soon.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
===== Documentation/pci.txt 1.12 vs edited =====
--- 1.12/Documentation/pci.txt 2004-06-11 15:09:58 -06:00
+++ edited/Documentation/pci.txt 2004-08-03 14:20:22 -06:00
@@ -25,6 +25,7 @@
Discover resources (addresses and IRQ numbers) provided by the device
Allocate these resources
Communicate with the device
+ Disable the device
Most of these topics are covered by the following sections, for the rest
look at <linux/pci.h>, it's hopefully well commented.
@@ -162,8 +163,8 @@
count on these devices by calling pci_dev_put().
-3. Enabling devices
-~~~~~~~~~~~~~~~~~~~
+3. Enabling and disabling devices
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Before you do anything with the device you've found, you need to enable
it by calling pci_enable_device() which enables I/O and memory regions of
the device, allocates an IRQ if necessary, assigns missing resources if
@@ -179,6 +180,12 @@
and also ensures that the cache line size register is set correctly.
Make sure to check the return value of pci_set_mwi(), not all architectures
may support Memory-Write-Invalidate.
+
+ If your driver decides to stop using the device (e.g., there was an
+error while setting it up or the driver module is being unloaded), it
+should call pci_disable_device() to deallocate any IRQ resources, disable
+PCI bus-mastering, etc. You should not do anything with the device after
+calling pci_disable_device().
4. How to access PCI config space
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next reply other threads:[~2004-08-03 20:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-03 20:26 Bjorn Helgaas [this message]
2004-08-05 22:41 ` Greg KH
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=200408031426.29228.bjorn.helgaas@hp.com \
--to=bjorn.helgaas@hp.com \
--cc=greg@kroah.com \
--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®