[PATCH] ntb: ntb_hw_intel: link_poll isn't clearing the pending status properly

5 views
Skip to first unread message

Dave Jiang

unread,
Feb 16, 2017, 6:22:37 PM2/16/17
to jdm...@kudzu.us, linu...@googlegroups.com, allen...@emc.com
On Skylake hardware, the link_poll isn't clearing the pending interrupt
bit. Adding a new function for SKX that handles clearing of status bit the
right way.

Signed-off-by: Dave Jiang <dave....@intel.com>
---
drivers/ntb/hw/intel/ntb_hw_intel.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/drivers/ntb/hw/intel/ntb_hw_intel.c b/drivers/ntb/hw/intel/ntb_hw_intel.c
index eca9688..c002384 100644
--- a/drivers/ntb/hw/intel/ntb_hw_intel.c
+++ b/drivers/ntb/hw/intel/ntb_hw_intel.c
@@ -1629,6 +1629,28 @@ static void atom_deinit_dev(struct intel_ntb_dev *ndev)

/* Skylake Xeon NTB */

+static int skx_poll_link(struct intel_ntb_dev *ndev)
+{
+ u16 reg_val;
+ int rc;
+
+ ndev->reg->db_iowrite(ndev->db_link_mask,
+ ndev->self_mmio +
+ ndev->self_reg->db_clear);
+
+ rc = pci_read_config_word(ndev->ntb.pdev,
+ SKX_LINK_STATUS_OFFSET, &reg_val);
+ if (rc)
+ return 0;
+
+ if (reg_val == ndev->lnk_sta)
+ return 0;
+
+ ndev->lnk_sta = reg_val;
+
+ return 1;
+}
+
static u64 skx_db_ioread(void __iomem *mmio)
{
return ioread64(mmio);
@@ -2852,7 +2874,7 @@ static struct intel_b2b_addr xeon_b2b_dsd_addr = {
};

static const struct intel_ntb_reg skx_reg = {
- .poll_link = xeon_poll_link,
+ .poll_link = skx_poll_link,
.link_is_up = xeon_link_is_up,
.db_ioread = skx_db_ioread,
.db_iowrite = skx_db_iowrite,

Jon Mason

unread,
Feb 16, 2017, 8:07:15 PM2/16/17
to Dave Jiang, linu...@googlegroups.com, allen...@emc.com
On Thu, Feb 16, 2017 at 04:22:36PM -0700, Dave Jiang wrote:
> On Skylake hardware, the link_poll isn't clearing the pending interrupt
> bit. Adding a new function for SKX that handles clearing of status bit the
> right way.
>
> Signed-off-by: Dave Jiang <dave....@intel.com>

Pulled into my ntb branch. I'll give it a couple of hours for the
bots to build test it, then I'll give a pull request to Linux (assuming
that it isn't too late in the cycle).

Thanks,
Jon
> --
> You received this message because you are subscribed to the Google Groups "linux-ntb" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-ntb+...@googlegroups.com.
> To post to this group, send email to linu...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/linux-ntb/148728735682.1188.5989205862351479482.stgit%40djiang5-desk3.ch.intel.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages