lkml.org 
[lkml]   [2011]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] pciehp: Retrieve link speed after link is trained

    During hot plug, board_added will call pciehp_power_on_slot().
    But link speed is updated in pciehp_power_on_slot().

    We should not update link speed there, because that is too early.

    Move updating to pciehp_check_link_status() after making sure link is trained.

    Signed-off-by: Yinghai Lu <yinghai.lu@oracle.com>

    ---
    drivers/pci/hotplug/pciehp_hpc.c | 10 ++--------
    1 file changed, 2 insertions(+), 8 deletions(-)

    Index: linux-2.6/drivers/pci/hotplug/pciehp_hpc.c
    ===================================================================
    --- linux-2.6.orig/drivers/pci/hotplug/pciehp_hpc.c
    +++ linux-2.6/drivers/pci/hotplug/pciehp_hpc.c
    @@ -294,6 +294,8 @@ int pciehp_check_link_status(struct cont
    return retval;
    }

    + pcie_update_link_speed(ctrl->pcie->port->subordinate, lnk_status);
    +
    return retval;
    }

    @@ -516,14 +518,6 @@ int pciehp_power_on_slot(struct slot * s
    ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__,
    pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_cmd);

    - retval = pciehp_readw(ctrl, PCI_EXP_LNKSTA, &lnk_status);
    - if (retval) {
    - ctrl_err(ctrl, "%s: Cannot read LNKSTA register\n",
    - __func__);
    - return retval;
    - }
    - pcie_update_link_speed(ctrl->pcie->port->subordinate, lnk_status);
    -
    return retval;
    }


    \
     
     \ /
      Last update: 2011-10-09 09:09    [W:0.027 / U:60.704 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site