Skip to contentSkip to conversation

net: fec: stop the "rcv is not +last, " error messages

PATCH Greg Ungerer 4 participants 9 messages Mar 30, 2016 – Apr 1, 2016

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

Hi Troy,

Commit 55cd48c8 ('net: fec: stop the "rcv is not +last, " error messages') adds a write to a register that is not present in all implementations of the FEC hardware module. None of the ColdFire SoC parts with the FEC module have the FTRL (0x1b0) register.

Does this need a quirk flag to key access to this register of? Or can you piggyback on the FEC_QUIRK_HAS_RACC flag?

Regards
Greg

#1 lore raw
Quoted 7 lines · Greg Ungerer

Hi Troy,

Commit 55cd48c8 ('net: fec: stop the "rcv is not +last, " error messages') adds a write to a register that is not present in all implementations of the FEC hardware module. None of the ColdFire SoC parts with the FEC module have the FTRL (0x1b0) register.

Quoted 5 lines

Does this need a quirk flag to key access to this register of? Or can you piggyback on the FEC_QUIRK_HAS_RACC flag?

Regards
Greg

I'm no expert on what hardware has which registers, but piggybacking works for all the processors that I use. Let's see what Freescale says, but would you like to submit a patch to move it inside the quirk's "if", or do you want me to do it?

#2 lore raw
In reply to Greg Ungerer

Hi Greg,

Quoted 9 lines · Greg Ungerer

Hi Troy,

Commit 55cd48c8 ('net: fec: stop the "rcv is not +last, " error messages') adds a write to a register that is not present in all implementations of the FEC hardware module. None of the ColdFire SoC parts with the FEC module have the FTRL (0x1b0) register.

Does this need a quirk flag to key access to this register of? Or can you piggyback on the FEC_QUIRK_HAS_RACC flag?

Would the change below work on Coldfire?

drivers/net/ethernet/freescale/fec_main.c +1 -1
@@ -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);
+       }
 #endif
 
        /*
#3 lore raw

Hi Fabio,

Quoted 18 lines · Fabio Estevam

Hi Greg,

Quoted 9 lines · Greg Ungerer

Hi Troy,

Commit 55cd48c8 ('net: fec: stop the "rcv is not +last, " error messages') adds a write to a register that is not present in all implementations of the FEC hardware module. None of the ColdFire SoC parts with the FEC module have the FTRL (0x1b0) register.

Does this need a quirk flag to key access to this register of? Or can you piggyback on the FEC_QUIRK_HAS_RACC flag?

Would the change below work on Coldfire?

drivers/net/ethernet/freescale/fec_main.c fec_restart(struct net_device *ndev) · line 950

Quoted 9 lines
drivers/net/ethernet/freescale/fec_main.c +1 -1
@@ -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);
+       }
 #endif
 
        /*

Yes, that fixes it. Will you carry this change?

Regards
Greg

#5 lore raw
In reply to Fabio Estevam

From: Fabio Estevam <[email protected]> Sent: Thursday, March 31, 2016 2:37 AM

Quoted 22 lines

To: Greg Ungerer <[email protected]>
Cc: Troy Kisky <[email protected]>; [email protected]
Subject: Re: [PATCH] net: fec: stop the "rcv is not +last, " error messages

Hi Greg,

Quoted 9 lines · Greg Ungerer

Hi Troy,

Commit 55cd48c8 ('net: fec: stop the "rcv is not +last, " error messages') adds a write to a register that is not present in all implementations of the FEC hardware module. None of the ColdFire SoC parts with the FEC module have the FTRL (0x1b0) register.

Does this need a quirk flag to key access to this register of? Or can you piggyback on the FEC_QUIRK_HAS_RACC flag?

Would the change below work on Coldfire?

drivers/net/ethernet/freescale/fec_main.c fec_restart(struct net_device *ndev) · line 950

Quoted 9 lines
drivers/net/ethernet/freescale/fec_main.c +1 -1
@@ -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);
+       }
 #endif
 
        /*

Fabio, we cannot do it like this that may cause confused for the quirk flag "FEC_QUIRK_HAS_RACC".

Hi, Greg,

The header file fec.h define the FEC_FTRL as below, if ColdFire SoC has no this register, we may remove the define in here and define the register according to SOC type. For example, it is ColdFire Soc, define it as 0xFFF. Is it feasible ?

#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
    defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM)

...
#define FEC_FTRL 0x1b0
...
#else
...
#endif

Regards,
Andy

#6 lore raw

Hi Andy,

Quoted 40 lines · Fugang Duan

From: Fabio Estevam <[email protected]> Sent: Thursday, March 31, 2016 2:37 AM

Quoted 22 lines

To: Greg Ungerer <[email protected]>
Cc: Troy Kisky <[email protected]>; [email protected]
Subject: Re: [PATCH] net: fec: stop the "rcv is not +last, " error messages

Hi Greg,

Quoted 9 lines · Greg Ungerer

Hi Troy,

Commit 55cd48c8 ('net: fec: stop the "rcv is not +last, " error messages') adds a write to a register that is not present in all implementations of the FEC hardware module. None of the ColdFire SoC parts with the FEC module have the FTRL (0x1b0) register.

Does this need a quirk flag to key access to this register of? Or can you piggyback on the FEC_QUIRK_HAS_RACC flag?

Would the change below work on Coldfire?

drivers/net/ethernet/freescale/fec_main.c fec_restart(struct net_device *ndev) · line 950

Quoted 9 lines
drivers/net/ethernet/freescale/fec_main.c +1 -1
@@ -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);
+       }
 #endif
 
        /*

Fabio, we cannot do it like this that may cause confused for the quirk flag "FEC_QUIRK_HAS_RACC".

Hi, Greg,

The header file fec.h define the FEC_FTRL as below, if ColdFire SoC has no this register, we may remove the define in here and define the register according to SOC type. For example, it is ColdFire Soc, define it as 0xFFF. Is it feasible ?

Quoted 8 lines
#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
    defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM)

...
#define FEC_FTRL 0x1b0
...
#else
...
#endif

Sure you could do that. But... you still have to be careful with references to it in fec_main.c. They will need be conditional on existence of FEC_FTRL, otherwise you break compilation.

Even if you define it to some bogus value we still don't want the code actually writing to it.

Regards
Greg

#7 lore raw
In reply to Fugang Duan

Hi Andy,

Quoted 2 lines · Fugang Duan

Fabio, we cannot do it like this that may cause confused for the quirk flag "FEC_QUIRK_HAS_RACC".

We can treat FEC_QUIRK_HAS_RACC flag as "this is a non-Coldfire SoC".

Quoted 6 lines

Hi, Greg,

The header file fec.h define the FEC_FTRL as below, if ColdFire SoC has no this register, we may remove the define in here and define the register according to SOC type. For example, it is ColdFire Soc, define it as 0xFFF. Is it feasible ?

This is even worse IMHO. We should not write to a 'fake' register offset of 0xFFF.

#8 lore raw
In reply to Fabio Estevam

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

Quoted 7 lines

To: Fugang Duan <[email protected]>
Cc: Greg Ungerer <[email protected]>; Troy Kisky <[email protected]>; [email protected]
Subject: Re: [PATCH] net: fec: stop the "rcv is not +last, " error messages

Hi Andy,

Quoted 8 lines
Quoted 2 lines · Fugang Duan

Fabio, we cannot do it like this that may cause confused for the quirk flag

"FEC_QUIRK_HAS_RACC".

We can treat FEC_QUIRK_HAS_RACC flag as "this is a non-Coldfire SoC".

FEC_QUIRK_HAS_RACC means the HW support "Receive Accelerator Function Configuration". It is really make somebody confused.

To save trouble, you treat FEC_QUIRK_HAS_RACC flag as "this is a non-Coldfire SoC", you must add comment on the flag define.

Quoted 10 lines
Quoted 5 lines

Hi, Greg,

The header file fec.h define the FEC_FTRL as below, if ColdFire SoC has no this

register, we may remove the define in here and define the register according to SOC type. For example, it is ColdFire Soc, define it as 0xFFF. Is it feasible ?

Quoted 1 line

This is even worse IMHO. We should not write to a 'fake' register offset of 0xFFF.

We can do it like this:

#if defined(CONFIG_ARM)
        writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);

#endif