[PATCH rdma-next] RDMA/core: Exclude hfi1 from device_rename supported devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Leon Romanovsky <leonro@xxxxxxxxxxxx>

Disable device rename functionality for hfi1 driver, because current
state where users can rename device name visible to them in dmesg,
netlink e.t.c and not reflected in debugfs produces ambiguity to the
users.

[1] https://patchwork.kernel.org/patch/10723375/
Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
---
 drivers/infiniband/core/device.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 06aeababf705..d733b2b63b60 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -214,6 +214,21 @@ int ib_device_rename(struct ib_device *ibdev, const char *name)
 	struct ib_device *device;
 	int ret = 0;

+	if (ibdev->driver_id == RDMA_DRIVER_HFI1)
+		/*
+		 * hfi1 debugfs entries are device name based,
+		 * it means that any change in device name will create
+		 * mess for the users, while all prints/netlink will report
+		 * new name and debugfs will report old name.
+		 *
+		 * Attempts to solve it by ensuring that debugfs is unique
+		 * for that driver failed https://patchwork.kernel.org/patch/10723375/
+		 *
+		 * Need to return error here to ensure that any future systemd changes
+		 * won't break for the distros while working with hfi1.
+		 */
+		return -EOPNOTSUPP;
+
 	/* If old and new name are same, nothing more to be done */
 	if (!strcmp(name, dev_name(&ibdev->dev)))
 		return ret;
--
2.19.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux