Patch "vDPA/ifcvf: decouple hw features manipulators from the adapter" has been added to the 6.2-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    vDPA/ifcvf: decouple hw features manipulators from the adapter

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-decouple-hw-features-manipulators-from-the-adapter.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 d59f633dd05940739b5f46f5d4403cafb91d2742 Mon Sep 17 00:00:00 2001
From: Zhu Lingshan <lingshan.zhu@xxxxxxxxx>
Date: Fri, 25 Nov 2022 22:57:13 +0800
Subject: vDPA/ifcvf: decouple hw features manipulators from the adapter

From: Zhu Lingshan <lingshan.zhu@xxxxxxxxx>

commit d59f633dd05940739b5f46f5d4403cafb91d2742 upstream.

This commit gets rid of ifcvf_adapter in hw features related
functions in ifcvf_base. Then these functions are more rubust
and de-coupling from the ifcvf_adapter layer. So these
functions could be invoded once the device is probed, even
before the adapter is allocaed.

Signed-off-by: Zhu Lingshan <lingshan.zhu@xxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Message-Id: <20221125145724.1129962-2-lingshan.zhu@xxxxxxxxx>
Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/vdpa/ifcvf/ifcvf_base.c |    9 ++-------
 drivers/vdpa/ifcvf/ifcvf_base.h |    1 +
 drivers/vdpa/ifcvf/ifcvf_main.c |    1 +
 3 files changed, 4 insertions(+), 7 deletions(-)

--- a/drivers/vdpa/ifcvf/ifcvf_base.c
+++ b/drivers/vdpa/ifcvf/ifcvf_base.c
@@ -220,10 +220,8 @@ u64 ifcvf_get_features(struct ifcvf_hw *
 
 int ifcvf_verify_min_features(struct ifcvf_hw *hw, u64 features)
 {
-	struct ifcvf_adapter *ifcvf = vf_to_adapter(hw);
-
 	if (!(features & BIT_ULL(VIRTIO_F_ACCESS_PLATFORM)) && features) {
-		IFCVF_ERR(ifcvf->pdev, "VIRTIO_F_ACCESS_PLATFORM is not negotiated\n");
+		IFCVF_ERR(hw->pdev, "VIRTIO_F_ACCESS_PLATFORM is not negotiated\n");
 		return -EINVAL;
 	}
 
@@ -301,14 +299,11 @@ static void ifcvf_set_features(struct if
 
 static int ifcvf_config_features(struct ifcvf_hw *hw)
 {
-	struct ifcvf_adapter *ifcvf;
-
-	ifcvf = vf_to_adapter(hw);
 	ifcvf_set_features(hw, hw->req_features);
 	ifcvf_add_status(hw, VIRTIO_CONFIG_S_FEATURES_OK);
 
 	if (!(ifcvf_get_status(hw) & VIRTIO_CONFIG_S_FEATURES_OK)) {
-		IFCVF_ERR(ifcvf->pdev, "Failed to set FEATURES_OK status\n");
+		IFCVF_ERR(hw->pdev, "Failed to set FEATURES_OK status\n");
 		return -EIO;
 	}
 
--- a/drivers/vdpa/ifcvf/ifcvf_base.h
+++ b/drivers/vdpa/ifcvf/ifcvf_base.h
@@ -89,6 +89,7 @@ struct ifcvf_hw {
 	u16 nr_vring;
 	/* VIRTIO_PCI_CAP_DEVICE_CFG size */
 	u32 cap_dev_config_size;
+	struct pci_dev *pdev;
 };
 
 struct ifcvf_adapter {
--- a/drivers/vdpa/ifcvf/ifcvf_main.c
+++ b/drivers/vdpa/ifcvf/ifcvf_main.c
@@ -842,6 +842,7 @@ static int ifcvf_probe(struct pci_dev *p
 	vf = &adapter->vf;
 	vf->dev_type = get_dev_type(pdev);
 	vf->base = pcim_iomap_table(pdev);
+	vf->pdev = pdev;
 
 	adapter->pdev = pdev;
 	adapter->vdpa.dma_dev = &pdev->dev;


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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux