]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mlx5: Remove redundant iseg base
authorParav Pandit <parav@nvidia.com>
Thu, 19 Mar 2026 12:22:10 +0000 (14:22 +0200)
committerLeon Romanovsky <leon@kernel.org>
Sun, 22 Mar 2026 18:40:36 +0000 (14:40 -0400)
iseg_base and base_addr both point to BAR0, making iseg_base redundant.
Remove iseg_base and rely on base_addr instead, reducing the size of
struct mlx5_core_dev.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260319122211.27384-2-tariqt@nvidia.com
Reviewed-by: Joe Damato <joe@dama.to>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mlx5/main.c
drivers/net/ethernet/mellanox/mlx5/core/main.c
drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c
include/linux/mlx5/driver.h

index 9fb0629978bd26af7da02a095b4897f47ba7df53..5b8987ddaa8e9bdd706bee8791f2d239dd8fa7dd 100644 (file)
@@ -2740,7 +2740,7 @@ static int mlx5_ib_mmap(struct ib_ucontext *ibcontext, struct vm_area_struct *vm
                if (PAGE_SIZE > 4096)
                        return -EOPNOTSUPP;
 
-               pfn = (dev->mdev->iseg_base +
+               pfn = (dev->mdev->bar_addr +
                       offsetof(struct mlx5_init_seg, internal_timer_h)) >>
                        PAGE_SHIFT;
                return rdma_user_mmap_io(&context->ibucontext, vma, pfn,
index b0bc4a7d4a93a4221c69b0da90bc3710118eae8d..661b211eeb95857ac6dc6f69649e80632c7e2a92 100644 (file)
@@ -950,8 +950,7 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct pci_dev *pdev,
            pci_enable_atomic_ops_to_root(pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP128))
                mlx5_core_dbg(dev, "Enabling pci atomics failed\n");
 
-       dev->iseg_base = dev->bar_addr;
-       dev->iseg = ioremap(dev->iseg_base, sizeof(*dev->iseg));
+       dev->iseg = ioremap(dev->bar_addr, sizeof(*dev->iseg));
        if (!dev->iseg) {
                err = -ENOMEM;
                mlx5_core_err(dev, "Failed mapping initialization segment, aborting\n");
index c45540fe7d9d95f286bfb21b1b733fca700ef6c6..4391ef0bab5df02ca68263046c66feb463e5e07c 100644 (file)
@@ -37,7 +37,6 @@ static int mlx5_sf_dev_probe(struct auxiliary_device *adev, const struct auxilia
        mdev->device = &adev->dev;
        mdev->pdev = sf_dev->parent_mdev->pdev;
        mdev->bar_addr = sf_dev->bar_base_addr;
-       mdev->iseg_base = sf_dev->bar_base_addr;
        mdev->coredev_type = MLX5_COREDEV_SF;
        mdev->priv.parent_mdev = sf_dev->parent_mdev;
        mdev->priv.adev_idx = adev->id;
@@ -53,7 +52,7 @@ static int mlx5_sf_dev_probe(struct auxiliary_device *adev, const struct auxilia
                goto mdev_err;
        }
 
-       mdev->iseg = ioremap(mdev->iseg_base, sizeof(*mdev->iseg));
+       mdev->iseg = ioremap(mdev->bar_addr, sizeof(*mdev->iseg));
        if (!mdev->iseg) {
                mlx5_core_warn(mdev, "remap error\n");
                err = -ENOMEM;
index 04dcd09f7517b226f9a98afd2ed340395093114c..b8b5af78284d1a5714f33855cae14fa2a4b7fd1c 100644 (file)
@@ -755,7 +755,6 @@ struct mlx5_core_dev {
        } caps;
        struct mlx5_timeouts    *timeouts;
        u64                     sys_image_guid;
-       phys_addr_t             iseg_base;
        struct mlx5_init_seg __iomem *iseg;
        phys_addr_t             bar_addr;
        enum mlx5_device_state  state;