Skip to content

Commit 56030a9

Browse files
authored
Merge pull request #92 from Microsemi/vep_inst_id_fix
Update the way of getting vep instance id
2 parents 59e500a + 99fccbe commit 56030a9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ntb_hw_switchtec.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ static void switchtec_ntb_part_link_speed(struct switchtec_ntb *sndev,
460460
u32 linksta;
461461

462462
pff = ioread32(&stdev->mmio_part_cfg_all[partition].vep_pff_inst_id);
463-
if (pff == 0xFFFFFFFF) {
463+
pff &= 0xFF;
464+
if (pff == 0xFF) {
464465
dev_warn(&sndev->stdev->dev,
465466
"Invalid pff, setting speed/width to 0");
466467
*speed = 0;
@@ -1255,7 +1256,7 @@ static int crosslink_enum_partition(struct switchtec_ntb *sndev,
12551256
{
12561257
struct part_cfg_regs __iomem *part_cfg =
12571258
&sndev->stdev->mmio_part_cfg_all[sndev->peer_partition];
1258-
u32 pff = ioread32(&part_cfg->vep_pff_inst_id);
1259+
u32 pff = ioread32(&part_cfg->vep_pff_inst_id) & 0xFF;
12591260
struct pff_csr_regs __iomem *mmio_pff =
12601261
&sndev->stdev->mmio_pff_csr[pff];
12611262
const u64 bar_space = 0x1000000000LL;

switchtec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ static int ioctl_pff_to_port(struct switchtec_dev *stdev,
10811081
break;
10821082
}
10831083

1084-
reg = ioread32(&pcfg->vep_pff_inst_id);
1084+
reg = ioread32(&pcfg->vep_pff_inst_id) & 0xFF;
10851085
if (reg == p.pff) {
10861086
p.port = SWITCHTEC_IOCTL_PFF_VEP;
10871087
break;
@@ -1127,7 +1127,7 @@ static int ioctl_port_to_pff(struct switchtec_dev *stdev,
11271127
p.pff = ioread32(&pcfg->usp_pff_inst_id);
11281128
break;
11291129
case SWITCHTEC_IOCTL_PFF_VEP:
1130-
p.pff = ioread32(&pcfg->vep_pff_inst_id);
1130+
p.pff = ioread32(&pcfg->vep_pff_inst_id) & 0xFF;
11311131
break;
11321132
default:
11331133
if (p.port > ARRAY_SIZE(pcfg->dsp_pff_inst_id))
@@ -1499,7 +1499,7 @@ static void init_pff(struct switchtec_dev *stdev)
14991499
if (reg < stdev->pff_csr_count)
15001500
stdev->pff_local[reg] = 1;
15011501

1502-
reg = ioread32(&pcfg->vep_pff_inst_id);
1502+
reg = ioread32(&pcfg->vep_pff_inst_id) & 0xFF;
15031503
if (reg < stdev->pff_csr_count)
15041504
stdev->pff_local[reg] = 1;
15051505

0 commit comments

Comments
 (0)