diff options
author | Grant Grundler <grundler@parisc-linux.org> | 2006-06-01 13:15:59 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 15:00:00 -0400 |
commit | 733a7fe12248072e1bca729c88a26298666f1956 (patch) | |
tree | 059c803091394a3a61a6c4537a4eaa3f5426fa5f | |
parent | f7e6600d762bf7c04b48c8d9bd0ab26d04a8d11f (diff) |
[PATCH] PCI: clean up pci documentation to be more specific
On Thu, Jun 01, 2006 at 02:46:11AM -0700, Rajesh Shah wrote:
> This patch assumes that pci_request_region() will always be called
> after pci_enable_device() and pci_release_region() will always
> be called before pci_disable_device(). We cannot make this
> assumption,since it's perfectly legal to disable a device
> first and then release it's regions. So, I think that patch
> needs to change.
Patch below clarifies comments in Documentation/pci.txt.
Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | Documentation/pci.txt | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Documentation/pci.txt b/Documentation/pci.txt index 66bbbf1d1ef6..3242e5c1ee9c 100644 --- a/Documentation/pci.txt +++ b/Documentation/pci.txt | |||
@@ -213,9 +213,17 @@ have been remapped by the kernel. | |||
213 | 213 | ||
214 | See Documentation/IO-mapping.txt for how to access device memory. | 214 | See Documentation/IO-mapping.txt for how to access device memory. |
215 | 215 | ||
216 | You still need to call request_region() for I/O regions and | 216 | The device driver needs to call pci_request_region() to make sure |
217 | request_mem_region() for memory regions to make sure nobody else is using the | 217 | no other device is already using the same resource. The driver is expected |
218 | same device. | 218 | to determine MMIO and IO Port resource availability _before_ calling |
219 | pci_enable_device(). Conversely, drivers should call pci_release_region() | ||
220 | _after_ calling pci_disable_device(). The idea is to prevent two devices | ||
221 | colliding on the same address range. | ||
222 | |||
223 | Generic flavors of pci_request_region() are request_mem_region() | ||
224 | (for MMIO ranges) and request_region() (for IO Port ranges). | ||
225 | Use these for address resources that are not described by "normal" PCI | ||
226 | interfaces (e.g. BAR). | ||
219 | 227 | ||
220 | All interrupt handlers should be registered with SA_SHIRQ and use the devid | 228 | All interrupt handlers should be registered with SA_SHIRQ and use the devid |
221 | to map IRQs to devices (remember that all PCI interrupts are shared). | 229 | to map IRQs to devices (remember that all PCI interrupts are shared). |