Loading Documentation/ABI/testing/sysfs-devices-node 0 → 100644 +7 −0 Original line number Diff line number Diff line What: /sys/devices/system/node/nodeX/compact Date: February 2010 Contact: Mel Gorman <mel@csn.ul.ie> Description: When this file is written to, all memory within that node will be compacted. When it completes, memory will be freed into blocks which have as many contiguous pages as possible Documentation/ABI/testing/sysfs-firmware-sfi 0 → 100644 +15 −0 Original line number Diff line number Diff line What: /sys/firmware/sfi/tables/ Date: May 2010 Contact: Len Brown <lenb@kernel.org> Description: SFI defines a number of small static memory tables so the kernel can get platform information from firmware. The tables are defined in the latest SFI specification: http://simplefirmware.org/documentation While the tables are used by the kernel, user-space can observe them this way: # cd /sys/firmware/sfi/tables # cat $TABLENAME > $TABLENAME.bin Documentation/DMA-API-HOWTO.txt +49 −36 Original line number Diff line number Diff line Loading @@ -639,6 +639,36 @@ is planned to completely remove virt_to_bus() and bus_to_virt() as they are entirely deprecated. Some ports already do not provide these as it is impossible to correctly support them. Handling Errors DMA address space is limited on some architectures and an allocation failure can be determined by: - checking if dma_alloc_coherent returns NULL or dma_map_sg returns 0 - checking the returned dma_addr_t of dma_map_single and dma_map_page by using dma_mapping_error(): dma_addr_t dma_handle; dma_handle = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dev, dma_handle)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ } Networking drivers must call dev_kfree_skb to free the socket buffer and return NETDEV_TX_OK if the DMA mapping fails on the transmit hook (ndo_start_xmit). This means that the socket buffer is just dropped in the failure case. SCSI drivers must return SCSI_MLQUEUE_HOST_BUSY if the DMA mapping fails in the queuecommand hook. This means that the SCSI subsystem passes the command to the driver again later. Optimizing Unmap State Space Consumption On many platforms, dma_unmap_{single,page}() is simply a nop. Loading Loading @@ -703,42 +733,25 @@ to "Closing". 1) Struct scatterlist requirements. Struct scatterlist must contain, at a minimum, the following members: struct page *page; unsigned int offset; unsigned int length; The base address is specified by a "page+offset" pair. Previous versions of struct scatterlist contained a "void *address" field that was sometimes used instead of page+offset. As of Linux 2.5., page+offset is always used, and the "address" field has been deleted. 2) More to come... Handling Errors DMA address space is limited on some architectures and an allocation failure can be determined by: - checking if dma_alloc_coherent returns NULL or dma_map_sg returns 0 - checking the returned dma_addr_t of dma_map_single and dma_map_page by using dma_mapping_error(): dma_addr_t dma_handle; dma_handle = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dev, dma_handle)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ } Don't invent the architecture specific struct scatterlist; just use <asm-generic/scatterlist.h>. You need to enable CONFIG_NEED_SG_DMA_LENGTH if the architecture supports IOMMUs (including software IOMMU). 2) ARCH_KMALLOC_MINALIGN Architectures must ensure that kmalloc'ed buffer is DMA-safe. Drivers and subsystems depend on it. If an architecture isn't fully DMA-coherent (i.e. hardware doesn't ensure that data in the CPU cache is identical to data in main memory), ARCH_KMALLOC_MINALIGN must be set so that the memory allocator makes sure that kmalloc'ed buffer doesn't share a cache line with the others. See arch/arm/include/asm/cache.h as an example. Note that ARCH_KMALLOC_MINALIGN is about DMA memory alignment constraints. You don't need to worry about the architecture data alignment constraints (e.g. the alignment constraints about 64-bit objects). Closing Loading Documentation/SubmittingDrivers +5 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,8 @@ Linux kernel master tree: ftp.??.kernel.org:/pub/linux/kernel/... ?? == your country code, such as "us", "uk", "fr", etc. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git Linux kernel mailing list: linux-kernel@vger.kernel.org [mail majordomo@vger.kernel.org to subscribe] Loading Loading @@ -160,3 +162,6 @@ How to NOT write kernel driver by Arjan van de Ven: Kernel Janitor: http://janitor.kernelnewbies.org/ GIT, Fast Version Control System: http://git-scm.com/ Documentation/acpi/apei/einj.txt 0 → 100644 +59 −0 Original line number Diff line number Diff line APEI Error INJection ~~~~~~~~~~~~~~~~~~~~ EINJ provides a hardware error injection mechanism It is very useful for debugging and testing of other APEI and RAS features. To use EINJ, make sure the following are enabled in your kernel configuration: CONFIG_DEBUG_FS CONFIG_ACPI_APEI CONFIG_ACPI_APEI_EINJ The user interface of EINJ is debug file system, under the directory apei/einj. The following files are provided. - available_error_type Reading this file returns the error injection capability of the platform, that is, which error types are supported. The error type definition is as follow, the left field is the error type value, the right field is error description. 0x00000001 Processor Correctable 0x00000002 Processor Uncorrectable non-fatal 0x00000004 Processor Uncorrectable fatal 0x00000008 Memory Correctable 0x00000010 Memory Uncorrectable non-fatal 0x00000020 Memory Uncorrectable fatal 0x00000040 PCI Express Correctable 0x00000080 PCI Express Uncorrectable fatal 0x00000100 PCI Express Uncorrectable non-fatal 0x00000200 Platform Correctable 0x00000400 Platform Uncorrectable non-fatal 0x00000800 Platform Uncorrectable fatal The format of file contents are as above, except there are only the available error type lines. - error_type This file is used to set the error type value. The error type value is defined in "available_error_type" description. - error_inject Write any integer to this file to trigger the error injection. Before this, please specify all necessary error parameters. - param1 This file is used to set the first error parameter value. Effect of parameter depends on error_type specified. For memory error, this is physical memory address. - param2 This file is used to set the second error parameter value. Effect of parameter depends on error_type specified. For memory error, this is physical memory address mask. For more information about EINJ, please refer to ACPI specification version 4.0, section 17.5. Loading
Documentation/ABI/testing/sysfs-devices-node 0 → 100644 +7 −0 Original line number Diff line number Diff line What: /sys/devices/system/node/nodeX/compact Date: February 2010 Contact: Mel Gorman <mel@csn.ul.ie> Description: When this file is written to, all memory within that node will be compacted. When it completes, memory will be freed into blocks which have as many contiguous pages as possible
Documentation/ABI/testing/sysfs-firmware-sfi 0 → 100644 +15 −0 Original line number Diff line number Diff line What: /sys/firmware/sfi/tables/ Date: May 2010 Contact: Len Brown <lenb@kernel.org> Description: SFI defines a number of small static memory tables so the kernel can get platform information from firmware. The tables are defined in the latest SFI specification: http://simplefirmware.org/documentation While the tables are used by the kernel, user-space can observe them this way: # cd /sys/firmware/sfi/tables # cat $TABLENAME > $TABLENAME.bin
Documentation/DMA-API-HOWTO.txt +49 −36 Original line number Diff line number Diff line Loading @@ -639,6 +639,36 @@ is planned to completely remove virt_to_bus() and bus_to_virt() as they are entirely deprecated. Some ports already do not provide these as it is impossible to correctly support them. Handling Errors DMA address space is limited on some architectures and an allocation failure can be determined by: - checking if dma_alloc_coherent returns NULL or dma_map_sg returns 0 - checking the returned dma_addr_t of dma_map_single and dma_map_page by using dma_mapping_error(): dma_addr_t dma_handle; dma_handle = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dev, dma_handle)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ } Networking drivers must call dev_kfree_skb to free the socket buffer and return NETDEV_TX_OK if the DMA mapping fails on the transmit hook (ndo_start_xmit). This means that the socket buffer is just dropped in the failure case. SCSI drivers must return SCSI_MLQUEUE_HOST_BUSY if the DMA mapping fails in the queuecommand hook. This means that the SCSI subsystem passes the command to the driver again later. Optimizing Unmap State Space Consumption On many platforms, dma_unmap_{single,page}() is simply a nop. Loading Loading @@ -703,42 +733,25 @@ to "Closing". 1) Struct scatterlist requirements. Struct scatterlist must contain, at a minimum, the following members: struct page *page; unsigned int offset; unsigned int length; The base address is specified by a "page+offset" pair. Previous versions of struct scatterlist contained a "void *address" field that was sometimes used instead of page+offset. As of Linux 2.5., page+offset is always used, and the "address" field has been deleted. 2) More to come... Handling Errors DMA address space is limited on some architectures and an allocation failure can be determined by: - checking if dma_alloc_coherent returns NULL or dma_map_sg returns 0 - checking the returned dma_addr_t of dma_map_single and dma_map_page by using dma_mapping_error(): dma_addr_t dma_handle; dma_handle = dma_map_single(dev, addr, size, direction); if (dma_mapping_error(dev, dma_handle)) { /* * reduce current DMA mapping usage, * delay and try again later or * reset driver. */ } Don't invent the architecture specific struct scatterlist; just use <asm-generic/scatterlist.h>. You need to enable CONFIG_NEED_SG_DMA_LENGTH if the architecture supports IOMMUs (including software IOMMU). 2) ARCH_KMALLOC_MINALIGN Architectures must ensure that kmalloc'ed buffer is DMA-safe. Drivers and subsystems depend on it. If an architecture isn't fully DMA-coherent (i.e. hardware doesn't ensure that data in the CPU cache is identical to data in main memory), ARCH_KMALLOC_MINALIGN must be set so that the memory allocator makes sure that kmalloc'ed buffer doesn't share a cache line with the others. See arch/arm/include/asm/cache.h as an example. Note that ARCH_KMALLOC_MINALIGN is about DMA memory alignment constraints. You don't need to worry about the architecture data alignment constraints (e.g. the alignment constraints about 64-bit objects). Closing Loading
Documentation/SubmittingDrivers +5 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,8 @@ Linux kernel master tree: ftp.??.kernel.org:/pub/linux/kernel/... ?? == your country code, such as "us", "uk", "fr", etc. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git Linux kernel mailing list: linux-kernel@vger.kernel.org [mail majordomo@vger.kernel.org to subscribe] Loading Loading @@ -160,3 +162,6 @@ How to NOT write kernel driver by Arjan van de Ven: Kernel Janitor: http://janitor.kernelnewbies.org/ GIT, Fast Version Control System: http://git-scm.com/
Documentation/acpi/apei/einj.txt 0 → 100644 +59 −0 Original line number Diff line number Diff line APEI Error INJection ~~~~~~~~~~~~~~~~~~~~ EINJ provides a hardware error injection mechanism It is very useful for debugging and testing of other APEI and RAS features. To use EINJ, make sure the following are enabled in your kernel configuration: CONFIG_DEBUG_FS CONFIG_ACPI_APEI CONFIG_ACPI_APEI_EINJ The user interface of EINJ is debug file system, under the directory apei/einj. The following files are provided. - available_error_type Reading this file returns the error injection capability of the platform, that is, which error types are supported. The error type definition is as follow, the left field is the error type value, the right field is error description. 0x00000001 Processor Correctable 0x00000002 Processor Uncorrectable non-fatal 0x00000004 Processor Uncorrectable fatal 0x00000008 Memory Correctable 0x00000010 Memory Uncorrectable non-fatal 0x00000020 Memory Uncorrectable fatal 0x00000040 PCI Express Correctable 0x00000080 PCI Express Uncorrectable fatal 0x00000100 PCI Express Uncorrectable non-fatal 0x00000200 Platform Correctable 0x00000400 Platform Uncorrectable non-fatal 0x00000800 Platform Uncorrectable fatal The format of file contents are as above, except there are only the available error type lines. - error_type This file is used to set the error type value. The error type value is defined in "available_error_type" description. - error_inject Write any integer to this file to trigger the error injection. Before this, please specify all necessary error parameters. - param1 This file is used to set the first error parameter value. Effect of parameter depends on error_type specified. For memory error, this is physical memory address. - param2 This file is used to set the second error parameter value. Effect of parameter depends on error_type specified. For memory error, this is physical memory address mask. For more information about EINJ, please refer to ACPI specification version 4.0, section 17.5.