Skip to contentSkip to conversation

fec: Do not access unexisting register in Coldfire

PATCH Applied Fabio Estevam 4 participants 4 messages Mar 31, 2016 – Apr 1, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fec: Do not access unexisting register in Coldfire

From: Fabio Estevam <[email protected]>

Commit 55cd48c821de ("net: fec: stop the "rcv is not +last, " error messages") introduces a write to a register that does not exist in Coldfire.

Move the FEC_FTRL register access inside the FEC_QUIRK_HAS_RACC 'if' block, so that we guarantee it will not be used on Coldfire CPUs.

---
 drivers/net/ethernet/freescale/fec_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/fec_main.c +1 -1
index 37c0815..08243c2 100644
@@ -943,8 +943,8 @@ fec_restart(struct net_device *ndev)
 		else
 			val &= ~FEC_RACC_OPTIONS;
 		writel(val, fep->hwp + FEC_RACC);
+		writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
 	}
-	writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
 #endif
 
 	/*
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw

From: Fabio Estevam <[email protected]>
Date: Thu, 31 Mar 2016 12:05:17 -0300

Quoted 11 lines

From: Fabio Estevam <[email protected]>

Commit 55cd48c821de ("net: fec: stop the "rcv is not +last, " error messages") introduces a write to a register that does not exist in Coldfire.

Move the FEC_FTRL register access inside the FEC_QUIRK_HAS_RACC 'if' block, so that we guarantee it will not be used on Coldfire CPUs.

Applied, thanks.

#2 lore raw
In reply to Fabio Estevam

Thanks for taking care of that Fabio.

Regards
Greg

Quoted 30 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Commit 55cd48c821de ("net: fec: stop the "rcv is not +last, " error messages") introduces a write to a register that does not exist in Coldfire.

Move the FEC_FTRL register access inside the FEC_QUIRK_HAS_RACC 'if' block, so that we guarantee it will not be used on Coldfire CPUs.

---
 drivers/net/ethernet/freescale/fec_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/fec_main.c +1 -1
index 37c0815..08243c2 100644
@@ -943,8 +943,8 @@ fec_restart(struct net_device *ndev)
 		else
 			val &= ~FEC_RACC_OPTIONS;
 		writel(val, fep->hwp + FEC_RACC);
+		writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
 	}
-	writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
 #endif
 
 	/*
#3 lore raw
In reply to Fabio Estevam

From: Fabio Estevam <[email protected]> Sent: Thursday, March 31, 2016 11:05 PM

Quoted 36 lines

To: [email protected]
Cc: Fugang Duan <[email protected]>; [email protected]; [email protected]; [email protected]; Fabio Estevam <[email protected]>
Subject: [PATCH] fec: Do not access unexisting register in Coldfire

From: Fabio Estevam <[email protected]>

Commit 55cd48c821de ("net: fec: stop the "rcv is not +last, " error messages") introduces a write to a register that does not exist in Coldfire.

Move the FEC_FTRL register access inside the FEC_QUIRK_HAS_RACC 'if' block, so that we guarantee it will not be used on Coldfire CPUs.

---
 drivers/net/ethernet/freescale/fec_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/fec_main.c +1 -2
index 37c0815..08243c2 100644
@@ -943,8 +943,8 @@ fec_restart(struct net_device *ndev)
 		else
 			val &= ~FEC_RACC_OPTIONS;
 		writel(val, fep->hwp + FEC_RACC);
+		writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
 	}
-	writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
 #endif
 
 	/*
--
Quoted 1 line

1.9.1

If you stick to do it like this, you must add comments on the quirk flag FEC_QUIRK_HAS_RACC.