Regarding PCIE clock of Jetson TX2

I’ll get back to you with the REFCLK questions soon.
Regarding, keeping REFCLK alive even when there is no PCIe endpoint device connected, please use the following patch.

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 63c0e343d388..52c46b68981e 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -2194,7 +2194,7 @@ static bool tegra_pcie_port_check_link(struct tegra_pcie_port *port)
                tegra_pcie_port_reset(port);
        } while (--retries);
  
-       return false;
+       return true;
 }
  
 static void tegra_pcie_apply_sw_war(struct tegra_pcie_port *port,

The default behavior of TX2 is that, if there is no PCIe endpoint detected, it powers down the PCIe controller (thereby shutting off the REFCLK as well). The above patch changes that behavior.