Commit 1745de5e5639457513fe43440f2800e23c3cbc7d
1 parent
8a6fc708b9
Exists in
master
and in
20 other branches
dma-debug: add dma_debug_driver kernel command line
This patch add the dma_debug_driver= boot parameter to enable the driver filter for early boot. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Showing 2 changed files with 25 additions and 0 deletions Side-by-side Diff
Documentation/kernel-parameters.txt
... | ... | @@ -646,6 +646,13 @@ |
646 | 646 | DMA-API debugging code disables itself because the |
647 | 647 | architectural default is too low. |
648 | 648 | |
649 | + dma_debug_driver=<driver_name> | |
650 | + With this option the DMA-API debugging driver | |
651 | + filter feature can be enabled at boot time. Just | |
652 | + pass the driver to filter for as the parameter. | |
653 | + The filter can be disabled or changed to another | |
654 | + driver later using sysfs. | |
655 | + | |
649 | 656 | dscc4.setup= [NET] |
650 | 657 | |
651 | 658 | dtc3181e= [HW,SCSI] |
lib/dma-debug.c
... | ... | @@ -1108,4 +1108,23 @@ |
1108 | 1108 | } |
1109 | 1109 | } |
1110 | 1110 | EXPORT_SYMBOL(debug_dma_sync_sg_for_device); |
1111 | + | |
1112 | +static int __init dma_debug_driver_setup(char *str) | |
1113 | +{ | |
1114 | + int i; | |
1115 | + | |
1116 | + for (i = 0; i < NAME_MAX_LEN - 1; ++i, ++str) { | |
1117 | + current_driver_name[i] = *str; | |
1118 | + if (*str == 0) | |
1119 | + break; | |
1120 | + } | |
1121 | + | |
1122 | + if (current_driver_name[0]) | |
1123 | + printk(KERN_INFO "DMA-API: enable driver filter for " | |
1124 | + "driver [%s]\n", current_driver_name); | |
1125 | + | |
1126 | + | |
1127 | + return 1; | |
1128 | +} | |
1129 | +__setup("dma_debug_driver=", dma_debug_driver_setup); |