Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-cao committed Aug 10, 2020
2 parents 8a3f9d2 + 56030a9 commit 5b836d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions ntb_hw_switchtec.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ static void switchtec_ntb_part_link_speed(struct switchtec_ntb *sndev,
u32 linksta;

pff = ioread32(&stdev->mmio_part_cfg_all[partition].vep_pff_inst_id);
if (pff == 0xFFFFFFFF) {
pff &= 0xFF;
if (pff == 0xFF) {
dev_warn(&sndev->stdev->dev,
"Invalid pff, setting speed/width to 0");
*speed = 0;
Expand Down Expand Up @@ -1255,7 +1256,7 @@ static int crosslink_enum_partition(struct switchtec_ntb *sndev,
{
struct part_cfg_regs __iomem *part_cfg =
&sndev->stdev->mmio_part_cfg_all[sndev->peer_partition];
u32 pff = ioread32(&part_cfg->vep_pff_inst_id);
u32 pff = ioread32(&part_cfg->vep_pff_inst_id) & 0xFF;
struct pff_csr_regs __iomem *mmio_pff =
&sndev->stdev->mmio_pff_csr[pff];
const u64 bar_space = 0x1000000000LL;
Expand Down
6 changes: 3 additions & 3 deletions switchtec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,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;
Expand Down Expand Up @@ -1127,7 +1127,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))
Expand Down Expand Up @@ -1499,7 +1499,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;

Expand Down

0 comments on commit 5b836d6

Please sign in to comment.