*/
 
 #include <linux/acpi.h>
+#include <linux/pm_runtime.h>
 
 #include "tb.h"
 
                 pci_pcie_type(pdev) == PCI_EXP_TYPE_DOWNSTREAM))) {
                const struct device_link *link;
 
+               /*
+                * Make them both active first to make sure the NHI does
+                * not runtime suspend before the consumer. The
+                * pm_runtime_put() below then allows the consumer to
+                * runtime suspend again (which then allows NHI runtime
+                * suspend too now that the device link is established).
+                */
+               pm_runtime_get_sync(&pdev->dev);
+
                link = device_link_add(&pdev->dev, &nhi->pdev->dev,
                                       DL_FLAG_AUTOREMOVE_SUPPLIER |
+                                      DL_FLAG_RPM_ACTIVE |
                                       DL_FLAG_PM_RUNTIME);
                if (link) {
                        dev_dbg(&nhi->pdev->dev, "created link from %s\n",
                        dev_warn(&nhi->pdev->dev, "device link creation from %s failed\n",
                                 dev_name(&pdev->dev));
                }
+
+               pm_runtime_put(&pdev->dev);
        }
 
 out_put: