Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ SHELL = /bin/bash
.SHELLFLAGS += -e

KERNEL_ABI_MINOR_VERSION = 2
KVERSION_SHORT ?= 6.1.0-22-$(KERNEL_ABI_MINOR_VERSION)
KVERSION_SHORT ?= 6.1.0-29-$(KERNEL_ABI_MINOR_VERSION)
KVERSION ?= $(KVERSION_SHORT)-amd64
KERNEL_VERSION ?= 6.1.94
KERNEL_VERSION ?= 6.1.123
KERNEL_SUBVERSION ?= 1
CONFIGURED_ARCH ?= amd64
CONFIGURED_PLATFORM ?= vs
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
From ddec9cfeb44ed194cadee824f3f49c057bf7a560 Mon Sep 17 00:00:00 2001
From ac10df67c019b8ee1c80b46390759669cd69862f Mon Sep 17 00:00:00 2001
From: Michael Shych <michaelsh@nvidia.com>
Date: Wed, 12 Jul 2023 14:26:38 +0000
Subject: [PATH backport v6.1 30/32] platform: mellanox: nvsw-sn2201: change
fans i2c busses.
Subject: [PATCH 2/4] platform: mellanox: nvsw-sn2201: change fans i2c busses.

Link: https://www.spinics.net/lists/platform-driver-x86/msg39647.html

Expand All @@ -18,7 +17,7 @@ Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c
index 7b9c107c17ce..75b699676ca6 100644
index f53baf7e7..1a7c45aa4 100644
--- a/drivers/platform/mellanox/nvsw-sn2201.c
+++ b/drivers/platform/mellanox/nvsw-sn2201.c
@@ -84,6 +84,10 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ab5040e2b99cc3eb57eaa266b90877bcc38c28ed Mon Sep 17 00:00:00 2001
From 1c43cf584d3fd62823dd3b28018481f15a8836c7 Mon Sep 17 00:00:00 2001
From: Michael Shych <michaelsh@nvidia.com>
Date: Wed, 29 Nov 2023 13:12:38 +0000
Subject: [PATCH v1 1/1] platform: mellanox: indicate deferred I2C bus creation
Subject: [PATCH 3/4] platform: mellanox: indicate deferred I2C bus creation
for a hot-plug driver

It fixes timing issue when during initialization hot-plug driver
Expand All @@ -15,7 +15,7 @@ Signed-off-by: Michael Shych <michaelsh@nvidia.com>
1 file changed, 1 insertion(+)

diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c
index 65b677690..79e4d0619 100644
index 1a7c45aa4..a3e2bc6d6 100644
--- a/drivers/platform/mellanox/nvsw-sn2201.c
+++ b/drivers/platform/mellanox/nvsw-sn2201.c
@@ -520,6 +520,7 @@ struct mlxreg_core_hotplug_platform_data nvsw_sn2201_hotplug = {
Expand All @@ -27,5 +27,5 @@ index 65b677690..79e4d0619 100644

/* SN2201 static devices. */
--
2.14.1
2.20.1

Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,19 @@ index ba56485cbe8c..e86723b44c2e 100644
obj-$(CONFIG_MLXREG_LC) += mlxreg-lc.o
diff --git a/drivers/platform/mellanox/mlxreg-dpu.c b/drivers/platform/mellanox/mlxreg-dpu.c
new file mode 100644
index 000000000000..f831d6dd5ece
index 000000000..c6cfbee55
--- /dev/null
+++ b/drivers/platform/mellanox/mlxreg-dpu.c
@@ -0,0 +1,625 @@
@@ -0,0 +1,626 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Nvidia Data Processor Unit platform driver
+ *
+ * Copyright (C) 2024 Nvidia Technologies Ltd.
+ * Copyright (C) 2025 Nvidia Technologies Ltd.
+ */
+
+#include <linux/device.h>
+#include <linux/dev_printk.h>
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/platform_data/mlxcpld.h>
Expand Down Expand Up @@ -389,13 +390,14 @@ index 000000000000..f831d6dd5ece
+ .mask = MLXREG_DPU_AGGR_MASK,
+};
+
+/* mlxreg_dpu - device private data
+ * @dev: platform device;
+ * @data: pltaform core data;
+ * @io_data: register access platform data;
+ * @io_regs: register access device;
+ * @hotplug_data: hotplug platform data;
+ * @hotplug: hotplug device;
+/**
+ * struct mlxreg_dpu - device private data
+ * @dev: platform device
+ * @data: platform core data
+ * @io_data: register access platform data
+ * @io_regs: register access device
+ * @hotplug_data: hotplug platform data
+ * @hotplug: hotplug device
+ */
+struct mlxreg_dpu {
+ struct device *dev;
Expand Down Expand Up @@ -478,6 +480,11 @@ index 000000000000..f831d6dd5ece
+ return false;
+}
+
+static const struct reg_default mlxreg_dpu_regmap_default[] = {
+ { MLXREG_DPU_REG_PG_EVENT_OFFSET, 0x00 },
+ { MLXREG_DPU_REG_HEALTH_EVENT_OFFSET, 0x00 },
+};
+
+/* Configuration for the register map of a device with 2 bytes address space. */
+static const struct regmap_config mlxreg_dpu_regmap_conf = {
+ .reg_bits = 16,
Expand All @@ -487,10 +494,13 @@ index 000000000000..f831d6dd5ece
+ .writeable_reg = mlxreg_dpu_writeable_reg,
+ .readable_reg = mlxreg_dpu_readable_reg,
+ .volatile_reg = mlxreg_dpu_volatile_reg,
+ .reg_defaults = mlxreg_dpu_regmap_default,
+ .num_reg_defaults = ARRAY_SIZE(mlxreg_dpu_regmap_default),
+};
+
+static int mlxreg_dpu_copy_hotplug_data(struct device *dev, struct mlxreg_dpu *mlxreg_dpu,
+ struct mlxreg_core_hotplug_platform_data *hotplug_data)
+static int
+mlxreg_dpu_copy_hotplug_data(struct device *dev, struct mlxreg_dpu *mlxreg_dpu,
+ const struct mlxreg_core_hotplug_platform_data *hotplug_data)
+{
+ struct mlxreg_core_item *item;
+ int i;
Expand All @@ -502,18 +512,15 @@ index 000000000000..f831d6dd5ece
+
+ mlxreg_dpu->hotplug_data->items = devm_kmemdup(dev, hotplug_data->items,
+ mlxreg_dpu->hotplug_data->counter *
+ sizeof(*hotplug_data->items),
+ sizeof(*mlxreg_dpu->hotplug_data->items),
+ GFP_KERNEL);
+ if (!mlxreg_dpu->hotplug_data->items)
+ return -ENOMEM;
+
+ item = mlxreg_dpu->hotplug_data->items;
+ for (i = 0; i < mlxreg_dpu->hotplug_data->counter; i++, item++) {
+ item = devm_kmemdup(dev, &hotplug_data->items[i], sizeof(*item), GFP_KERNEL);
+ if (!item)
+ return -ENOMEM;
+ for (i = 0; i < hotplug_data->counter; i++, item++) {
+ item->data = devm_kmemdup(dev, hotplug_data->items[i].data,
+ hotplug_data->items[i].count * sizeof(item->data),
+ hotplug_data->items[i].count * sizeof(*item->data),
+ GFP_KERNEL);
+ if (!item->data)
+ return -ENOMEM;
Expand All @@ -533,6 +540,7 @@ index 000000000000..f831d6dd5ece
+ err = regmap_read(regmap, MLXREG_DPU_REG_CONFIG3_OFFSET, &regval);
+ if (err)
+ return err;
+
+ switch (regval) {
+ case MLXREG_DPU_BF3:
+ /* Copy platform specific hotplug data. */
Expand All @@ -552,15 +560,15 @@ index 000000000000..f831d6dd5ece
+ if (mlxreg_dpu->io_data) {
+ mlxreg_dpu->io_data->regmap = regmap;
+ mlxreg_dpu->io_regs =
+ platform_device_register_resndata(dev, "mlxreg-io", data->slot, NULL, 0,
+ mlxreg_dpu->io_data,
+ sizeof(*mlxreg_dpu->io_data));
+ platform_device_register_resndata(dev, "mlxreg-io",
+ data->slot, NULL, 0,
+ mlxreg_dpu->io_data,
+ sizeof(*mlxreg_dpu->io_data));
+ if (IS_ERR(mlxreg_dpu->io_regs)) {
+ dev_err(dev, "Failed to create regio for client %s at bus %d at addr 0x%02x\n",
+ data->hpdev.brdinfo->type, data->hpdev.nr,
+ data->hpdev.brdinfo->addr);
+ err = PTR_ERR(mlxreg_dpu->io_regs);
+ goto fail_register_io;
+ return PTR_ERR(mlxreg_dpu->io_regs);
+ }
+ }
+
Expand All @@ -569,9 +577,10 @@ index 000000000000..f831d6dd5ece
+ mlxreg_dpu->hotplug_data->regmap = regmap;
+ mlxreg_dpu->hotplug_data->irq = irq;
+ mlxreg_dpu->hotplug =
+ platform_device_register_resndata(dev, "mlxreg-hotplug", data->slot, NULL, 0,
+ mlxreg_dpu->hotplug_data,
+ sizeof(*mlxreg_dpu->hotplug_data));
+ platform_device_register_resndata(dev, "mlxreg-hotplug",
+ data->slot, NULL, 0,
+ mlxreg_dpu->hotplug_data,
+ sizeof(*mlxreg_dpu->hotplug_data));
+ if (IS_ERR(mlxreg_dpu->hotplug)) {
+ err = PTR_ERR(mlxreg_dpu->hotplug);
+ goto fail_register_hotplug;
Expand All @@ -582,16 +591,13 @@ index 000000000000..f831d6dd5ece
+
+fail_register_hotplug:
+ platform_device_unregister(mlxreg_dpu->io_regs);
+fail_register_io:
+
+ return err;
+}
+
+static void mlxreg_dpu_config_exit(struct mlxreg_dpu *mlxreg_dpu)
+{
+ /* Unregister hotplug driver. */
+ platform_device_unregister(mlxreg_dpu->hotplug);
+ /* Unregister IO access driver. */
+ platform_device_unregister(mlxreg_dpu->io_regs);
+}
+
Expand All @@ -606,14 +612,14 @@ index 000000000000..f831d6dd5ece
+ if (!data || !data->hpdev.brdinfo)
+ return -EINVAL;
+
+ mlxreg_dpu = devm_kzalloc(&pdev->dev, sizeof(*mlxreg_dpu), GFP_KERNEL);
+ if (!mlxreg_dpu)
+ return -ENOMEM;
+
+ data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr);
+ if (!data->hpdev.adapter)
+ return -EPROBE_DEFER;
+
+ mlxreg_dpu = devm_kzalloc(&pdev->dev, sizeof(*mlxreg_dpu), GFP_KERNEL);
+ if (!mlxreg_dpu)
+ return -ENOMEM;
+
+ /* Create device at the top of DPU I2C tree.*/
+ data->hpdev.client = i2c_new_client_device(data->hpdev.adapter,
+ data->hpdev.brdinfo);
Expand All @@ -624,8 +630,7 @@ index 000000000000..f831d6dd5ece
+ goto i2c_new_device_fail;
+ }
+
+ regmap = devm_regmap_init_i2c(data->hpdev.client,
+ &mlxreg_dpu_regmap_conf);
+ regmap = devm_regmap_init_i2c(data->hpdev.client, &mlxreg_dpu_regmap_conf);
+ if (IS_ERR(regmap)) {
+ dev_err(&pdev->dev, "Failed to create regmap for client %s at bus %d at addr 0x%02x\n",
+ data->hpdev.brdinfo->type, data->hpdev.nr, data->hpdev.brdinfo->addr);
Expand All @@ -647,13 +652,10 @@ index 000000000000..f831d6dd5ece
+ mlxreg_dpu->dev = &pdev->dev;
+ platform_set_drvdata(pdev, mlxreg_dpu);
+
+ /* Configure DPU. */
+ err = mlxreg_dpu_config_init(mlxreg_dpu, regmap, data, data->hpdev.brdinfo->irq);
+ if (err)
+ goto mlxreg_dpu_config_init_fail;
+
+ return err;
+
+mlxreg_dpu_config_init_fail:
+regcache_sync_fail:
+devm_regmap_init_i2c_fail:
Expand Down Expand Up @@ -697,7 +699,6 @@ index 000000000000..f831d6dd5ece
+MODULE_DESCRIPTION("Nvidia Data Processor Unit platform driver");
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS("platform:mlxreg-dpu");
+
--
2.34.1
2.44.0

Loading