svn commit: r322163 - in stable/9/sys/ofed: drivers/net/mlx4 include/linux/mlx4

Hans Petter Selasky hselasky at FreeBSD.org
Mon Aug 7 13:17:58 UTC 2017


Author: hselasky
Date: Mon Aug  7 13:17:57 2017
New Revision: 322163
URL: https://svnweb.freebsd.org/changeset/base/322163

Log:
  MFC r321772:
  Fix broken usage of the mlx4_read_clock() function:
   - return value has too small width
   - cycle_t is unsigned and cannot be less than zero
  
  Sponsored by:	Mellanox Technologies

Modified:
  stable/9/sys/ofed/drivers/net/mlx4/main.c
  stable/9/sys/ofed/include/linux/mlx4/device.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ofed/drivers/net/mlx4/main.c
==============================================================================
--- stable/9/sys/ofed/drivers/net/mlx4/main.c	Mon Aug  7 13:16:38 2017	(r322162)
+++ stable/9/sys/ofed/drivers/net/mlx4/main.c	Mon Aug  7 13:17:57 2017	(r322163)
@@ -1795,10 +1795,10 @@ static void unmap_bf_area(struct mlx4_dev *dev)
 		io_mapping_free(mlx4_priv(dev)->bf_mapping);
 }
 
-int mlx4_read_clock(struct mlx4_dev *dev)
+s64 mlx4_read_clock(struct mlx4_dev *dev)
 {
 	u32 clockhi, clocklo, clockhi1;
-	cycle_t cycles;
+	s64 cycles;
 	int i;
 	struct mlx4_priv *priv = mlx4_priv(dev);
 
@@ -1815,7 +1815,7 @@ int mlx4_read_clock(struct mlx4_dev *dev)
 
 	cycles = (u64) clockhi << 32 | (u64) clocklo;
 
-	return cycles;
+	return cycles & CORE_CLOCK_MASK;
 }
 EXPORT_SYMBOL_GPL(mlx4_read_clock);
 

Modified: stable/9/sys/ofed/include/linux/mlx4/device.h
==============================================================================
--- stable/9/sys/ofed/include/linux/mlx4/device.h	Mon Aug  7 13:16:38 2017	(r322162)
+++ stable/9/sys/ofed/include/linux/mlx4/device.h	Mon Aug  7 13:17:57 2017	(r322163)
@@ -1337,7 +1337,7 @@ int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev,
 
 int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, u32 max_range_qpn);
 
-int mlx4_read_clock(struct mlx4_dev *dev);
+s64 mlx4_read_clock(struct mlx4_dev *dev);
 int mlx4_get_internal_clock_params(struct mlx4_dev *dev,
 				   struct mlx4_clock_params *params);
 


More information about the svn-src-stable-9 mailing list