]> git.openfabrics.org - ~adrianc/mstflint.git/commitdiff
On mclose a pci conf device, add a read from a safe-to-read address
authorOren Kladnitsky <orenk@dev.mellanox.co.il>
Mon, 7 Oct 2013 10:25:54 +0000 (13:25 +0300)
committerOren Kladnitsky <orenk@dev.mellanox.co.il>
Mon, 7 Oct 2013 10:25:54 +0000 (13:25 +0300)
This prevents side effects on a full pci config dump through sysfs or other method.

include/mtcr_ul/mtcr.h

index aceaa503705856fe18f106fe40ac7774876b04da..d9e342ef5706f31a8014322b08df8e3d79e450e1 100644 (file)
@@ -1076,10 +1076,13 @@ int mclose(mfile *mf)
 ;
 #else
 {
+  unsigned int word;
 #if CONFIG_ENABLE_MMAP
   if (mf->ptr)
     munmap(mf->ptr,MTCR_MAP_SIZE);
+  else
 #endif
+    mread4(mf, 0xf0014, &word);
   close(mf->fd);
   free(mf);
   return 0;