diff options
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/fw.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 0ab81a930f33..dbabfae3a3de 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
| @@ -1897,6 +1897,36 @@ out: | |||
| 1897 | return err; | 1897 | return err; |
| 1898 | } | 1898 | } |
| 1899 | 1899 | ||
| 1900 | static int mlx4_hca_core_clock_update(struct mlx4_dev *dev) | ||
| 1901 | { | ||
| 1902 | struct mlx4_cmd_mailbox *mailbox; | ||
| 1903 | __be32 *outbox; | ||
| 1904 | int err; | ||
| 1905 | |||
| 1906 | mailbox = mlx4_alloc_cmd_mailbox(dev); | ||
| 1907 | if (IS_ERR(mailbox)) { | ||
| 1908 | mlx4_warn(dev, "hca_core_clock mailbox allocation failed\n"); | ||
| 1909 | return PTR_ERR(mailbox); | ||
| 1910 | } | ||
| 1911 | outbox = mailbox->buf; | ||
| 1912 | |||
| 1913 | err = mlx4_cmd_box(dev, 0, mailbox->dma, 0, 0, | ||
| 1914 | MLX4_CMD_QUERY_HCA, | ||
| 1915 | MLX4_CMD_TIME_CLASS_B, | ||
| 1916 | !mlx4_is_slave(dev)); | ||
| 1917 | if (err) { | ||
| 1918 | mlx4_warn(dev, "hca_core_clock update failed\n"); | ||
| 1919 | goto out; | ||
| 1920 | } | ||
| 1921 | |||
| 1922 | MLX4_GET(dev->caps.hca_core_clock, outbox, QUERY_HCA_CORE_CLOCK_OFFSET); | ||
| 1923 | |||
| 1924 | out: | ||
| 1925 | mlx4_free_cmd_mailbox(dev, mailbox); | ||
| 1926 | |||
| 1927 | return err; | ||
| 1928 | } | ||
| 1929 | |||
| 1900 | /* for IB-type ports only in SRIOV mode. Checks that both proxy QP0 | 1930 | /* for IB-type ports only in SRIOV mode. Checks that both proxy QP0 |
| 1901 | * and real QP0 are active, so that the paravirtualized QP0 is ready | 1931 | * and real QP0 are active, so that the paravirtualized QP0 is ready |
| 1902 | * to operate */ | 1932 | * to operate */ |
| @@ -2001,6 +2031,9 @@ int mlx4_INIT_PORT(struct mlx4_dev *dev, int port) | |||
| 2001 | err = mlx4_cmd(dev, 0, port, 0, MLX4_CMD_INIT_PORT, | 2031 | err = mlx4_cmd(dev, 0, port, 0, MLX4_CMD_INIT_PORT, |
| 2002 | MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); | 2032 | MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); |
| 2003 | 2033 | ||
| 2034 | if (!err) | ||
| 2035 | mlx4_hca_core_clock_update(dev); | ||
| 2036 | |||
| 2004 | return err; | 2037 | return err; |
| 2005 | } | 2038 | } |
| 2006 | EXPORT_SYMBOL_GPL(mlx4_INIT_PORT); | 2039 | EXPORT_SYMBOL_GPL(mlx4_INIT_PORT); |
