  #include <asm/arch/smc.h>
  #include <linux/delay.h>
  #include <linux/jiffies.h>
- #include <linux/module.h>
--#include <linux/hrtimer.h>
- 
--static ktime_t request_pci_timestamp = {0};
-+static unsigned int request_pci_timestamp = 0;
+@@ -30,7 +31,7 @@
  /*
   * Request PCI_ARB to grant access to the STATIC core.
   */

 {
 	unsigned maxtries = 10; /* wait for maxtries jiffies at maximum */
 
@@ -50,25 +50,185 @@
 	if (!(readl(SYS_CTRL_PCI_STAT) & (1UL << SYSCTL_PCI_STAT_SYSPCI_STATIC_GNT)))
 		printk(KERN_WARNING "%s: timeout requesting access to PCI bus for static memory interface\n",  __func__);
 
-	request_pci_timestamp = ktime_get();
+	request_pci_timestamp = jiffies_to_msecs(get_jiffies_64());
+
+    return ( 0 != ( readl(SYS_CTRL_PCI_STAT) & (1UL << SYSCTL_PCI_STAT_SYSPCI_STATIC_GNT) ) ? 0 : 1 );
 }

-void hipox_smc_release_pci_ad_31_0(void)
+static void _hipox_smc_release_pci_ad_31_0(void)
 {
 	const s64 timeout = 400; /* us */  
 	s64 delta = ktime_us_delta(ktime_get(), request_pci_timestamp);
@@ -70,5 +73,163 @@
 	}
 }
 
