netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fsl/fman: fix dtsec_set_tx_pause_frames
@ 2016-03-13 19:14 igal.liberman
  2016-03-14 19:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: igal.liberman @ 2016-03-13 19:14 UTC (permalink / raw)
  To: netdev; +Cc: scottwood, madalin.bucur, Igal Liberman

From: Igal Liberman <igal.liberman@freescale.com>

Fix a bug introduced in e06a03b (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: Igal Liberman <igal.liberman@freescale.com>
---
 drivers/net/ethernet/freescale/fman/fman_dtsec.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c
index 7c92eb8..c88918c 100644
--- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c
+++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c
@@ -932,15 +932,14 @@ int dtsec_set_tx_pause_frames(struct fman_mac *dtsec,
 	if (!is_init_done(dtsec->dtsec_drv_param))
 		return -EINVAL;
 
-	/* FM_BAD_TX_TS_IN_B_2_B_ERRATA_DTSEC_A003 Errata workaround */
-	if (dtsec->fm_rev_info.major == 2)
-		if (pause_time <= 320) {
+	if (pause_time) {
+		/* FM_BAD_TX_TS_IN_B_2_B_ERRATA_DTSEC_A003 Errata workaround */
+		if (dtsec->fm_rev_info.major == 2 && pause_time <= 320) {
 			pr_warn("pause-time: %d illegal.Should be > 320\n",
 				pause_time);
 			return -EINVAL;
 		}
 
-	if (pause_time) {
 		ptv = ioread32be(&regs->ptv);
 		ptv &= PTV_PTE_MASK;
 		ptv |= pause_time & PTV_PT_MASK;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fsl/fman: fix dtsec_set_tx_pause_frames
  2016-03-13 19:14 [PATCH] fsl/fman: fix dtsec_set_tx_pause_frames igal.liberman
@ 2016-03-14 19:03 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-03-14 19:03 UTC (permalink / raw)
  To: igal.liberman; +Cc: netdev, scottwood, madalin.bucur

From: <igal.liberman@freescale.com>
Date: Sun, 13 Mar 2016 21:14:43 +0200

> From: Igal Liberman <igal.liberman@freescale.com>
> 
> Fix a bug introduced in e06a03b (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: Igal Liberman <igal.liberman@freescale.com>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-14 19:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-13 19:14 [PATCH] fsl/fman: fix dtsec_set_tx_pause_frames igal.liberman
2016-03-14 19:03 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).