Skip to content

Commit

Permalink
misc: xilinx-sdfec: Correct write to protect regs
Browse files Browse the repository at this point in the history
The function xsdfec_wr_protect incorrectly skips writing to the
CODE_WR_PROTECT and AXI_WR_PROTECT registers when the input argument wr_pr
is false.

Signed-off-by: Derek Kiernan <derek.kiernan@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
  • Loading branch information
Derek Kiernan authored and Michal Simek committed May 15, 2018
1 parent e5b6542 commit f3d40d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/misc/xilinx_sdfec.c
Expand Up @@ -171,15 +171,18 @@ xsdfec_wr_protect(struct xsdfec_dev *xsdfec, bool wr_pr)
xsdfec_regwrite(xsdfec,
XSDFEC_AXI_WR_PROTECT_ADDR,
XSDFEC_WRITE_PROTECT_ENABLE);
/* prevents register and tables writes */
xsdfec->wr_protect = wr_pr;
} else {
/* allows register and table writes including protection regs */
xsdfec->wr_protect = wr_pr;
xsdfec_regwrite(xsdfec,
XSDFEC_AXI_WR_PROTECT_ADDR,
XSDFEC_WRITE_PROTECT_DISABLE);
xsdfec_regwrite(xsdfec,
XSDFEC_CODE_WR_PROTECT_ADDR,
XSDFEC_WRITE_PROTECT_DISABLE);
}
xsdfec->wr_protect = wr_pr;
}

static int
Expand Down

0 comments on commit f3d40d3

Please sign in to comment.