summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-06-19 17:53:06 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-06-19 17:53:06 +0200
commit87583e6ec5c1961ef975b873041eeada3e1e6c6d (patch)
treeb21760a6341335cbac7b708a2053284190bb8814
parent954583ac2ee8ec522a0283e6e3b249345c71a3e7 (diff)
downloadpcitool-87583e6ec5c1961ef975b873041eeada3e1e6c6d.tar.gz
pcitool-87583e6ec5c1961ef975b873041eeada3e1e6c6d.tar.bz2
pcitool-87583e6ec5c1961ef975b873041eeada3e1e6c6d.tar.xz
pcitool-87583e6ec5c1961ef975b873041eeada3e1e6c6d.zip
Execute all operations on kernel_memory using plain pci model to avoid extra references
-rw-r--r--driver/kmem.c2
-rw-r--r--pcitool/cli.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/driver/kmem.c b/driver/kmem.c
index 9b3ab14..2c72e38 100644
--- a/driver/kmem.c
+++ b/driver/kmem.c
@@ -238,7 +238,7 @@ static int pcidriver_kmem_free_check(pcidriver_privdata_t *privdata, kmem_handle
if (kmem_entry->refs) {
kmem_entry->mode += 1;
- mod_info("can't free referenced kmem_entry\n");
+ mod_info("can't free referenced kmem_entry, refs = %lx\n", kmem_entry->refs);
return -EBUSY;
}
diff --git a/pcitool/cli.c b/pcitool/cli.c
index 580d992..9eeb046 100644
--- a/pcitool/cli.c
+++ b/pcitool/cli.c
@@ -2689,6 +2689,7 @@ int main(int argc, char **argv) {
case OPT_LIST_KMEM:
if (mode != MODE_INVALID) Usage(argc, argv, "Multiple operations are not supported");
mode = MODE_LIST_KMEM;
+ if (!model) model = "pci";
if (optarg) use = optarg;
else if ((optind < argc)&&(argv[optind][0] != '-')) use = argv[optind++];
@@ -2708,6 +2709,7 @@ int main(int argc, char **argv) {
case OPT_READ_KMEM:
if (mode != MODE_INVALID) Usage(argc, argv, "Multiple operations are not supported");
mode = MODE_READ_KMEM;
+ if (!model) model = "pci";
num_offset = strchr(optarg, ':');
@@ -2724,6 +2726,7 @@ int main(int argc, char **argv) {
case OPT_ALLOC_KMEM:
if (mode != MODE_INVALID) Usage(argc, argv, "Multiple operations are not supported");
mode = MODE_ALLOC_KMEM;
+ model = "pci";
if (optarg) use = optarg;
else if ((optind < argc)&&(argv[optind][0] != '-')) use = argv[optind++];
@@ -2731,6 +2734,7 @@ int main(int argc, char **argv) {
case OPT_FREE_KMEM:
if (mode != MODE_INVALID) Usage(argc, argv, "Multiple operations are not supported");
mode = MODE_FREE_KMEM;
+ if (!model) model = "pci";
if (optarg) use = optarg;
else if ((optind < argc)&&(argv[optind][0] != '-')) use = argv[optind++];