[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210924110842.6323-4-kelvin.cao@microchip.com>
Date: Fri, 24 Sep 2021 11:08:40 +0000
From: <kelvin.cao@...rochip.com>
To: <kurt.schwemmer@...rosemi.com>, <logang@...tatee.com>,
<bhelgaas@...gle.com>, <linux-pci@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: <kelvin.cao@...rochip.com>, <kelvincao@...look.com>
Subject: [PATCH 3/5] PCI/switchtec: Update the way of getting management VEP instance ID
From: Kelvin Cao <kelvin.cao@...rochip.com>
Gen4 firmware adds DMA VEP and NVMe VEP support in VEP (virtual EP)
instance ID register in addtion to management EP, update the way of
getting management VEP instance ID.
Signed-off-by: Kelvin Cao <kelvin.cao@...rochip.com>
---
drivers/pci/switch/switchtec.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 76f14ed15445..b76094e2c885 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -1125,7 +1125,7 @@ static int ioctl_pff_to_port(struct switchtec_dev *stdev,
break;
}
- reg = ioread32(&pcfg->vep_pff_inst_id);
+ reg = ioread32(&pcfg->vep_pff_inst_id) & 0xFF;
if (reg == p.pff) {
p.port = SWITCHTEC_IOCTL_PFF_VEP;
break;
@@ -1171,7 +1171,7 @@ static int ioctl_port_to_pff(struct switchtec_dev *stdev,
p.pff = ioread32(&pcfg->usp_pff_inst_id);
break;
case SWITCHTEC_IOCTL_PFF_VEP:
- p.pff = ioread32(&pcfg->vep_pff_inst_id);
+ p.pff = ioread32(&pcfg->vep_pff_inst_id) & 0xFF;
break;
default:
if (p.port > ARRAY_SIZE(pcfg->dsp_pff_inst_id))
@@ -1545,7 +1545,7 @@ static void init_pff(struct switchtec_dev *stdev)
if (reg < stdev->pff_csr_count)
stdev->pff_local[reg] = 1;
- reg = ioread32(&pcfg->vep_pff_inst_id);
+ reg = ioread32(&pcfg->vep_pff_inst_id) & 0xFF;
if (reg < stdev->pff_csr_count)
stdev->pff_local[reg] = 1;
--
2.25.1
Powered by blists - more mailing lists