Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pci-tegra.c force alive pcie port #827

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 18 additions & 7 deletions drivers/pci/controller/pci-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ struct tegra_pcie {

const struct tegra_pcie_soc *soc;
struct dentry *debugfs;

bool force_alive;
};

static inline struct tegra_pcie *msi_to_pcie(struct tegra_msi *msi)
Expand Down Expand Up @@ -2361,15 +2363,24 @@ static void tegra_pcie_enable_ports(struct tegra_pcie *pcie)
/* Start LTSSM from Tegra side */
reset_control_deassert(pcie->pcie_xrst);

list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
if (tegra_pcie_port_check_link(port))
continue;
list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
if (tegra_pcie_port_check_link(port))
continue;

dev_info(dev, "link %u down, ignoring\n", port->index);
dev_info(dev, "trying link %u down \n", port->index);

if (pcie->force_alive)
{
dev_info(dev, "link %u forced to alive \n", port->index);
} else
{
tegra_pcie_port_disable(port);
tegra_pcie_port_free(port);
dev_info(dev, "link %u down \n", port->index);
}

}

tegra_pcie_port_disable(port);
tegra_pcie_port_free(port);
}

if (pcie->soc->has_gen2)
tegra_pcie_change_link_speed(pcie);
Expand Down