]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
pcie: host: tegra: fix enabling AER
authorVidya Sagar <vidyas@nvidia.com>
Mon, 18 Jan 2016 13:42:13 +0000 (19:12 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 22 Jan 2016 17:06:03 +0000 (09:06 -0800)
root port should exhibit its AER capability and only then can
kernel PCIe subsystem load corresponding AER driver thereby enabling
it to print AER message as and when they occur. There was an issue because
of which root port wasn't exhibiting its AER capability and hence
AER messages (if any) aren't seen in the log. This patch fixes that issue

Bug 200166513

Change-Id: I3783f28f8e14d80dc87e331bf1f5059ac956a8b4
Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
Reviewed-on: http://git-master/r/933829
(cherry picked from commit 544c0b29fc2f7fe3d431d30b210da3e989aec36b)
Reviewed-on: http://git-master/r/934996
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hayden Du <haydend@nvidia.com>
drivers/pci/host/pci-tegra.c

index 3de1789922298d4a0f7fbcc7a2a1a53e1d18e8a6..82ef153a3546572cc7382619834e5dd90cf5f717 100644 (file)
@@ -853,9 +853,6 @@ static void tegra_pcie_enable_aer(struct tegra_pcie_port *port, bool enable)
        unsigned int data;
 
        PR_FUNC_LINE;
-       if (!port->status)
-               return;
-
        data = rp_readl(port, NV_PCIE2_RP_VEND_CTL1);
        if (enable)
                data |= PCIE2_RP_VEND_CTL1_ERPT;
@@ -878,7 +875,8 @@ static int tegra_pcie_attach(struct tegra_pcie *pcie)
                pci_rescan_bus(bus);
        /* unhide AER capability */
        list_for_each_entry(port, &pcie->ports, list)
-               tegra_pcie_enable_aer(port, true);
+               if (port->status)
+                       tegra_pcie_enable_aer(port, true);
 
        hotplug_event = false;
        return 0;
@@ -896,7 +894,8 @@ static int tegra_pcie_detach(struct tegra_pcie *pcie)
 
        /* hide AER capability to avoid log spew */
        list_for_each_entry(port, &pcie->ports, list)
-               tegra_pcie_enable_aer(port, false);
+               if (port->status)
+                       tegra_pcie_enable_aer(port, false);
 
        /* remove all pcie data structures */
        for_each_pci_dev(pdev) {