aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
diff options
context:
space:
mode:
authorWei Hu (Xavier) <xavier.huwei@huawei.com>2019-02-03 20:43:15 +0800
committerJason Gunthorpe <jgg@mellanox.com>2019-02-04 16:13:50 -0700
commitd3743fa94ccd177917783726faf54632439ddb54 (patch)
treed2b2c0079e461053de508dd0e896d73dc772cfc7 /drivers/infiniband/hw/hns/hns_roce_hw_v2.h
parentRDMA/hns: Fix the chip hanging caused by sending mailbox&CMQ during reset (diff)
downloadlinux-dev-d3743fa94ccd177917783726faf54632439ddb54.tar.xz
linux-dev-d3743fa94ccd177917783726faf54632439ddb54.zip
RDMA/hns: Fix the chip hanging caused by sending doorbell during reset
On hi08 chip, There is a possibility of chip hanging when sending doorbell during reset. We can fix it by prohibiting doorbell during reset. Fixes: 2d40788825ac ("RDMA/hns: Add support for processing send wr and receive wr") Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v2.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
index f22094e2ebab..6b0486fcbc59 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
@@ -1799,4 +1799,15 @@ struct hns_roce_sccc_clr_done {
__le32 rsv[5];
};
+static inline void hns_roce_write64(struct hns_roce_dev *hr_dev, __le32 val[2],
+ void __iomem *dest)
+{
+ struct hns_roce_v2_priv *priv = (struct hns_roce_v2_priv *)hr_dev->priv;
+ struct hnae3_handle *handle = priv->handle;
+ const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
+
+ if (!hr_dev->dis_db && !ops->get_hw_reset_stat(handle))
+ hns_roce_write64_k(val, dest);
+}
+
#endif