Commit 7c82a7b9 authored by Igal Liberman's avatar Igal Liberman Committed by David S. Miller

fsl/fman: fix dtsec_set_tx_pause_frames

Fix a bug introduced in e06a03bd (fsl/fman: fix the pause_time test)
When pause_time is set to '0' - pause frames are disabled and
there's no need to apply dTSEC-A003 Errata workaround.
Signed-off-by: default avatarIgal Liberman <igal.liberman@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 387178ec
...@@ -932,15 +932,14 @@ int dtsec_set_tx_pause_frames(struct fman_mac *dtsec, ...@@ -932,15 +932,14 @@ int dtsec_set_tx_pause_frames(struct fman_mac *dtsec,
if (!is_init_done(dtsec->dtsec_drv_param)) if (!is_init_done(dtsec->dtsec_drv_param))
return -EINVAL; return -EINVAL;
if (pause_time) {
/* FM_BAD_TX_TS_IN_B_2_B_ERRATA_DTSEC_A003 Errata workaround */ /* FM_BAD_TX_TS_IN_B_2_B_ERRATA_DTSEC_A003 Errata workaround */
if (dtsec->fm_rev_info.major == 2) if (dtsec->fm_rev_info.major == 2 && pause_time <= 320) {
if (pause_time <= 320) {
pr_warn("pause-time: %d illegal.Should be > 320\n", pr_warn("pause-time: %d illegal.Should be > 320\n",
pause_time); pause_time);
return -EINVAL; return -EINVAL;
} }
if (pause_time) {
ptv = ioread32be(&regs->ptv); ptv = ioread32be(&regs->ptv);
ptv &= PTV_PTE_MASK; ptv &= PTV_PTE_MASK;
ptv |= pause_time & PTV_PT_MASK; ptv |= pause_time & PTV_PT_MASK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment