Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933356AbbFIOtF (ORCPT ); Tue, 9 Jun 2015 10:49:05 -0400 Received: from mailuogwhop.emc.com ([168.159.213.141]:49567 "EHLO mailuogwhop.emc.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753268AbbFIOpZ (ORCPT ); Tue, 9 Jun 2015 10:45:25 -0400 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd03.lss.emc.com t59EjLbT032293 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd03.lss.emc.com t59EjLbT032293 From: Allen Hubbe To: linux-ntb@googlegroups.com Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Jon Mason , Dave Jiang Subject: [PATCH v3 04/18] NTB: Enable link for Intel root port mode in probe Date: Tue, 9 Jun 2015 05:44:31 -0400 Message-Id: <5ef61ff1b2b5ab0f49dded7056b90917237ef714.1433838377.git.Allen.Hubbe@emc.com> X-Mailer: git-send-email 2.4.0.rc0.44.g244209c.dirty In-Reply-To: References: In-Reply-To: References: X-RSA-Classifications: public X-Sentrion-Hostname: mailuogwprd03.lss.emc.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1849 Lines: 55 From: Dave Jiang Link training should be enabled in the driver probe for root port mode. We should not have to wait for transport to be loaded for this to happen. Otherwise the ntb device will not show up on the transparent bridge side of the link. Signed-off-by: Dave Jiang --- drivers/ntb/hw/intel/ntb_hw_intel.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/ntb/hw/intel/ntb_hw_intel.c b/drivers/ntb/hw/intel/ntb_hw_intel.c index 10ca18af4106..64ce690d9616 100644 --- a/drivers/ntb/hw/intel/ntb_hw_intel.c +++ b/drivers/ntb/hw/intel/ntb_hw_intel.c @@ -1318,6 +1318,9 @@ static int snb_poll_link(struct intel_ntb_dev *ndev) static int snb_link_is_up(struct intel_ntb_dev *ndev) { + if (ndev->ntb.topo == NTB_TOPO_SEC) + return 1; + return NTB_LNK_STA_ACTIVE(ndev->lnk_sta); } @@ -1614,6 +1617,7 @@ static int snb_setup_b2b_mw(struct intel_ntb_dev *ndev, static int snb_init_ntb(struct intel_ntb_dev *ndev) { int rc; + u32 ntb_ctl; if (ndev->bar4_split) ndev->mw_count = HSX_SPLIT_BAR_MW_COUNT; @@ -1630,6 +1634,12 @@ static int snb_init_ntb(struct intel_ntb_dev *ndev) dev_err(ndev_dev(ndev), "NTB Primary config disabled\n"); return -EINVAL; } + + /* enable link to allow secondary side device to appear */ + ntb_ctl = ioread32(ndev->self_mmio + ndev->reg->ntb_ctl); + ntb_ctl &= ~NTB_CTL_DISABLE; + iowrite32(ntb_ctl, ndev->self_mmio + ndev->reg->ntb_ctl); + /* use half the spads for the peer */ ndev->spad_count >>= 1; ndev->self_reg = &snb_pri_reg; -- 2.4.0.rc0.43.gcf8a8c6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/