[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1555944178-1957-2-git-send-email-wesley.sheng@microchip.com>
Date: Mon, 22 Apr 2019 22:42:56 +0800
From: Wesley Sheng <wesley.sheng@...rochip.com>
To: <kurt.schwemmer@...rosemi.com>, <logang@...tatee.com>,
<jdmason@...zu.us>, <dave.jiang@...el.com>, <allenbh@...il.com>,
<linux-pci@...r.kernel.org>, <linux-ntb@...glegroups.com>,
<linux-kernel@...r.kernel.org>
CC: <wesleyshenggit@...a.com>, <wesley.sheng@...rochip.com>,
<kelvin.cao@...rochip.com>
Subject: [PATCH 1/3] ntb_hw_switchtec: Remove redundant steps of switchtec_ntb_reinit_peer() function
From: Joey Zhang <joey.zhang@...rochip.com>
When a re-initialization is caused by a link event, the driver will
re-setup the shared memory window. But at that time, the shared memory
is still valid, and it's unnecessary to free, reallocate and then
initialize it again. We only need to reconfigure the hardware
registers. Remove the redundant steps from
switchtec_ntb_reinit_peer() function.
Signed-off-by: Joey Zhang <joey.zhang@...rochip.com>
Signed-off-by: Wesley Sheng <wesley.sheng@...rochip.com>
Reviewed-by: Logan Gunthorpe <logang@...tatee.com>
---
drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
index d905d36..947ed0b 100644
--- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
+++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
@@ -1457,10 +1457,13 @@ static void switchtec_ntb_deinit_db_msg_irq(struct switchtec_ntb *sndev)
static int switchtec_ntb_reinit_peer(struct switchtec_ntb *sndev)
{
- dev_info(&sndev->stdev->dev, "peer reinitialized\n");
- switchtec_ntb_deinit_shared_mw(sndev);
- switchtec_ntb_init_mw(sndev);
- return switchtec_ntb_init_shared_mw(sndev);
+ int rc;
+
+ dev_info(&sndev->stdev->dev, "reinitialize shared memory window\n");
+ rc = config_rsvd_lut_win(sndev, sndev->mmio_peer_ctrl, 0,
+ sndev->self_partition,
+ sndev->self_shared_dma);
+ return rc;
}
static int switchtec_ntb_add(struct device *dev,
--
2.7.4
Powered by blists - more mailing lists