kernel/kernel-rt/centos/patches/0022-driver-core-auxiliary-bus-make-remove-function-retur.patch
M. Vefa Bicakci ef3c9a4618 kernel: Add auxiliary bus support
This commit back-ports the auxiliary bus device driver from kernel
version 5.11 to the StarlingX kernels, along with the bug fixes to this
driver to date.

This is necessary, because Intel's out-of-tree ice and iavf drivers, and
Mellanox OFED v5.5's out-of-tree drivers rely on the functionality
provided by the auxiliary bus driver. However, because the v5.10 kernel
baseline used by StarlingX does not have this driver, the out-of-tree
drivers would build and install their own version of the driver, named
auxiliary.ko. This would cause kernel module symbol resolution errors at
run-time when attempting to load ice and mlx5 kernel modules
concurrently.

Hence, this commit cherry-picks eight patches to add the auxiliary bus
device driver to StarlingX's kernels, and adds a ninth patch to enable
CONFIG_AUXILIARY_BUS by default. The latter is necessary, because
StarlingX does not enable any in-tree kernel modules that 'select'
CONFIG_AUXILIARY_BUS, which causes the kernel's build system to
automatically disable this option. (None of the cherry-picked patches
had merge conflicts.)

It should be noted that all affected out-of-tree drivers' build systems
are robust enough to detect that the kernel provides an auxiliary.ko
driver, so the only out-of-tree driver modification involved changing
the ice driver's spec file so that the installation of auxiliary.ko is
removed.

Testing:
- An incremental monolithic build of StarlingX's master branch was
  successful. This build included currently-unreleased Mellanox OFED
  v5.5 work as well.

- The built ISO image was successfully installed into and bootstrapped
  in a VM with low-latency profile in All-in-One simplex configuration,
  and the ability to insert ice, iavf and mlx5 kernel modules
  concurrently was confirmed.

- The same test was repeated with a different VM, this time with the
  standard (i.e., non-low-latency) profile in All-in-One simplex mode.

- The same ISO image was installed onto a 'standard' StarlingX system
  with two controller and two compute nodes with network adapters
  managed by Mellanox's OFED drivers. The low-latency profile was used.
  The Mellanox network adapters are used for inter-node communication in
  this server set-up. The bootstrap procedure was successful, and the
  RDMA/Infiniband over Ethernet functionalities of the Mellanox adapters
  were successfully tested using the Linux RDMA community's perftest
  package.

- The same ISO image was installed onto an All-in-One simplex StarlingX
  system with an Intel E810 network adapter, managed by the ice driver,
  which is the system's management (OAM) interface. While the bootstrap
  of the system ultimately failed, this was due to an unrelated reason,
  and the network adapter's functionality was not found to be affected
  by this commit. iperf3 was used on virtual function interfaces
  (belonging to the same E810 network adapter) manually set up and
  attached to separate network namespaces, as an additional sanity test.

Story: 2009878
Task: 44612

Change-Id: I8acfb0539757a35be3fb099ea2a6f95e05557e4f
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
2022-02-28 17:35:11 -05:00

80 lines
3.3 KiB
Diff

From 3dd9d97b9329c10548b0376307bdda8e23310fa9 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Fri, 4 Dec 2020 12:44:07 +0100
Subject: [PATCH] driver core: auxiliary bus: make remove function return void
There's an effort to move the remove() callback in the driver core to
not return an int, as nothing can be done if this function fails. To
make that effort easier, make the aux bus remove function void to start
with so that no users have to be changed sometime in the future.
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Ertman <david.m.ertman@intel.com>
Cc: Fred Oh <fred.oh@linux.intel.com>
Cc: Kiran Patil <kiran.patil@intel.com>
Cc: Leon Romanovsky <leonro@nvidia.com>
Cc: Martin Habets <mhabets@solarflare.com>
Cc: Parav Pandit <parav@mellanox.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: Shiraz Saleem <shiraz.saleem@intel.com>
Link: https://lore.kernel.org/r/X8ohB1ks1NK7kPop@kroah.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8142a46c50d2dd8160c42284e1044eed3bec0d18)
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
---
Documentation/driver-api/auxiliary_bus.rst | 2 +-
drivers/base/auxiliary.c | 5 ++---
include/linux/auxiliary_bus.h | 2 +-
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/Documentation/driver-api/auxiliary_bus.rst b/Documentation/driver-api/auxiliary_bus.rst
index 5dd7804631ef..2312506b0674 100644
--- a/Documentation/driver-api/auxiliary_bus.rst
+++ b/Documentation/driver-api/auxiliary_bus.rst
@@ -150,7 +150,7 @@ and shutdown notifications using the standard conventions.
struct auxiliary_driver {
int (*probe)(struct auxiliary_device *,
const struct auxiliary_device_id *id);
- int (*remove)(struct auxiliary_device *);
+ void (*remove)(struct auxiliary_device *);
void (*shutdown)(struct auxiliary_device *);
int (*suspend)(struct auxiliary_device *, pm_message_t);
int (*resume)(struct auxiliary_device *);
diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c
index eca36d6284d0..c44e85802b43 100644
--- a/drivers/base/auxiliary.c
+++ b/drivers/base/auxiliary.c
@@ -82,13 +82,12 @@ static int auxiliary_bus_remove(struct device *dev)
{
struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver);
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
- int ret = 0;
if (auxdrv->remove)
- ret = auxdrv->remove(auxdev);
+ auxdrv->remove(auxdev);
dev_pm_domain_detach(dev, true);
- return ret;
+ return 0;
}
static void auxiliary_bus_shutdown(struct device *dev)
diff --git a/include/linux/auxiliary_bus.h b/include/linux/auxiliary_bus.h
index 3580743d0e8d..d67b17606210 100644
--- a/include/linux/auxiliary_bus.h
+++ b/include/linux/auxiliary_bus.h
@@ -19,7 +19,7 @@ struct auxiliary_device {
struct auxiliary_driver {
int (*probe)(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id);
- int (*remove)(struct auxiliary_device *auxdev);
+ void (*remove)(struct auxiliary_device *auxdev);
void (*shutdown)(struct auxiliary_device *auxdev);
int (*suspend)(struct auxiliary_device *auxdev, pm_message_t state);
int (*resume)(struct auxiliary_device *auxdev);
--
2.29.2