This is a note to let you know that I've just added the patch titled vDPA/ifcvf: manage ifcvf_hw in the mgmt_dev to the 6.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: vdpa-ifcvf-manage-ifcvf_hw-in-the-mgmt_dev.patch and it can be found in the queue-6.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 6a3b2f179b49f2c6452ecc37b4778a43848b454c Mon Sep 17 00:00:00 2001 From: Zhu Lingshan <lingshan.zhu@xxxxxxxxx> Date: Fri, 25 Nov 2022 22:57:21 +0800 Subject: vDPA/ifcvf: manage ifcvf_hw in the mgmt_dev From: Zhu Lingshan <lingshan.zhu@xxxxxxxxx> commit 6a3b2f179b49f2c6452ecc37b4778a43848b454c upstream. This commit allocates the hw structure in the management device structure. So the hardware can be initialized once the management device is allocated in probe. Signed-off-by: Zhu Lingshan <lingshan.zhu@xxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Message-Id: <20221125145724.1129962-10-lingshan.zhu@xxxxxxxxx> Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/vdpa/ifcvf/ifcvf_base.h | 5 +++-- drivers/vdpa/ifcvf/ifcvf_main.c | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) --- a/drivers/vdpa/ifcvf/ifcvf_base.h +++ b/drivers/vdpa/ifcvf/ifcvf_base.h @@ -39,7 +39,7 @@ #define IFCVF_INFO(pdev, fmt, ...) dev_info(&pdev->dev, fmt, ##__VA_ARGS__) #define ifcvf_private_to_vf(adapter) \ - (&((struct ifcvf_adapter *)adapter)->vf) + (((struct ifcvf_adapter *)adapter)->vf) /* all vqs and config interrupt has its own vector */ #define MSIX_VECTOR_PER_VQ_AND_CONFIG 1 @@ -95,7 +95,7 @@ struct ifcvf_hw { struct ifcvf_adapter { struct vdpa_device vdpa; struct pci_dev *pdev; - struct ifcvf_hw vf; + struct ifcvf_hw *vf; }; struct ifcvf_vring_lm_cfg { @@ -110,6 +110,7 @@ struct ifcvf_lm_cfg { struct ifcvf_vdpa_mgmt_dev { struct vdpa_mgmt_dev mdev; + struct ifcvf_hw vf; struct ifcvf_adapter *adapter; struct pci_dev *pdev; }; --- a/drivers/vdpa/ifcvf/ifcvf_main.c +++ b/drivers/vdpa/ifcvf/ifcvf_main.c @@ -402,7 +402,7 @@ static struct ifcvf_hw *vdpa_to_vf(struc { struct ifcvf_adapter *adapter = vdpa_to_adapter(vdpa_dev); - return &adapter->vf; + return adapter->vf; } static u64 ifcvf_vdpa_get_device_features(struct vdpa_device *vdpa_dev) @@ -750,7 +750,7 @@ static int ifcvf_vdpa_dev_add(struct vdp return -EOPNOTSUPP; adapter = ifcvf_mgmt_dev->adapter; - vf = &adapter->vf; + vf = adapter->vf; pdev = adapter->pdev; vdpa_dev = &adapter->vdpa; @@ -838,10 +838,11 @@ static int ifcvf_probe(struct pci_dev *p adapter->vdpa.mdev = &ifcvf_mgmt_dev->mdev; ifcvf_mgmt_dev->adapter = adapter; - vf = &adapter->vf; + vf = &ifcvf_mgmt_dev->vf; vf->dev_type = get_dev_type(pdev); vf->base = pcim_iomap_table(pdev); vf->pdev = pdev; + adapter->vf = vf; ret = ifcvf_init_hw(vf, pdev); if (ret) { Patches currently in stable-queue which might be from lingshan.zhu@xxxxxxxxx are queue-6.2/vdpa-ifcvf-allocate-the-adapter-in-dev_add.patch queue-6.2/vdpa-ifcvf-decouple-vq-irq-releasers-from-the-adapter.patch queue-6.2/vdpa-ifcvf-decouple-vq-irq-requester-from-the-adapter.patch queue-6.2/vdpa-ifcvf-ifcvf_request_irq-works-on-ifcvf_hw.patch queue-6.2/vdpa-ifcvf-decouple-config-space-ops-from-the-adapter.patch queue-6.2/vdpa-ifcvf-decouple-config-irq-releaser-from-the-adapter.patch queue-6.2/vdpa-ifcvf-alloc-the-mgmt_dev-before-the-adapter.patch queue-6.2/vdpa-ifcvf-manage-ifcvf_hw-in-the-mgmt_dev.patch queue-6.2/vdpa-ifcvf-decouple-hw-features-manipulators-from-the-adapter.patch queue-6.2/vdpa-ifcvf-decouple-config-dev-irq-requester-and-vectors-allocator-from-the-adapter.patch